Quiz Question Results and 'Back' Button

Quiz Question Results and 'Back' Button

by Mike Churchward -
Number of replies: 6
Picture of Core developers Picture of Plugin developers Picture of Testers
I have some users who I believe screwed up their results by incorrectly using the back button. The results show that they had the right answer, but then somehow there ended up being no answer selected (see image).

My question is, is there anyway now to regrade the quiz such that the correct answer will be counted?

mike
Attachment quiz.jpg
Average of ratings: -
In reply to Mike Churchward

Re: Quiz Question Results and 'Back' Button

by N Hansen -
You know, I've been having something like this happen frequently lately. I'm running 1.5 with the essay question. What is happening is that when I grade some questions, the state that is being recorded in the newest state table is not actually the newest state, so even though the grade and my comments are getting saved, the grade and my comments aren't showing up, nor are the grades being added into the total. I found that I have to go into newest states table in the database and manually change the id of the state so it matches up correctly, and then run regrade. The questions it affects seem to be random so I haven't been able yet to figure out why it is happening. I wonder if it is something similar happening in your case. I would go into the newest states table and check to see if the particular instance of the question for that student is correct.
In reply to N Hansen

Re: Quiz Question Results and 'Back' Button

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
I've had that problem too. With that one, I believe the problem is that 'newgraded' field in the quiz_newest_states table is not correct. I've noticed that the essay questions that don't show up in the count all have the 'newest' field set to state id that contains the grade, but that their 'newgraded' field is zero.

I wrote a script that runs through the database and sets the 'newgraded' field to the 'newest' field value for all quiz_newest_states entries that have newgraded set to zero, where the corresponding 'stateid' field in quiz_essay_states has the 'graded' field set to 1. I'm not 100% sure that it is the right thing to do, but when I regrade the quiz everything seems to be okay.

Still haven't figured out what to do about the other issue though.

mike
In reply to Mike Churchward

Re: Quiz Question Results and 'Back' Button

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
N. Hansen asked me to post the script I mentioned, so here it is. This is an unsupported, "use at own risk" script. It updates the database tables directly, specifically the quiz_newest_states table. It fixes essay questions that have been graded but don't appear in the grade count. It runs from the Moodle root. After running, any affected quiz will need to be 'regraded'.

mike
In reply to Mike Churchward

Re: Quiz Question Results and 'Back' Button

by N Hansen -
Thanks Mike! I've posted more about this as bug 5726. If anyone can help identify the cause (I think I've worked out the effect mostly) it would be helpful. I'm suspicious of database corruption but I am waiting for another student to submit a quiz to see what happens since I fixed my database.
In reply to N Hansen

Re: Quiz Question Results and 'Back' Button

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Nicole -

I followed your trail through the bug tracker. Quite a lot of sleuthing there! I don't think that its related to corruption though. Have you seen it since then?

mike
In reply to Mike Churchward

Re: Quiz Question Results and 'Back' Button

by Gustav W Delius -
Mike, it is unfortunately always the last saved answer that will be used for grading. So the only thing you could do is go straight to your database and remove the states with the unwanted saved answers from the question_states table.