Quiz broke- is there a way to fix this?

Quiz broke- is there a way to fix this?

by Wendy Harper -
Number of replies: 7
I suspect that a student put a zero as an answer that was in a formulas question for the denominator resulting in a division by zero criteria checking.   I can not confirm this because I am unable to see the results of this quiz.    Temporarily,  I was able to make a new quiz, but, I need to access the grades from the original quiz.   I would appreciate any help in getting passed this error.   I would like to save the other students grades.
Average of ratings: -
In reply to Wendy Harper

Re: Quiz broke- is there a way to fix this?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think your analysis of what is going on is probably right.

If you need a work-around, and you have direct access to the database, you could try fixing the data. Proceed at your own risk! You would need to start with something like

SELECT * FROM mdl_question_attempt_steps WHERE state = ''

(Or possible IS NULL, instead of = ''). If that finds data which seem to be related to this quiz attempt, then you could try changing the empty state value to 'gradedwrong' or something valid. That might recover the situation.

It is probably also the case that should handle this bad data better, or not let it be created in the first place. I created MDL-80127.

Average of ratings: Useful (3)
In reply to Tim Hunt

Re: Quiz broke- is there a way to fix this?

by Wendy Harper -
Thank you Tim,   
I was able to recover the quiz for the other students.   This student's quiz was deleted.   
It is a formulas programming issue....   The student typed 0 for the input box that was for the denominator.  
in the grading criteria I had it checking
_0/_1 == num/den

For this question I changed it to _0 == num   && _1 == den
however, this will not work for other questions as I was giving partial credit for answers that were not reduced.
I will post in the forum for solutions to this programming issue.

I appreciate your attention to this issue, I imagine others may run into something similar.
Thank you for your help,
Wendy
Average of ratings: Useful (2)
In reply to Wendy Harper

Re: Quiz broke- is there a way to fix this?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Now that you have found this issue, I would not be surprised if the formulas maintaners fix it. They are quite good like that. I will make sure they see this.
Average of ratings: Useful (1)
In reply to Wendy Harper

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Wendy Harper

Re: Quiz broke- is there a way to fix this?

by Matthias Giger -
Picture of Particularly helpful Moodlers
Don't know whether this will work, but you can try.

Change the grading criteria of the offending question and then regrade the quiz for all students.
For regrading you might need to use the url from another quiz and then replace the id in this url.
In reply to Matthias Giger

Re: Quiz broke- is there a way to fix this?

by Wendy Harper -
How would I have the quiz grade the offending question based on the new question since it uses the question as programmed when the student begins the quiz attempt?
In reply to Wendy Harper

Re: Quiz broke- is there a way to fix this?

by Matthias Giger -
Picture of Particularly helpful Moodlers
I don't know whether I quite understand your question, but that is how it could work:

Edit the offending grading criteria from n/d == _0/_1 to n*_1 == d*_0 so that there won't be an error in case a student enters a 0.

Once you have updated the question, then you regrade the attempts in quiz.

This should work as long as the question itself is set to use "always the latest" because even for attempts in progress a regrade forces the newest version to be used.

Does this answer the question?
Anyway, I've seen that you could solve the problem following an alternative approach.