eduramiba / moodle-theme-uikit

UIKit theme for Moodle ⛺
2 stars 1 forks source link

Quizes not showing #7

Closed borisvmalysh closed 9 years ago

borisvmalysh commented 9 years ago

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: image When switching to another theme (Essential) quizes render well.

eduramiba commented 9 years ago

I can't reproduce this. Is there anything special in this quiz or it happens with any simple quiz?

gjb2048 commented 9 years ago

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.

borisvmalysh commented 9 years ago

Even a quiz with only one multiple choice question showes the message.

I've turn on debugging messages with the following configuration

image

When attempting the quiz get the following data

image

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 image

returns 404 error. The link leads to the following address http://flipchart.ru/mod/quiz/function.shell-exec Which can't be found.

gjb2048 commented 9 years ago

Go to your moodle installation folder and there you will find '/question/type/splitset/questiontype.php'.

gjb2048 commented 9 years ago

Where 'splitset' is a contributed and not a core question type.

gjb2048 commented 9 years ago

The warning can be ignored for now. Its the question type error that is the problem.

eduramiba commented 9 years ago

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?

gjb2048 commented 9 years ago

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.

borisvmalysh commented 9 years ago

I've found the '/question/type/splitset/questiontype.php' file, but I don't clearly understand what I should do with it.

borisvmalysh commented 9 years ago

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

gjb2048 commented 9 years ago

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.

borisvmalysh commented 9 years ago

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... image

But it still doesn't work

gjb2048 commented 9 years ago

So... what's the error now?

borisvmalysh commented 9 years ago

[MAIN CONTENT GOES HERE - vRFD2aCXHw]

gjb2048 commented 9 years ago

Well!! No ****!

I mean with developer level debugging!

borisvmalysh commented 9 years ago

1 sec

borisvmalysh commented 9 years ago

Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/uptime' in /home/thewhitebo/flipchart.ru/docs/lib/moodlelib.php on line 8913

gjb2048 commented 9 years ago

That will not cause it. Anything else?

borisvmalysh commented 9 years ago

No.. That's all I get when I enter the quiz. image

When I start the quiz I get the mistake error image

When I folow the link from the first message I get 404 error.

gjb2048 commented 9 years ago

Did you change the question type?

borisvmalysh commented 9 years ago

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...

borisvmalysh commented 9 years ago

Just by the way, Gareth, I thank you a whole lot for your attention to the issue.

gjb2048 commented 9 years ago

No problem.

Ok, do also try a 'Purge all caches' and possibly restart your web server to clear any PHP code cache.

borisvmalysh commented 9 years ago

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.

borisvmalysh commented 9 years ago

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.

gjb2048 commented 9 years ago

Ok, so make /usr/bin/uptime executable from the point of view of the web server progress. I.e. the user / group.

borisvmalysh commented 9 years ago

) If only I knew how to do that

gjb2048 commented 9 years ago

Learn the UNIX commands 'ls' and 'chmod'.

borisvmalysh commented 9 years ago

Ok, I will try. But since I'm only a language teacher, it's gonna take me forever... Is there any other way?

gjb2048 commented 9 years ago

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.

borisvmalysh commented 9 years ago

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 }

gjb2048 commented 9 years ago

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