From 81f64ed3a445b61b7203614188d5b731079f58ce Mon Sep 17 00:00:00 2001 From: sam_marshall Date: Thu, 31 Jul 2008 14:42:29 +0000 Subject: [PATCH] MDL-15498: Completion: resetting state failed when activity set to manual completion (caused error when unlocking settings) --- lib/completionlib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/completionlib.php b/lib/completionlib.php index 203f6d27a6..44ea7d87de 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -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.) - * + *

+ * 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'); -- 2.39.5