You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a course, when you use metadata local plugin for a scorm module, I suspect something is overriding scorm availabiliy field. The steps for replying the problem are:
Step 1. Upload a scorm package and configure Restrict access date. For example I want to allow access to scorm package for student from an specific date until other date.
Step 2. Later, when I edit Scorm setting, both restrisct access date are displayed in Availability field label.
This problem only ocurrs when you use local_metadata plugins for module. I reported this bug in Moodle tracker, https://tracker.moodle.org/browse/MDL-66155 , and they closed it because this bug relates to 3rd party code.
Although nearly 2 years on, we have just run into this same problem. It is not specific to SCORM activities but rather all activities - i.e.
Enable local_metadata for modules and add some fields
Go to the 'Edit Settings' page for an activity
Set a restriction under the 'Restrict Access' section (this does not need to be date based)
Save and then go back to the activity 'Edit Settings' page
The 'Availability' section title has been replaced by the underlying 'Restrict Access' configuration (which is a JSON string)
On further investigation this happens in the coursemodule_standard_elements function in the context_handler.php file.
This function first adds the metadata heading and fields to the form (which works fine). However after that is sets the entirety of the form data using a copy of the module/activity instance.
This data structure does not map to the form data and there are name clashes - namely the 'availability' data field in the instance matches the 'availability' form field in the form which then gets overridden.
To fix this my suggestion would be to only pass the metadata plugin's field data to the form set_data function. i.e. build the metadata specific data structure during the loop which creates the form fields and then pass that to the function call.
I will be doing this on our instance of Moodle and will report back with a specific fix.
In a course, when you use metadata local plugin for a scorm module, I suspect something is overriding scorm availabiliy field. The steps for replying the problem are:
Step 1. Upload a scorm package and configure Restrict access date. For example I want to allow access to scorm package for student from an specific date until other date.
Step 2. Later, when I edit Scorm setting, both restrisct access date are displayed in Availability field label.
This problem only ocurrs when you use local_metadata plugins for module. I reported this bug in Moodle tracker, https://tracker.moodle.org/browse/MDL-66155 , and they closed it because this bug relates to 3rd party code.
I attach two urls for showing two screenshot:
Step1
Step2
Thanks
The text was updated successfully, but these errors were encountered: