Closed borisvmalysh closed 9 years ago
I can't reproduce this. Is there anything special in this quiz or it happens with any simple quiz?
Sorry to but in, but that message happens when the rendering of the page fails (search core lib folder PHP files for 'MAIN CONTENT GOES HERE' to see what I mean). Turn on developer debugging to get a stack trace.
Even a quiz with only one multiple choice question showes the message.
I've turn on debugging messages with the following configuration
When attempting the quiz get the following data
As far as I understand, something should be changed in the following files:
Strict Standards: Declaration of qtype_splitset::get_question_options() should be compatible with that of question_type::get_question_options() in /home/thewhitebo/flipchart.ru/docs/question/type/splitset/questiontype.php on line 346
Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/uptime' in /home/thewhitebo/flipchart.ru/docs/lib/moodlelib.php on line 8913
And also this link
returns 404 error. The link leads to the following address http://flipchart.ru/mod/quiz/function.shell-exec Which can't be found.
Go to your moodle installation folder and there you will find '/question/type/splitset/questiontype.php'.
Where 'splitset' is a contributed and not a core question type.
The warning can be ignored for now. Its the question type error that is the problem.
Hi, That's weird because none of these files are part of UIkit theme.
Does it work in the same exact site with other themes?
It should fail in all themes!
Try turning on 'Allow theme changes in URL' type setting in the themes settings, then you can add parameters to the URL like '&theme=essential' to switch themes and confirm that the exact page also causes the issue in other themes. Which given the error I suspect is the case here and the assertion that it works in other themes is false.
I've found the '/question/type/splitset/questiontype.php' file, but I don't clearly understand what I should do with it.
And by the way I've not changed anything but for some reason quiz does work in the site with Moodle 2.7 and php 5.4
Ok, the error message means that the method's parameters are different to that defined in the parent class in core. Therefore I suspect that something has changed in core recently which has been applied to both the M2.6 and M2.7 branches but that one of your Moodle installations is out of date. In any event, the plugin has not been updated in years: https://moodle.org/plugins/pluginversions.php?plugin=qtype_splitset - therefore it is the duty of the maintainer to maintain it. If they don't then it should be released and maintained by somebody else.
Well, I've disabled the splitset plugin and renamed the '/question/type/splitset' folder so that it doesn't affect the site in any manner...
But it still doesn't work
So... what's the error now?
[MAIN CONTENT GOES HERE - vRFD2aCXHw]
Well!! No ****!
I mean with developer level debugging!
1 sec
Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/uptime' in /home/thewhitebo/flipchart.ru/docs/lib/moodlelib.php on line 8913
That will not cause it. Anything else?
No.. That's all I get when I enter the quiz.
When I start the quiz I get the mistake error
When I folow the link from the first message I get 404 error.
Did you change the question type?
No. None of quizes (even containing nothing but 1 multiple choice question) renders well on the site, when it works under UIkit theme... When I change the theme it works ok.
I've just installed UIkit on another (third) site with the same moodle 2.6 and php 5.3, and everything is working ok. So the problem should be with the configuration of the site that has the problem. Probably it's because of some of the plugins installed...
Just by the way, Gareth, I thank you a whole lot for your attention to the issue.
No problem.
Ok, do also try a 'Purge all caches' and possibly restart your web server to clear any PHP code cache.
I've just purged all caches and got the same message: Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/uptime' in /home/thewhitebo/flipchart.ru/docs/lib/moodlelib.php on line 8913 Now restarting the server.
Nope. It returns the same mistakes:
1 - Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/uptime' in /home/thewhitebo/flipchart.ru/docs/lib/moodlelib.php on line 8913 when I enter the quiz and 2 - [MAIN CONTENT GOES HERE - vRFD2aCXHw] when I start it.
Ok, so make /usr/bin/uptime executable from the point of view of the web server progress. I.e. the user / group.
) If only I knew how to do that
Learn the UNIX commands 'ls' and 'chmod'.
Ok, I will try. But since I'm only a language teacher, it's gonna take me forever... Is there any other way?
I don't know how important the uptime call is. But you could try commenting it out in /lib/moodlelib.php on line 8913. Or ask the hoster to fix the permissions issue for you.
I don't know what exactly and how to comment out, but here's the context. If it's not a big bother could you please help me out a bit?
8907 // Grab the load average for the last minute.
8908 // /proc will only work under some linux configurations
8909 // while uptime is there under MacOSX/Darwin and other unices.
8910 if (is_readable('/proc/loadavg') && $loadavg = @file('/proc/loadavg')) {
8911 list($serverload) = explode(' ', $loadavg[0]);
8912 unset($loadavg);
8913 } else if ( function_exists('is_executable') && is_executable('/usr/bin/uptime') && $loadavg = /usr/bin/uptime
) {
8914 if (preg_match('/load averages?: (\d+[.,:]\d+)/', $loadavg, $matches)) {
8915 $serverload = $matches[1];
8916 } else {
8917 trigger_error('Could not parse uptime output!');
8918 }
8919 }
8920 if (!empty($serverload)) {
8921 $info['serverload'] = $serverload;
8922 $info['html'] .= 'Load average: '.$info['serverload'].' ';
8923 $info['txt'] .= "serverload: {$info['serverload']} ";
8924 }
Looking at the code, that is the performance information. You could try turning it off. See: https://docs.moodle.org/27/en/admin/setting/debugging#Performance_info
Two sites (moodle 2.6 (php 5.3) and moodle 2.7 (php 5.4)) using the same UIkit theme version 2014091200 when rendering a quiz show the following message:
When switching to another theme (Essential) quizes render well.