Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

H5P activity grader class.

Copyright: 2020 Ferran Recio <ferran@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 214 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: grader  - X-Ref

Class for handling H5P activity grading.

__construct(stdClass $instance, string $idnumber = '')   X-Ref
Class contructor.

param: stdClass $instance H5Pactivity instance object
param: string $idnumber course_modules idnumber

grade_item_delete()   X-Ref
Delete grade item for given mod_h5pactivity instance.

return: int Returns GRADE_UPDATE_OK, GRADE_UPDATE_FAILED, GRADE_UPDATE_MULTIPLE or GRADE_UPDATE_ITEM_LOCKED

grade_item_update($grades = null)   X-Ref
Creates or updates grade item for the given mod_h5pactivity instance.

param: mixed $grades optional array/object of grade(s); 'reset' means reset grades in gradebook
return: int 0 if ok, error code otherwise

update_grades(int $userid = 0)   X-Ref
Update grades in the gradebook.

param: int $userid Update grade of specific user only, 0 means all participants.

get_user_grades_for_gradebook(int $userid = 0)   X-Ref
Get an updated list of user grades and feedback for the gradebook.

param: int $userid int or 0 for all users
return: array of grade data formated for the gradebook api

get_user_grades_for_deletion(int $userid = 0)   X-Ref
Get an deletion list of user grades and feedback for the gradebook.

This method is used to delete all autmatic gradings when grading method is set to manual.

param: int $userid int or 0 for all users
return: array of grade data formated for the gradebook api