General help

Missing activity completion option: only via API

 
Picture of Halley Media
Missing activity completion option: only via API
 

Hi there,
I added a new "URL" activity to a topic so that students can view content provided by our remote website. The embedding part is fine as it is: I can configure which parameters will be passed to the URL (such as userid and cmid) and then the content is shown just fine in a iframe. 

Now we need to track activity completion but none of the three existing options are suited to our case.

  • Do not indicate activity completion. Not good because we have to show activity completion;
  • Students can manually mark the activity as completed. Not good because students are not allowed to manually mark activies as completed.
  • Show activity as complete when conditions are met. Not good because then I must select the only condition available, which is "Student must view this activity to complete it". This will mark the activity as complete as soon as the student visits the activity page which is not a true indication of completion, is it?

Instead, our students will have to interact with the remote content provided by our website and it will be us to tell Moodle when completion occurs, by calling the core_completion_override_activity_completion_status function via the REST api. Completion must not be set by any other means.

So, I though a fourth option might be useful.

  • Show activity but only the remote website is allowed to mark completion via API


At present, I'm using a workaround which is far from ideal: I'm using the "Show activity as complete when conditions are met" option and then, as soon as our page is requested, I set the completion status back to 0 by calling the Moodle REST API. When the student has completed the activity, then I finally call it again and set it to 1.

Is there any other workaround (or better solution) I could use in the meantime?
Thanks in advance.

 
Average of ratings: -
Picture of Howard Miller
Re: Missing activity completion option: only via API
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Not that I am aware of. 

Availability conditions are pluggable, so you could write one to do this. 

Examples - https://moodle.org/plugins/browse.php?list=category&id=57

 
Average of ratings: Useful (1)
Picture of Halley Media
Re: Missing activity completion option: only via API
 

Nice to know, thanks. Just to be sure: are the "availability conditions" you suggested the same thing as an "activity completion requirement"?

 
Average of ratings: -
Picture of Howard Miller
Re: Missing activity completion option: only via API
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Indeed they are.

 
Average of ratings: Useful (1)
Picture of Halley Media
Re: Missing activity completion option: only via API
 

Good, I'll get to work. Thanks for the examples you provided.

 
Average of ratings: -