h5p/moodle-mod_hvp

Error grade_floatval(): Argument #1 ($number) must be of type ?float, string given

Laur0r opened this issue · 1 comments

If the completion tracking is enabled and a gradepass element is defined in the mod_form, the validation method in mod_form.php in line 341:
if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {

throws the exception grade_floatval(): Argument #1 ($number) must be of type ?float, string given whenever the form is submitted as the given $data['gradepass'] is of type string. A conversion to float is necessary here as the grade_floatval() function has been changed since Moodle 4.0 to only except float values.