| 1 |
% !TeX encoding = UTF-8 |
| 2 |
% !TeX spellcheck = en_US |
| 3 |
% !TEX TS-program = pdflatex |
| 4 |
\documentclass{article} |
| 5 |
\usepackage[nostamp,handout,samepage]{moodle} |
| 6 |
\ifPDFTeX % FOR LATEX and PDFLATEX |
| 7 |
\usepackage[utf8]{inputenc} % necessary |
| 8 |
\usepackage[T1]{fontenc} % necessary |
| 9 |
\else % assuming XELATEX or LUALATEX |
| 10 |
\usepackage{fontspec} |
| 11 |
\fi |
| 12 |
\moodleregisternewcommands |
| 13 |
\newcommand{\longtext}{Lorem ipsum dolor sit amet, consectetuer adipiscing |
| 14 |
elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. |
| 15 |
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer |
| 16 |
id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant |
| 17 |
morbi tristique senectus et netus et malesuada fames ac turpis egestas.} |
| 18 |
\newcommand{\longtexts}{\longtext\par\longtext\par\longtext} |
| 19 |
|
| 20 |
%\RLsetrandomseed{3} |
| 21 |
\begin{document} |
| 22 |
|
| 23 |
\section*{Introduction} |
| 24 |
|
| 25 |
This document is intended to check the support of the package option |
| 26 |
\texttt{samepage}; it is used in conjunction with the option \texttt{handout}. |
| 27 |
With these options, the PDF file is clean from teacher-only |
| 28 |
information (answers, points, penalty, feedback, tags) and in addition |
| 29 |
the questions are never split across pages. Hence, it can be given |
| 30 |
to students for classroom work or even as a written form of the test. |
| 31 |
Notice that this is still experimental, works for a subset of question types, |
| 32 |
and it should be checked. |
| 33 |
|
| 34 |
In particular, as would Moodle do, answers in \texttt{matching} questions are |
| 35 |
shuffled and the option \texttt{shuffle} triggers the shuffling of choices |
| 36 |
offered (\texttt{multi} and \texttt{matching}). The XML file is generated as |
| 37 |
usual. |
| 38 |
|
| 39 |
\begin{quiz}[points=1,tags={tag},feedback={General feedback},shuffle]{Option |
| 40 |
Handout with Samepage} |
| 41 |
|
| 42 |
\begin{description}{Description} |
| 43 |
\longtexts |
| 44 |
\end{description} |
| 45 |
|
| 46 |
\begin{essay}{Essay} |
| 47 |
Question text |
| 48 |
|
| 49 |
\longtexts |
| 50 |
|
| 51 |
\item A |
| 52 |
\item B |
| 53 |
\item C |
| 54 |
\end{essay} |
| 55 |
|
| 56 |
\begin{multi}[shuffle=false]{Multi Single} |
| 57 |
Question text |
| 58 |
|
| 59 |
\longtexts |
| 60 |
|
| 61 |
\item[feedback={AAA}]* A \longtext |
| 62 |
\item[feedback={BBB},fraction=10] B \longtext |
| 63 |
\item[feedback={CCC}] C \longtext |
| 64 |
\end{multi} |
| 65 |
|
| 66 |
\begin{multi}[multiple]{Multi Multiple} |
| 67 |
Question text |
| 68 |
|
| 69 |
\longtexts |
| 70 |
|
| 71 |
\item[feedback={AAA}]* A \longtext |
| 72 |
\item[feedback={BBB}] B \longtext |
| 73 |
\item[feedback={CCC}]* C \longtext |
| 74 |
\item[feedback={DDD}] D \longtext |
| 75 |
\end{multi} |
| 76 |
|
| 77 |
\begin{truefalse}{True/False 1} |
| 78 |
\longtexts |
| 79 |
\item[feedback={AAA}] |
| 80 |
\item[feedback={BBB}]* |
| 81 |
\end{truefalse} |
| 82 |
|
| 83 |
\begin{truefalse}{True/False 2} |
| 84 |
\longtexts |
| 85 |
\item* |
| 86 |
\end{truefalse} |
| 87 |
|
| 88 |
\begin{truefalse}{True/False 3} |
| 89 |
\longtexts |
| 90 |
\item |
| 91 |
\item* |
| 92 |
\end{truefalse} |
| 93 |
|
| 94 |
\begin{numerical}[tolerance=1]{Numerical} |
| 95 |
\longtexts |
| 96 |
\item[feedback={1}] 1 |
| 97 |
\item[feedback={3},fraction=0] 3 |
| 98 |
\end{numerical} |
| 99 |
|
| 100 |
\begin{shortanswer}[tolerance=1]{Short Answer} |
| 101 |
\longtexts |
| 102 |
\item[feedback={1}] aaa |
| 103 |
\item[feedback={3},fraction=0] bbb |
| 104 |
\end{shortanswer} |
| 105 |
|
| 106 |
\begin{matching}[dd]{Matching} |
| 107 |
\longtexts |
| 108 |
\item A \longtext \answer 1 |
| 109 |
\item B \longtext \answer 2 |
| 110 |
\item C \longtext \answer 3 |
| 111 |
\item \answer 4 |
| 112 |
\end{matching} |
| 113 |
|
| 114 |
\begin{matching}[shuffle=false]{Matching} |
| 115 |
\longtexts |
| 116 |
\item A \longtext \answer 1 |
| 117 |
\item B \longtext \answer 2 |
| 118 |
\item C \longtext \answer 3 |
| 119 |
\item \answer 4 |
| 120 |
\end{matching} |
| 121 |
|
| 122 |
\begin{cloze}{Cloze} |
| 123 |
|
| 124 |
\begin{multi}[horizontal,shuffle=false] |
| 125 |
Question text |
| 126 |
|
| 127 |
\longtexts |
| 128 |
|
| 129 |
\item[feedback={AAA}]* A |
| 130 |
\item[feedback={BBB},fraction=10] B |
| 131 |
\item[feedback={CCC}] C |
| 132 |
\end{multi} |
| 133 |
|
| 134 |
\begin{multi}[vertical,shuffle=false] |
| 135 |
Question text |
| 136 |
\item[feedback={AAA}]* A |
| 137 |
\item[feedback={BBB},fraction=10] B |
| 138 |
\item[feedback={CCC}] C |
| 139 |
\end{multi} |
| 140 |
|
| 141 |
\begin{multi}[inline,shuffle=false] |
| 142 |
Question text |
| 143 |
\item[feedback={AAA}]* A |
| 144 |
\item[feedback={BBB},fraction=10] B |
| 145 |
\item[feedback={CCC}] C |
| 146 |
\end{multi} |
| 147 |
|
| 148 |
\begin{multi}[horizontal] |
| 149 |
Question text |
| 150 |
\item[feedback={AAA}]* A |
| 151 |
\item[feedback={BBB},fraction=10] B |
| 152 |
\item[feedback={CCC}] C |
| 153 |
\end{multi} |
| 154 |
|
| 155 |
\begin{multi}[vertical] |
| 156 |
Question text |
| 157 |
\item[feedback={AAA}]* A |
| 158 |
\item[feedback={BBB},fraction=10] B |
| 159 |
\item[feedback={CCC}] C |
| 160 |
\end{multi} |
| 161 |
|
| 162 |
\begin{multi}[inline] |
| 163 |
Question text |
| 164 |
\item[feedback={AAA}]* A |
| 165 |
\item[feedback={BBB},fraction=10] B |
| 166 |
\item[feedback={CCC}] C |
| 167 |
\end{multi} |
| 168 |
|
| 169 |
\begin{numerical}[tolerance=1] |
| 170 |
Question text |
| 171 |
\item[feedback={1}] 1 |
| 172 |
\item[feedback={3},fraction=0] 3 |
| 173 |
\end{numerical} |
| 174 |
|
| 175 |
\begin{shortanswer}[tolerance=1] |
| 176 |
Question text |
| 177 |
\item[feedback={1}] aaa |
| 178 |
\item[feedback={3},fraction=0] bbb |
| 179 |
\end{shortanswer} |
| 180 |
|
| 181 |
\end{cloze} |
| 182 |
|
| 183 |
\end{quiz} |
| 184 |
|
| 185 |
\end{document} |