Quickchecks¶
1. Overview¶
Quickcheks are small problems embedded in other documents. The user types in the answer in one or more input fields, and clicks a "Check" button to see wether the answer is correct or not. Ther user can also click a "Show solution" button to see the solution and, if existing, an explanation. In contrast to normal problems, no data is stored on the server, neither personalized data, nor answers, nor corrections.
The reader of this document is supposed to have a basic knowledge of generic problems.
2. TeX description¶
The TeX description of quickchecks is very similar to that of generic TeX problems. Here is an example:
\begin{quickcheck}
\type{input.number}
\displayprecision{3}
\correctorprecision{3}
\begin{variables}
\randint{num}{1}{6}
\function[calculate]{deg}{num/6*180}
\function[calculate]{rad}{deg/180*pi}
\end{variables}
\text{
Wie groß ist der Winkel $\var{deg}^\circ$ im Bogenmaß?
Runden Sie Ihr Ergebnis auf drei Stellen hinter dem Komma.
Antwort: \ansref
}
\explanation{
Bogenmaß = Gradmaß / 180 $\cdot$ $\pi$, also $\var{deg}/180\cdot\pi$, also, da $\pi = 3.14159\ldots$,
Bogenmaß gerundet auf drei Stellen = $\var{rad}$.
}
\begin{answer}
\solution{rad}
\end{answer}
\end{quickcheck}
In the browser, this looks as followes:
.
If you type in the answer and click the check button, the system will mark correct and wrong answers as follows:
Correct answer:
Wrong answer:
Clicking the "Show solution" button will show the correct answer and, if existing, the explantion:
The "Show solution" button changes to a "Hide solution" button by this, which hides these things again.
3. Pools¶
Quickchecks provide a functionality similar to random question pools in generic problems. You can define a "pool" of quickchecks from which one or more are selected randomly. All quickchecks of the pool must be enclosed in a quickcheckcontainer
environment. The selection is controlled by one or more \randomquickcheckpool
commands, which are completely analog to the \randomquestionpool
commands in generic problems:
\begin{quickcheckcontainer}
\randomquickcheckpool{1}{5}
\randomquickcheckpool{6}{10}
\begin{quickcheck}
...
\end{quickcheck}
\begin{quickcheck}
...@\explanation{...}@
\end{quickcheck}
.
.
.
\end{quickcheckcontainer}
4. Multiple Choice Questions¶
As an alternative to input fields (e.g. input.number) that the user has to fill out,
you can use multiple choice questions. The syntax is similar to multiple choice questions
in generic problems.
Use the choices
environment with the parameter multiple
or unique
. You don't need thetype
command like in 'regular' quickchecks. It will be completely ignored.
\begin{quickcheck} \begin{variables} \randint[Z]{c1}{1}{12} \randint[Z]{c2}{1}{12} \function[calculate]{cSum1}{c1+c2} \function[calculate]{cSum2}{c1-c2} \end{variables} \text{Wähle alle richtigen Aussagen aus:} \begin{choices}{multiple} \begin{choice} \text{$\var{c1}+\var{c2}=\var{cSum1}$} \solution{true} \end{choice} \begin{choice} \text{$\var{c1}+\var{c2}=\var{cSum2}$} \solution{false} \end{choice} \begin{choice} \text{$\var{c1}+\var{c2}=\abs{\var{c1}+\var{c2}}$} \solution[compute]{c1+c2 > 0} \end{choice} \begin{choice} \text{$\var{c1}-\var{c2}=\abs{\var{c1}-\var{c2}}$} \solution[compute]{cSum1 > 0} \end{choice} \end{choices} \end{quickcheck}
choice
environment. You have the following three options:
\solution{true}
or\solution{false}
or\solution[compute]{<expression>}
You can use arithmetic and logical expressions (including variables) to compute a solution.
Make sure that if you use the typeunique
that one but only one choice istrue
.
5. List of TeX commands and environments¶
There are five quickcheck environments:
quickcheck
-- Top-level environment of a quickcheckquickcheckcontainer
-- Container for quickchecks that should form a poolvariables
-- Container for variables; same as in generic problemschoices
-- multiple choice questionschoice
-- one choice in a multiple choice questions
The quickcheck commands are:
\ansref
\checkAsFunction[<options>]{<variable>}{<min>}{<max>}{<steps>}
\correctorprecision{<number>}
\derivative[<actions>]{<variable>}{<expression>}{<free_variable>}
\displayprecision{<number>}
\explanation{...}
\field{<field>}
\function[<actions>]{<variable>}{<expression>}
\number{<variable>}{<value>}
\drawFromSet[<options>]{variable}{set}
\precision{<number>}
\randadjustIf{<variables>}{<condition>}
\randdouble{<name>}{<min>}{<max>}
\randint[<nonzero>]{<name>}{<min>}{<max>}
\randomquickcheckpool{<min>}{<max>}
\randrat{<name>}{<minNumerator>}{<maxNumerator>}{<minDenominator>}{<maxDenominator>}
\solution{<solution>}
\solution[compute]{<solution>}
\substitute[<actions>]{<variable>}{<expression>}{<free_variable>}{<substitute>}
\text{...}
\type{<type>}
\var{<variable>}
All commands have the same meaninmg as in generic problems.
The content of \text{...}
and \explanation{...}
may contain arbitrary JMmtex code, including tables, lists, images, etc.
Note: type=string for \drawFromSet
is not very well supported for Quickchecks at the moment. That's due to the fact that
variables outside a math environment are not supported at the moment in a Quickcheck environment.
Supported input types¶
Currently, the input types "input.number"
and "input.function"
are supported. Alternatively
you can use multiple choice questions (see Multiple Choice Questions)