Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

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

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.

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

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.

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