MDL-20636 lib/Questionlib fixed calls to question_delete_question() #381
authorColin Chambers <c.chambers@open.ac.uk>
Fri, 8 Apr 2011 14:56:05 +0000 (15:56 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 8 Apr 2011 15:21:47 +0000 (16:21 +0100)
lib/questionlib.php

index 2292117..239d58a 100644 (file)
@@ -389,7 +389,7 @@ function question_delete_question($questionid) {
     if ($children = $DB->get_records('question', array('parent' => $questionid), '', 'id,qtype')) {
         foreach ($children as $child) {
             if ($child->id != $questionid) {
-                delete_question($child->id);
+                question_delete_question($child->id);
             }
         }
     }
@@ -428,7 +428,7 @@ function question_delete_course($course, $feedback=true) {
             //deleting questions
             if ($questions = $DB->get_records('question', array('category' => $category->id), '', 'id,qtype')) {
                 foreach ($questions as $question) {
-                    delete_question($question->id);
+                    question_delete_question($question->id);
                 }
                 $DB->delete_records("question", array("category"=>$category->id));
             }
@@ -477,7 +477,7 @@ function question_delete_course_category($category, $newcategory, $feedback=true
 
                     // Try to delete each question.
                     foreach ($questions as $question) {
-                        delete_question($question->id);
+                        question_delete_question($question->id);
                     }
 
                     // Check to see if there were any questions that were kept because they are
@@ -586,7 +586,7 @@ function question_delete_activity($cm, $feedback=true) {
             //deleting questions
             if ($questions = $DB->get_records('question', array('category' => $category->id), '', 'id,qtype')) {
                 foreach ($questions as $question) {
-                    delete_question($question->id);
+                    question_delete_question($question->id);
                 }
                 $DB->delete_records("question", array("category"=>$category->id));
             }