There are many ways our friends use Ximera. Some make worksheets, some make exercise banks, and some make full textbooks. Common to all of these are the use of interactive elements that students submit answers to. We’ll call anything a student can answer an answerable. With that said, we’ll discuss the basic answerables below, and then describe how they might be used in use cases of: worksheets, exercise banks, and textbooks.
The basic way of including a answerable item in Ximera is to use the \answer
command.
\answer command must be in math-mode (display or inline) and also be
inside of a theorem-like environment. Here are some examples of how to use
\answer. We can validate a single number:
\begin{problem}
State the answer to life, the universe, and everything.
\[
\answer{42}
\]
\end{problem}
We can validate an expression of variables:
\begin{exercise}
Compute:
\[
\frac{\partial}{\partial x} \sin(3xyx)
= \answer{3yz\cos(3xyz)}
\]
\end{exercise}
We can validate with several answerables in an environment:
\begin{question}
For each of the following functions, find $x$ such that it is a
critical point, or write ‘‘NA’’ if none exists.
\begin{enumerate}
\item For $f(x) = |x-4|$, $x$ is a critical point when
$x=\answer{4}$.
\item For $g(x) = x^2-4x+1$, $x$ is a critical point when
$x=\answer{2}$.
\item For $h(x) = 3x-2$, $x$ is a critical point when
$x=\answer[format=string]{NA}$.
\end{enumerate}
\end{question}
There are also a number of optional arguments that can be passed to the \answer
command.
- tolerance
-
sets a \(\pm \) value on the author’s (numeric) answer that will be accepted from a student. For example, the answer box
\answer[tolerance=5]{100}will accept anything in the range of \([95,105]\) as correct. - format=string
-
validates words typed into an answer box. Here
$\answer[format=string]{Cat}$will validateCat,cAt,caT,catall as correct. However, if spaces are inserted before, between, or after, it will be marked as incorrect. - given
-
will show an answer in the PDF. Sometimes it is necessary to show such content to ensure understandable in a PDF setting. Here given means that the answer is given to the student in the PDF.
There are two other optional arguments validator and id, but they are for building
custom validators and are beyond the scope of this document.
\answer using commas and there can be no spaces, like
this:
\[
\answer[given,tolerance=5]{100}
\]
Validating an answer is achieved by client-side JavaScript. Around one dozen algorithms check if the student’s provided answer is mathematically equivalent to the content author’s provided answer. If any report the answer as being correct, then it is marked as correct.
- Student input
-
answers a nontrivial task. Students need to be able to easily type in their answers.
- Checking for equality
-
will not reveal the form of the answer. This means that sometimes the answer to the question can be the question itself. For example
1+2 = \answer{3}can be answered with ‘\(1+2\)’ because that equals \(3\). - Right-click reveals the answer
-
to the students. Moreover, the source is open to the students. Ximera is not designed for high-stakes assessment.
- Richardson’s theorem
-
states it is not possible to decide equality between the expressions of involving integers, \(\pi \), logarithms and exponential and sine functions.
- Floating-point numbers
-
can lead to erroneous computations, leading to identifying nonequal expressions as equal.
In abstract, each of these confounds are quite daunting. However, in practice, they can be mitigated via Ximera’s design along with thought on the author’s side when constructing problems.
Student input is reflected back to the student, in the sense that Ximera tells the users what it thinks they are typing. In addition, we provide a math palette. Authors can assist students with input by ensuring that the required answer is not too difficult to type in.
Ximera checks for equality and is comprehensive in practice, but that can be problematic when you want the answer in a specific form. For example if you want students to sum numbers, you will have to use
\[
1+2 = \answer[format=string]{3}
\]
For other specific forms, like factoring polynomials, you will need to use a custom validator.
Ximera is open-source and not designed for high-stakes assessment. All content is open and students can find the source if they look hard enough. Moreover, answers can be exposed via right-click. This has the even more unfortunate side-effect that a student can mess up their browser settings to the point that Ximera content will not render.
For accessibility reasons (like screen readers and the like) the library that powers the answer box has a bunch of features bundled in, one of which is the ability to right-click and get different formatting of its contents. Unfortunately, if you right-click and go to “Show Math As” and then “TeX Commands” you can very easily see the contents of the answer command.
This information isn’t necessary for accessibility (after all, the answer box is
supposed to contain the actual content supplied by the student, and doesn’t have any
content the student needs to know about) but it’s tied to the behavior of the
underlying library that supports all the rendered math on the page, so we can’t
remove it without killing all accessibility at this point. However, it is easily countered
in specific cases of the answer box. To do this, in your xmPreamble.tex, add
something like:
\newcommand{\myHiddenAns}{6}
then in your document, you can write
\begin{exercise}
Compute $3!$
\[
3! = \answer{\myHiddenAns}
\]
\end{exercise}
Ricardson’s theorem forces the developers of Ximera to make a decision:
- To sometimes count correct submissions as incorrect.
- To sometimes count incorrect submissions as correct.
For the Ximera platform, we chose to sometimes count incorrect submissions as correct. This means that at least one of the validators believed that the student typed in the correct solution. The validator can surely be optimized further, but that will be for future research and development.
Floating-point computations are a fact-of-life when working with computers.
\begin{example}
Confirm:
\[
10 \ne \answer{10^{-11}+10}
\]
\end{example}
Ximera accepts \(10\) for the answer that should be \(10^{-11}+10\) as correct, even though we obviously know that’s not true. This because \(10^{-11}\) is a number that is too small for machine precision. For a more in-depth review of the perils of floating-point arithmetic, see What Every Computer Scientist Should Know About Floating-Point Arithmetic.
Parenthesis around answer boxes are good to use, especially if your answer is negative and part of an expression.
Since the answer box is a different size than the answer you should use \left and
\right to do it like this:
\begin{exercise}
3 + \left(\answer{-2}\right) = 1
\end{exercise}
and here we see this in a more sophisticated context:
\begin{exercise}
Given a normal vector $\vec{n} = (a,b,c)$ and a point
$(x_0,y_0,z_0)$, the equation of the plane with normal
vector $\vec{n}$ that passes through $(x_0,y_0,z_0)$ is
given by
\[
a(x-x_0)+b(y-y_0)+c(z-z_0) = 0.
\]
Find the equation of a plane with normal vector $(2,-1,9)$
that passes through $(2,-3,4)$. Express your final answer
in the form $ax+by+cz=d$.
\[
2x+\left(\answer{-1}\right)y+\left(\answer{9}\right)z
= \answer{43}.
\]
\end{exercise}
2024-12-23 16:28:56