I would like to use the R package 'exams' with my class and do automatic correction through scanning. For this reason, I have decided to consider only single-choice questions.
I would like to insert more than just one single-choice question in the same exercise. Apparently, this can be done only using \extype{cloze}
. Is this right? I found out that only a unique begin/end pair for "question" is allowed and so is for "answerlist".
So, I have created an Rnw file whose content is:
\begin{question}
Choose between:
\begin{aswerlist}
\item a
\item b
\item c
\item d
\item e
\item f
\item a1
\item b1
\item c1
\item d1
\item e1
\item f1
\end{answerlist}
\end{question}
\begin{solution}
The right answers are:
<<echo=FALSE, results=tex>>=
soluz1 = c(1,rep(0,5))
soluz2 = c(1,rep(0,5))
soluz=c(soluz1,soluz2)
answerlist(ifelse(soluz, "True", "False"))
@
\end{solution}
%% \exname{prova}
%% \extype{cloze}
%% \exsolution{\Sexpr{mchoice2string(soluz1)}|mchoice2string(soluz2)}}
%% \exclozetype{schoice|schoice}
%% \exshuffle{5}
but I am delivered an error message:
Error in extract_environment(question, "answerlist", value = FALSE, markup = markup) : no unique begin/end pair for‘answerlist’found
Any help would be great!