Cannot add multiple question without purging cache everytime

Cannot add multiple question without purging cache everytime

Pere O. -
回帖数:10

When trying to add multiple questions on a quiz, I get an empty screen (see screenshot).

Purgin all caches fixes the problem, but the problem occurs again after adding one question, so it's not very feasible to that for every question.

This happened to me on Moodle 2.4.0, and also in 2.4.1 after upgrade. I don't use any custom plugin nor nothing strange.

Does anynone have a clue on how to fix that? Does anybody know where the Moodle cache is?

附件 screenshot_multiple_questions2.png
回复Pere O.

Re: Cannot add multiple question without purging cache everytime

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Please turn on Debugging so we get an error message, rather than a half-blank page.

回复Tim Hunt

Re: Cannot add multiple question without purging cache everytime

Pere O. -

Thanks Tim,

I set Debug to 'DEVELOPER', but I can't see any messages at all.

I also inserted:

$CFG->debug=2047;
$CFG->debugdisplay=1;

inside config.php. But no messages anywhere.

But for some strange reason... now it works fine! Now I can add multiple-answer questions without the need of clearing the cache.

Do you have any clues on how I can enable the Debugging if the above does not work? Shouldn't the Debugging page just work?

 

Many thanks

回复Pere O.

Re: Cannot add multiple question without purging cache everytime

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Well, debugging will only show errormessages if there is an error!

You symptoms are very odd. I don't undestand what was happening at all, so if you do manage to make this happen again, please do send us the error message.

回复Tim Hunt

Re: Cannot add multiple question without purging cache everytime

Pere O. -

Hi,

The problem has now suddenly appeared again, and I would say that now it's worse, because purging the cache does not fix it.

It's also strange that I don't see any error messages at all, or it can be that I cannot get Debugging working...

 

I'm not able to paste code here. The output of the page is truncated after the header, just after the help. The last part can be found here: http://pastebin.mozilla.org/2092410

 

EDIT: I'm quite sure that there are no errors in the page and it's not a problem of enabling debugging. I have an ErrorLog directive inside the apache site file, and if I manually simulate errors inside Moodle code I see them without problems. So for some reason the site breaks but there aren't any errors. I've also checked that it's not a permissions problem.

 
回复Pere O.

Re: Cannot add multiple question without purging cache everytime

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

That output is 99%-certainly caused by a PHP fatal error.

The Debugging page explains how to turn on debugging even if you cannot get to that admin page.

Without an error message, I cannot say more.

回复Tim Hunt

Re: Cannot add multiple question without purging cache everytime

Pere O. -

Hi Tim,

Following the instructions, I've enabled Debugging in the admin page, in the config file and in the database. But I only see the screen posted above. No errors when trying to add a multiple-answer question.

If I manually produce errors, for example doing a typo inside config.php, the error and the backtrace is displayed (I'm using xdebug).

I'm trying to locate the issue myself but I cannot either do much without seeing any message.

回复Pere O.

Re: Cannot add multiple question without purging cache everytime

Pere O. -

I see that inside display_question_editing_page() function, "$mform->display();" is printing an empty string.

 

After that, "echo $OUTPUT->footer();" is not reached.

That's weird. And I don't understand why I'm the only one experiencing this issue, even after the upgrade. And it happens randomly, here are the debug messages when suddenly 'works':

13.525071 secs
RAM: 40.1MB
RAM peak: 40.3MB
Included 685 files
Contexts for which filters were loaded: 1
Filters created: 2
Pieces of content filtered: 0
Strings filtered: 0
get_string calls: 2434
strings mem cache hits: 0
strings disk cache hits: 3691
Included YUI modules: 0
Other JavaScript modules: 4
DB reads/writes: 1828/0
ticks: 1353 user: 554 sys: 41 cuser: 0 csys: 0
Load average: 0.76
Session: 7.5KB
Caches interaction by definition then store
core/databasemeta
** static persist **: 1677 / 25 / 0
cachestore_file: 25 / 0 / 0
core/string
** static persist **: 3351 / 340 / 0
cachestore_file: 340 / 0 / 0
Total Hits / Misses / Sets : 5393 / 365 / 0
This page is: General type: admin. Context Quiz: Benchmark 2012 Module 4 (context id 68). Page type question-type-multichoice.

回复Tim Hunt

Re: Cannot add multiple question without purging cache everytime

Pere O. -

Hi again,

Sorry for the noise, finally I think it was my fault, because I forgot I hacked one function of the Moodle core, see https://moodle.org/mod/forum/discuss.php?d=164375#p961405

After getting rid of this unfortunate modification, now I only have the problem when I refresh the page /mod/quiz/edit.php, which is something that I don't really need to do.

Thanks for your time.