hot potato + Safari + iPhone = pop-up problem

hot potato + Safari + iPhone = pop-up problem

by Gerald Grow -
Number of replies: 6
I have a site with many Hot Potatoes quizzes displayed through Moodle.

When I access it from Safari on an iPhone or iTouch, this problem occurs:

After I click the correct answer, the pop-up containing the feedback BRIEFLY appears, then it is replaced by a blank screen.

If I hit the Back button, I can restore the pop-up/feedback, read it, click OK, and go on to the next question. The pop-up problem recurs with every feedback pop-up.

Does anyone know how to fix this situation?



Here is where to see the problem:

USING AN IPHONE, go to http://courses.newsroom101.com

Log into Pop-up Demo as Guest.

Click either of the two pop-up demo JQZ items. Each contains only two questions -- just to demo the problem.

You can also click the link that displays the same quiz from an off-Moodle location, from which it works normally. That is, when the Hot Potatoes JQZ .htm file is accessed, on an iPhone, from a website (rather than through Moodle), the pop-up functions correctly.

Moodle and the iPhone's pop-up seems to have some conflict.

Incidentally, my iPhone prefs are set NOT to block pop-ups -- a step that is necessary in order to see the pop-up at all.

Thanks for any insight!

Gerald Grow

[Cross-posted at Moodle forum and Hot Potatoes discussion list.]
Average of ratings: -
In reply to Gerald Grow

Re: hot potato + Safari + iPhone = pop-up problem

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Gerald,
whenever you click a button on quiz displayed via the HotPot module, the results so far are sent to Moodle, and Moodle returns a 204 status code to the browser, which means "don't do anything". It seems that Safari on iPhone is not doing nothing!

Is it possible to find out what version of Safari you are using on your iPhone?
BTW, the quiz popup messages displayed OK on Safari 3.3.2 on a Windows PC.

I would be interested to know if the same problem occurs when you adminster the quiz via QuizPort. I would expect QuizPort to behave better. Firstly, it generally does not send results in the middle of a quiz, and secondly, if it does send results in the middle of a quiz, it uses AJAX to send the results on a different channel that the main client - server connection.

Gordon

In reply to Gordon Bateson

Re: hot potato + Safari + iPhone = pop-up problem

by Gerald Grow -
1. I can't locate the version of Safari on my iTouch v. 1, but I also had the same problem on an iPhone running the latest (recent) software upgrade.

2. Yes, Safari works fine with these Moodle quizzes when run from a desktop -- PC or Mac. The problem happens only on the iPhone version of Safari.

I'll put the quiz into a quizport and try it. If you get to this first, feel free to do that.

Has anyone published a way to format Hot Potatoes or Moodle for iPhone users? At present, the lines of text are too wide.
In reply to Gerald Grow

Re: hot potato + Safari + iPhone = pop-up problem

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
> Has anyone published a way to format
> Hot Potatoes or Moodle for iPhone users?

FYI, one of the goals of the QuizPort output formats is to allow the same content to be formatted differently for different clients. I haven't developed any output formats for handheld devices yet, but the potential is there.
In reply to Gerald Grow

Re: hot potato + Safari + iPhone = pop-up problem

by Gerald Grow -
I have loaded the sample quiz in a Quizport, and that seems to work fine on the iPhone. The pop-up with feedback stays in place as it should.


In reply to Gerald Grow

Re: hot potato + Safari + iPhone = pop-up problem

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Thanks for the extra info Gerald.

It looks like Safari on iPhone cannot handle the 204 HTTP status code.
You could try disabling the PHP which returns the 204 code:
  1. open "mod/hotpot/attempt.php" with your favorite text editor
  2. locate the following lines (around line 153)
    // continue without reloading the page
    header("Status: 204");
    header("HTTP/1.0 204 No Response");

  3. comment out the header lines, thus:
    // continue without reloading the page
    // header("Status: 204");
    // header("HTTP/1.0 204 No Response");

  4. save the modified file
Please try that and see if it helps in the Safari case. If it does then you can make the code a little cleverer to check to see if the browser is Safari. If it isn't iPhone Safari, send the 204 status code as usual. If it is iPhone Safari, don't do anything.

You could also try just commenting out the "header" first line, and see if that helps.

regards
Gordon
In reply to Gordon Bateson

Re: hot potato + Safari + iPhone = pop-up problem

by Gerald Grow -
That fixed it!

The pop-up now behaves properly on iPhone Safari, and on my desktop Mac in Firefox.

I have not had a chance to check yet with other browsers and platforms.

Thanks!