Calculated Qn - Decimal Places - Bug?

Calculated Qn - Decimal Places - Bug?

autor Andrew G -
Počet odpovedí: 15

[Moodle 2.2]

Dear Forum,

I'm creating calculated questions and only want students to submit responses to 2 decimal places - so have selected the '2 decimal places' option.  However, the qn type accepts >2 decimal places!  Is this a bug? 

Regards,

A

Priemer hodnotení : -
V odpovedi na Andrew G

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -
Hi Andrew
This is not a bug but an "historical" feature.
The main objective of the calculated question grading is to check if the student response is inside the tolerance limits set for a given answer (using the unit value) . The decimal places settings are used to display the response correctly.
Adding fomat grading either significant figures or correct decimal point ( . or ,) will complexify an already complex question editing interface.
Pierre
V odpovedi na Andrew G

Re: Calculated Qn - Decimal Places - Bug?

autor Tim Hunt -
Obrázok: Core developers Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Peer reviewers Obrázok: Plugin developers

You might also want to look at the 'varnumeric' question type in the plugins database. That can grade the number of significant figures.

V odpovedi na Tim Hunt

Re: Calculated Qn - Decimal Places - Bug?

autor Andrew G -

Dear Pierre/Tim,

thanks for your responses.  However, I'm still puzzled.

I'm happy with the grading of the questions as these work fine within the tolerances set.  However the student display of the correct answers do not conform to the question settings. The questions are set to: 'correct answer shows 2' (see pic below).

This doesn't seem to have any effect on the way the correct answers are displayed, where the example below shows 12 decimal places. The question will mark the answers to 2 decimal places but the feedback shows 12 places.

Part of the assessment is to ensure students can round their answers and so provide precise data within given parameters (ie. correct to n decimal places). The way it currently functions could potentially be confusing for students as we are asking them to provide answers to 2 decimal places but the feedback provides answers to more than 2.

 Thanks.

V odpovedi na Andrew G

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -
This appears to be a bug.
Could you specify with Moodle version you are using ?
Pierre
V odpovedi na Pierre Pichet

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -

This is a bug as I checked on Moodle Demo site.

Will create a new bug if necessary.

Pierre

V odpovedi na Andrew G

Re: Calculated Qn - Decimal Places - Bug?

autor James Roberts -

I have to agree that this is an irritating (but non-fatal) bug.  I am using an algorithm that estimates the normal distribution accurately to about 3 decimal places.  Unfortunately, students will see a "correct answer" to 16 decimal places that is not correct.  It would be nice if I could truncate the reported answer.

V odpovedi na James Roberts

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -

Use the  round(your equation,3) function that will round the result to 3 decimals and set the format to 3 decimals.

This should work.

Pierre

V odpovedi na Pierre Pichet

Re: Calculated Qn - Decimal Places - Bug?

autor James Roberts -

Thanks Pierre, that worked!

The only downside is that my formula is now even longer and more complex . I wish that the text box (for the answer to calculated questions) had a greater width so that I could see more of the formula.

V odpovedi na James Roberts

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -

Me too,  Mrnutie this is MDL-31056 also on the drawing board.

Some other bugs need to be resolve before because if I allow longer equation the rendering of dataitems needs to be modified which leads me to find problems in handling the numerical values (MDL-31680) and ...

Pierre

 

V odpovedi na Pierre Pichet

Re: Calculated Qn - Decimal Places - Bug?

autor James Roberts -

Pierre (or anyone else), any solution/workaround to the following problem would be appreciated.

While the round({x},decimal places) function establishes a maximum number of decimal places, it doesn't establish a minimum number.  So, for example, round(2.3, 2) will return 2.3 and not 2.30.  I use calculated questions in Moodle for financial problems and I would like to have dollars and cents sometimes.  $2.3 looks strange to students although it is mathematically identical to $2.30.

V odpovedi na James Roberts

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -

Hi James,

The case of rounding does not work when the last decimal is 0, the rounding function eliminates the 0.

However if ypou add a smaller decimal than your rounding you will have the display you want.

i.e. round(8.8+0.00000001, 2) = 8.80

If your number is small, the probability that it could result to a 0 becomes very small .(in this example something smaller than 1 in 1000000.

Pierre

 

V odpovedi na Pierre Pichet

Re: Calculated Qn - Decimal Places - Bug?

autor James Roberts -

Pierre,

I tried your suggested work around.  (IOW, I tried adding a small decimal - eg. 0.0002 to a number and then rounding to two decimal places).  It doesn't work.

In simple terms, students see 8.3 as the correct answer to a question that should appear as $8.30.  (Money is already a confusing concept ... )

V odpovedi na James Roberts

Re: Calculated Qn - Decimal Places - Bug?

autor Pierre Pichet -

Hi James,

A more laborious solution is to display all the datasets and change the values so that the response does not contain 0 as final digits i.e. 8.00 or 8.30.

Pierre

V odpovedi na Pierre Pichet

Re: Calculated Qn - Decimal Places - Bug?

autor James Roberts -

Pierre,

I realize that this is an old thread but since I stumbled upon it, and I have often learned alot about Moodle from old threads, I thought that I would add a few points.

First, I now do as you suggest above: I now check the values of wild cards that represent prices to ensure that they don't finish in 0. For example, I edit any number such as 8.30 and change it to 8.35 or change 10.70 to 10.75 etc. (BTW, it's not that laborious for anyone who does accounting.... but alot of my prices finish with a nickel or with a 5!)

Second, it took me time to understand that I can change/edit the value of a "wild card" after Moodle has first inserted a specific value. ("Preset" might be a better term/definition rather than "wild card" - since the values are not really random but can be edited later.)  That is to say: I now recommend to colleagues to add only one value to a wild card on first creating a calculated question, and then add more values later.

Anyway, thanks for your various posts Pierre.