Calculated Question: Correct Answer marked as Incorrect

Calculated Question: Correct Answer marked as Incorrect

by Dan Fenske -
Number of replies: 15
Greetings,

I have been using the Calculated Questions in the Quiz module in adaptive mode for a few months instead of assigning paper/pencil homework and all has been working well until lately.

I have had a few students input an answer which falls into the accepted range for that answer, but the server still marks the answer wrong. When I gave her the correct answer as given by the editing page, it was still marked wrong.

I have the correct answer set to two decimal places. When she enters the answer in more than 2 decimal places, she received a correct response.

My only lead is that the calculation is rather lengthy, but it yields the correct answers.

Any ideas on where to start?
Average of ratings: -
In reply to Dan Fenske

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
First give a real and complete example including the Moodle version you use.
But at first sight it could be a conflict between the 2 decimals correct answer setting and the tolerance limits.
If you correct answer is 1.015 +- 0.001 i.e correct values are between 1.014 and 1.015 and if you set two decimal places then 1.01 and 1.02 will get wrong.

Pierre


In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Dan Fenske -

Hello,

I have been very frustrated lately with certain calculated questions.  We are running Moodle v. 1.6.2 (we plan to upgrade this summer).

It seems that the problem is when I set the correct answer to 0 decimal places.  When students enter the correct answer tot he nearest whole number, Moodle sees it as incorrect, even though it is correct. (In the editing windows, Moodle lists the answer as correct.)  IN fact, in the results window, the student's response matches the correct answer given by Moodle.

I tried setting the correct answer to 2 decimal places, and it seems to work.

The quiz is in adaptive mode with penalites applied.  The tolerance is set to 0.01 and the tolerance type is set to Relative.

If there is any advice for me, I would be grateful.  (Is more information needed?)

In reply to Dan Fenske

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
Use the preview to test one of the questions that is not working correctly.
Notice your paramters value and the response.
The edit the question and look at third page that shows the values and the error limits.
Locate your dataset item and compare.
Give us the data.
Some of the tolerance and limits and significants figure can be mutually exclusive.

Pierre

P.S. The calculated question code has been merged from head to 1.6. The only differences are in the editing interface that has been changed in 1.8 and 1.9.

In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Dan Fenske -
Here is the question that I asked:

A sound's sound level is increased from {d1} dB to {d2} dB. How many times louder would you perceive the new sound?

And the formula to calculate the answer is:

pow(2,(({d2}-{d1})/10)) which calculates the answer correctly. I set the tolerance level to .01 and the tolerance type to "Relative." I set the answer to be 0 decimal places, in other words, to the nearest whole number.

In the second page of the editing screen, each variable is set to "a literal from the same question as before".

In the third screen, I have each {d2} set to between 40 and 75 with 1 decimal place and {d1} set to between 10 and 25 with 1 decimal place.

When I preview the question, I enter the correct answer (according to the dataset) to the nearest whole number. The answer matches the answer given in the dataset. Moodle tells me that the answer is incorrect. When I click "Fill with correct" the exact same answer is filled in! Yet, when I type it in, Moodle doesn't like it.

When I enter the answer with decimal places, Moodle marks it correct (it is within the range of acceptable answers).

When I set the question for 1 decimal place instead of two, the question works as designed.

I am really at a loss to explain this. it is frustrating for me and my students when they have the correct answer, but Moodle marks it wrong.

If you have any advice, I would be grateful!
In reply to Dan Fenske

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
The problem is a conflict between the interger value (0 decimal place) and the 0.01 relative i.e 1%
in one case the calculated answer was 21 with a range of 20.79 to 21.21
This work correctly on a moodle 1.6.3 version.
This work also for 1.9 the limits are always calculated after the response at the integer level is set.
However UQAM 1.6.3 has a special merge for calculated questions.
I will look at the history and come back

Pierre
In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
You can test yourself on
http://132.208.141.198/moodle_16/
log as user: moodle pw: moodle
and look (and play ) at the question test db

Pierre
In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Dan Fenske -

Hello Pierre,

You have successfully duplicated my issue.  The symptoms that I descibed to you happened on your test question.

When the question was set to have 0 decimal places in the response, the server marked my (correct) answer as incorrect.  When I selected "fill with correct" it filled in the same whole number that I had typed in.  Confusing!

When I set the response to 1 decimal place, things worked well.

I guess that the workaround is to set my responses to include decimal places.  This summer we are installing a new server and will install version 1.9.

I sincerely thank you for your time.  I am recommending Moodle to every teacher I talk to, even those that do not teach online.  It's a great companion to a face-to face course.

In reply to Dan Fenske

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
Effectively it is corrected in 1.9
http://132.208.141.198/moodle_19/
user:moodle pw:moodle

I will look more closely to see if there remain some bad combinations of number of decimals and tolerance.
The problem is that the 0 decimal answer is 8 when the correct mathematrical answer is 7.7 which is outside the tolerance range.
This is also confusing for the students as some will answer 7 and other 8 if you ask for the rounding value. You should always allow a number of decimals (or significant figures) that match the tolerance limits.

Pierre
P.S. Better examples in the docs will help (MDL-7679)

In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
the following comment was added to MDL-6879
Will add some further validation procedure when buiding datasetitems (datasetitems_form.php) so that problems with significant figures and tolerance values are pinpointed and corrected.
Pierre

In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators
Hi Piere, found a similar problem that a correct answer is graded as incorrect http://tracker.moodle.org/browse/MDL-14433

Attachment calculated.png
In reply to Ralf Hilgenstock

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
Hi Ralf,
More probably the settings of tolerance interval and significant figure are in conflict. Your correct mathematical result 139.03 is outside the other constraint.
Could you give us all the parameters that you set for this answer.

Pierre



In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators
Hi Pierre,

This are the parameters:

Formula (({a}*{b})-({a}*{b}*{c}/100))+(({a}*{b})-({a}*{b}*{c}/100))*0.19
Tolerance 0 or 0.00
Tolerance Type Nominal
Correct Answer shows 2

decimal places for {a} and {c}: 0
decimal places for {b}: 2

After setting tolerance to 0.01 I got correct results and grades. Can you explain this?


Ralf




In reply to Ralf Hilgenstock

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
Yes because with tolerance 0 your answer should be exactly expressed by the 2 decimal place.
For example 1/3 = 0,3333 so will be Ok if decimal are set to 3 and tolerance to 0.0004 nominal.
0,333 will be inside the 0,3329333 to 0,333733333 limit.
I am working to put an additional line to tell if the True value is inside or outside(warning) the limits.
See MDL-14433

Pierre
In reply to Pierre Pichet

Re: Calculated Question: Correct Answer marked as Incorrect

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators
Ah, that makes it clearer. My understanding of tolerance was that an answer between the upper und the lower borders are accepted as correct.


Can you add also a little help file to the settings for tolerance?
In reply to Ralf Hilgenstock

Re: Calculated Question: Correct Answer marked as Incorrect

by Pierre Pichet -
Can you add also a little help file to the settings for tolerance?
This is part of the planwink
see higher in this discussion
P.S. Better examples in the docs will help (MDL-7679)

Pierre