## Calculated Question - Negative Answer with Units

XMLWordPrintable
• Bug
• Resolution: Fixed
• Minor
• 4.0.4, 4.1.2, 4.2 regressions, 4.2.6, 4.3.3, 4.4
• MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
• MOODLE_402_STABLE, MOODLE_403_STABLE
• MDL-76024-MOODLE_402_STABLE
• MDL-76024-MOODLE_403_STABLE
• MDL-76024-main
• Hide

1. Create a calculated question like: "{a}*{b}"
2. Give 100% for answer formula "{a}*{b}"
3. Give 50% for answer formula "-{a}*{b}" – note the negative sign
4. Set unit handling to "Units are optional..."
5. Add a unit (e.g. "cm")
6. On the next page "Choose wildcards dataset properties" just click "Next page" button.
7. Confirm on the next page "Edit the wildcards datasets" in "Answers tolerance parameters" the positive answer is evaluated correctly
8. Confirm that the negative answer is no longer displaying an "ERROR" message and the answers are correct.
Show
Create a calculated question like: "{a}*{b}" Give 100% for answer formula "{a}*{b}" Give 50% for answer formula "-{a}*{b}" – note the negative sign Set unit handling to "Units are optional..." Add a unit (e.g. "cm") On the next page "Choose wildcards dataset properties" just click "Next page" button. Confirm  on the next page "Edit the wildcards datasets" in "Answers tolerance parameters" the positive answer is evaluated correctly Confirm  that the negative answer is no longer displaying an "ERROR" message and the answers are correct.

Negative answers to calculated questions with units are evaluated wrong.

To duplicate:
Create a calculated question like: "{a}*{b}"
Give 100% for answer formula "{a}*{b}"
Give 50% for answer formula "-{a}*{b}" – note the negative sign
On the next page "Choose wildcards dataset properties" select Next button.
On the next page "Edit the wildcards datasets" in "Answers tolerance parameters" the positive problen is evaluated correctly, the negative problem is not, saying "ERROR: Correct answers etc." is outside limits, though it is not.

Screenshots in this discussion: https://moodle.org/mod/forum/discuss.php?d=439168

1. BC-76024.png
70 kB
2. image-2023-04-04-12-16-47-159.png
7 kB
3. image-2023-04-04-12-17-20-595.png
17 kB
4. MDL-76024.png
136 kB
5. thumbnail_image001.jpg
6 kB
6. thumbnail_image009.jpg
7 kB
Matthias Opitz
Rick Beasley
dragos5436
Tim Hunt
Ron Carl Alfon Yu
5 Vote for this issue
Watchers:
27 Start watching this issue
Created:
Updated:
Resolved:
Estimated:
0m
Remaining:
0m
Logged:
2h 3m