如何从自动多项选择中获取表格类型的答案键而不是 OMR 模板类型输出?

如何从自动多项选择中获取表格类型的答案键而不是 OMR 模板类型输出?

如何在自动多项选择中从答案表而不是 OMR 表类型中获取答案?

展示

在此处输入图片描述

所需输出

在此处输入图片描述

提前致谢!

答案1

要将答案改为简单的表格,您可以修改用于打印每个问题答案的内部命令。

具体来说,内部命令\AMC@answerBox@会打印问题的答案列表。您可以修改此命令,检查答案是否正确,并且仅在正确的情况下打印答案。检查当前答案是否为正确答案的代码可以从其他内部命令中复制,这本质上是一个 if 语句,用于查看命令的第二个参数是否等于内部命令\AMC@checkedbox。修改后的命令如下:

\renewcommand\AMC@answerBox@[4]{%
\ifAMC@catalog%
    \AMC@logchar{#1}{#4}%
\fi%
\ifx #2\AMC@checkedbox \AMCchoiceLabelFormat{#1}\fi%
}

然后有一个内部命令\AMCformAnswerA,用于在答案之间添加水平空格。如果您不想打印错误答案,那么还应删除此水平空格。简化此命令可得到:

\def\AMCformAnswerA#1{\addtocounter{AMC@ncase}{1}#1}

完整 MWE:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{multicol}
\usepackage[separateanswersheet,answers,noshuffle]{automultiplechoice}
\AMCboxStyle{shape=oval}

\begin{document}
\AMCtext{draft}{}
\AMCtext{message}{}
\begin{question}{prez} first \begin{choices}\correctchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} second \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} third \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} fourth \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} fifth \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\correctchoice{a4}\end{choices}\end{question}
\begin{question}{prez} sixth \begin{choices}\correctchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} seventh \begin{choices}\correctchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} eighth \begin{choices}\wrongchoice{a1}\correctchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} ninth \begin{choices}\wrongchoice{a1}\correctchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} tenth \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\correctchoice{a4}\end{choices}\end{question}
\begin{question}{prez} eleventh \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} twelfth \begin{choices}\correctchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} thirteenth \begin{choices}\correctchoice{a1}\wrongchoice{a2}\wrongchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} fourteenth \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\begin{question}{prez} fifteenth \begin{choices}\wrongchoice{a1}\wrongchoice{a2}\correctchoice{a3}\wrongchoice{a4}\end{choices}\end{question}
\makeatletter
\def\AMCformQuestion#1{#1.}
\def\AMCformAnswerA#1{\addtocounter{AMC@ncase}{1}#1}
\renewcommand\AMC@answerBox@[4]{%
\ifAMC@catalog%
    \AMC@logchar{#1}{#4}%
\fi%
\ifx #2\AMC@checkedbox \AMCchoiceLabelFormat{#1}\fi%
}
\makeatother

\hrule
\vspace{5mm}
{\Large ANSWER KEY}
\AMCformBegin
\begin{multicols}{3}
\AMCform
\end{multicols}

\end{document}

结果:

在此处输入图片描述

备注:此类修改会显著改变答案键的原始实现。可能会产生副作用,即代码的其他部分不再正常工作。

相关内容