catalyst / totara-mod-ojt

https://github.com/catalyst/totara-mod-ojt/wiki
5 stars 21 forks source link

Add support for "user must view activity" completion #53

Closed agwells closed 4 weeks ago

agwells commented 4 weeks ago

In #50, I assumed this plugin had support for module viewing (i.e., in activity completion, adding "user must view the module"), because it had a call to $completion->set_module_viewed_reset(). So, I added FEATURE_COMPLETION_TRACKS_VIEWS to ojt_supports().

But, it turns out I was wrong. :-P The plugin did not yet support this. It had no code to actually mark that a user had viewed the module. (So it didn't need to be calling set_module_viewed_reset(). Possibly this code was there because it was copied from another plugin.)

So that means that, since I added the flag, the completion settings for an OJT activity have a section for "User must view the module", but if it's enabled, then a learner can never complete the activity because it will never be marked as viewed.

I considered removing the FEATURE_COMPLETION_TRACKS_VIEWS flag, but then I would also need to write an upgrade script to reconfigure any activities out there that have already been created and set to "User must view the module". It seemed simpler just to add support for module view tracking.

danmarsden commented 4 weeks ago

wrong place - going for an internal review first.