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.
Hi,
When clicked twice (double click) "Next" -button (after selecting answer option) it throws "Access denied" -page.
Quiz settings are:
Categorized random questions (multiple choice)
This issue appears at least in 2 different sites which have the latest versions of Dupal (7.31) and Quiz 7.x-5.0-alpha4.
Comment | File | Size | Author |
---|---|---|---|
#21 | double_click_of_next-2343113-21.patch | 817 bytes | djdevin |
#17 | double_click_of_next-2343113-17.patch | 1.24 KB | djdevin |
Comments
Comment #1
greenwork CreditAttribution: greenwork commentedI am seeing the same issue as well on 7.5 dev
It appears to only happen on my end when I have strict rules on no backward navigation as well as no resume. I assume it has to do with the resume option.
Comment #2
greenwork CreditAttribution: greenwork commentedI noticed it still happened. One thing I am doing now is when my question is updated I go to the quiz and edit the quiz. An update question option exists on the question table. So far so good.
Maybe this has something to do with it.
Comment #3
jukka792 CreditAttribution: jukka792 commentedAt least this "access denied" -page appears when none of these are checked in the "taking options" of the quiz settings:
Haven't tested with other combinations.
Solution could be to hide the "next" -button using javascript so that two clicks are not possible.
Comment #4
jukka792 CreditAttribution: jukka792 commentedTested more..
When "allow jumping" and "allow skipping" is on, everything is working fine.
When those are off, clicking twice "next" -button throws you to "access denied" -page.
(Manually change the URL address to next node number and quiz will continue normally).
Comment #5
djdevinI reproduced this, can't figure it out yet.
My guess is that the current question counter is being incremented, however the same question is being submitted 2x.
So when it goes to redirect, it redirects to the wrong question.
Comment #6
greenwork CreditAttribution: greenwork commentedallow skipping did not change the double click problem. I think you are right on the submitted 2x part for the same question.
Here is a decent article
http://biostall.com/disabling-submit-button-to-prevent-double-form-submi...
Comment #7
greenwork CreditAttribution: greenwork commentedbackward navigation and resume fixed this problem for me so far. I think with backward nav you are allowed to change your answers. Double clicking is probably submitting it 2x for the same answer.
Comment #8
greenwork CreditAttribution: greenwork commentedResume is a bit of a problem though because it causes all anon users to resume the same exam.
Comment #9
greenwork CreditAttribution: greenwork commentedCan anyone confirm that all anon users resume the same exam or get access denied depending upon if resume and backward nav are selected.
Maybe its just my setup currently. Our workaround will be to have everyone Log in.
Comment #10
djdevin@greenwe, you might be right, typically I do not give permission for anon to take quiz so I may not have noticed it. Give me a day or two to correct it.
Comment #11
djdevin@greenwe The fix was easy, I made an issue here: #2367361: anonymous user should not be allowed to resume quiz
Comment #12
djdevinCan someone try this patch?
I was able to reproduce before the patch, and could not reproduce after this patch.
Basically it detects if the current question is not where they are, it assumes that a double click happened, and redirects.
The trick is clicking, then clicking a little bit after the last click before the browser redirects. All about the timing!
Comment #13
greenwork CreditAttribution: greenwork commentedTested both and they appear to fix the issues. The anon issue was resolved in your other patch. Double clicking without resume or skipping is not creating an error and properly progresses to the next slide. Will revert over the next 24 hours after more testing.
Comment #14
djdevinGreat this is probably the fix then. Note the page does not work with pages yet but the concept is the same.
Comment #16
jukka792 CreditAttribution: jukka792 commented#12 Works here also! Thanks a lot.
Comment #17
djdevinComment #18
Youlearnit CreditAttribution: Youlearnit as a volunteer commentedTried to apply this patch to RC1 but got these errors:
Notice: Undefined property: QuizResult::$layout in quiz_access_question() (line 3632 of quiz.module).
Comment #19
gun_dose CreditAttribution: gun_dose commentedAs mentioned above, in 7.x-5.0-rc1 this patch doesn't work and causes error, that totally breaks quiz - answers are not accepted and clicking any button causes only refreshing of current page with error message. I couldn't fix this patch so I solved this problem without patch in another way - by javascript, that adds class "clicked" to all buttons after the first click and prevents default on buttons, that has this class
Comment #21
djdevinRerolled.
Comment #23
joelpittetCan this kludge include a check for the upper bound/total # of questions to avoid going past? I'm getting a bunch of
And I think it's due to this.
Comment #24
jukka792 CreditAttribution: jukka792 as a volunteer commentedI was able to solve this problem by hiding the "next" -button using javascript after click.
Comment #25
vmkazakoff CreditAttribution: vmkazakoff commented