
Настраивать
У меня есть следующие 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
, который будет добавлен в конец oneparcheckboxes
среды T/F.
\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}