]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10767 - set values of checkboxes correctly
authordanmarsden <danmarsden>
Wed, 27 Aug 2008 22:02:16 +0000 (22:02 +0000)
committerdanmarsden <danmarsden>
Wed, 27 Aug 2008 22:02:16 +0000 (22:02 +0000)
mod/scorm/mod_form.php

index 229427588ae2a87ebf0614fdcb787180a48c4039..669cb1bd6ec3398254bf4bd3b6d71a054b45f855 100644 (file)
@@ -252,6 +252,22 @@ class mod_scorm_mod_form extends moodleform_mod {
 
         return $errors;
     }
-
+    //need to translate the "options" field.
+    function set_data($default_values) {
+        if (is_object($default_values)) {
+            if (!empty($default_values->options)) {
+                $options = explode(',', $default_values->options);
+                foreach ($options as $option) {
+                    $opt = explode('=', $option);
+                    if (isset($opt[1])) {
+                        $default_values->$opt[0] = $opt[1];
+                    }
+                }
+            }
+            $default_values = (array)$default_values;
+        }
+        $this->data_preprocessing($default_values);
+        parent::set_data($default_values); //never slashed for moodleform_mod
+    }
 }
 ?>
\ No newline at end of file