[Tex/LaTex] Exam with multiple choice using exsheets

examexsheets

I have seen many examples of multiple choice exams setting the correct with exam. But, is there anyway of doing a mulitple choice with exsheets?

I would like something like:

1. Question 1
  a)
  b)
  c)

And then in the code have something that sets bold the correct answer when I toggle it on.

Best Answer

Since exsheets strictly separates questions from solutions, the only way that adheres to this separation would be something like copying an enumeration environment and marking the correct answer with \textbf in the solution. Using the \PrintSolutionsTF command does not work inside the question environment.

\documentclass{article}

\usepackage{exsheets}
\usepackage{enumerate}

\begin{document}

\begin{question}[type=exam]
\begin{enumerate}[a)]
\item answer 1
\item answer 2
\item answer 3
\end{enumerate}
\end{question}

\begin{solution}
\begin{enumerate}[a)]
\item answer 1
\item \textbf{answer 2}
\item answer 3
\end{enumerate}
\end{solution}

\begin{question}[type=exam]
\begin{enumerate}[a)]
\item answer 1
% does not work as this is not in a solution environment
\item \PrintSolutionsTF{\textbf{answer 2}}{answer 2}
\item answer 3
\end{enumerate}
\end{question}

\printsolutions

\end{document}

You could, however, define your own commands to achieve your desired behavior. This would then be independent of the package. See How to avoid the compilation of some of my newcommands in latex for such a solution.