Lesson Module Question Page jumps to blank page

Lesson Module Question Page jumps to blank page

by Gary Suhr -
Number of replies: 13

When creating a moodle lesson I get a blank page after I make my choice and click please check one answer. It is a multiple choice question.

When i run debug this is the error I get

 Parse error: parse error, unexpected T_OBJECT_OPERATOR in /opt/moodle/html/mod/lesson/action/continue.php on line 418

We are using 1.9.11+ (Build 20110427)

Any help would be appreciated

Average of ratings: -
In reply to Gary Suhr

Re: Lesson Module Question Page jumps to blank page

by Dominique BODIN -

Hi,

I met quite the same problem: since I've updated from 1.9.9  to 1.9.13 and 1.9.14+ the module Lesson doesn't work anymore : at the very first page of each lesson, when checking the answer -right or wrong- Moddle displays a blank page .../moodle/mod/lesson/lesson.php

This is true either for the "old" lessons created in the previous versions of Moodle as well as far any new lesson created in the 1.9.14+ version.

I've temporarly downgraded to the previous version 1.9.9+ (Build: 20100901) and the very same lessons work perfectly fine again.

Any help would be welcome ! Thanks,

D.B.

In reply to Dominique BODIN

Re: Lesson Module Question Page jumps to blank page

by Dominique BODIN -

Hello again,

I received exactly the same error message :

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /..../www/moodle/mod/lesson/action/continue.php on line 418

The 418 line in continue.php is :

$response = reset($answers)->answer;

Thanks for any help,

D.B.

In reply to Dominique BODIN

Re: Lesson Module Question Page jumps to blank page

by Karim Wallani -

I am having the exact same parse error as D B after I upgraded Moodle from 1.9.8 to 1.9.14:

Parse error: parse error, unexpected T_OBJECT_OPERATOR in /..../mod/lesson/action/continue.php on line 418

I am indeed using PHP 4, and switching to PHP 5 is not an option for me. I would appreciate some urgent help for PHP 4.

In reply to Dominique BODIN

Re: Lesson Module Question Page jumps to blank page

by Karim Wallani -

By the way, Lessons work fine on PHP 5, but not on PHP 4. Is there some code I need to change on line 418 of continue.php?

In reply to Karim Wallani

Re: Lesson Module Question Page jumps to blank page

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

PHP 4 is really old stuff now. You should really upgrade to PHP 5.

Joseph

In reply to Joseph Rézeau

Re: Lesson Module Question Page jumps to blank page

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes, but Moodle 1.9 should work on PHP4. That has always been supported, and if a recent change has broken it, that is a serious bug and should be fixed.

In reply to Tim Hunt

Re: Lesson Module Question Page jumps to blank page

by Karim Wallani -

I agree with Tim Hunt. Indeed Moodle 1.9 (in particular, the latest Moodle 1.9.14) does indeed support PHP 4. And if an update has broken a core feature of it (in this case, Lessons), then the developers better fix it!

I understand full well that PHP 4 is old, but I have no other choice but to use PHP 4 at my inistitution. But I still want to be able to enjoy the latest Moodle in the 1.9 series. Why shouldn't the developers issue a PHP 4 fix for Lessons?!

In reply to Karim Wallani

Re: Lesson Module Question Page jumps to blank page

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Karim: "Why shouldn't the developers issue a PHP 4 fix for Lessons?!"

Well, for a start, I doubt there are that many Moodle developers around that still have a PHP4 test installation at the ready to conduct tests.

Of course this is no excuse, it just explains things.

Joseph

In reply to Joseph Rézeau

Re: Lesson Module Question Page jumps to blank page

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes, but once it has been pointed out, the error is normally obvious, and we have a line number and a file.

Acutally, I'm bored. Here is a proposed fix. MDL-30038 (Note, I have not tested it. As Joseph says, I don't have a test server with PHP4.)

In reply to Tim Hunt

Re: Lesson Module Question Page jumps to blank page

by Karim Wallani -

Thanks, Tim. I can definitely test it for you, but please forgive, I am a newbie, and I don't know how to access the code changes you have suggested.

In reply to Karim Wallani

Re: Lesson Module Question Page jumps to blank page

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

http://docs.moodle.org/dev/How_to_apply_a_patch should probalby explain, but it has not been updated since we all started using git.

I've attached the changes as a plain diff.

Alternatively, it is a simple edit: https://github.com/timhunt/moodle/commit/1c62549cf560b9d6ecd8c5a3fe702df8dd9cf1a6 You could probably make those changes manually, if you are careful.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Lesson Module Question Page jumps to blank page

by Karim Wallani -

Thank you, Tim! You are a gentleman and a scholar! It worked!!!!!!!! smile