Calculated qtype comment on datasetitems should follow formatting rules

XMLWordPrintable

Details

• Type: Bug
• Status: Closed
• Priority: Minor
• Resolution: Fixed
• Affects Version/s: 2.6.5, 2.7.2, 2.8
• Fix Version/s:
• Component/s:
• Labels:
• Testing Instructions:
Hide
• Go to any question bank
• Create a new 'Calculated' question
• Set the following fields:
question name: mdl47224
question text: mdl47224
answer 1 formula = ( {x}*0.001)*{y}
* click save changes
* click next page
* Set the following fields:
wild card {x}

: 0.240
range min: 0.15
range max: 0.45
decimal places: 3
distribution: uniform

wild card

{y}

: 84.2
range min: 20
range max: 100
decimal places: 1
distribution: uniform

tolerance: 0
format: significant figures

• click update the answers tolerance parameters

Expected: In the answers tolerance parameters section, beneath the correct answer (0.0202), it should say "Min: 0.0202 — Max: 0.0202"

Actual: Currently it shows ERROR correct answer out of range, with a range of: "Min: 0.020208 — Max: 0.020208"

Which is wrong as the correct answer is only to 3 significant figures, not 5.

Show
Go to any question bank Create a new 'Calculated' question Set the following fields: question name: mdl47224 question text: mdl47224 answer 1 formula = ( {x}*0.001)*{y} grade: 100% answer display: 3 significant figures * click save changes * click next page * Set the following fields: wild card {x} : 0.240 range min: 0.15 range max: 0.45 decimal places: 3 distribution: uniform wild card {y} : 84.2 range min: 20 range max: 100 decimal places: 1 distribution: uniform tolerance: 0 correct answer shows: 3 format: significant figures click update the answers tolerance parameters Expected: In the answers tolerance parameters section, beneath the correct answer (0.0202), it should say "Min: 0.0202 — Max: 0.0202" Actual: Currently it shows ERROR correct answer out of range, with a range of: "Min: 0.020208 — Max: 0.020208" Which is wrong as the correct answer is only to 3 significant figures, not 5.
• Affected Branches:
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
• Fixed Branches:
MOODLE_26_STABLE, MOODLE_27_STABLE
• Pull from Repository:
• Pull Master Branch:
• Pull Master Diff URL:

Description

So thanks to MDL-31680 - calculated question types now correctly display the correct number of significant figures for wildcards.

One more place that seems to need to obey the length/format rules is the min and max values shown in the "Answers tolerance parameters" section.

Example:
(

{x}

0.001)

{y}

with x=0.240 and y = 84.2 and 3 signficant figures

(0.240*0.001)*84.2 = 0.0202
For a tolerance of 0, the min/max would both be 0.202. Instead we currently get: 0.020208. Which shows up as an error, because the min/max isn't having the length/format rules applied to it.

Attachments

19 kB
2. MDL-47224.jpg
94 kB
3. mdl47224fix.png
21 kB

People

Assignee:
Reporter:
Peer reviewer:
Tim Hunt
Integrator:
Eloy Lafuente (stronk7)
Tester:
Participants:
Component watchers:
Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze