Question grades are not recorded properly when "Build on attempts" feature is enabled

Question grades are not recorded properly when "Build on attempts" feature is enabled

by Basil Gohar -
Number of replies: 4
We're running 1.6.1+, and it seems like when we have the "Each attempt builds on the last" feature enabled for some quizzes, the proper answer for some of the quiz questions are not properly recorded.

The scenario is as follows.  A student will make a first attempt, and get, say, 11/20 answers correctly.  On the second attempt, the student will get all questions correct.  Yet, their grade is only recorded as 14/20.  Penalties and adaptive mode are not enabled.

I only discovered that the proper grades for the questions weren't being recorded when I went in as a teacher an manually overrode a particular question grade.  It was there that I saw some of the answers that were wrong on the 1st attempt, and right on the 2nd attempt, did not seem to be recording their scores.  When I overrode the question grade, I could see that for some of those questions (but not all?) did not have the proper grade assigned, even though the student answers correctly on the second attempt.

When I overrode the grade to be the full question value, then the grade was correct.

As I've exhausted most other avenues, and I found no bug open related to this issue - I'm reasonably sure this is a new bug.  If I'm mistaken, I would love to be corrected, otherwise I'll probably be opening a new bug.

Thank you in advance!
Average of ratings: -
In reply to Basil Gohar

Re: Question grades are not recorded properly when "Build on attempts" feature is enabled

by Basil Gohar -
After I disabled the "Each attempt builds on the last" feature, the problem went away.  However, old quiz questions still seem to have the wrong grade assigned to them, so even regrading does not seem to fix them.

I've opened a bug report, and it can be found here:

http://moodle.org/bugs/bug.php?op=show&bugid=6269

Sadly, I had to do a manual SQL query to fix the several hundred quiz instances that had this feature enabled.  I hope someone can look into this, or point out what I may be doing wrong.  Again, thank you in advance!
In reply to Basil Gohar

Re: Question grades are not recorded properly when "Build on attempts" feature is enabled

by Luis Oliveira -
I have had the same problem. However I regraded the quiz (before reading this post) and all the grades of the second attempt changed. The problem is that I am using random question selection and, after regrading, all the questions  of the second attempt changed despite having the build on last attempt on. I looked into the mdl_quiz_attempts table and the layout is the same for both attempts, but  when the student responses are displayed, the questions of the two attempts are not the same (but it worked ok before regrading). Any suggestions?

Thanks.

--Luis