使用 ExamDesign 類別在 Latex 中進行多項選擇題的多個答案

使用 ExamDesign 類別在 Latex 中進行多項選擇題的多個答案

有一種 MCQ(多項選擇題),其中每個 MCQ 可以有一個或多個答案,最大可能答案數可以等於總選擇數。如何使用 examdesign 類別在乳膠中完成此操作?

這是一個例子:

\documentclass[a4paper, 11pt]{examdesign}

\parindent 0pt

\usepackage[margin=1in]{geometry}

\class{Your Exam}

\Fullpages

\ContinuousNumbering

\DefineAnswerWrapper{}{}

\NumberOfVersions{1}

\ShortKey

\NoRearrange
\begin{document}

\begin{multiplechoice}[title={A title}]

These are meant to be multiple-choice questions, with multiple answers.

\begin{question}
  How many people live in Wales?
    \choice{Approximately 2,811,865.}
    \choice[!]{More than in most countries.}
    \choice{None.}
    \choice{Exactly seventeen.}
\end{question}

\begin{question}
  How many cows does it take to graze a field?
  \choice[i]{One.}
  \choice[i]{Two.}
  \choice{Three.}
  \choice[i]{Four}
\end{question}
\end{multiplechoice}
\end{document}

我想要不同選擇的正確答案,並且全部選擇應列印在解決方案中。

答案1

examdesign已經支援多個正確答案。

的定義似乎有一個小問題(您的範例中\exam@ShortKeyChoice的內部定義)。\choice用於解決方案追蹤的內部計數器不會針對正確的解決方案而增加。這意味著,如果您有多個正確答案,則答案部分的按鍵將關閉。

我強烈建議您聯絡軟體包維護者以了解此事。文件可能會提到如何報告錯誤。 (雖然考慮到對軟體包的最後一次真正的更改是在 2001 年,但進行大修復的機會可能比我最初想像的要小。開發人員的電子郵件地址在 PDF 文件中也不可見,您必須.dtx直接轉到原始碼找到它。

同時,這裡有一個解決方法。我們只需要把\stepcounter{choice}條件移到外面即可。在原始定義中,計數器僅在(此處已刪除)\else分支中增加,\if#1!這意味著計數器只會針對錯誤答案而增加,而不會針對正確答案而增加。這意味著第 n 個正確答案的計數將減少 n-1。

\documentclass[a4paper, 11pt]{examdesign}

\makeatletter
\renewcommand{\exam@ShortKeyChoice}[2][]{%
  \if#1!%
    \ifOneCorrectAnswerAlreadyGiven
    , (\alph{choice})
    \else
    \exam@MultipleChoiceShortKeyPrefix
    (\alph{choice})%
    \OneCorrectAnswerAlreadyGiventrue
    \fi
   \fi
  \stepcounter{choice}%
  \ignorespaces}
\makeatother

\class{Your Exam}
\Fullpages
\ContinuousNumbering
\DefineAnswerWrapper{}{}
\NumberOfVersions{1}
\ShortKey
\NoRearrange

\begin{document}
\begin{multiplechoice}[title={A title}]
These are meant to be multiple-choice questions, with multiple answers.

\begin{question}
  How many people live in Wales?
    \choice{Approximately 2,811,865.}
    \choice[!]{More than in most countries.}
    \choice{None.}
    \choice{Exactly seventeen.}
\end{question}

\begin{question}
  How many cows does it take to graze a field?
  \choice{One.}
  \choice[!]{Two.}
  \choice{Three.}
  \choice[!]{Four}
\end{question}
\end{multiplechoice}
\end{document}

2.(b)、(d)

相關內容