Authoring questions

Examples

See some examples on this website |examples_website|.

Content in OpenTA consists of exercises with one or many questions. An exercise and its questions are created using a custom XML format. For example,

example.xml

<exercise>
  <exercisename>Momentum and energy</exercisename>
  <global>
	m = 3 kg; v = 5 meter / second;
  </global>
  <text>
    A particle with mass $m$ is moving with velocity $v$.
  </text>
  <question key="1" type="default">
    <text>What is the energy of the particle?</text>
    <expression>m*v^2/2</expression>
  </question>
  <question key="2" type="default">
    <text>What is the momentum  of the particle?</text>
    <expression>m*v</expression>
  </question>
</exercise>

Mathematics typesetting

OpenTA supports typesetting mathematical expressions in text through KaTeX. This means that whenever you want to show some mathematics, for example \(\frac{1+x^2}{\sqrt{1-x}}\), you write the corresponding LaTeX syntax within dollar signs: $\frac{1+x^2}{\sqrt{1-x}}$.

See the LaTeX wiki for a syntax reference.

For some more hands-on examples see this stackexchange collection (this is aimed at MathJax which also uses the same syntax).