Using "Description" items in quiz causes grade calculation errors in 2.1.1+

Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Rick Jerz -
Number of replies: 11
Picture of Particularly helpful Moodlers Picture of Testers

I came across a strange error with quizzes.  I use a number of "Description" items to separate groups of questions.  Moodle 2.1.1+ wants to count some of these as real questions.  Of course, the student cannot get these correct, so the grade calculation is wrong.  I think this has something to do with groupings of "Description" items.  In the quiz.  Notice in this graphic that I have 5 groups of "i's".  Moodle thinks this quiz is worth 32 points, but it really only has 27 questions.  The best that a student can score is 27/32.

I made a tracker item for this.  (see MDL-29270)

Average of ratings: -
In reply to Rick Jerz

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Rick,

I cannot replicate your problem. In bug report MDL-29270 I see you are using random questions. Could you confirm that you still get that problem if you use "normal" questions only in your quiz?

And do you have Cloze/multianswer questions in your quiz as well?

Joseph

In reply to Joseph Rézeau

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I don't think it has to do with random questions.  And I am not using Cloze either.  I am making this video below to show you the problem.

http://www.rjerz.com/v/misc/Grade_Total_Wrong/Grade_Total_Wrong.html

In reply to Rick Jerz

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Rick, and thank you for providing the video.

It seems that the problem arises when you add the 4th "Description Question" to your Quiz. After you've added it, your Quiz grades show 1, which obviously should not happen since it only contains Description question at that stage.

Now it would be interesting to find out more about that famous Description question #4 (Graphing and Interpretation).

  • You say it might come from moodle 1.9. Can you check that?
  • What are the contents of that Question (name and text)? Does it contain any special objects : image, video, audio, etc... besides pure text?

Joseph

In reply to Rick Jerz

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Jean-Michel Védrine -

Hello Rick,

If you have access to your database, can you look at your mdl_question table (for instance using phpmyadmin) and see if you found any record with qtype = 'description' and defaulmark != 0.0000000

In reply to Jean-Michel Védrine

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Jean-Michel Védrine -

Hello Rick,

I would also be interested to know if you can do a little experiment :

find a "problematic" description question (one that when added to a quiz increase the total mark by 1)

open it for editing

change nothing

save

See if it correct the problem for that description question

In reply to Jean-Michel Védrine

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I added some more information on my tracker I am, MDL-29270.


Then your comments in this forum made me think a little bit more. I discovered an interesting detail. On some of these description items that were initially imported a month and a half ago, when I preview them they show that they are worth one point (see first graphic).  On any newly created description of item when I preview them they are worth zero points (see second graphic).  So whenever I use one of these old Description questions that have an internal one set, sure enough, the quiz score is incremented.

I am puzzled by this preview mode because nowhere, when I create the question, is there any input box for establishing these values. Where did they come from?

In reply to Rick Jerz

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Jean-Michel Védrine -

Hello Rick,

I am now nearly sure that description questions that have this problem have their default mark set to 1.0000000 in the mdl_question table.

It is not suprising that you can't reproduce the problem because this should not happend : the interface in the editing question screen has no place to set a default mark when you are editing a description question and it is set to 0 by a hidden field in the form.

So the question is how some of your description questiuons ended having 1 as default mark ? Most probably something went wrong during the export/import from 1.9 to 2.1. It would be interesting to know what you have used for this export from 1.9 -> import in 2.1 operation ? Moodle XML ? Another format ? backup / Restore ?

If you want to correct the problem this should be quite easy to do with just a sql query in phpMyAdmin, something like :

UPDATE `mdl_question` SET `defaultmark` = '0.0000000' WHERE `qtype` ='description'

But as i said, I also think that opening one of this questions for editing and saving without any change will reset the defaultmark field to 0 and solve the problem for that question.

In reply to Jean-Michel Védrine

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Jean-Michel Védrine -

Well, I made a short test and I can reproduce your problem : it's a problem in importing 1.9 backups in Moodle 2.1 : all description questions have their defaultmark set to 1. You have found a bug.

I will update the tracker issue accordingly

Average of ratings: Useful (2)
In reply to Jean-Michel Védrine

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Great detective job, Jean-Michel.cool

In reply to Joseph Rézeau

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Jean-Michel Védrine -

Thanks,

I suppose nobody will be surprised if I say that I love Hercule Poirot's (And Miss Marple too !) books and films big grin

I made further tests and description doesn't seems to be the only question type affected by this problem.

I didn't test all questions types but for the ones I tested, all questions' defaultmark were reset to 1 when restoring a 1.9 backup in Moodle 2.1.

I think this is related to the name change of this field : in Moodle 1.9 it was called defaultgrade and is now defaultmark in Moodle 2.1, but until now it's only a feeling : I never looked at this part of the code (only at the part I needed to restore fields specifics to my question types).

In reply to Jean-Michel Védrine

Re: Using "Description" items in quiz causes grade calculation errors in 2.1.1+

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Thanks everyone.  I did see the Tracker item updated with great notes.

I am always glad with I discover a problem that can be fixed.