MDL-32386 completion: Fix incorrect method parameters

This commit is contained in:
Aaron Barnes
2012-08-27 11:54:41 +12:00
parent 4ff0f02857
commit 40efa28d9e
2 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -614,16 +614,20 @@ class completion_info {
debugging('set_module_viewed must be called before header is printed',
DEBUG_DEVELOPER);
}
// Don't do anything if view condition is not turned on
if ($cm->completionview == COMPLETION_VIEW_NOT_REQUIRED || !$this->is_enabled($cm)) {
return;
}
// Get current completion state
$data = $this->get_data($cm, $userid);
$data = $this->get_data($cm, false, $userid);
// If we already viewed it, don't do anything
if ($data->viewed == COMPLETION_VIEWED) {
return;
}
// OK, change state, save it, and update completion
$data->viewed = COMPLETION_VIEWED;
$this->internal_set_data($cm, $data);