## Min and max limits are reversed in calculated questions with a negative answer and geometric tolerance

XMLWordPrintable
• Bug
• Resolution: Fixed
• Minor
• 2.9.4
• MOODLE_29_STABLE
• MOODLE_400_STABLE, MOODLE_401_STABLE
• MDL-53137-401
• MDL-53137-master
• Hide
1. Create a numerical question that produces a negative answer, and specify geometric tolerances, e.g. using the example in the issue description below.
2. Verify that the 'Answers tolerance parameters' section of the form doesn't report any errors.
3. Preview the question and use the 'Fill in the correct responses' button.
4. Use the 'Check' button and verify that the filled answers are indeed marked as correct.
Show
Create a numerical question that produces a negative answer, and specify geometric tolerances, e.g. using the example in the issue description below. Verify that the 'Answers tolerance parameters' section of the form doesn't report any errors. Preview the question and use the 'Fill in the correct responses' button. Use the 'Check' button and verify that the filled answers are indeed marked as correct.

In calculated questions using certain formulae (apparently only ones that produce a negative answer) and geometric tolerances, the minimum and maximum tolerance limits are reversed, and the correct answer is marked as incorrect.

To reproduce, use the following example.

Formula for answers 1 and 3:

 `-1*(({C1a}+{C2a})*({R1}+{R2})/1000000)*log(4.5)*1000`

Formula for answers 2 and 4:

 `(({C1a}+{C2a})*({R1}+{R2})/1000000)*log(4.5)*1000`

Tolerance for answers 1 and 2: 0.01 (geometric)
Tolerance for answers 3 and 4: 0.1 (geometric)
All answers displayed to 3 significant figures.

Wild card C1a: 2.4
Wild card C2a: 1.1
Wild card R1: 2.5
Wild card R2: 7.8

The 'Answers tolerance parameters' section of the form reports the following.

-1*((2.4+1.1)*(2.5+7.8)/1000000)*log(4.5)*1000 = -0.0542
ERROR Correct answer : -0.0542 outside limits of true value
Min: -0.053685138766123 — Max: -0.054764210055323

((2.4+1.1)*(2.5+7.8)/1000000)*log(4.5)*1000 = 0.0542
Correct answer : 0.0542 inside limits of true value
Min: 0.053685138766123 — Max: 0.054764210055323

-1*((2.4+1.1)*(2.5+7.8)/1000000)*log(4.5)*1000 = -0.0542
ERROR Correct answer : -0.0542 outside limits of true value
Min: -0.049292718321622 — Max: -0.059644189169164

((2.4+1.1)*(2.5+7.8)/1000000)*log(4.5)*1000 = 0.0542
Correct answer : 0.0542 inside limits of true value
Min: 0.049292718321622 — Max: 0.059644189169164

Clearly, for the two negative answers in this example the minimum and maximum limits are the wrong way around.

In the question preview, the 'Fill in correct responses' button enters the correct answer of -0.0542 (answer 1 is the one for which 100% is awarded), but then clicking the 'Check' button marks the answer wrong and gives the feedback "The correct answer is: -0.0542".

1. (I) Passed -- (400)MDL-53137.png
49 kB
Kim Jared Lucas
2. (I) Passed -- (401)MDL-53137.png
44 kB
Kim Jared Lucas
3. (I) Passed -- (Master)MDL-53137.png
43 kB
Kim Jared Lucas
4. MDL-53137_1.jpg
213 kB
Pierre Pichet
5. MDL-53137.png
66 kB
Tony Butler
Tony Butler
Tony Butler
Tim Hunt
Paul Holden
Kim Jared Lucas
0 Vote for this issue
Watchers:
8 Start watching this issue
Created:
Updated:
Resolved:
Estimated:
0m
Remaining:
0m
Logged:
1h 51m