Just came across a "bug" in Quiz 2.1. Did a search, couldn't find anything related, so creating a new issue (although I'm not sure how this hasn't come up before! :P)

If you have two anonymous users who share the same IP address taking *same* quiz at the *same* time, you end up with some weird behaviour: questions will jump and change order, or you'll get an error message like:

warning: implode() [function.implode]: Invalid arguments passed in /www/html/dev.lactualite.com/sites/default/themes/lactualite/template.php on line 1445.
warning: Invalid argument supplied for foreach() in /www/html/dev.lactualite.com/sites/default/themes/lactualite/template.php on line 1461.

(it's referring to template.php because I overrode the *_multichoice_feedback() function for theming purposes; copied the functionality, I only modified the markup a little)

Well, the behaviour isn't exactly *that* weird because Quiz keys into an IP address for anonymous users when keeping track of the quiz results. (At least that's what I think is happening, based on what I'm seeing on the Quiz Results page?) So Quiz will get a bit confused when it receives an answer for Question 8 and then a few seconds later, gets an answer for Question 3, and attempts to redirect the user to the "next" question, which ever one that may be.

Not sure if my theory about why this is happening is correct, but this is definitely the behaviour I'm seeing.

Is there a way to avoid this problem, a setting I should change? Is the way the question tracking is done changed in Quiz 3? (Wondering if upgrading could help.)

Using:
Drupal 6.12
MySQL 5.0.67
Quiz 2.1

Thanks!

Comments

Stephen Scholtz’s picture

Sorry, a correction.

This problem seems to only pop up at the start of the quiz, when (I assume) a session variable has not yet been created for User 2 (the one who's filling in the quiz after User 1, the first anonymous user, with the same ip address, to get there), or if the User 2 tries to retake the test, clears their cache and hits the url fresh again (without the session var in there)

If User 2 ignores the error messages, and just keep answering questions, eventually User 2 gets their own session variable and makes their own way through the quiz, no more disturbances. (Unless as mentioned, they were to change the url by removing the session var and trying to start the quiz from scratch again)

Does that behaviour sound consistent with the way Quiz was built?

Stephen Scholtz’s picture

Priority: Normal » Minor

Sorry, ignore this for now, I don't think I nailed down exactly in what scenario this particular bug shows up. Working on that now so I can give a much better description of how this comes about.

mbutcher’s picture

Stephen,

This is actually a very interesting issue, so let us know what you find. Information about a quiz gets stored in the session, so two users should not have conflicting quizzes.

This issue is marked as using Quiz 2.1. Have you tested at all using Quiz 3.0 beta 2? There are some other bugs that might actually have been responsible for generating the errors you are seeing. And Quiz 3 should be a smooth upgrade from Quiz 2... so if you have a spare server or instance for testing....

(Quiz 3.0 final is tentatively scheduled for next week, so the code base is pretty stable.)

Stephen Scholtz’s picture

Priority: Minor » Normal

Ok, think I have it figured out...

Ignore my previous babbling about ip addresses and stuff, as that's not the issue. Here's what seems to be happening:

- as an anonymous user, start a quiz (ex url: mysite.com/node/3067)
- part way through the quiz (say question 5), edit the url to delete the "/quiz/start/..." stuff, or just leave the page, go somewhere else, and then come back to the quiz by a normal link, so you're back at mysite.com/node/3067.
- the anonymous user will be on the question they left off at (question 5) and can continue...though sometimes they're reset back to question 1. :P

Sometimes the starting question for the quiz will get "stuck" at whatever that user left off at, and sometimes it won't. If it gets stuck, now *any* anonymous user who comes to this Quiz page will start off on question 5, instead of question 1. The quiz page is now "stuck" on that question, and won't reset back to question 1, at least not for a while.

I thought that deleting the Quiz results of the user who caused the problem would solve the issue. This *some*times works, but not always.

If the question doesn't get stuck and resets to 1, and the user answers a question, it boots them ahead to where ever they left off and there's some error messages (the implode() error mentioned above).

I believe this has something to do with the cache being turned on maybe? The anonymous user who quit part way through the quiz and came back ends up creating a cache version of the quiz starting page (mysite.com/node/3067) that has their last question on it, and then that cached version gets served to every anonymous user after that, at least for a time.

Anyways, I'm not if I've explained the issue well enough, as the behaviour does seem kind of inconsistent. But having an anonymous user abandon the quiz part way through and come back to the original URL seems to be a key cause.

Logged in users don't seem to have this problem at all.

Thanks!

mbutcher’s picture

Ah, yes... that sounds more like some of the issues I have seen in the past.

I believe that all of these have been fixed in Quiz 3. In some cases, I have recommended that users of Quiz 2 use the Cache Exclude module to eliminate caching issues. But most of the issues are related to Quiz 2's inability to handle partially complete quizzes. In quiz 3, this is much more robust.

Matt

Stephen Scholtz’s picture

Installed Quiz 3 on my local environment, and through a bare bones initial test, Quiz 3 seems to be better in this regard. Will test a little more tomorrow and see if I can reproduce this behaviour in any way.

Thanks!

mbutcher’s picture

Status: Active » Postponed (maintainer needs more info)

Waiting for update.

falcon’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This issue doesn't seem to be relevant anymore.