From 18352a55f5a728f85315e9b131c98c3929b53dcf Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 21 Jan 2004 17:13:55 +0000 Subject: [PATCH] For now just avoid public categories. 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index a8f6d3d67c..22b1786f4f 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -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) { -- 2.39.5