Numerical Questions in Moodle
The Numerical question type requires students to enter a numerical value as their answer. Unlike short answer questions, numerical questions allow for an accepted margin of error (tolerance) and can handle units of measurement. This question type is essential for mathematics, science, engineering, and any subject that requires numerical computation.
Creating a Numerical Question
- Navigate to the Question bank and click Create a new question.
- Select Numerical from the question type list.
- Configure the settings as described below.
- Click Save changes.
General Settings
- Category: The question bank category where this question will be stored.
- Question name: An internal identifier for the question.
- Question text: The question prompt. Supports HTML formatting, images, and mathematical notation (via MathJax or the equation editor).
- Default mark: The maximum marks for a correct answer.
- General feedback: Feedback shown after answering, regardless of correctness.
Defining Answers and Accepted Error
You can define one or more acceptable answers, each with a tolerance (accepted error):
- Answer: The correct numerical value (e.g., 3.14159).
- Accepted error: The margin of error allowed. If the correct answer is 3.14 with an accepted error of 0.01, then any value between 3.13 and 3.15 will be accepted.
- Grade: The percentage of marks for this answer (typically 100% for the correct answer).
- Feedback: Specific feedback for this answer.
Example Configuration
Question: What is the value of pi to 2 decimal places?
Answer 1: 3.14 Accepted error: 0.005 Grade: 100%
Answer 2: 3.1 Accepted error: 0.05 Grade: 50% Feedback: Try to be more precise.
Answer 3: * Grade: 0% Feedback: The answer is 3.14.
The wildcard (*) can be used as a catch-all for any unmatched numerical response, similar to short answer questions.
Units
Numerical questions can be configured to handle units of measurement. This is managed through the Units handling and Unit penalty settings.
Unit Handling Options
- Units are not used: The student enters only a number. No unit input field is shown.
- Units are optional: A unit input field is displayed but students are not required to enter a unit. If they enter an incorrect unit, a penalty may be applied.
- The unit must be given: Students must enter both a number and a unit. If the unit is missing or incorrect, a penalty is applied.
Defining Units
You can define multiple units with conversion multipliers:
Unit 1: m Multiplier: 1.0 (base unit)
Unit 2: cm Multiplier: 0.01 (1 cm = 0.01 m)
Unit 3: km Multiplier: 1000 (1 km = 1000 m)
When students enter a value with a unit, Moodle multiplies the entered value by the unit multiplier before comparing it to the expected answer. For example, if the correct answer is 5 (in metres), a student entering "500 cm" would be evaluated as 500 x 0.01 = 5, which matches.
Unit Display
- Text input element: The student types the unit in a text field next to the number field.
- Drop-down menu of units: The student selects the unit from a dropdown list of defined units.
- Unit is displayed as part of the question text: The unit is only shown for reference; the student enters only the number.
Unit Penalty
When units are optional or required, you can set a unit penalty (0 to 1) that is applied when the student enters a wrong or missing unit. For example, a penalty of 0.1 means the student loses 10% of their marks for an incorrect unit.
Unit Position
Choose whether the unit appears to the right (e.g., "5 kg") or to the left (e.g., "") of the number input.
Multiple Tries and Penalties
- Penalty for each incorrect try: Set the penalty fraction for quiz behaviours that allow multiple tries.
- Hints: Add hints for subsequent attempts.
GIFT Format for Numerical Questions
// Simple numerical question
::Pi value::What is the value of pi to 2 decimal places?{#3.14:0.005}
// With range
::Temperature::At what temperature (Celsius) does water boil?{#100:1}
Numerical vs Calculated Questions
While numerical questions have fixed answers, calculated questions use formulas with wildcards to generate different numerical values for each student. Choose numerical questions when you want all students to answer the same fixed-value question. Choose calculated questions when you want randomised values.
Best Practices
- Always set an appropriate accepted error to account for rounding differences.
- Use the wildcard (
*) as a catch-all answer to provide feedback for any wrong response. - Clearly state the required precision and units in the question text (e.g., "Give your answer in metres, to 2 decimal places").
- Define multiple units when students might reasonably respond in different measurement systems.
- Set unit penalties proportionally — a wrong unit with the right number should usually still receive partial credit.
- Preview and test with various inputs to ensure the accepted error range works as expected.