Topic outline
-
-
Many numerical questions specify that the answer should be rounded to a certain number of decimal places or significant figures. Using the round function allows you to assess whether the student has rounded off their answer to the correct number of decimal places (which should be specified in your question).
We'll use the same example question as the last level to show you how to apply rounding to an answer:
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 and name a formula question. Add random and global variables. and the main question text.
-
2. In the Part 1 section, enter the correct answer.
Use the 'round' function to set the rounding, in the format round(answer variable,x) where x is the number of decimal places the answer should be rounded to. (It's also possible to set rounding using the grading criteria and variables, but this is the most basic method.)
You can also use the 'signif' function to set the number of significant figures, in the format signif(answer variable, x) where x sets the number of significant figures for the answer.
Watch out for this: The student answer will now be marked incorrect if the incorrect number of decimal places is given, even if the numerical answer is correct.
-
3. Set the allowable error and enter the question text for the part. Add feedback, and instantiate if you wish.
4. 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.
-
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.)
-