
설정
다음과 같은 MWE가 있습니다.
\documentclass[addpoints,12pt]{exam}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}
\checkboxchar{$\Box$}
\checkedchar{$\blacksquare$}
\bracketedpoints
\shadedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}
\begin{document}
\textbf{\textsc{True/False:} [1pt each]}
\vspace{0.1in}
\begin{questions}
\question Every normal distribution has a bell-shaped graph.
\begin{oneparcheckboxes}
\correctchoice T
\choice F
\end{oneparcheckboxes}
\question If $X$ is a binomial random variable, then $X$ is approx. normal.
\begin{oneparcheckboxes}
\choice T
\correctchoice F
\end{oneparcheckboxes}
\question Why did the chicken cross the road?
\begin{solution}[1.0in]
To get to the other side!
\end{solution}
\end{questions}
\end{document}
완벽하게 훌륭한 (짧은) 시험을 만들어냅니다. 이제 옵션을 추가하면 answers
(즉, 첫 번째 줄을 다음으로 변경 \documentclass[addpoints,12pt,answers]{exam}
) 올바른 T/F 선택 항목이 표시되고 단답형 질문에 대한 솔루션이 표시됩니다.
질문
내가 하고 싶은 일은 각 T/F 질문 옆에 약간의 추론과 함께 짧은 한 줄 솔루션을 추가하는 것입니다. 이 솔루션은 다음을 수행합니다.
- 배경이 음영처리되어 있음
- T 및 F 선택과 같은 줄에 있어야 합니다.
answers
옵션이 주어졌을 때만 존재
이 작업을 수행하는 쉬운 방법이 있나요?
답변1
\explanation
T/F 환경 마지막에 추가할 을 생성했습니다 oneparcheckboxes
.
\documentclass[addpoints,12pt,answers]{exam}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}
\checkboxchar{$\Box$}
\checkedchar{$\blacksquare$}
\bracketedpoints
\shadedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}
\definecolor{SolutionColor}{gray}{0.8}
\def\explanation#1{%
\ifprintanswers\mdseries\colorbox{SolutionColor}{\strut #1}\fi}
\begin{document}
\textbf{\textsc{True/False:} [1pt each]}
\vspace{0.1in}
\begin{questions}
\question Every normal distribution has a bell-shaped graph.
\begin{oneparcheckboxes}
\correctchoice T
\choice F
\explanation{Explanation goes here}
\end{oneparcheckboxes}
\question If $X$ is a binomial random variable, then $X$ is approx. normal.
\begin{oneparcheckboxes}
\choice T
\correctchoice F
\explanation{Another explanation goes here}
\end{oneparcheckboxes}
\question Why did the chicken cross the road?
\begin{solution}[1.0in]
To get to the other side!
\end{solution}
\end{questions}
\end{document}