Example Test "Transport" - Use of Random Values
Example test “Transport”
1 | In both questions, the same random values should be applied for the vehicle type (transport) and speed, with the speed depending on the vehicle type. These random values will be defined as test variables. In the example, the text variable {transport} will be randomly initialised at test level with one of the following values: "bike", "bus”, "car" or "train". The numerical variable {speed} should be randomly selected from a range of values, which will be set by a corresponding condition, depending on the selected vehicle {transport}. | |
2 | To use the random test values in the individual questions, you must also create variables in those questions and link the values to one another. In the example, two questions of the type calculation interaction will be created. In each question, the question variables {transport} and {speed} will be defined. For the purpose of clarity, the question variables in the example have the same name with the extension “item1” in the first question and “item2” in the second. The values of the question variables will not be set in the question itself, as this would override the linked test variable values. When creating question variables, select the empty entry from the drop-down menu Set value to in the Edit variable dialogue for each question variable. | |
3 | The variable link will be defined at test level for each test variable. Edit the particular variable and link it to the related question variables. In the example, the test variable {transport} will be linked to the question variables {transport_item1} and {transport_item2}. The test variable {speed}, in contrast, will be linked to the question variables {speed_item1} and {speed_item2}. | |
4 | You may also define more question-specific variables and conditions for your questions. The given values of all question variables, including the linked variables that will be filled in automatically, will be entered in the question text by typing the variable name (e. g. {transport_item1}, {speed_item1}). In the example, an additional question-specific variable {speed} was created for question 1, and the correct solution was calculated as a variable {distance}. The variables will be included in the question text with appropriate syntax, and the variable with the correct solution {distance} will be bound to the gap. The Example “Transport” provides more detailed information on these steps. For question 2, the variables will also be included, and the correct solution will be calculated within the question {distance2}. | |
5 | One of the defined values will be randomly chosen for each participant and each test attempt. In the example, the value "bus" was randomly selected as the vehicle ({transport}) together with a speed of 42 (km/h). These values calculated at test level can now be used in all questions, and related question series can be created with random values. |