Quiz broke- is there a way to fix this?

Quiz broke- is there a way to fix this?

Wendy Harper -
回帖数: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.
回复Wendy Harper

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.

回复Tim Hunt

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

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
回复Wendy Harper

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Wendy Harper

本讨论区帖子已移除

本讨论区帖子的内容已移除,无法再访问。
回复Wendy Harper

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

Matthias Giger -
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.
回复Matthias Giger

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

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?
回复Wendy Harper

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

Matthias Giger -
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.