h5p / moodle-mod_hvp

H5P Plugin for Moodle
GNU General Public License v3.0
131 stars 169 forks source link

Manual completion not working #508

Open PatTutor opened 1 year ago

PatTutor commented 1 year ago

An activity like H5P can be set to "manual completion", at which point the plugin does not longer control the "completion" status, but instead the user can click a button to manually complete the activity.

This does not work with H5P. Currently in "manual completion" mode, when a H5P activity completes, the H5P plugin sets the "completed" flag automatically. This is a change that only the user should be allowed to do in this mode.

This is a problem with our teachers and students: we have some H5P activities where we would like the students to use manual completion.

A plugin does not have to check for for "manual completion" by itself. Rather, the plugin should follow the guidelines how to set the completion status, and then everything works fine. The guidelines are in /lib/completionlib.php:568-579 class completion_info method update_state() (moodle 4.1.3):

 * For manual completion, this function is called when completion is toggled
 * with $possibleresult set to the target state.
 *
 * For automatic completion, this function should be called every time a module
 * does something which might influence a user's completion state. For example,
 * if a forum provides options for marking itself 'completed' once a user makes
 * N posts, this function should be called every time a user makes a new post.
 * [After the post has been saved to the database]. When calling, you do not
 * need to pass in the new completion state. Instead this function carries out completion
 * calculation by checking grades and viewed state itself, and calling the involved module
 * via mod_{modulename}\\completion\\custom_completion::get_overall_completion_state() to
 * check module-specific conditions.

So H5P should do the following changes:

Could you please follow these guidelines so that manual completion is working as well?

Many thanks! Pat