# Exam writing: How to create options to circle answer

I am trying to find a code to allow students to select the correct answer. I can see how to do multiple choice. However, I want this to be all in one question rather than spread out. Any suggestions?

At the moment I have create a space for the students to write their answers in. However, I would prefer to provide the two options of them to select from.

So I am trying to add the formatted "Reduction/Oxidation"

at the end of each chemical half equation/ equation.

\documentclass[
a4paper,
12pt,
]
{exam}

\usepackage[version=4]{mhchem}

\newcommand{\subject}{Chemistry}
\newcommand{\paper}{SAT 2: Topic 3}
\newcommand{\papershort}{SAT 2}
\newcommand{\conditions}{90 Minutes, Exam Conditions}
\newcommand{\duedate}{June 26}

\begin{document}

\begin{questions}

\else
to agree that exam conditions were satisfied.}
\fi

\question
Identify these reactions as either oxidation or reduction (circle answer):
\begin{parts}
\part[1]
\ce{Ca -> Ca^2+ + 2e-}

\begin{solutionordottedlines}[.25in]
oxidation
\end{solutionordottedlines}

\part[1]
\ce{F2 +2e- -> 2F-}

\begin{solutionordottedlines}[.25in]
reduction
\end{solutionordottedlines}

\part[1]
\ce{H2O2 + 2H+ +2e- -> 2H2O}

\begin{solutionordottedlines}[.25in]
reduction
\end{solutionordottedlines}

\part[1]
\ce{Cu -> Cu^2+ + 2e-}
\begin{solutionordottedlines}[.25in]
oxidation
\end{solutionordottedlines}
\end{parts}

\end{questions}

\end{document}

• Welcome to TeX.se Without showing us how you're creating your exam in the first place it's hard to help you. Can you edit your question to show a compilable document with the code you used to create the image, and explain a bit more clearly what you mean by "all one question rather than spread out". – Alan Munn Jun 5 '19 at 1:27
• Suggestion: auto-multiple-choice.net – Fran Jun 5 '19 at 7:22
• @AlanMunn edits completed as requested. Please let me know if this is sufficient information. – Helen Jun 5 '19 at 23:29
• I editted your MWE so that it compiles and fixed the formatting. To highlight code-blocks, either indent them by four spaces or use the {} on the gui. You can highlight in-line code in your post using back-ticks. – user30471 Jun 6 '19 at 0:15

Am I right in that you just want to obtain:

If so then you can achieve this just by adding Reduction /Oxidation to the end of each question. Alternatively, you could use a macro like

\newcommand\ReductionOxidation{\hfill Reduction / Oxidation}


to do this. The \hfill pushes the reduction/oxidation to the right-hand margin. If you wanted to you could be "fancier" and define

\newcommand\ReductionOxidation[1]{\ce{#1}\hfill Reduction / Oxidation}


and then write \ReductionOxidation{Ca -> Ca^2+ + 2e-} in the questions -- that is, you save yourself from having to typing the \ce. Here is the full MWE for the output above:

\documentclass[ a4paper, 12pt, addpoints, noanswers ] {exam}

\usepackage[version=4]{mhchem}

\newcommand{\subject}{Chemistry}
\newcommand{\paper}{SAT 2: Topic 3}
\newcommand{\papershort}{SAT 2}
\newcommand{\conditions}{90 Minutes, Exam Conditions}
\newcommand{\duedate}{June 26}

\newcommand\ReductionOxidation{\hfill Reduction / Oxidation}

\begin{document}

\begin{questions}

\else
\fullwidth{You and your supervisor must \textbf{write your names} to agree that exam conditions were satisfied.}
\fi

\question
Identify these reactions as either oxidation or reduction (circle answer):
\begin{parts}
\part[1]
\ce{Ca -> Ca^2+ + 2e-}\ReductionOxidation

\begin{solutionordottedlines}[.25in]
oxidation
\end{solutionordottedlines}

\part[1]
\ce{F2 +2e- -> 2F-}\ReductionOxidation

\begin{solutionordottedlines}[.25in]
reduction
\end{solutionordottedlines}

\part[1]
\ce{H2O2 + 2H+ +2e- -> 2H2O}\ReductionOxidation

\begin{solutionordottedlines}[.25in]
reduction
\end{solutionordottedlines}

\part[1]
\ce{Cu -> Cu^2+ + 2e-}\ReductionOxidation
\begin{solutionordottedlines}[.25in]
oxidation
\end{solutionordottedlines}
\end{parts}

\end{questions}

\end{document}


EDIT

Of you could be fancier still and replace the definition of \ReductionOxidation with:

\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\newcommand\ellipse[1]{\tikz[baseline=(current bounding box.center)]{\node[ellipse,draw]{#1};}}
\newcommand\ReductionOxidation{\hfill\ellipse{Reduction}\space\ellipse{Oxidation}}


to produce:

• Thanks Andrew - appreciate the support with my first attempt using code. – Helen Jun 7 '19 at 2:16
• @Helen It occurred to me that it is better still to give the students something to shade or colour in... – user30471 Jun 9 '19 at 1:34