Closed (works as designed)
Project:
Quiz
Version:
6.x-4.0-rc10
Component:
Code - Quiz module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2011 at 18:47 UTC
Updated:
8 Jun 2011 at 13:33 UTC
Anonymous users keep getting redirected to the first question when clicking the next button.
I have my drupal caching disabled. PHP 5.3 and Mysql 5.1
Comments
Comment #1
falcon commentedCan't reproduce this one. I have an almost vanilla install and tried with no randomization and categorized random questions. Could you please try to change your settings around to see if this only happens with specific settings? Also try to disable some of the modules you are using to see if any of those might be causing this error.
Could you provide a link to the quiz? If you don't want to post it here you can use my contact form.
Comment #2
nickdoherty commentedI have this issue too.
I am using the Multiple Choice quiz content types. There are 10 questions with each question containing 4 options.
Multiple answers, Random Order, Simple scoring are turned off.
While radio boxes are being used (due to Multiple Answers) however this still occurs with checkboxes.
All 4 multiple choice options are acceptable and are given a score from 1 - 4.
Anonymous users can't get past the first question, validation doesn't occur. Caching is turned off. I looked at the quiz.module code for hours attempting to sort out the issue however couldn't find anything.
Authenticated users have no issues filling out the quiz.
Any ideas?
Comment #3
jeffromansfield commentedI am having this issue too.
Authenticated users can use the quiz fine, but anonymous cant get past the same question.
Nico_O are you using Multiple Choice ?
Comment #4
beauz commentedI'm getting stuck on this same problem here too.
It's got me stumped in that I can't work out how to reproduce it on a clean install, but definitely seeing it on an existing site. Thing is I have tried everything on that site including switching to Garland and disabling all other modules on the site, even completely removed and uninstalled quiz4, reinstalled and set up new quizzes and questions.
I get to question 1, click next, the same page reloads with a new quizkey querystring
take?quizkey=b981138bd574352155e2cfbb7d337133
take?quizkey=87983923c4e660e66ba1409df884ea99
etc.
Also doesnt seem to validate the form, even if my quiz normally requires me to select one answer out of the radio buttons, I don't get any validation error if I leave them all empty before submit.
Really got me stumped...
Comment #5
Nico_0 commentedFalcon, I sent the link through your contact form.
I am using multiple choice questions.
Comment #6
JBloch commentedI am having the same problem too but it on appears on Internet Explorer (at least on IE8 and IE9). No problems on Chrome or Firefox.
Comment #7
nickdoherty commentedAfter nearly 3 days of attempting to fix this, going through every line of code, and losing a lot of sleep, I finally figured it out.
The solution is so simple I shed a tear upon its discovery.
Check your users table, if you are missing a user with the id of 0, this is the user that gets assigned sessions via the quiz module. If you don't have a user 0 (all details except ID should be blank) you need to create one.
tldr; Make sure User 0 exists in your Users table. If not add it. Problem solved.
Comment #8
Nico_0 commentedThanks, that worked for me!
It looks like a couple of my sites lost the user 0 through database migrations.
Comment #9
falcon commentedSo many people has this bug? Well, I'm glad you figured it out!
Comment #10
JBloch commentedThnx for the solution but it didn't fix my problem.
I still couldn't get past the first question in IE8 and IE9.
After tons of debuging, I discovered that I got a new session each time I pressed the NEXT button and therefore the test restarted again and again.
This only happens with IE and not with Firefox or Chrome.
The solution for me was to get rid off an underscore in my subdomain name. This is appently a feature in IE ( thnx for that MS).
Comment #11
beauz commented@nickdoherty - you're a champion, I owe you a beer.
@falcon - Is there any way to code a check in for this? Seems a common issue...
Comment #12
falcon commentedYes, but does anyone have any idea as to why this is happening? (Why user 0 is missing on so many installs that is)
Comment #13
gateone commentedI have run into the same thing. What happens here is the following:
The fundamental problem is the index in the MySQL-table "user". MySQL actually won't really allow a 0 as a value for an auto-incremented table! Particularly if you move your database from database to database, the 0 value in the user table gets omitted, instead it will enter the next available ID, so if you have user IDs from 1 to 10, instead of the 0 for the anonymous user, it will place a 11 there.
I suppose this might also happen on some system settings - particularly shared environments - when you initially install Drupal. It is though a bit amazing, nobody has really done anything about this already.
So to cure this problem:
Go to the user table of your Drupal installation - phpMyAdmin or Navicat or the good old SQL command line will help you there. For not so experienced users, try phpMyAdmin which many hosting providers already have set up for you or even simpler, use Navicat, a visual SQL-Editor. You can start out with the free Navicat for MySQL which is limited to its full version but does this job quite well.
Now the very first entry of this table should be uid = 0 with name, pass, mail all empty. You will likely find any random number on uid. The second line of this table should be uid 1.
So simply change the value on uid for this first line with no name, pass, mail from whatever there is to 0
This however, will not do the trick if you already tried it out and got the error. Why? Because your session table already contains data. So as a last step, truncate the session table and now try again as anonymous. Voila!
Cheers, Steve.
Comment #14
sivaji_ganesh_jojodae commentedQuiz could not do anything about anonymous uid. There is an issue raised against Drupal core project for this bug, see #350407: Anonymous should not appear in the users table at all for fix. Please post your opinions there. To restore the anonymous uid see Drupal handbook page Restoring the Anonymous (user ID 0) user record