Example "Variable Solution"

Last modified by Anna Paul-Hasenfuss on 15.09.2025

In addition to questions and answers, you can also define the correct solution dynamically for each test run. As a result, a wide variety of question templates are possible, which generate different, equivalent questions through the use of random values and provide the appropriate solution in each case.

Player - Beispielaufgabe Möglichkeiten zur variablenabhängigen Änderung der korrekten Lösung.png

This variable-dependent adjustment of the correct solution is available for choice, matching, and hotspot interactions. To access this feature, you need to enable the ID display in your user settings.

Explanation of the example’s function

Configuration in the “Variables processed before display” area: 

You will need the following variables and conditions to implement this:

  • A text variable used in the question that contains the random values for the question.
  • A text variable able to hold the correct solution. This variable is initialized with an empty value.
  • A condition in which the values of the question are linked to the corresponding IDs of the answers.

Beispiel - Variable korrekte Lösung Pre Variablen_de.png

Configuration in the questions area:

You need to include the text variable to display the random values in the question. 

Beispiel - Variable korrekte Lösung Aufgabenstellung_de.png

By changing the solution variable in the ID of the correct answer section, the previous setting of the correct solution to the task is replaced by the answers specified in the condition.

Beispiel - Variable korrekte Lösung ID_de.png

Using the pre-configured question example

Import the question example: Sächsische_Städte.zip. For instructions on how to import a question, see the help page Create or Import Content.Editor - Import Beispiel Städte_de.png

Change the question title and adjust the text accordingly. If you change the title of the variable “city,” you also have to make this change in the Variables tab.

 

Editor - Änderung Aufgabenstellung_de.png

Adjust the background image and the corresponding hotspot areas to suit your question. You can delete existing hotspots and add new ones.

For newly added hotspots, an ID is automatically assigned to these new answer options. You can customize the default name of the ID. Keep in mind that the ID must start with a letter.
 

Editor - ID individualisieren_de.png

Check the condition in the Variables tab and adjust it to match your question and solutions.

 

Editor - Änderung Bedingung_de.png
The Feedback tab contains reference texts relevant to the city question. Make sure to adapt these to your question as well.Editor - Anpassung Feedbacktexte_de.png

Save your question and use the preview to check if it is correct.

Player - Vorschau zur Aufgabe_de.png