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 7f3fe1f..fc65b95 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;