Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity completion "Expect Completed on" function doesn't add entry to Calendar/Timeline block for OUwiki activities #93

Open
alexanderwilliams091 opened this issue May 30, 2022 · 1 comment

Comments

@alexanderwilliams091
Copy link

alexanderwilliams091 commented May 30, 2022

ENVIRONMENT: 3.11.6
PLUGIN RELEASE: 2017101200

Hi,

It has been observed by the institution I provide support for that the OUwiki activity does not add calendar/timeline block entries whenever the activity is set to use the 'Expect completion by' function of Activity Completion. This particular institution seldom uses the plugin and left it at the above versioning. It is understood that if this same issue applies to the present release, this institution must update to benefit.

As mentioned for the same issue I raised for the OUblog It appears the Moodle core code might not automatically handle adding entries to the calendar via this field, so requires plugins to explicitly update '\core_completion\api::update_completion_date_event' instead. This was noted elsewhere for the Checklist activity via https://tracker.moodle.org/browse/CONTRIB-8344 where the following code was required to be added for it, for example: https://github.com/davosmith/moodle-checklist/commit/c2edd07cd27a8c20e80e640b5234d990185b744d.patch

STEPS TO REPLICATE:

  • Ensure either/both the Calendar/Timeline block is added to your testing course. Activity Completion should also be enabled and tracked within this test course per the course settings.

  • Add a now OUwiki activity. Under Activity Completion, set 'Completion tracking' to 'Students can manually mark the activity as completed' and set the 'Expect completion by' date to the next day. Leave all other settings default. Save and return to course.

  • Look at the Calendar/timeline block and observe there is no entry listed for the date specified.

@alexanderwilliams091
Copy link
Author

To add further, it would be best to handle this more like how other core modules --- like the Quiz --- handles this:

$completionexpected = (!empty($quiz->completionexpected)) ? $quiz->completionexpected : null;
\core_completion\api::update_completion_date_event($quiz->coursemodule, 'quiz', $quiz->id, $completionexpected);

The checklist method actually means you can never make the calendar event go away by unticking 'Expect completion by'. The way the Quiz does it means it can be un-set via the applicable tick-box, which would be the preferable outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant