MDL-41580 SCORM: add helper function and validation in mod_form