I just upgraded from 2.25 to 2.47. When I enter a quiz, I get the message - This question is missing. Unable to display anything. for each question. If I go in and edit the quiz, I can see and edit the individual questions, but if I try to preview it - I get the message - Coding error detected, it must be fixed by a programmer: File store path does not exist and can not be created.
I also created a brand new question and get the same Coding error detected when I try to view it.
Is there a way to fix this?
These are just the standard core question types such as multiple choice, true/false etc.. I also just tried creating a new quiz and a new question, same problem, I can create the question but it doesn't display.
I am also able to export the questions from the question banks.
I set debugging to Developper then went to editing a quiz. When I click the preview icon next to a question, I get the following error:
Error code: codingerror
- line 641 of /cache/stores/file/lib.php: coding_exception thrown
- line 432 of /cache/stores/file/lib.php: call to cachestore_file->ensure_path_exists()
- line 512 of /cache/classes/loaders.php: call to cachestore_file->set()
- line 1309 of /cache/classes/loaders.php: call to cache->set()
- line 340 of /cache/classes/loaders.php: call to cache_application->set()
- line 1374 of /cache/classes/loaders.php: call to cache->get()
- line 480 of /question/engine/bank.php: call to cache_application->get()
- line 255 of /question/engine/bank.php: call to question_finder->load_question_data()
- line 274 of /question/engine/bank.php: call to question_bank::load_question_data()
- line 46 of /question/preview.php: call to question_bank::load_question()
Thanks for your help
Looks like I've found the solution:
Just tried Development/Purge all caches, it gave pages of errors because it couldn't read the moodledata directory. The permissions were set to 755. I set them to 777 and ran Purge all Caches again, this time there were no errors.
I then went and looked at one of the quizzes and all the questions are now visible! I have also reset the permissions to 755. So, I guess the problem is solved but I'm wondering if it is going to re-occur sometime in the future. 755 has always worked in the past but are there any recommendations for other settings, 770 or 700?
Thanks for this thread. It helped me to quickly resolve my issue. I will elaborate on my own situation.
My site's Moodledata had permissions 770. I set it to 775 and the problem was resolved.
This seemed particularly odd to me, as the folder is owned by apache:apache, and the moodledata folder should be (is) only accessed by 'apache'.
I saw that at least one child folder was owned by root... I ran a 'sudo chown 775 moodledata -R' on the folder, and the problem was then solved - functioning quizes with only 770 access.
I'm a little baffled by this, as I had previously chowned the whole folder to apache:apache. I'm not sure what could be changing some of the contents to root ownership? Maybe I had a sysadmin space cadet day...
tl;dr - check that there aren't some subfolders/files in your moodledata that are owned by someone else