require_js: /mod/quiz/quiz.js - file not found.

require_js: /mod/quiz/quiz.js - file not found.

by Glen Mora -
Number of replies: 3
when i make a quiz and try to view it, i either get the error message above or i get a blank page with no source. i have a quiz.js file, its permissions are:

-rwxr-xr-x 1 www-data www-data 2982 2008-09-17 09:32 quiz.js

i installed the version that is in the debian repositories, moodle version 1.9.2

the quiz.js file is here:
http://moodle.sarasota.k12.fl.us/mod/quiz/quiz.js

here is the portion of my config.php that i've been playing with to see if i can fix it:

$CFG->wwwroot = 'http://moodle.sarasota.k12.fl.us';
$CFG->dirroot = '/var/www/moodle';
# $CFG->dirroot = '/usr/share/moodle';
$CFG->dataroot = '/var/lib/moodle';

you can see i commented out the original dirroot and changed it to my moodle installation, but it didn't seem to help.

i'm out of ideas... anybody have any?

Average of ratings: -
In reply to Glen Mora

Re: require_js: /mod/quiz/quiz.js - file not found.

by Glen Mora -
bump.

no ideas... really?


In reply to Glen Mora

Re: require_js: /mod/quiz/quiz.js - file not found.

by Charlie Owen -
Just discovered the same problem on ours - seemed to appear out of the blue after years of operation.

Our solution was to slightly hack /lib/ajax/ajaxlib.php

Around line 60 where it says:

if (array_key_exists($libname, $translatelist)) {
if (!empty($HTTPSPAGEREQUIRED)) {
$wwwroot = $CFG->httpswwwroot;
}
else {
$wwwroot = $CFG->wwwroot;
}
$libpath = $wwwroot . $translatelist[$libname];
} else {
$libpath = $libname;
}


Change that to:


if (!empty($HTTPSPAGEREQUIRED)) {
$wwwroot = $CFG->httpswwwroot;
}
else {
$wwwroot = $CFG->wwwroot;
}

if (array_key_exists($libname, $translatelist)) {
$libpath = $wwwroot . $translatelist[$libname];
} else {
$libpath = $libname;
}


I would report this as a bug, but I can't replicate it on a fresh Moodle install. Still, weird that it appeared on both of our systems.
In reply to Charlie Owen

Re: require_js: /mod/quiz/quiz.js - file not found.

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi,

I just followed a link in MDL-15800 to here, so no need to report it as a new bug. wink