Problem in submitting quiz

Problem in submitting quiz

by Carl Kennard -
Number of replies: 3
We're still having all sorts of problems with this. Out of 16 students we tested today 4 worked. Does anyone know if this is a widespread problem? We're on the verge of dumping the quiz module for assessment altogether as it seems totally unreliable - can anyone help as we'd prefer it if we didn't have to?
Average of ratings: -
In reply to Carl Kennard

Re: Tárgy: Re: Problem in submitting quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It goes on being baffling. The quiz works for most of the people most of the time. And there is not yet a diagnosis of what exactly is different about your system that causes this problem.

(Note that Carl field MDL-15305 about this issue - just so this issue is linked to from here.)

Just out of interest, what authentication system are you using. And how is your quiz set out, are all the questions on one page?

None of the error messages you report in the bug are every generated by Moodle. Can I assume you reported them from memory / other people's reports, rather than copying them and pasting them exactly. The exact error message would help me in tracking down exactly where the errors are happening.
In reply to Tim Hunt

Re: Tárgy: Re: Problem in submitting quiz

by Carl Kennard -

We use a complicated Novell single-sign-in type of authentication that uses LDAP and iChain to create users' profiles and put them in the correct network groups. We've had suspicions the problem was due to the quiz taking too long to complete (some take students over 45 minutes) and the student system accounts timing out because of inactivity but we've done about 2 weeks of testing and although it does seem to go wrong more frequently the longer the quiz, out of 8 trial students at least half of the group worked when left it for this amount of time (and longer) before pressing the submit button.

The questions have been set up so they are all on one page when the student opens the quiz. We thought the problem could be because of the volume of questions instead. Some quizzes had around 70 questions. We tested the quiz, gradually increasing the number of questions and found problems began to consistently occur after reaching the 30 mark but again out of the group tested, not all failed.

The next possibility we tried was if students didn't answer all of the questions but this made no perceivable difference to the success rate.

That is the exact error message type - during the testing period I've seen it repeatedly with my own eyes, its not anecdotal. It does vary sometimes - sometimes it says "no quiz with id = 0", sometimes "no attempt with id = 0", sometimes with "no questions found in this quiz". Always in a pink box.

There is a slight variation on the problem where the user gets a page telling their quiz has been submitted. Usually there's a continue link on the page but sometimes this page seems to get stuck and the page doesn't have the link. If you go back the quiz asks you to continue your previous attempt. If you do so, sometimes you answers are still there and you can re-submit, sometimes they are not.

We also thought it could be due to Moodle being unable to deal with students all submitting the quiz at simultaneously but we've tried submitting 4 attempts at exactly the same time and it made no difference. We've also tried to see if its due to the amount of students taking the quiz varying the number from 4 -16 but again this made no consistent difference.

Our main problem is when we test the problem it doesn't always fail so we can't pin down the exact conditions that cause it to occur.

In reply to Carl Kennard

Re: Tárgy: Re: Problem in submitting quiz

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 split these posts out to be a separate thread, since the levels of indent in the original thread was getting a bit extreme. This thread used to appear in reply to http://moodle.org/mod/forum/discuss.php?d=82022#p424667))

I think the problem here is likely to be related to the single sign-on (SSO). I had to fix a related problem with the OU SSO. The result was this change, that went in to Moodle 1.9: cvs:moodle/mod/quiz/attempt.php?r1=1.119&r2=1.120. I am afraid that there is not a corresponding tracker issue.

What I was seeing (when I looked at our Apache logs was the following sequence of requests, fortunately our Apache logs contain usernames and cookies, so I could see what was happening):
  • POST to .../mod/quiz/attempt.php which resulted in a redirect to our SSO URL. The referrer was .../mod/quiz/attempt.php?id=123
  • GET of .../mod/quiz/attempt.php, with referrer being the SSO URL. At this point, the OU SSO cookie had changed, but the Moodle session cookie was the same.
The trouble is that the redirect to the SSO address, and back again, which replaced the original POST request with a GET request, effectively threw away all the submitted data, including the id of the quiz you are currently looking at. The change I made to the code at least puts the quiz id and page number in the URL, so at least you go back to where you were, instead of seeing a pink error.

Unfortunately there is no way to recover the lost data. Basically, it is very dangerous to put many questions on one page, it means that students can do a lot of work between saving. Fortunately, almost all OU quizzes are one or two questions per page.

At the same time as I made these code chagnes, we also increased our session time-outs.

Anway, it would be good if you are able to check your server logs, to see if something like this is happening to you.

That would explain the "No quiz "There is no quiz with id 0" Error messages. (Note, no = sign there.) The other error messages could not be caused by this problem. The "No questions found" (again, that is the error message in the code, and it is different from what you remember) is particularly odd. That can only happen if you get a valid questionid as the result of several database queries, and then the next database query returns no data. That would suggest that the database server is overloaded, and failing to respond to some queries. Are there any database log files you can look at?