
Aufstellen
Ich habe folgendes 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}
Das Ergebnis ist eine vollkommen gute (kurze) Prüfung. Wenn ich jetzt die answers
Option hinzufüge – das heißt, die erste Zeile ändere in \documentclass[addpoints,12pt,answers]{exam}
–, werden die richtigen R/F-Auswahlmöglichkeiten und eine Lösung für die Frage mit kurzer Antwort angezeigt.
Frage
Ich möchte außerdem neben jeder R/F-Frage eine kurze einzeilige Lösung mit einer Begründung hinzufügen. Diese Lösung würde:
- haben schattierten Hintergrund
- auf derselben Linie liegen wie die Auswahlmöglichkeiten T und F
- nur anwesend sein, wenn die
answers
Option gegeben ist
Gibt es eine einfache Möglichkeit, dies zu tun?
Antwort1
Ich habe erstellt \explanation
, um es am Ende der T/F- oneparcheckboxes
Umgebung hinzuzufügen.
\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}