使用 mcexam 套件將答案寫在同一行中

使用 mcexam 套件將答案寫在同一行中

要編寫多題考試,我目前正在使用麥克考試包,它允許隨機化問題和答案。我需要在一行中列印答案,但在包文件中沒有說明這是否可能。預設情況下,輸出是一個數字列表,其外觀類似於使用 enumitem 套件獲得的列表。有沒有辦法在一行中列印答案?謝謝你!

微量元素:

\documentclass{article}
\usepackage[output=exam, numberofversions=8, version=3, randomizequestions=true,randomizeanswers=true]{mcexam}%

 \usepackage[top=10mm,bottom=10mm,inner=10mm,outer=10mm, marginparwidth=20mm, marginparsep=4mm]{geometry}

\begin{document}

\setlist[setmcquestions]{label=\mcquestionlabelfmt{*}.
,ref=\mcquestionlabelfmt{*}
14
,itemsep=.5\baselineskip
,topsep=.5\baselineskip         }
\setlist[setmcanswerslist]{label=\mcanswerlabelfmt{*}
,noitemsep}
\setlist[setmcquestioninfo]{before=\footnotesize\sffamily}

\begin{mcquestions}
\question Question 1:
\begin{mcanswerslist}
\answer first answer
\answer second ansewr
\answer third answer
\answer fourth answer
\end{mcanswerslist}
\end{mcquestions}

\end{document}

答案1

第一種方法列在套件文檔中(截至第 2.2 小節編寫時)。我只是出於好奇而測試了第二種方法,它對於簡短的答案非常有效。

\documentclass{article}
\usepackage[
  output=exam,
  numberofversions=8,
  version=3,
  randomizequestions=true,
  randomizeanswers=true]{mcexam}%

\usepackage{multicol}

\begin{document}

\setlist[setmcquestions]{label=\mcquestionlabelfmt{*}.
,ref=\mcquestionlabelfmt{*}
14
,itemsep=.5\baselineskip
,topsep=.5\baselineskip         }
\setlist[setmcanswerslist]{label=\mcanswerlabelfmt{*}
,noitemsep}
\setlist[setmcquestioninfo]{before=\footnotesize\sffamily}

\begin{mcquestions}
\question Question 1:
\begin{mcanswers}
  \begin{tabular}
    {c@{\hskip\tabcolsep}*3{c@{\hskip3\tabcolsep}c@{\hskip\tabcolsep}}c}
    \answernum{1}&\answer{1}{first answer}  &
    \answernum{2}&\answer{2}{second answer} &
    \answernum{3}&\answer{3}{third answer}  &
    \answernum{4}&\answer{4}{fourth answer}
  \end{tabular}
\end{mcanswers}
\end{mcquestions}

\begin{mcquestions}
\question Question 1:
\begin{multicols}{4}
\begin{mcanswerslist}
\answer one
\answer two
\answer three
\answer four
\end{mcanswerslist}
\end{multicols}
\end{mcquestions}

\end{document}

結果:在此輸入影像描述

相關內容