quiz errors in 1.4.1+

quiz errors in 1.4.1+

by SFWBC SFWBC -
Number of replies: 14

After upgrading our version of Moodle up to the latest stable branch (1.4.1+), the quiz modules gives the following errors when atteempting to edit questions. (you can preview questions, but not edit or add)

Warning: main(truefalse.html): failed to open stream: No such file or directory in /home3/www/sfwbc/online/mod/quiz/questiontypes/truefalse/editquestion.php on line 26

The file is exactly where this path says itis not, and it has the coorect chmod settings to be accessed.

Our previous version of moodle did not have a seperate folder for questions types. It had truefalse.php, multichoice.php, etc.

This is the only module that returns a file not found error.

Any help resolving this would be greatly appreciated.

Average of ratings: -
In reply to SFWBC SFWBC

Re: quiz errors in 1.4.1+

by Henrik Kaipe -
I'll help you with this one but first I would like you to inform us of some additional technical details:

1)  Which server operating system do you use?
2)  Which web server do you use (Apache, IIS etc) and which version of this web server? (important!!!)
3)  Which PHP version do you use? (important!!!)
4)  Which database brand and database version do you use?

(When asking for technical assistance on bugs and stuff, information on these technical details will always help your chance to get help in the forum)

Another thing -
Do you get this error for the question type truefalse only or do you get it for all of the question types? (I assume you get it for all the question types - just want to make sure.)

-----
PS
As the warning message can be easily misunderstood I would like to point out that the file that cannot be opened here is truefalse.html (just in case someone thought it was editquestion.php)
DS

In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by SFWBC SFWBC -

Henrik,

Thanks for the quick reply. Here is what I think are the correct answers.

We get this error for all question types when adding or editing questions. Everything else seems to be running without a hiccup.

1)  Which server operating system do you use? Apache
2)  Which web server do you use (Apache, IIS etc) and which version of this web server? (important!!!) Apache/1.3.31 (Unix) PHP/4.3.8
3)  Which PHP version do you use? (important!!!) Version 4.3.8
4)  Which database brand and database version do you use? mysql 3.23.56

Thanks,

Rodney

In reply to SFWBC SFWBC

Re: quiz errors in 1.4.1+

by Henrik Kaipe -
I use the very same and it works for me. This is truely annoying. However, it can probably be fixed anyway. This is what to do:

At the end of the file named editquestion.php in questiontypes/truefalse you will find this line:
    require("truefalse.html");
Have this line changed to
    require("$CFG->dirroot/mod/quiz/questiontypes/truefalse/truefalse.html");
and things will probably work out fine for the question type truefalse.

If this works then make the equivalent changes for all the question types! Make sure to always use double quotes (") and never single quotes (')  !!!

Then tell us if this fix works, in which case we might make the same change for the official quiz module.

Is there anyone else having the same problems?
In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by Brian * -
I'm having exactly the same issue.
No complications with previous installs as I am a new user starting with the 1.4.1 version as my first trial.
"Warning: main(truefalse.html): failed to open stream: No such file or directory in /home/serve/gaena/ce/mod/quiz/questiontypes/truefalse/editquestion.php on line 26"
Same thing for every question type.
Apache 2.0.49 on linux shared hosting server , php 4.3.8 
Your fix does indeed work. I hope it is included in future releases.
In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by morena meri -

thank you very much now it works fine

Thank again

Morena

In reply to morena meri

Re: quiz errors in 1.4.1+

by Genner Cerna -
Simple statistics is not working...

error: No answers defined for question id 1680!
In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by Thierry Walch -

Hello

Thanks so much for your solution !

Have a good one

Thierry

In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by SFWBC SFWBC -

Now this is the error I am receiving. Help.

Fatal error: Cannot redeclare quiz_upgrade() (previously declared in /home3/www/sfwbc/online/mod/quiz/db/mysql.php:3) in /home3/www/sfwbc/online/mod/quiz_old/db/mysql.php on line 3

In reply to SFWBC SFWBC

Re: quiz errors in 1.4.1+

by Henrik Kaipe -
Seems like you renamed the old quiz directory to quiz_old and thereafter kept it in the "mod" directory. That won't work, if you keep quiz_old then move it away from the "mod" directory or it will be seen as a separate moodle module that tries to use the same database tables as the quiz module.
In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by Rodney Holloman -
It was actually in a separate directory in another directory. ie online_backup. Should we delete the old moodle stuff off the server?
In reply to Rodney Holloman

Re: quiz errors in 1.4.1+

by Henrik Kaipe -
Are you sure? The error message clearly says online
In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by Rodney Holloman -

Right. You are correct.

Before upgrading, we renamed our moodle directory to online_backup. Then installed 1.4.1+ and began beating our heads against the wall.

It is working like a charm at the moment. We are getting an error message accessing the admin module though.

Fatal error: Cannot redeclare quiz_upgrade() (previously declared in /home3/www/sfwbc/online/mod/quiz/db/mysql.php:3) in /home3/www/sfwbc/online/mod/quiz_old/db/mysql.php on

Rodney

In reply to Rodney Holloman

Re: quiz errors in 1.4.1+

by SFWBC SFWBC -

I changed the require function in each of the questions editquestion.php file to the absolute http path, and they now work fine. The quiz_old error was resolved by moving the folder.

I believe the whole issue was caused because config.php was not called for any of these files, so they did not know that the physical address for "truefalse.html", etc., though it was in the same directory, was different than home3/www/sfwbc, etc.

Perhaps in later updates this could be included in the files so they search in the paths specified by config.php.

Thanks for all the help!

In reply to Henrik Kaipe

Re: quiz errors in 1.4.1+

by Rodney Holloman -

Henrik,

Thanks for all your help. You got a favorite charity or something?

BTW, love the new 1.4.1+ (even with the quiz frustration)

Thanks,

Rodney H