MDL-36168 SCORM: fix reset of course completion settings.
authorDan Marsden <dan@danmarsden.com>
Thu, 25 Oct 2012 04:12:52 +0000 (17:12 +1300)
committerDan Marsden <dan@danmarsden.com>
Thu, 25 Oct 2012 04:12:52 +0000 (17:12 +1300)
mod/scorm/mod_form.php

index 3d620d0..0798bc4 100644 (file)
@@ -499,7 +499,7 @@ class mod_scorm_mod_form extends moodleform_mod {
         }
 
         // Turn off completion settings if the checkboxes aren't ticked
         }
 
         // Turn off completion settings if the checkboxes aren't ticked
-        $autocompletion = !empty($data->completion) && $data->completion == COMPLETION_TRACKING_AUTOMATIC;
+        $autocompletion = isset($data->completion) && $data->completion == COMPLETION_TRACKING_AUTOMATIC;
 
         if (isset($data->completionstatusrequired) && is_array($data->completionstatusrequired)) {
             $total = 0;
 
         if (isset($data->completionstatusrequired) && is_array($data->completionstatusrequired)) {
             $total = 0;