我想要创建以下格式的文档:
第一部分:多项选择题
问题 1
问题2
....
第一部分答案
然后是一些段落、文本、说明……
第二部分:多项选择题
问题 1
问题2
....
第二部分答案
我试过:
\documentclass[a4paper]{exam}
\usepackage{exam-randomizechoices}
\begin{document}
\begin{questions}
\question[]
What is 1+1?
\begin{randomizechoices}
\CorrectChoice 2
\choice 1
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\question[]
What is $3x4$?
\begin{randomizechoices}
\CorrectChoice 12
\choice 13
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\end{questions}
This is the answers for Part 1-multiple choice questions.
\printkeytable
This is a paragraph. Then more multiple choice questions.
\begin{questions}
\question[]
What is 7-5?
\begin{randomizechoices}
\CorrectChoice 2
\choice 1
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\question[]
What is $6x4$?
\begin{randomizechoices}
\CorrectChoice 24
\choice 13
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\end{questions}
This is the answers for Part 2-multiple choice questions.
\printkeytable
\end{document}
但是我没有得到第 1 部分的正确答案表。事实上,它只是复制了第 2 部分的答案并将其也放在第 1 部分中。
如何得到正确答案表?
非常感谢。
答案1
您可以将问题分成几部分,但任何两个问题不能具有相同的页码。
示例中,保存了第一部分中最后一个问题编号,用于继续对第二部分中的问题进行编号。
\printkeytable[<first number>-<last number>]
接受可选范围和
\printkeytable[<first number>-]
将从第一个问题编号到最后一个问题打印关键表。
\documentclass[a4paper]{exam}
\usepackage{exam-randomizechoices}
\newcounter{lastquestion}% added <<<<<<<<<<
\begin{document}
\section{Part I}
\begin{questions}
\question
What is 1+1?
\begin{randomizechoices}
\CorrectChoice 2
\choice 1
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\question
What is $3x4$?
\begin{randomizechoices}
\CorrectChoice 12
\choice 13
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\setcounter{lastquestion}{\arabic{question}}% store end question number <<<<<<<<<<
\end{questions}
These are the answers for Part 1-multiple choice questions.
\printkeytable \bigskip
This is a paragraph. Then more multiple choice questions.
\section{Part II}
\begin{questions}
\setcounter{question}{\thenumquestions}% use as base numbering <<<<<<<<<
\setcounter{lastquestion}{\thenumquestions}% store base question number <<<<<<<<<
\question
What is 7-5?
\begin{randomizechoices}
\CorrectChoice 2
\choice 1
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\question
What is $6x4$?
\begin{randomizechoices}
\CorrectChoice 24
\choice 13
\choice 3
\choice 4
\choice 5
\end{randomizechoices}
\end{questions}
These are the answers for Part 2-multiple choice questions.
\stepcounter{lastquestion} % <<<<<
\printkeytable[\thelastquestion-] % from first question of the second part to the end <<<<<<<<<<
\end{document}