]> git.mjollnir.org Git - moodle.git/commitdiff
need to check vars aren't empty b4 using them! - another one!
authordanmarsden <danmarsden>
Wed, 12 Apr 2006 21:15:10 +0000 (21:15 +0000)
committerdanmarsden <danmarsden>
Wed, 12 Apr 2006 21:15:10 +0000 (21:15 +0000)
mod/choice/lib.php

index 9351d1abb1dd71006b42304d878b726aa0f5b0e1..9264e0904904bb926b47ee4a7c7b604f8600d10e 100644 (file)
@@ -74,7 +74,9 @@ function choice_add_instance($choice) {
                     $option = NULL;
                     $option->text = $value;
                     $option->choiceid = $choice->id;
-                    $option->maxanswers = $choice->{'newlimit'.substr($name, 9)};
+                    if (isset($choice->{'newlimit'.substr($name, 9)})) {
+                        $option->maxanswers = $choice->{'newlimit'.substr($name, 9)};
+                    }
                     $option->timemodified = time();
                     insert_record("choice_options", $option);                
                 }