]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15498: Completion: resetting state failed when activity set to manual completion...
authorsam_marshall <sam_marshall>
Thu, 31 Jul 2008 14:42:29 +0000 (14:42 +0000)
committersam_marshall <sam_marshall>
Thu, 31 Jul 2008 14:42:29 +0000 (14:42 +0000)
lib/completionlib.php

index 203f6d27a666ef31dba0128d386a671ffa86ab6c..44ea7d87de83ef0fbaf6f4dd0b70b2397636edc8 100644 (file)
@@ -347,10 +347,16 @@ class completion_info {
      * as it may cause some things to become incomplete when they were previously
      * complete, with the effect - for example - of hiding a later activity that
      * was previously available.)
-     *
+     * <p>
+     * Resetting state of manual tickbox has same result as deleting state for 
+     * it.
      * @param object $cm Activity
      */
     public function reset_all_state($cm) {
+        if($cm->completion==COMPLETION_TRACKING_MANUAL) {
+            $this->delete_all_state($cm);
+            return;
+        }
         global $DB;
         // Get current list of users with completion state
         $rs=$DB->get_recordset('course_modules_completion',array('coursemoduleid'=>$cm->id),'','userid');