Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When user logs out before completing quiz, if they come back and click "start" they get two messages:
You are resuming a quiz
You have run out of time
I do not have timed quizes and I allow 1 take, and allow resume. But logging out eats up the user's one time. A session ending should not end the quiz. This also does not show any results of the few questions they did answer.
Comment | File | Size | Author |
---|---|---|---|
#13 | quiz-allow_resume-1792932-13.patch | 654 bytes | perelman.yuval |
Comments
Comment #1
IWasBornToWin CreditAttribution: IWasBornToWin commentedAny suggestions?
Comment #2
acrazyanimal CreditAttribution: acrazyanimal commentedI have a similar problem that when the user logs out and then comes back to resume the quiz the quiz gets automatically submitted for them and they don't have the chance to finish.
Comment #3
IWasBornToWin CreditAttribution: IWasBornToWin commentedAny way to solve this?
Comment #4
mpearrow CreditAttribution: mpearrow commentedSame problem in Quiz 7.x-4.x-alpha9. In my case I have an external auth system (Shibboleth) that times out a user's session if their IP address changes or they are inactive for a time. When they return, their in-progress sessions have automatically skipped ahead.
I've been looking into this since it is a fairly significant usability issue. We've band-aided the issue by allowing unlimited takes, but this is a kludge. If I come up with anything I'll post here.
Comment #5
mpearrow CreditAttribution: mpearrow commentedOk, here's what I have tried so far, and this seems to be working for me. What appears to be nuking the user's in-progress sessions is an if clause around line 2026 of quiz.module:
i
If I comment out all the lines except for the quiz_jump_to line, things work as I'd expect - A user can work on the quiz, log out, log back in, and pick back up where he/she left off. I'm pretty sure that commenting out those lines is also going to screw things up if you actually care about timed quizzes (I don't)
I wouldn't recommend this as an actual fix so I am not supplying a patch - however, this does I think help isolate where the "bug" is happening.
Comment #6
falcon CreditAttribution: falcon commentedComment #7
IWasBornToWin CreditAttribution: IWasBornToWin commentedI just took your suggestion in #5 and commented out the lines. I started a 10 question quiz, answered 3 questions, logged out and back in. Went to quiz, it had a "start" button (which should say "resume" in my opinion) so i clicked on start, it took me to questions 4 out or 10. There was also a message letting me know I was resuming a quiz already in progress. So far so good, but...
There was a message at the bottom by the 4th question which told me this was the last question. I answered the 4th question and the quiz graded me. It didn't allow me to finish. It also didn't get my last answer. It only gave me a 3 out of 10. Nor did it show me the correct or wrong answers in the results.
Thanks
Comment #8
IWasBornToWin CreditAttribution: IWasBornToWin commentedAll the other questions are being shown as skipped.
Comment #9
IWasBornToWin CreditAttribution: IWasBornToWin commentedAny suggestions?
Comment #10
tellerman CreditAttribution: tellerman commentedThis is happening to us as well. Please fix this bug if you can.
Comment #11
perelman.yuval CreditAttribution: perelman.yuval commentedHi all
The problem is in the _quiz_resume_existing_quiz function
The question_duration is needed only for timed quiz but added to all quizes on resume
In the _quiz_take_quiz_init function they check for the quiz type before setting the question_duration in the session
So i think if you change the code from the resume function to
It will work.
I tested it and it is working well, if there is a need i can make a patch.
Comment #12
Sherbet CreditAttribution: Sherbet commentedPatches are always welcome. Quiz could definitely use some maintainer's love. It'd be nice to get rid of the Alpha status soon.
Comment #13
perelman.yuval CreditAttribution: perelman.yuval commentedThis is the patch :)
Comment #14
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedPatch #13 did the trick. Committed to git. Thanks.
Comment #15
Sabareesh CreditAttribution: Sabareesh commentedPatch 13 works fine in my case too, Thanks for the share.
Comment #17
dmegatool CreditAttribution: dmegatool commented#13 Works for me too. Thx !!