You add an algorithm to a question of a quiz, so that the question uses variables that get new values.

Before you start

The quiz is open in the Quiz Designer.

Steps

  1. On the page, in the Add: list, click Numeric. The Numeric question dialog opens.

  2. In Question text, enter a question that uses a variable. For example: What is $a + 1?

  3. In Number (required), enter the answer, with the variable. For example: $a+1

  4. In the Add: list of the dialog, click Algorithm. The Algorithm section opens.

  5. In the algorithm editor, define the variable. For example: $a=range(2,9);

  6. Click Insert.

The question appears on the page. The Quiz Designer shows the variable name as typed.

Check out Algorithms in the Question Designer for the syntax.