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.