Hello,
More than 2 years ago, i asked question about health.php in Moodle 1.9, and "Question categories should belong to a valid context" error. Finally, i hadn't corrected everything
We installed in june 2013 a new Moodle 2.4 platform, but taken backups from our old 1.9 Moodle (started with Moodle 1.4 or 1.5, and upgraded with 1.6 and 1.8). Last year, we upgraded to 2.7. So, i'm now on Moodle 2.7.4, and i still have these problems.
When i run moodle/admin/tool/health on one of my Moodle instances, i have 1 category (id=87) without a valid context, that contains 4 questions.
To have details, i've run :
SELECT id, category, qtype, from_unixtime(timecreated) AS created, createdby, from_unixtime(timemodified) AS modified, modifiedby, name, questiontext FROM mdl_question WHERE category IN (87);
It shows me these questions : 516,517,518,519
I've run these commands, to check :
SELECT COUNT(1) FROM mdl_question_answers WHERE question IN (516,517,518,519);
SELECT COUNT(1) FROM mdl_question_attempts WHERE questionid IN (516,517,518,519);
It returns nothing, so i think i can modify the category, to point to a new dedicated (temporary) course, and then delete these questions.
Are my requests Ok? Do i have to check other tables (before deleting things)?
Don't hesitate to provide more details and/or tools that could help me to correct problems in my Moodle DB.
Thanks in advance,
Séverin