]> git.mjollnir.org Git - moodle.git/commitdiff
checking that there remain $oldwrappedids before deleting them lines 87-..
authorpichetp <pichetp>
Sat, 6 Oct 2007 20:51:28 +0000 (20:51 +0000)
committerpichetp <pichetp>
Sat, 6 Oct 2007 20:51:28 +0000 (20:51 +0000)
add         if(is_array($oldwrappedids) && count($oldwrappedids)){

question/type/multianswer/questiontype.php

index 7f3fe1fd0bca3cd2464fab38efc216e20b61a842..fc65b95c0ab973530123d2c75bddb4c007b61ed5 100644 (file)
@@ -84,8 +84,10 @@ class embedded_cloze_qtype extends default_questiontype {
         }
 
         // Delete redundant wrapped questions
-        $oldwrappedids = implode(',', $oldwrappedids);
-        delete_records_select('question', "id IN ($oldwrappedids)");
+        if(is_array($oldwrappedids) && count($oldwrappedids)){ 
+            $oldwrappedids = implode(',', $oldwrappedids);
+            delete_records_select('question', "id IN ($oldwrappedids)");
+        }
 
         if (!empty($sequence)) {
             $multianswer = new stdClass;