]> git.mjollnir.org Git - moodle.git/commitdiff
For now just avoid public categories.
authormoodler <moodler>
Wed, 21 Jan 2004 17:13:55 +0000 (17:13 +0000)
committermoodler <moodler>
Wed, 21 Jan 2004 17:13:55 +0000 (17:13 +0000)
It would be nice if instead a check was made to make sure that the
category wasn't being used by other courses, then even public
categories could be deleted.

mod/quiz/lib.php

index a8f6d3d67cbabc0dcbe6034c057cb2288de0f5dd..22b1786f4f9eef0248bb78e580cef21090ee39d3 100644 (file)
@@ -168,9 +168,9 @@ function quiz_delete_instance($id) {
 function quiz_delete_course($course) {
 /// Given a course object, this function will clean up anything that
 /// would be leftover after all the instances were deleted
-/// In this case, all the quiz categories and questions
+/// In this case, all non-public quiz categories and questions
 
-    if ($categories = get_records("quiz_categories", "course", $course->id)) {
+    if ($categories = get_records_select("quiz_categories", "course = '$course->id' AND public = '0'")) {
         foreach ($categories as $category) {
             if ($questions = get_records("quiz_questions", "category", $category->id)) {
                 foreach ($questions as $question) {