MDL-15498: Completion: resetting state failed when activity set to manual completion (caused error when unlocking settings)

This commit is contained in:
sam_marshall
2008-07-31 14:42:29 +00:00
parent d39bbb8a0e
commit 81f64ed3a4
+7 -1
View 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');