== Can you help with this?
== I have had some random problems in my Moodle course recently (Sporadic errors on restore, and on delete course. Safari producing a "Can't open this page" error). Looking for the cause, I ran /admin/tool/health and got a report telling me that some question categories and parent categories should be the same, but are not.
== To separate them from the Moodle report, my comments begin with the equal signs.
== "Health" reported 11 instances, listed below. (Attached: a screenshot of the table, so you can see the columns better.)
== First in the report were the following lines, repeated many times. I don't know how to make sense of them.
Did you remember to make the first column something unique in your call to get_records? Duplicate value '6141' found in column 'parentid'.
line 1254 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
line 567 of /admin/tool/health/index.php: call to mysqli_native_moodle_database->get_records_sql()
line 84 of /admin/tool/health/index.php: call to problem_000016->description()
line 53 of /admin/tool/health/index.php: call to health_find_problems()
== Those repeated lines were followed by this table:
Question categories should belong to the same context as their parent
When one question category is the parent of another, then they should both belong to the same context. This is not true for the following categories:
Child category Parent category
Id Name Context id Id Name Context id
6389 Default for Irregular Verbs, 4 3812 6141 top 3644
6879 Default for Quiz 1 - Take this first! 4364 7124 top 4008
7002 Default for Irregular Verbs Unit 1 Review 4350 7185 top 4172
7004 Default for Irregular Verbs, 5 4353 7156 top 4175
7005 Default for Irregular Verbs, 6 4354 7157 top 4176
7006 Default for Irregular Verbs Unit 2 Review 4355 7158 top 4177
7007 Default for Irregular Verbs, All - Random Selection of Questions 4356 7159 top 4178
7008 Default for Lay and Lie, 1 4359 7160 top 4181
7011 Default for Passives, 1 4364 7163 top 4186
7012 Default for Passives, 2 4365 7164 top 4187
7013 Default for Passives Review - Random Selection of Questions 4366 7165 top 4188
== Clicking the box in the table produced this:
Solution
An automated solution is difficult. It depends whether the parent or child category is in the wrong pace. People in the Quiz forum may be able to help.
== Environment: Running Moodle 3.5.3+ on Linux on a LiquidWeb VPS, with cPanel. The server uses mod_security. Plug-ins: Hot Potatoes. Essential theme.
== The course contains many quizzes. It has worked well for a number of years, with ongoing updates and corrections to content.