Topic outline
-
-
This section will build on the previous question and show you how to add multiple variables and multiples questions/answers within one part.
Again, you only need to follow the steps below - leave all other settings as default.
The example we'll use here is:
If a = (random number ), b = (random number) and c = 10, calculate a + b, b + c, and then add the two answers together.
You can see the final version of the question embedded at the bottom of this page.
(We have included an .xml file of this question below. You can download this and import it into your course website question bank. Use it to develop your own basic formula questions.)
Steps
1. Create a new question in the Moodle question bank and select the Formulas question type.
2. Fill in the name, and enter random and global variables.
Remember to start each variable on a new line, and end each line with a semicolon. Give each variable a unique name and enclose the parameters in curly brackets {}.
-
3. Enter the marks for the part.
Watch out for this: Unless you've set the whole question up for composite marking (which we'll look at later), Moodle will only award the marks for a fully correct answer. If the student gets just one of the answers wrong, no marks will be given.4. Enter the correct answers and set the allowable error, either relative or absolute.
- Relative error is a percentage (a relative error of <0.01 means the error must be less than 1% of the answer).
- Absolute error as an actual number. Therefore, an absolute error of <1 means the error must be within 1 integer of the answer.
Watch out for this if using relative error with composite answers: When you have multiple answers within one part of a Formula question, the relative error is only calculated once, based on the largest of the answers. Moodle then applies that error to all answers. This can really impact on the effectiveness of the question. To avoid this, recreate the question, using separate parts for each answer.5. Write the question text and define three spaces for the student's answers.
-
6. Add feedback for an incorrect answer.
7. Use variables instantiation to see how Moodle will assign the variables. You can ask Moodle to show you some examples of the datasets it will supply, and see how they work. You can see the instantiation for the example question below.
-
8. Save and preview your question.
You can see the final form of the example question embedded below. Try inputting different answers to see how the question responds.
-
2.2 KB application/xml Uploaded 7/11/22, 15:33
You can import this question into your course question bank. You can then copy and adapt it.
Administration - Course administration - Question bank - Import - Moodle xml format - Choose the file - Import. (Watch a video on how to import the question into a course website.)
-