Skip to content

Commit

Permalink
MDL-47232 completion: Completed and failed activities count as completed
Browse files Browse the repository at this point in the history
  • Loading branch information
sensei-hacker authored and David Monllao committed Jan 8, 2015
1 parent 2e02eab commit 2cc8d56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion completion/criteria/completion_criteria_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function review($completion, $mark = true) {
$data = $info->get_data($cm, false, $completion->userid);

// If the activity is complete
if (in_array($data->completionstate, array(COMPLETION_COMPLETE, COMPLETION_COMPLETE_PASS))) {
if (in_array($data->completionstate, array(COMPLETION_COMPLETE, COMPLETION_COMPLETE_PASS, COMPLETION_COMPLETE_FAIL))) {
if ($mark) {
$completion->mark_complete();
}
Expand Down Expand Up @@ -229,6 +229,7 @@ public function cron() {
AND (
mc.completionstate = '.COMPLETION_COMPLETE.'
OR mc.completionstate = '.COMPLETION_COMPLETE_PASS.'
OR mc.completionstate = '.COMPLETION_COMPLETE_FAIL.'
)
';

Expand Down

0 comments on commit 2cc8d56

Please sign in to comment.