| 1 |
%%% Copyright (c) 2017 Jorre Vannieuwenhuyze. |
| 2 |
%%% |
| 3 |
%%% Permission is granted to copy, distribute and/or modify this |
| 4 |
%%% software under the terms of the LaTeX Project Public License |
| 5 |
%%% (LPPL), version 1.3c or any later version. |
| 6 |
%%% |
| 7 |
%%% This software is provided 'as is', without warranty of any kind, |
| 8 |
%%% either expressed or implied, including, but not limited to, the |
| 9 |
%%% implied warranties of merchantability and fitness for a |
| 10 |
%%% particular purpose. |
| 11 |
|
| 12 |
|
| 13 |
\documentclass[a4paper]{article} |
| 14 |
|
| 15 |
\usepackage[output=concept |
| 16 |
,numberofversions=4 |
| 17 |
,version=1 |
| 18 |
,seed=1 |
| 19 |
,randomizequestions=true |
| 20 |
,randomizeanswers=true |
| 21 |
,writeRfile=true |
| 22 |
]{mcexam} |
| 23 |
|
| 24 |
% Packages used for special things |
| 25 |
\usepackage{tikz,framed} |
| 26 |
|
| 27 |
% Set headers and footers |
| 28 |
\usepackage{fancyhdr,lastpage} |
| 29 |
\pagestyle{fancy} |
| 30 |
\fancyhf{} |
| 31 |
\renewcommand{\headrulewidth}{0pt} |
| 32 |
\renewcommand{\footrulewidth}{1pt} |
| 33 |
\lfoot{\mctheversion} |
| 34 |
\rfoot{Page \thepage\ of \pageref{LastPage}} |
| 35 |
|
| 36 |
% Ensure each question+answers is printed entirely on the same page. |
| 37 |
\usepackage{calc} |
| 38 |
\renewenvironment{setmcquestion}{\begin{minipage}[t]{\linewidth-\labelwidth}}{\end{minipage}\par} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
% solution counter starting at 3 |
| 45 |
%\newcounter{temp} |
| 46 |
%\setlist[setmcquestions]{ |
| 47 |
%label=\protect\setcounter{temp}{\arabic{*}} |
| 48 |
% \protect\addtocounter{temp}{2} |
| 49 |
% \arabic{temp}. |
| 50 |
%,ref=\protect\setcounter{temp}{\arabic{*}} |
| 51 |
% \protect\addtocounter{temp}{2} |
| 52 |
% \arabic{temp}. |
| 53 |
%,itemsep=2\baselineskip |
| 54 |
%,topsep=2\baselineskip } |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
\begin{document} |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
\begin{center} |
| 70 |
\bfseries\LARGE Example Exam \texttt{mcexam} Package |
| 71 |
\end{center} |
| 72 |
|
| 73 |
\begin{framed} |
| 74 |
\centering\bfseries\Large\MakeUppercase{\mctheversion} |
| 75 |
\end{framed} |
| 76 |
|
| 77 |
\mcifoutput{concept,exam}{ |
| 78 |
|
| 79 |
\bigskip |
| 80 |
|
| 81 |
\noindent Name: \dotfill\\[.5\baselineskip] |
| 82 |
\noindent Student Number: \dotfill\\[.5\baselineskip] |
| 83 |
\noindent Program: \dotfill |
| 84 |
|
| 85 |
\vspace{2\baselineskip} |
| 86 |
|
| 87 |
\noindent\textbf{Instructions:} |
| 88 |
\begin{itemize}[nosep] |
| 89 |
\item Answer all questions. |
| 90 |
\item Fill in the answers on the answer sheet. |
| 91 |
\end{itemize} |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
\begin{mcquestions} |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
\begin{mcquestioninstruction} |
| 105 |
The next question is about the sky. |
| 106 |
\end{mcquestioninstruction} |
| 107 |
|
| 108 |
\question What is the color of the sky? |
| 109 |
|
| 110 |
\begin{mcanswerslist}[fixlast] |
| 111 |
\answer[correct] blue |
| 112 |
\answer green |
| 113 |
\answer red |
| 114 |
\answer yellow |
| 115 |
\answer none of the above |
| 116 |
\end{mcanswerslist} |
| 117 |
|
| 118 |
\begin{mcexplanation} |
| 119 |
If you look up to the sky and there are no clouds, you'll see it is blue. |
| 120 |
\end{mcexplanation} |
| 121 |
|
| 122 |
\begin{mcnotes} |
| 123 |
This question had a large proportion of good answers last year. |
| 124 |
\end{mcnotes} |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
\question Which figure is a square? |
| 130 |
\begin{mcanswers} |
| 131 |
\begin{tabular}{@{}cccc} |
| 132 |
\answer{1}{\tikz{\draw (-0.66,0)--(0.66,0)--(0,1)--cycle;}}& |
| 133 |
\answer{2}{\tikz{\draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;}}& |
| 134 |
\answer[correct]{3}{\tikz{\draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;}}& |
| 135 |
\answer{4}{\tikz{\draw (0,0) circle[radius=0.5];}}\\ |
| 136 |
\answernum{1}&\answernum{2}&\answernum{3}&\answernum{4}\\ |
| 137 |
\end{tabular} |
| 138 |
\end{mcanswers} |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
\begin{mcquestioninstruction} |
| 145 |
Questions \ref{ref1} to \ref{ref2} are about maths. |
| 146 |
\end{mcquestioninstruction} |
| 147 |
|
| 148 |
\question What is the value of $\pi$?\label{ref1} |
| 149 |
|
| 150 |
\begin{mcanswerslist}[{1,2,3,4},{2,3,4,1},{3,4,1,2}] |
| 151 |
\answer[correct] 3.14 |
| 152 |
\answer 2.19 |
| 153 |
\answer a billion |
| 154 |
\answer 0 |
| 155 |
\end{mcanswerslist} |
| 156 |
|
| 157 |
\begin{mcexplanation} |
| 158 |
$\pi$ is 3.14 |
| 159 |
\end{mcexplanation} |
| 160 |
|
| 161 |
\question[follow] How much is 2 + 2 ? |
| 162 |
|
| 163 |
\begin{mcanswerslist}[ordinal] |
| 164 |
\answer 3 |
| 165 |
\answer[correct] 4 |
| 166 |
\answer 5 |
| 167 |
\answer 6 |
| 168 |
\answer 7 |
| 169 |
\end{mcanswerslist} |
| 170 |
|
| 171 |
|
| 172 |
\question[follow] The square root of 2 is \ldots\label{ref2} |
| 173 |
|
| 174 |
\begin{mcanswerslist}[fixlast] |
| 175 |
\answer 2.1 |
| 176 |
\answer[correct] smaller than 2 |
| 177 |
\answer larger than a billion |
| 178 |
\answer none of the above |
| 179 |
\end{mcanswerslist} |
| 180 |
|
| 181 |
|
| 182 |
\question Which statement is correct? |
| 183 |
|
| 184 |
\begin{mcanswerslist}[{1,2,3,4},{2,1,4,3},{3,4,1,2},{4,3,2,1}] |
| 185 |
\answer The moon is a planet. |
| 186 |
\answer The moon is a star. |
| 187 |
\answer The sun is a planet. |
| 188 |
\answer[correct] The sun is a star. |
| 189 |
\end{mcanswerslist} |
| 190 |
|
| 191 |
\question Which is the letter alpha? |
| 192 |
|
| 193 |
\begin{mcanswers} |
| 194 |
\begin{tabular}{cccc} |
| 195 |
\answer[correct]{1}{\Huge$\alpha$} & |
| 196 |
\answer{2}{\Huge$\beta$} & |
| 197 |
\answer{3}{\Huge$\gamma$} & |
| 198 |
\answer{4}{\Huge$\delta$} \\[0.1\baselineskip] |
| 199 |
\answernum{1}&\answernum{2}&\answernum{3}&\answernum{4}\\ |
| 200 |
\end{tabular} |
| 201 |
\end{mcanswers} |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
\question What year did Albert Einstein die? |
| 208 |
|
| 209 |
\begin{mcanswerslist}[ordinal] |
| 210 |
\answer 1949 |
| 211 |
\answer 1954 |
| 212 |
\answer[correct] 1955 |
| 213 |
\answer 1960 |
| 214 |
\end{mcanswerslist} |
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
\question Which is the largest planet in the solar system? |
| 219 |
|
| 220 |
\begin{mcanswerslist} |
| 221 |
\answer[correct] Jupiter |
| 222 |
\answer Neptune |
| 223 |
\answer Earth |
| 224 |
\answer Mars |
| 225 |
\end{mcanswerslist} |
| 226 |
|
| 227 |
|
| 228 |
\question What colour is Cerulean? |
| 229 |
|
| 230 |
\begin{mcanswerslist} |
| 231 |
\answer Red |
| 232 |
\answer[correct] Blue |
| 233 |
\answer Yellow |
| 234 |
\answer Green |
| 235 |
\end{mcanswerslist} |
| 236 |
|
| 237 |
\question What are a group of Dolphins called? |
| 238 |
|
| 239 |
\begin{mcanswerslist} |
| 240 |
\answer School |
| 241 |
\answer Herd |
| 242 |
\answer[correct] Pod |
| 243 |
\answer Pool |
| 244 |
\end{mcanswerslist} |
| 245 |
|
| 246 |
\question Who invented Penicillin? |
| 247 |
|
| 248 |
\begin{mcanswerslist} |
| 249 |
\answer[correct] Alexandra Fleming |
| 250 |
\answer Thomas Edison |
| 251 |
\answer Marie Curie |
| 252 |
\answer George Orwell |
| 253 |
\end{mcanswerslist} |
| 254 |
|
| 255 |
\question What date was President John F Kennedy assassinated? |
| 256 |
|
| 257 |
\begin{mcanswerslist}[{1,2,3,4},{1,3,2,4},{4,3,2,1},{4,2,3,1}] |
| 258 |
\answer November 22 1962 |
| 259 |
\answer November 24 1962 |
| 260 |
\answer[correct] November 22 1963 |
| 261 |
\answer November 24 1963 |
| 262 |
|
| 263 |
\end{mcanswerslist} |
| 264 |
|
| 265 |
\question How many men have walked on the moon? |
| 266 |
|
| 267 |
\begin{mcanswerslist}[ordinal] |
| 268 |
\answer 5 |
| 269 |
\answer 9 |
| 270 |
\answer 10 |
| 271 |
\answer[correct] 12 |
| 272 |
\end{mcanswerslist} |
| 273 |
|
| 274 |
\question Who has won the most Academy Awards? |
| 275 |
|
| 276 |
\begin{mcanswerslist} |
| 277 |
\answer James Cameron |
| 278 |
\answer[correct] Walt Disney |
| 279 |
\answer Katherine Hepburn |
| 280 |
\answer Steven Spielberg |
| 281 |
\end{mcanswerslist} |
| 282 |
|
| 283 |
\question What is the currency of Brazil? |
| 284 |
|
| 285 |
\begin{mcanswerslist}[{1,2,3,4},{2,1,3,4}] |
| 286 |
\answer Dollar |
| 287 |
\answer[correct] Real |
| 288 |
\answer Dollar \emph{and} Real |
| 289 |
\answer None of the above |
| 290 |
\end{mcanswerslist} |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
\question Is this the last question? it is a very long question which spans several lines of the document. |
| 297 |
|
| 298 |
\begin{mcanswerslist}[permutenone] |
| 299 |
\answer[correct] yes |
| 300 |
\answer no |
| 301 |
\end{mcanswerslist} |
| 302 |
|
| 303 |
\begin{mcexplanation} |
| 304 |
It may not be the last question in your exam, but it is the question which was last programmed. |
| 305 |
\end{mcexplanation} |
| 306 |
|
| 307 |
|
| 308 |
\end{mcquestions} |
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
\mcifoutput{concept,exam}{ |
| 315 |
|
| 316 |
\vspace{2\baselineskip} |
| 317 |
|
| 318 |
\noindent\textbf{Instructions:} |
| 319 |
\begin{itemize}[nosep] |
| 320 |
\item You finished the exam! |
| 321 |
\item Hand in the answer sheet. |
| 322 |
\end{itemize} |
| 323 |
|
| 324 |
} |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
\end{document} |