Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Namespaces | |
namespace | mod_h5pactivity\event |
| |
namespace | mod_h5pactivity\external |
| |
namespace | mod_h5pactivity\local |
| |
namespace | mod_h5pactivity\local\report |
| |
namespace | mod_h5pactivity\output |
| |
namespace | mod_h5pactivity\output\result |
| |
namespace | mod_h5pactivity\privacy |
| |
namespace | mod_h5pactivity\search |
| |
namespace | mod_h5pactivity\xapi |
| |
Classes | |
class | backup_h5pactivity_activity_structure_step |
Define the complete structure for backup, with file and id annotations. More... | |
class | backup_h5pactivity_activity_task |
The class provides all the settings and steps to perform one complete backup of mod_h5pactivity. More... | |
class | behat_mod_h5pactivity_generator |
class | mod_h5pactivity\event\course_module_instance_list_viewed |
The course_module_instance_list_viewed event class. More... | |
class | mod_h5pactivity\event\course_module_viewed |
The course_module_viewed event class. More... | |
class | mod_h5pactivity\event\statement_received |
The statement_received event class. More... | |
class | mod_h5pactivity\external\get_attempts |
class | mod_h5pactivity\external\get_results |
class | mod_h5pactivity\external\get_user_attempts |
class | mod_h5pactivity\external\h5pactivity_summary_exporter |
Class for exporting h5p activity data. More... | |
class | mod_h5pactivity\external\log_report_viewed |
class | mod_h5pactivity\external\log_report_viewed_testcase |
External function test for log_report_viewed. More... | |
class | mod_h5pactivity\external\view_h5pactivity |
class | mod_h5pactivity\local\attempt |
Class attempt for H5P activity. More... | |
class | mod_h5pactivity\local\grader |
Class for handling H5P activity grading. More... | |
class | mod_h5pactivity\local\manager |
Class manager for H5P activity. More... | |
interface | mod_h5pactivity\local\report |
Interface for any mod_h5pactivity report. More... | |
class | mod_h5pactivity\local\report\attempts |
Class H5P activity attempts report. More... | |
class | mod_h5pactivity\local\report\participants |
Class H5P activity participants report. More... | |
class | mod_h5pactivity\local\report\results |
Class H5P activity results report. More... | |
class | mod_h5pactivity\output\attempt |
Class to help display report link in mod_h5pactivity. More... | |
class | mod_h5pactivity\output\reportattempts |
Class to output an attempts report on mod_h5pactivity. More... | |
class | mod_h5pactivity\output\reportlink |
Class to help display report link in mod_h5pactivity. More... | |
class | mod_h5pactivity\output\reportresults |
Class to display the result report in mod_h5pactivity. More... | |
class | mod_h5pactivity\output\result |
Class to display an attempt tesult in mod_h5pactivity. More... | |
class | mod_h5pactivity\output\result\choice |
Class to display H5P choice result. More... | |
class | mod_h5pactivity\output\result\fillin |
Class to display H5P fill-in result. More... | |
class | mod_h5pactivity\output\result\longfillin |
Class to display H5P long fill in result. More... | |
class | mod_h5pactivity\output\result\matching |
Class to display H5P matching result. More... | |
class | mod_h5pactivity\output\result\other |
Class to display H5P other result. More... | |
class | mod_h5pactivity\output\result\sequencing |
Class to display H5P sequencing result. More... | |
class | mod_h5pactivity\output\result\truefalse |
Class to display H5P choice result. More... | |
class | mod_h5pactivity\privacy\provider |
class | mod_h5pactivity\search\activity |
Search area for mod_h5pactivity activities. More... | |
class | mod_h5pactivity\xapi\handler |
class | mod_h5pactivity_generator |
h5pactivity module data generator class. More... | |
class | mod_h5pactivity_mod_form |
Module instance settings form. More... | |
class | restore_h5pactivity_activity_structure_step |
Defines the structure step to restore one mod_h5pactivity activity. More... | |
class | restore_h5pactivity_activity_task |
Restore task for mod_h5pactivity. More... | |
Functions | |
h5pactivity_add_instance (stdClass $data, mod_h5pactivity_mod_form $mform=null) | |
Saves a new instance of the mod_h5pactivity into the database. | |
h5pactivity_check_updates_since (cm_info $cm, int $from, array $filter=[]) | |
Check if the module has any update that affects the current user since a given time. | |
h5pactivity_delete_instance (int $id) | |
Removes an instance of the mod_h5pactivity from the database. | |
h5pactivity_dndupload_handle ($uploadinfo) | |
Handle a file that has been uploaded. | |
h5pactivity_dndupload_register () | |
Register the ability to handle drag and drop file uploads. | |
h5pactivity_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $h5pactivitynode=null) | |
Extends the settings navigation with the H5P activity settings. | |
h5pactivity_fetch_recent_activity (array $submissions, int $courseid) | |
Fetches recent activity for course module. | |
h5pactivity_get_file_areas (stdClass $course, stdClass $cm, stdClass $context) | |
Returns the lists of all browsable file areas within the given module context. | |
h5pactivity_get_file_info (file_browser $browser, array $areas, stdClass $course, stdClass $cm, context $context, string $filearea, ?int $itemid=null, ?string $filepath=null, ?string $filename=null) | |
File browsing support for data module. | |
h5pactivity_get_recent_mod_activity (array &$activities, int &$index, int $timestart, int $courseid, int $cmid, int $userid=0, int $groupid=0) | |
Returns all h5pactivities since a given time. | |
h5pactivity_grade_item_delete (stdClass $moduleinstance) | |
Delete grade item for given mod_h5pactivity instance. | |
h5pactivity_grade_item_update (stdClass $moduleinstance, $grades=null) | |
Creates or updates grade item for the given mod_h5pactivity instance. | |
h5pactivity_is_branded () | |
Whether the activity is branded. | |
h5pactivity_page_type_list (string $pagetype, ?stdClass $parentcontext, stdClass $currentcontext) | |
Return a list of page types. | |
h5pactivity_pluginfile ($course, $cm, context $context, string $filearea, array $args, bool $forcedownload, array $options=[]) | |
Serves the files from the mod_h5pactivity file areas. | |
h5pactivity_print_recent_activity ($course, bool $viewfullnames, int $timestart) | |
Print recent activity from all h5pactivities in a given course. | |
h5pactivity_print_recent_mod_activity (stdClass $activity, int $courseid, bool $detail, array $modnames) | |
Print recent activity from all h5pactivities in a given course. | |
h5pactivity_rescale_activity_grades (stdClass $course, stdClass $cm, float $oldmin, float $oldmax, float $newmin, float $newmax) | |
Rescale all grades for this activity and push the new grades to the gradebook. | |
h5pactivity_reset_course_form_defaults (stdClass $course) | |
Course reset form defaults. | |
h5pactivity_reset_course_form_definition (&$mform) | |
Implementation of the function for printing the form elements that control whether the course reset functionality affects the H5P activity. | |
h5pactivity_reset_gradebook (int $courseid, string $type='') | |
Removes all grades from gradebook. | |
h5pactivity_reset_userdata (stdClass $data) | |
This function is used by the reset_course_userdata function in moodlelib. | |
h5pactivity_scale_used_anywhere (int $scaleid) | |
Checks if scale is being used by any instance of mod_h5pactivity. | |
h5pactivity_set_mainfile (stdClass $data) | |
Saves draft files as the activity package. | |
h5pactivity_supports (string $feature) | |
Checks if H5P activity supports a specific feature. | |
h5pactivity_update_grades (stdClass $moduleinstance, int $userid=0) | |
Update mod_h5pactivity grades in the gradebook. | |
h5pactivity_update_instance (stdClass $data, mod_h5pactivity_mod_form $mform=null) | |
Updates an instance of the mod_h5pactivity in the database. | |
xmldb_h5pactivity_upgrade ($oldversion) | |
Function to upgrade mod_h5pactivity. | |
h5pactivity_add_instance | ( | stdClass | $data, |
mod_h5pactivity_mod_form | $mform = null ) |
Saves a new instance of the mod_h5pactivity into the database.
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the instance.
stdClass | $data | An object from the form. |
mod_h5pactivity_mod_form | $mform | The form. |
int | The id of the newly inserted record. |
h5pactivity_check_updates_since | ( | cm_info | $cm, |
int | $from, | ||
array | $filter = [] ) |
Check if the module has any update that affects the current user since a given time.
cm_info | $cm | course module data |
int | $from | the time to check updates from |
array | $filter | if we need to check only specific updates |
stdClass | an object with the different type of areas indicating if they were updated or not |
h5pactivity_delete_instance | ( | int | $id | ) |
Removes an instance of the mod_h5pactivity from the database.
int | $id | Id of the module instance. |
bool | True if successful, false on failure. |
h5pactivity_dndupload_handle | ( | $uploadinfo | ) |
Handle a file that has been uploaded.
object | $uploadinfo | details of the file / content that has been uploaded |
int | instance id of the newly created mod |
h5pactivity_dndupload_register | ( | ) |
Register the ability to handle drag and drop file uploads.
array | containing details of the files / types the mod can handle |
h5pactivity_extend_settings_navigation | ( | settings_navigation | $settingsnav, |
navigation_node | $h5pactivitynode = null ) |
Extends the settings navigation with the H5P activity settings.
This function is called when the context for the page is an H5P activity. This is not called by AJAX so it is safe to rely on the $PAGE.
settings_navigation | $settingsnav | The settings navigation object |
navigation_node | $h5pactivitynode | The node to add module settings to |
h5pactivity_fetch_recent_activity | ( | array | $submissions, |
int | $courseid ) |
Fetches recent activity for course module.
array | $submissions | The activity submissions |
int | $courseid | Limit the search to this course |
array\$recentactivity | recent activity in a course. |
h5pactivity_get_file_areas | ( | stdClass | $course, |
stdClass | $cm, | ||
stdClass | $context ) |
Returns the lists of all browsable file areas within the given module context.
The file area 'intro' for the activity introduction field is added automatically by file_browser::get_file_info_context_module().
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
string[] | array of pair file area => human file area name |
h5pactivity_get_file_info | ( | file_browser | $browser, |
array | $areas, | ||
stdClass | $course, | ||
stdClass | $cm, | ||
context | $context, | ||
string | $filearea, | ||
?int | $itemid = null, | ||
?string | $filepath = null, | ||
?string | $filename = null ) |
File browsing support for data module.
file_browser | $browser | |
array | $areas | |
stdClass | $course | |
stdClass | $cm | |
context | $context | |
string | $filearea | |
int | null | $itemid | |
string | null | $filepath | |
string | null | $filename |
file_info_stored|null | file_info_stored instance or null if not found |
h5pactivity_get_recent_mod_activity | ( | array & | $activities, |
int & | $index, | ||
int | $timestart, | ||
int | $courseid, | ||
int | $cmid, | ||
int | $userid = 0, | ||
int | $groupid = 0 ) |
Returns all h5pactivities since a given time.
array | $activities | The activity information is returned in this array |
int | $index | The current index in the activities array |
int | $timestart | The earliest activity to show |
int | $courseid | Limit the search to this course |
int | $cmid | The course module id |
int | $userid | Optional user id |
int | $groupid | Optional group id |
void |
h5pactivity_grade_item_delete | ( | stdClass | $moduleinstance | ) |
Delete grade item for given mod_h5pactivity instance.
stdClass | $moduleinstance | Instance object. |
int | Returns GRADE_UPDATE_OK, GRADE_UPDATE_FAILED, GRADE_UPDATE_MULTIPLE or GRADE_UPDATE_ITEM_LOCKED |
h5pactivity_grade_item_update | ( | stdClass | $moduleinstance, |
$grades = null ) |
Creates or updates grade item for the given mod_h5pactivity instance.
Needed by grade_update_mod_grades().
stdClass | $moduleinstance | Instance object with extra cmidnumber and modname property. |
mixed | $grades | optional array/object of grade(s); 'reset' means reset grades in gradebook |
int | int 0 if ok, error code otherwise |
h5pactivity_is_branded | ( | ) |
Whether the activity is branded.
This information is used, for instance, to decide if a filter should be applied to the icon or not.
bool | True if the activity is branded, false otherwise. |
h5pactivity_page_type_list | ( | string | $pagetype, |
?stdClass | $parentcontext, | ||
stdClass | $currentcontext ) |
Return a list of page types.
string | $pagetype | current page type |
stdClass | null | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
array | array of page types and it's names |
h5pactivity_pluginfile | ( | $course, | |
$cm, | |||
context | $context, | ||
string | $filearea, | ||
array | $args, | ||
bool | $forcedownload, | ||
array | $options = [] ) |
Serves the files from the mod_h5pactivity file areas.
mixed | $course | course or id of the course |
mixed | $cm | course module or id of the course module |
context | $context | |
string | $filearea | |
array | $args | |
bool | $forcedownload | |
array | $options | additional options affecting the file serving |
bool | false if file not found, does not return if found - just send the file |
h5pactivity_print_recent_activity | ( | $course, | |
bool | $viewfullnames, | ||
int | $timestart ) |
Print recent activity from all h5pactivities in a given course.
This is used by the recent activity block
mixed | $course | the course to print activity for |
bool | $viewfullnames | boolean to determine whether to show full names or not |
int | $timestart | the time the rendering started |
bool | true if activity was printed, false otherwise. |
h5pactivity_print_recent_mod_activity | ( | stdClass | $activity, |
int | $courseid, | ||
bool | $detail, | ||
array | $modnames ) |
Print recent activity from all h5pactivities in a given course.
This is used by course/recent.php
stdClass | $activity | |
int | $courseid | |
bool | $detail | |
array | $modnames |
h5pactivity_rescale_activity_grades | ( | stdClass | $course, |
stdClass | $cm, | ||
float | $oldmin, | ||
float | $oldmax, | ||
float | $newmin, | ||
float | $newmax ) |
Rescale all grades for this activity and push the new grades to the gradebook.
stdClass | $course | Course db record |
stdClass | $cm | Course module db record |
float | $oldmin | |
float | $oldmax | |
float | $newmin | |
float | $newmax |
bool | true if reescale is successful |
h5pactivity_reset_course_form_defaults | ( | stdClass | $course | ) |
Course reset form defaults.
stdClass | $course | the course object |
array |
h5pactivity_reset_course_form_definition | ( | & | $mform | ) |
Implementation of the function for printing the form elements that control whether the course reset functionality affects the H5P activity.
MoodleQuickForm | $mform | form passed by reference |
h5pactivity_reset_gradebook | ( | int | $courseid, |
string | $type = '' ) |
Removes all grades from gradebook.
int | $courseid | Coude ID |
string | $type | optional type (default '') |
h5pactivity_reset_userdata | ( | stdClass | $data | ) |
This function is used by the reset_course_userdata function in moodlelib.
This function will remove all H5P attempts in the database and clean up any related data.
stdClass | $data | the data submitted from the reset course. |
array | of reseting status |
h5pactivity_scale_used_anywhere | ( | int | $scaleid | ) |
Checks if scale is being used by any instance of mod_h5pactivity.
This is used to find out if scale used anywhere.
int | $scaleid | ID of the scale. |
bool | True if the scale is used by any mod_h5pactivity instance. |
h5pactivity_set_mainfile | ( | stdClass | $data | ) |
Saves draft files as the activity package.
stdClass | $data | an object from the form |
h5pactivity_supports | ( | string | $feature | ) |
Checks if H5P activity supports a specific feature.
@uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_SHOW_DESCRIPTION @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_COMPLETION_HAS_RULES @uses FEATURE_MODEDIT_DEFAULT_COMPLETION @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES @uses FEATURE_BACKUP_MOODLE2
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
h5pactivity_update_grades | ( | stdClass | $moduleinstance, |
int | $userid = 0 ) |
Update mod_h5pactivity grades in the gradebook.
Needed by grade_update_mod_grades().
stdClass | $moduleinstance | Instance object with extra cmidnumber and modname property. |
int | $userid | Update grade of specific user only, 0 means all participants. |
h5pactivity_update_instance | ( | stdClass | $data, |
mod_h5pactivity_mod_form | $mform = null ) |
Updates an instance of the mod_h5pactivity in the database.
Given an object containing all the necessary data (defined in mod_form.php), this function will update an existing instance with new data.
stdClass | $data | An object from the form in mod_form.php. |
mod_h5pactivity_mod_form | $mform | The form. |
bool | True if successful, false otherwise. |
xmldb_h5pactivity_upgrade | ( | $oldversion | ) |
Function to upgrade mod_h5pactivity.
int | $oldversion | the version we are upgrading from |
bool | result |