Skip to content

Commit

Permalink
MDL-75719 completion: Fix viewed criteria.
Browse files Browse the repository at this point in the history
When we unlock completion criteria and save changes 'viewed' criteria
still should be completed if user has viewed activity before. Seems
that that was broken by recent changes. Fixing here.
  • Loading branch information
ilyatregubov committed Mar 2, 2023
1 parent 64efaed commit 710fa8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/completionlib.php
Expand Up @@ -1116,6 +1116,9 @@ public function get_data($cm, $wholecourse = false, $userid = 0, $unused = null)

if (empty($data->coursemoduleid)) {
$cacheddata[$data->cmid] = $defaultdata;
if ($data->viewed) {
$cacheddata[$data->cmid]['viewed'] = $data->viewed;
}
$cacheddata[$data->cmid]['coursemoduleid'] = $data->cmid;
} else {
unset($data->cmid);
Expand Down

0 comments on commit 710fa8e

Please sign in to comment.