Wiki source code of Beispiel Variable Lösung
Last modified by Anna Paul-Hasenfuss on 15.09.2025
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{section}} | ||
| 2 | {{column width="60%"}} | ||
| 3 | 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. | ||
| 4 | |||
| 5 | [[image:attach:Player - Beispielaufgabe Möglichkeiten zur variablenabhängigen Änderung der korrekten Lösung.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 6 | |||
| 7 | 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. | ||
| 8 | {{/column}} | ||
| 9 | |||
| 10 | {{column width="30%"}} | ||
| 11 | {{panel title="Content"}} | ||
| 12 | {{toc start="2"/}} | ||
| 13 | {{/panel}} | ||
| 14 | |||
| 15 | {{panel title="Related topics"}} | ||
| 16 | * [[User Profile and Settings>>doc:ONYX.Anmeldung.Benutzerprofil.WebHome]] | ||
| 17 | {{/panel}} | ||
| 18 | {{/column}} | ||
| 19 | {{/section}} | ||
| 20 | |||
| 21 | |||
| 22 | == Explanation of the example’s function == | ||
| 23 | |||
| 24 | === **Configuration in the “Variables processed before display” area: ** === | ||
| 25 | |||
| 26 | You will need the following variables and conditions to implement this: | ||
| 27 | |||
| 28 | * A text variable used in the question that contains the random values for the question. | ||
| 29 | * A text variable able to hold the correct solution. This variable is initialized with an empty value. | ||
| 30 | * A condition in which the values of the question are linked to the corresponding IDs of the answers. | ||
| 31 | |||
| 32 | [[image:attach:Beispiel - Variable korrekte Lösung Pre Variablen_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | === **Configuration in the questions area:** === | ||
| 37 | |||
| 38 | You need to include the text variable to display the random values in the question. | ||
| 39 | |||
| 40 | [[image:attach:Beispiel - Variable korrekte Lösung Aufgabenstellung_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 41 | |||
| 42 | 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. | ||
| 43 | |||
| 44 | [[image:attach:Beispiel - Variable korrekte Lösung ID_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | == Using the pre-configured question example == | ||
| 49 | |||
| 50 | |(% style="width:770px" %)Import the question example: [[Sächsische_Städte.zip>>attach:Sächsische_Städte.zip]]. For instructions on how to import a question, see the help page [[Create or Import Content>>doc:ONYX.Erstellung von Testinhalten.Inhalte erstellen oder importieren.WebHome]].|(% style="width:749px" %)[[image:attach:Editor - Import Beispiel Städte_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 51 | |(% style="width:770px" %)((( | ||
| 52 | 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. | ||
| 53 | |||
| 54 | |||
| 55 | )))|(% style="width:749px" %)[[image:attach:Editor - Änderung Aufgabenstellung_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 56 | |(% style="width:770px" %)((( | ||
| 57 | Adjust the background image and the corresponding hotspot areas to suit your question. You can delete existing hotspots and add new ones. | ||
| 58 | |||
| 59 | 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. | ||
| 60 | |||
| 61 | )))|(% style="width:749px" %)[[image:attach:Editor - ID individualisieren_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 62 | |(% style="width:770px" %)((( | ||
| 63 | Check the condition in the Variables tab and adjust it to match your question and solutions. | ||
| 64 | |||
| 65 | |||
| 66 | )))|(% style="width:749px" %)[[image:attach:Editor - Änderung Bedingung_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 67 | |(% style="width:770px" %)The Feedback tab contains reference texts relevant to the city question. Make sure to adapt these to your question as well.|(% style="width:749px" %)[[image:attach:Editor - Anpassung Feedbacktexte_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 68 | |(% style="width:770px" %)((( | ||
| 69 | Save your question and use the preview to check if it is correct. | ||
| 70 | )))|(% style="width:749px" %)[[image:attach:Player - Vorschau zur Aufgabe_de.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]] | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 |