adlnet / Moodle-mod_cmi5launch

A Moodle plugin which allows teachers to upload cmi5 packaged lessons within a Moodle Course Activity and then assign the activity to students
Apache License 2.0
5 stars 5 forks source link

Remove the "Mark as done" button #16

Closed FlorianTolk closed 8 months ago

FlorianTolk commented 1 year ago

Is your feature request related to a problem? Please describe. Currently there is a button labeled "Mark as Done" that is a leftover from the xAPI launch link plugin.

Describe the solution you'd like Remove this button from the UI.

davidpesce commented 1 year ago

This isn't something you can do via the plugin. All Moodle (activity/mod) plugins must implement the completion API. The "Mark as done" course setting should be adjusted to require some xAPI verb (completion/passed). You can look at the mod_tincanlaunch plugin for inspiration. That said, the periodic cron that runs (mod_tincanlaunch) is EXTREMELY inefficient and was designed around testing. It will need to be rewritten to implement an efficient way of retrieving the completion status.

FlorianTolk commented 1 year ago

@davidpesce, thanks for the clarification! Currently we update the "view" based off what is found in the LRS, but do not use all of Moodle's APIs, so this is really good to know.

This means when we get a completed or pass/fail statement we will want to let the completion API know instead of using this button.

@ADLMeganBohland is closer to this project, so she may have more data on how we currently handle completions.

davidpesce commented 1 year ago

Yeah, some complexities were resolved in newer versions of the mod_tincanlaunch plugin after it was copied here. I'd recommend taking a look at some of them. There are also scenarios in which the completion statement is not returned to the player and that's where the CRON task comes in. If the player fails to retrieve the completion, the user can re-launch the player to attempt retrieval again.

ADLMeganBohland commented 1 year ago

@davidpesce As Florian mentions above, we are not currently using the Moodle completion API yet, although it's definitely something I will look into. As for the cron, I actually have implemented my own LRS query. It runs whenever the user pulls up their view page, since we currently have their status shown there. It runs and then updates their status if need be.

davidpesce commented 1 year ago

Oh, excellent! Could you point me to it? I'm curious if I can improve that functionality within mod_tincanlaunch.

ADLMeganBohland commented 1 year ago

@davidpesce Of course, although there may be a benefit to using the cron, so I'll definitely investigate that option. In view.php on line 215 I call 'getregistraioninfo' which is a function I created from a new class I made called cmi5_connectors. It queries the cmi5 player the plugin uses, and this player keeps track of whether the AUs are satisfied or not. Hypothetically, it could also query an LRS here. The idea was that whenever a student loads the course, it gives them updated info. However, Florian did point out if a browser closes before that page is loaded, Moodle would not know it was completed until the page was loaded again.

So if I can utilize the completion API, that may solve that issue.

ADLMeganBohland commented 8 months ago

@FlorianTolk By removing the code for 'completion' API, this appears to have solved the issue. Later if we choose we can integrate completion into our plugin.