使用复选标记创建考试答案

使用复选标记创建考试答案

我正在尝试将考试关键示例放在文章正文中。因此,我使用文档样式“文章”(也许这不是一个好主意,但我不确定如何在同一文档中使用不同的文档类别。

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\maketitle

Here I put some description.

\begin{section}*{Test questions}

\begin{enumerate}
    \item Who is guilty?

\hspace{7mm} \makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.9em}} Person A

\hspace{7mm} \makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.1em}$\checkmark$} Person B

\hspace{7mm} \makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.9em}} Person C

\hspace{7mm} \makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.9em}} Person D

\hspace{7mm} \makebox[0pt][l]{$\square$}\raisebox{.15ex}{\hspace{0.9em}} Person E

    \item What to do?
\end{enumerate}


\end{section}   
\end{document}

有没有更优雅的方式来放置选项?另外,我希望复选标记是红色的。怎么做?

答案1

我不知道它是否更优雅,但这里有一个解决方案,它使用exam带有一些自定义的类来获得更接近 OP 输出的东西:

\documentclass[12pt,answers]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\checkboxchar{$\square$}
\checkedchar{$\blacksquare$}
\CorrectChoiceEmphasis{}

\renewcommand{\questionshook}{\setlength{\itemindent}{3mm}}

\begin{document}

\section*{Test questions}
\begin{questions}


\question Who is guilty?


\begin{checkboxes}

\choice Person A
\correctchoice Person B
\choice Person C
\choice Person D
\choice Person E

\end{checkboxes}

\question What to do ?
\end{questions}



\end{document}

在此处输入图片描述

答案2

以下是另一种选择:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}

\newcommand{\Checkmark}{\textcolor{red}{$\checkmark$}}

\begin{document}

%\maketitle

Here I put some description.

\begin{section}*{Test questions}

\begin{enumerate}
    \item Who is guilty?
\begin{itemize}\fboxsep=1pt %gap between box and contents
\item[\fbox{\phantom{\Checkmark}}] Person A
\item[\fbox{\Checkmark}] Person B
\item[\fbox{\phantom{\Checkmark}}] Person C
\item[\fbox{\phantom{\Checkmark}}] Person D
\item[\fbox{\phantom{\Checkmark}}] Person E
\end{itemize}
    \item What to do?
\end{enumerate}

\end{section}   
\end{document}

在以下帮助下乌尔丽克·菲舍尔我能够创建一个电子表格版本。

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{eforms}

\newsavebox{\squarebox}
\savebox{\squarebox}{$\square$}% default size

\everyRadioButton{
\BC{0 0 0}% black
\BG{1 1 1}% white
\textColor{1 0 0}% red
%\symbolchoice{check}% default
}
\begin{document}

%\maketitle

Here I put some description.

\begin{section}*{Test questions}

\begin{enumerate}
    \item Who is guilty?
\begin{itemize}\fboxsep=1pt %gap between box and contents
\item[{\radioButton[\V{B}]{Q1}{10bp}{10bp}{A}}] Person A
\item[\radioButton{Q1}{10bp}{10bp}{B}] Person B
\item[\radioButton{Q1}{10bp}{10bp}{C}] Person C
\item[\radioButton{Q1}{10bp}{10bp}{D}] Person D
\item[\radioButton{Q1}{10bp}{10bp}{E}] Person E
\end{itemize}
    \item What to do?
\end{enumerate}

\end{section}   
\end{document}

相关内容