Note: This type of question is only available for digital tests.
A numerical question can be selected to let the student answer with a number. This answer will automatically be reviewed if the answer is set at the criteria page.
How to create an image question
- Sign in to Ans.
- Create an assignment. Read here how to create an assignment.
- Click Add exercise and give the exercise a title.
- Click Add question and select Numerical question.
- Click on the Pencil-button on the topright to edit the exercise and click Options or - when the code editor has not already been used for the exercise - click Select value and then select Add values. The code editor will then be automatically be opened.
- Select Add code editor and the editor will be opened.
- In the code editor, see image below, variables have to be created. To create a variable with a changing value per student, the function random(x,y,step=z) can be used. This function will have a value somewhere between x and y and will have steps of z. This means that when the function has a value between 1 and 4 with steps of 1, the variable can have the values 1, 2, 3 and 4. After creating the right variables, the answers have to be calculated. In the example below, the variables a, b and c are answers to question 1a, 1b, and 1c. Variables can be added up by +, subtracted by -, divided by /, multiplied by * and be done to the power of by **. Make sure to use brackets if needed.
When all variables are calculated, press Run in the top right to run the code and find out if everything works. Also, if something did not work, you can print variables by using print(a) to print the variable a. This way, if running the code gives an error, mistakes can be found in the code. When in the top right Success is displayed, the code works and is also saved.
How to use the created variables in content and questions
- Click Add content or Add question.
- Click Var in the top right of the description block.
- The variable will be shown in a black box with the name as it was given in the code editor. This way it will be visible in the test as a number.
- Set a margin if the students have a margin of error. So 1,0 means the student has a margin of 1%. This value is the answer to this subquestion and will be shown when the question is reviewed.