Moodle

Units in quiz answers not checked if numerical answer matches sample answer exactly

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.5.3
  • Fix Version/s: None
  • Component/s: Quiz
  • Labels:
    None
  • Environment:
    All
  • Affected Branches:
    MOODLE_15_STABLE

Description

The requirement to have units as part of an answer is a key part of engineering science. At present this option in moodle seems to address convertion from alternative unit systems into the one used by the teacher. If no units are entered then the answer is used as given and compared with the teachers calculation.

What should happen is that an answer without a units component should be classified as incorrect. In a perfect world feedback should be separated between numerical inaccuracy and incorrect use of units.

In the example below (Moodle XML format), where the answer is a vector (12.5 i m/s, you need a diagram which is not included to work it out), the complete answer is required for the solution to be correct. However if the student enters 12.5 then the marks are awarded as if the complete answer had been entered.

  • <!-- question: 11427

-->

  • <question type=numerical>
  • <name>

<text>Velocity of a Point (RFA1)</text>

</name>

  • <questiontext format=moodle_auto_format>

<text>Using the formula in block 5/2 on page 329, calculate the angular velocity of the point $$P$$ in the diagram below when $$\omega$$ is 25 radians per second. Remember to include both the direction (i for the x direction and j for the y direction) and the units in your answer. e.g. If the answer is 2 m/s in the y direction then your answer should have the form: 2 j m/s</text>

</questiontext>

<image></image>

<penalty>0.1</penalty>

<hidden>0</hidden>

  • <answer>

12.5

<tolerance>0.01</tolerance>

  • <feedback>

<text>The answer should be $$\omega \times r$$</text>

</feedback>

<fraction>1</fraction>

</answer>

  • <units>
  • <unit>

<multiplier>1.00000000000000000000</multiplier>

<unit_name>i m/s</unit_name>

</unit>

  • <unit>

<multiplier>1.00000000000000000000</multiplier>

<unit_name>im/s</unit_name>

</unit>

  • <unit>

<multiplier>1000.00000000000000000000</multiplier>

<unit_name>i mm/s</unit_name>

</unit>

  • <unit>

<multiplier>1000.00000000000000000000</multiplier>

<unit_name>imm/s</unit_name>

</unit>

</units>

</question>

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Gustav Delius (gwd2 at york.ac.uk) Wednesday, 8 March 2006, 10:59 PM:

Yes, I was also surprised that the units are optional. The code makes it clear that this was a design decision by whoever added units to numerical questions. It would seem more useful to me that if the teacher gives any units then units should be required. Has this been discussed on the forums already?

From Paulo Matos (paulo.matos at fct.unl.pt) Saturday, 18 March 2006, 01:35 AM:

I just hit this bug and I agree with Paul, if there are any units they should be checked.

Anyone has digged into the code to circumscribe the bug. If so, please point where, please!

I found a workaround for this, well kind of (the bug still there): Specify alterantive units for valid answers and do not display the answer.

Now an example:

Question:

A car uses {a} liters of fuel per 100 km. How many kilometers will it run with 1 liter.



Normally

--------

Correct answer Formula: 100/{a}

Units: km (optional)

Alternative Units:

Multiplier: 1000 Unit: m

Workaround

----------

Correct answer Formula: 10/{a}

Units: (10*km) (optional)

Alternative Units:

Multiplier: 10 Unit: km

Multiplier: 10000 Unit: m

Imagine that the correct answer would be 19.2 km.

If the student enter '19.2' or '19200' (without units) the answer would not be accepted, however if it enters the '1.92 (followed by anything)' the answer is considered correct (because it hits the bug, it's a matches with the exact numerical value of the given formula).

From Paul Young (paul.young at dcu.ie) Monday, 20 March 2006, 07:26 PM:

Guys,

Thanks for feedback so far. Paulo, I had considered that workaround, going a bit farther than and calculating the answer in a completely different set of units (e.g. , however I would rather the bug was fixed. Delius, how complicated is the code to modify? While I am familiar with several programming languages, I have no idea of how moodle is programmed, although I would be prepared to have a go at it. Which brings me to my real question. As I am new to this bug reporting system, how do I know that some action will be taken to change the software, and who is responsible for controlling any development?

thanks again for your interest so far.

Paul

From Gustav Delius (gwd2 at york.ac.uk) Monday, 20 March 2006, 07:55 PM:

Paulo, luckily the Moodle question types in Moodle 1.6 will be plugable, so if someone develops new question types or enhanced versions of existing ones then anyone can use them by just dropping the files into a subdirectory of the question/questiontypes/ directory. So while I am currently nominally in charge of development, and have no time to work on this, this should not keep you from pressing ahead and to share the results of your work on the forum.

From Gustav Delius (gwd2 at york.ac.uk) Monday, 20 March 2006, 07:57 PM:

I got a bit confused between the Pauls and Paulos: my last post was addressed to Paul's question about who controls development.

Generally discussion of new features is best done on the forums rather than in this bug tracker because that way more people could chip in with good suggestions or volunteer to do the coding.

From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 28 March 2006, 06:31 PM:

I dig into the problem and solved it. So, please test it and

provide some feedback if you have any trouble.

The problem here reported affects numerical questions and as

calculated questions are based on numerical, those inherit the

bug. However, calculated introduced another bug: duplicated

units while displaying correct answer. In the test process I hit

MDL-3225.

What I did:

(numerical)

1. added extra optional parameter to apply_unit(), so

units be checked on test_response(), but other calls won't be

affected.

2. fixed tiny fraction on get_tolerance_interval(), see

MDL-3225

(calculated)

1. added extra optional parameter to

quiz_qtype_calculated_calculate_answer(), so units won't be

attached on print_question_formulation_and_controls(), but

other calls won't be affected.

From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 28 March 2006, 06:32 PM:

The patch is mod_quiz-units_and_precision.patch, see attachments

section.

From Paulo Matos (paulo.matos at fct.unl.pt) Wednesday, 29 March 2006, 12:19 AM:

This one seems to be the same reported on MDL-4474!

Added dependency.

Show
Martin Dougiamas added a comment - From Gustav Delius (gwd2 at york.ac.uk) Wednesday, 8 March 2006, 10:59 PM: Yes, I was also surprised that the units are optional. The code makes it clear that this was a design decision by whoever added units to numerical questions. It would seem more useful to me that if the teacher gives any units then units should be required. Has this been discussed on the forums already? From Paulo Matos (paulo.matos at fct.unl.pt) Saturday, 18 March 2006, 01:35 AM: I just hit this bug and I agree with Paul, if there are any units they should be checked. Anyone has digged into the code to circumscribe the bug. If so, please point where, please! I found a workaround for this, well kind of (the bug still there): Specify alterantive units for valid answers and do not display the answer. Now an example: Question: A car uses {a} liters of fuel per 100 km. How many kilometers will it run with 1 liter. Normally -------- Correct answer Formula: 100/{a} Units: km (optional) Alternative Units: Multiplier: 1000 Unit: m Workaround ---------- Correct answer Formula: 10/{a} Units: (10*km) (optional) Alternative Units: Multiplier: 10 Unit: km Multiplier: 10000 Unit: m Imagine that the correct answer would be 19.2 km. If the student enter '19.2' or '19200' (without units) the answer would not be accepted, however if it enters the '1.92 (followed by anything)' the answer is considered correct (because it hits the bug, it's a matches with the exact numerical value of the given formula). From Paul Young (paul.young at dcu.ie) Monday, 20 March 2006, 07:26 PM: Guys, Thanks for feedback so far. Paulo, I had considered that workaround, going a bit farther than and calculating the answer in a completely different set of units (e.g. , however I would rather the bug was fixed. Delius, how complicated is the code to modify? While I am familiar with several programming languages, I have no idea of how moodle is programmed, although I would be prepared to have a go at it. Which brings me to my real question. As I am new to this bug reporting system, how do I know that some action will be taken to change the software, and who is responsible for controlling any development? thanks again for your interest so far. Paul From Gustav Delius (gwd2 at york.ac.uk) Monday, 20 March 2006, 07:55 PM: Paulo, luckily the Moodle question types in Moodle 1.6 will be plugable, so if someone develops new question types or enhanced versions of existing ones then anyone can use them by just dropping the files into a subdirectory of the question/questiontypes/ directory. So while I am currently nominally in charge of development, and have no time to work on this, this should not keep you from pressing ahead and to share the results of your work on the forum. From Gustav Delius (gwd2 at york.ac.uk) Monday, 20 March 2006, 07:57 PM: I got a bit confused between the Pauls and Paulos: my last post was addressed to Paul's question about who controls development. Generally discussion of new features is best done on the forums rather than in this bug tracker because that way more people could chip in with good suggestions or volunteer to do the coding. From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 28 March 2006, 06:31 PM: I dig into the problem and solved it. So, please test it and provide some feedback if you have any trouble. The problem here reported affects numerical questions and as calculated questions are based on numerical, those inherit the bug. However, calculated introduced another bug: duplicated units while displaying correct answer. In the test process I hit MDL-3225. What I did: (numerical) 1. added extra optional parameter to apply_unit(), so units be checked on test_response(), but other calls won't be affected. 2. fixed tiny fraction on get_tolerance_interval(), see MDL-3225 (calculated) 1. added extra optional parameter to quiz_qtype_calculated_calculate_answer(), so units won't be attached on print_question_formulation_and_controls(), but other calls won't be affected. From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 28 March 2006, 06:32 PM: The patch is mod_quiz-units_and_precision.patch, see attachments section. From Paulo Matos (paulo.matos at fct.unl.pt) Wednesday, 29 March 2006, 12:19 AM: This one seems to be the same reported on MDL-4474! Added dependency.
Hide
Paolo Oprandi added a comment -

This bug still exist in 1.6.5. Paulo's patch for MDL-4474 fixed it for us, although calculated questiontype has moved around a bit.

Show
Paolo Oprandi added a comment - This bug still exist in 1.6.5. Paulo's patch for MDL-4474 fixed it for us, although calculated questiontype has moved around a bit.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: