]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15139 - Cannot create Random Short Answer questions becuase the validation code...
authortjhunt <tjhunt>
Thu, 26 Jun 2008 13:13:06 +0000 (13:13 +0000)
committertjhunt <tjhunt>
Thu, 26 Jun 2008 13:13:06 +0000 (13:13 +0000)
question/type/randomsamatch/edit_randomsamatch_form.php

index 21919fc3f233213b22eed7060de164a8e6bb7d73..72a772831c31e003ffc97e2a8121834ca3ad3742 100644 (file)
@@ -50,12 +50,11 @@ class question_edit_randomsamatch_form extends question_edit_form {
     function validation($data, $files) {
         global $QTYPES, $DB;
         $errors = parent::validation($data, $files);
-        if (isset($data['usecurrentcat'])){
-            $category = $data['category'];
-        }else{
-            $category = $data['categorymoveto'];
+        if (isset($data->categorymoveto)) {
+            list($category) = explode(',', $data['categorymoveto']);
+        } else {
+            list($category) = explode(',', $data['category']);
         }
-
         $saquestions = $QTYPES['randomsamatch']->get_sa_candidates($category);
         $numberavailable = count($saquestions);
         if ($saquestions === false){
@@ -72,6 +71,5 @@ class question_edit_randomsamatch_form extends question_edit_form {
         return $errors;
 
     }
-
 }
 ?>