## Quiz

### Cannot add multiple question without purging cache everytime

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Cannot add multiple question without purging cache everytime

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?

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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.

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

Yes, I'll do it.

Cheers

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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.

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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.

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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.

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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
ticks: 1353 user: 554 sys: 41 cuser: 0 csys: 0
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.

Average of ratings: -
Re: Cannot add multiple question without purging cache everytime

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.