Open Urpokarhu1 opened 3 years ago
I did some debugging and found out that the "Course completion > Default activity completion" page saves the custom completion rules as JSON string to course_completion_defaults
table:
{"modids":{"12":12},"id":1052,"completionunlocked":1,"completionpass":0,"submitbutton":"Save changes","disable":15}
That JSON is decoded and added to the $defaultvalues
array used in the activity edit/update form (mod_form.php). That form uses $defaultvalues['id']
to check if H5P activity/content already exists. But that fails because the id parameter saved to completion defaults is actually course id and not mod_hvp.id.
Hello! This problem occurs also with Moodle 3.3.9 & mod_hvp 1.21.0 If it doesn't exists an hvp activity with that id you get the error 'invalidhvp' bup if exists any hvp activity with that id in the Moodle instance, then you get the form to edit that activity. in any case you cannot add a new H5P activity in the course.
Hello,
You cannot add any H5P activities at all to the course after you have bulk edited existing H5P activitity course completion settings. Tested with Moodle 3.9 & mod_hvp 1.21.0
Steps to repeat:
Create a new course
Create two h5p activities, set "activity completion" to "students can manually mark the activity as completed" in both of them.
Open course completion page -> Default activity completion -tab-> select interactive content -> edit
Change completion to something else than "students can manually mark the activity as completed"
Save
Try to add new H5p activity on the course
Notice that you cannot and you get an error
Browser console: