So erstellen Sie einen dynamischen Antwortbogen für eine Multiple-Choice-Prüfung

So erstellen Sie einen dynamischen Antwortbogen für eine Multiple-Choice-Prüfung

Ich möchte einen Antwortbogen mit Sprechblasen erstellen, auf dem die Anzahl der Fragen durch \qCount angezeigt wird. Sie liegt immer unter 100. Ist es möglich, dies dynamisch zu erstellen? Ich kann die Fragennummern nicht vor jeder Zeile drucken und kann keine Sprechblasen innerhalb der Zellen anzeigen.

gewünschte Ausgabe:Probe

MWE:

\documentclass[a4paper]{article}

\usepackage{tikz}

\newcommand{\repeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \ans=\expandafter{\the\ans #2}
      \advance\i by 1
      \ifnum\i<#1\repeat
   \the\ans
}

\newcommand{\countRepeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \advance\i by 1
      \ans=\expandafter{\the\ans #2}
      \ifnum\i<#1\repeat
   \the\ans
}

\newcommand{\generateTable}[1]{%
\countRepeatntimes{#1}{\indent
\repeatntimes{4}{\textcolor{lightgray}{\rule{0.9\baselineskip}{0.9\baselineskip}} }\par
}
}

\begin{document}
\def\qCount{80}
\generateTable{\qCount}
\end{document}

Antwort1

Ich habe in der Schleife einen Stufenzähler für die Problemnummer ausgedruckt (und einen weiteren Zähler für die Blasenbeschriftung) und das Quadrat \rulein eine gedrehte „0“ geändert, entsprechend skaliert und gestreckt. Sie können die Größe über die numerischen Argumente ändern \scalebox{1.4}[1.5]{}. Ich habe es auch zweispaltig gemacht.

BEARBEITET, um einen ausgefüllten Beispielblock bereitzustellen.

\documentclass[a4paper,twocolumn]{article}

\usepackage{tikz,graphicx}
\usepackage[usestackEOL]{stackengine}

\newcommand{\repeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \ans=\expandafter{\the\ans #2}
      \advance\i by 1
      \ifnum\i<#1\repeat
   \the\ans
}

\newcommand{\countRepeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \advance\i by 1
      \ans=\expandafter{\the\ans #2}
      \ifnum\i<#1\repeat
   \the\ans
}

\newcounter{problem}
\newcounter{choice}
\newcommand{\generateTable}[1]{%
\countRepeatntimes{#1}{\stepcounter{problem}\makebox[2ex][r]{\theproblem.}%\indent
\setcounter{choice}{0}%
\repeatntimes{4}{\stepcounter{choice}\textcolor{black!35}{%
  \raisebox{-1.5pt}{\scalebox{1.5}[1.8]{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\tiny \Alph{choice}}}{\rotatebox{90}{0}}}}} }\par
}
}

\def\sampleblock{%
  \makebox[5.1ex]{}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.5}[1.8]{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\tiny \Alph{choice}}}{\rotatebox{90}{0}}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.5}[1.8]{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\tiny \Alph{choice}}}{\rotatebox{90}{0}}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \smash{\raisebox{-1.5pt}{\scalebox{1.5}[1.8]{\stackinset{c}{}{c}{-1pt}{%
    \scalebox{6}[3.5]{\color{black}$\cdot$}}{\rotatebox{90}{0}}}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.5}[1.8]{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\tiny \Alph{choice}}}{\rotatebox{90}{0}}}}}
\par}
\voffset=\dimexpr\voffset+.5in
\textheight=\dimexpr\textheight-.5in

\begin{document}

\smash{\Shortstack[l]{%
  Name \underline{\hspace{2.4in}} Class\underline{\hspace{1.2in}}
    Date\underline{\hspace{1.2in}}\\
  \textcolor{black!50}{\rule{5.9in}{2ex}}\\
  \rule[2ex]{10ex}{2ex}\sffamily\itshape\Huge Bubble Answer Sheet\\
  \strut\\
  \sampleblock\\
  \rule{0ex}{4pt}\\}%
}\vspace{-\baselineskip}\par
\def\qCount{80}
\generateTable{\qCount}
\end{document}

Bildbeschreibung hier eingeben

Bildbeschreibung hier eingeben


ERGÄNZUNG

In einem Kommentar wurde eine Version mit zirkulären Auswahlmöglichkeiten angefordert:

\documentclass[a4paper,twocolumn]{article}

\usepackage{tikz,graphicx}
\usepackage[usestackEOL]{stackengine}

\newcommand{\repeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \ans=\expandafter{\the\ans #2}
      \advance\i by 1
      \ifnum\i<#1\repeat
   \the\ans
}

\newcommand{\countRepeatntimes}[2]{
   \newcount\i
   \i=0
   \newtoks\ans
   \loop
      \advance\i by 1
      \ans=\expandafter{\the\ans #2}
      \ifnum\i<#1\repeat
   \the\ans
}

\newcounter{problem}
\newcounter{choice}
\newcommand{\generateTable}[1]{%
\countRepeatntimes{#1}{\stepcounter{problem}\makebox[2ex][r]{\theproblem.}%\indent
\setcounter{choice}{0}%
\repeatntimes{4}{\stepcounter{choice}\textcolor{black!35}{%
  \raisebox{0.5pt}{\scalebox{1.0}{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\footnotesize \Alph{choice}}}{$\bigcirc$}}}} }\par
}
}

\def\sampleblock{%
  \makebox[5.1ex]{}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.0}{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\footnotesize \Alph{choice}}}{$\bigcirc$}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.0}{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\footnotesize \Alph{choice}}}{$\bigcirc$}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \smash{\raisebox{-1.5pt}{\scalebox{1.0}{\stackinset{c}{}{c}{-2.5pt}{%
    \scalebox{8}{\color{black}$\cdot$}}{$\bigcirc$}}}}}
  \stepcounter{choice}\textcolor{black!35}{%
   \raisebox{-1.5pt}{\scalebox{1.0}{\stackinset{c}{}{c}{}{%
    \scalebox{.6}{\footnotesize \Alph{choice}}}{$\bigcirc$}}}}
\par}
\voffset=\dimexpr\voffset+.5in
\textheight=\dimexpr\textheight-.5in

\begin{document}

\smash{\Shortstack[l]{%
  Name \underline{\hspace{2.4in}} Class\underline{\hspace{1.2in}}
    Date\underline{\hspace{1.2in}}\\
  \textcolor{black!50}{\rule{5.9in}{2ex}}\\
  \rule[2ex]{10ex}{2ex}\sffamily\itshape\Huge Bubble Answer Sheet\\
  \strut\\
  \sampleblock\\
  \rule{0ex}{4pt}\\}%
}\vspace{-\baselineskip}\par
\def\qCount{80}
\generateTable{\qCount}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen