Page tree
No Translation available yet

You have English selected as language but this page has not been translated yet. Translate the page or view the content in the default space language below.

Display default
Skip to end of metadata
Go to start of metadata

Unable to render {include} The included page could not be found.

The task type Formula comparison is a special text entry interaction, which allows for the insertion of formulas as well as for the subsequent automatic formula comparison, including assessment and feedback.

The learner is expected to enter a formula.

Optionally, you can also enable the Check formula section. The learner would then be able to validate whether the entered syntax is correct. In addition, you can activate a formula preview.

For this task type, advanced assessment options (MAXIMA expert mode) are possible.

Define questions and answers

Enter your question in the input field. The gaps for the solution input can be defined within the text. Any number of gaps can be created. A more detailed description of how to create a gap can be found in the help section Text entry interaction.

Step by step

In the following, the creation of a calculation interaction is explained by means of an example.

Step 1: Design the task

The properties of a circle are to be calculated. The learner is expected to specify the formulas for the calculation of the circumference, the surface area, and the diameter.

Step 2: Create the question

In the tab "Question & Answer", enter the question in the text field. Click on the gap symbol or create a new gap via the button Add gap.

Step 3: Specify the correct solution

Enter your formula in MAXIMA notation in the field Solution under Edit gap. In the example, the solution is the formula for the calculation of the circumference of a circle: u=2*%pi*r.

Further examples of the MAXIMA notation:

  • E=m*c^2: Insert operators between any two variables (e.g. "m*c" instead of "mc").
  • %e^%i*%pi=cos(alpha)+%i*sin(alpha): Mathematical constants are entered with a preceding % (e.g. %e, %pi). Logarithmic functions can be written as usual (e.g. sin(1), cos(1)).

Step 4: Enable formula check (optional)

With the function Check formula, the participant can check the validity of their input. The entered formula is validated with MAXIMA. Select Show syntax errors to allow the participant to verify whether their entered formula is syntactically correct.

You can also allow the participant to preview the formula. The formula is presented via MathJax (LaTeX).

Task assessment in the expert mode

For the assessment of a task of the type formula comparison, extended options are available in the expert mode.

The Expert mode allows for the manipulation of the MAXIMA comparison operators: 

ONYX offers two different comparison options:

  1. True/false comparison with the standard expression
  2. Points-based comparison with the standard expression if is(equal(ev(LEARNERRESPONSE),ev(CORRECTRESPONSE))) then MAXSCORE else MINSCORE;


In the text field assessment (MAXIMA), you can adjust the MAXIMA command. To do so, you can use the following variables:

  • LEARNERRESPONSE (the participant's answer for this gap)
  • CORRECTRESPONSE (solution for this gap)
  • MAXSCORE (maximum points for this gap)
  • MINSCORE (minimum points for this gap, usually 0)
  • Access to other gaps is possible via the attachment of their ID, e.g. LEARNERRESPONSE_GAP_1. The gap's ID can be found in the edit window of the gap, in the lower right corner.


The true/false comparison only works when MAXIMA returns a Boolean value.

A numerical value can be returned if the option Points is used. The numerical value is the score that is bounded by the given minimum and maximum points.