Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
mod_h5pactivity

Files

file  access.php
 Plugin capabilities are defined here.
 
file  attempt.php
 H5P activity attempt object.
 
file  attempt.php
 Contains class mod_h5pactivity::output::reportlink.
 
file  attempts.php
 H5P activity attempts report.
 
file  backup_h5pactivity_activity_task.class.php
 The task that provides all the steps to perform a complete backup is defined here.
 
file  backup_h5pactivity_stepslib.php
 Backup steps for mod_h5pactivity are defined here.
 
file  behat_mod_h5pactivity_generator.php
 H5P-related steps definitions.
 
file  choice.php
 Contains class mod_h5pactivity::output::result::choice.
 
file  course_module_instance_list_viewed.php
 H5P Activity list viewed event.
 
file  course_module_viewed.php
 H5P activity viewed.
 
file  coverage.php
 Coverage information for the mod_h5pactivity.
 
file  fillin.php
 Contains class mod_h5pactivity::output::result::fillin.
 
file  get_attempts.php
 This is the external method for getting the information needed to present an attempts report.
 
file  get_h5pactivities_by_courses.php
 This is the external method for returning a list of h5p activities.
 
file  get_h5pactivity_access_information.php
 This is the external method for getting access information for a h5p activity.
 
file  get_results.php
 This is the external method for getting the information needed to present a results report.
 
file  grader.php
 H5P activity grader class.
 
file  h5pactivity_summary_exporter.php
 Class for exporting h5p activity data.
 
file  handler.php
 The xapi_handler for xAPI statements.
 
file  lib.php
 Library of interface functions and constants.
 
file  lib.php
 Data generator.
 
file  longfillin.php
 Contains class mod_h5pactivity::output::result::longfillin.
 
file  manager.php
 H5P activity manager class.
 
file  matching.php
 Contains class mod_h5pactivity::output::result::matching.
 
file  mod_form.php
 The main mod_h5pactivity configuration form.
 
file  other.php
 Contains class mod_h5pactivity::output::result::other.
 
file  participants.php
 H5P activity participants report.
 
file  provider.php
 Defines mod_h5pactivity::privacy::provider class.
 
file  report.php
 H5P activity report interface.
 
file  report_viewed.php
 H5P activity report viewed.
 
file  reportattempts.php
 Contains class mod_h5pactivity::output::report::attempts.
 
 
file  reportresults.php
 Contains class mod_h5pactivity::output::reportresults.
 
file  restore_h5pactivity_activity_task.class.php
 The task that provides a complete restore of mod_h5pactivity is defined here.
 
file  restore_h5pactivity_stepslib.php
 All the steps to restore mod_h5pactivity are defined here.
 
file  result.php
 Contains class mod_h5pactivity::output::result.
 
file  results.php
 H5P activity results report.
 
file  sequencing.php
 Contains class mod_h5pactivity::output::result::sequencing.
 
file  services.php
 H5P activity external functions and service definitions.
 
file  statement_received.php
 H5P activity send an xAPI tracking statement.
 
file  truefalse.php
 Contains class mod_h5pactivity::output::result::truefalse.
 
file  upgrade.php
 This file keeps track of upgrades to the h5pactivity module.
 
file  version.php
 Plugin version and other meta-data are defined here.
 
file  view_h5pactivity.php
 This is the external method for triggering the course module viewed event.
 

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\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\report_viewed
 
class  mod_h5pactivity\event\statement_received
 The statement_received event class. More...
 
class  mod_h5pactivity\external\get_attempts
 This is the external method for getting the information needed to present an attempts report. More...
 
class  mod_h5pactivity\external\get_h5pactivities_by_courses
 This is the external method for returning a list of h5p activities. More...
 
class  mod_h5pactivity\external\get_h5pactivity_access_information
 This is the external method for getting access information for a h5p activity. More...
 
class  mod_h5pactivity\external\get_results
 This is the external method for getting the information needed to present a results report. More...
 
class  mod_h5pactivity\external\h5pactivity_summary_exporter
 Class for exporting h5p activity data. More...
 
class  mod_h5pactivity\external\view_h5pactivity
 This is the external method for triggering the course module viewed event. More...
 
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
 Privacy API implementation for the H5P activity plugin. More...
 
class  mod_h5pactivity\xapi\handler
 Class xapi_handler for H5P statements. More...
 
class  mod_h5pactivity_generator
 h5pactivity module data generator class. More...
 
class  mod_h5pactivity_mod_form
 Module instance settings form. More...
 
class  phpunit_coverage_info
 Coverage information for the tool_dataprivacy plugin. 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. More...
 
 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. More...
 
 h5pactivity_delete_instance (int $id)
 Removes an instance of the mod_h5pactivity from the database. More...
 
 h5pactivity_dndupload_handle ($uploadinfo)
 Handle a file that has been uploaded. More...
 
 h5pactivity_dndupload_register ()
 Register the ability to handle drag and drop file uploads. More...
 
 h5pactivity_get_file_areas (stdClass $course, stdClass $cm, stdClass $context)
 Returns the lists of all browsable file areas within the given module context. More...
 
 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. More...
 
 h5pactivity_grade_item_delete (stdClass $moduleinstance)
 Delete grade item for given mod_h5pactivity instance. More...
 
 h5pactivity_grade_item_update (stdClass $moduleinstance, $grades=null)
 Creates or updates grade item for the given mod_h5pactivity instance. More...
 
 h5pactivity_page_type_list (string $pagetype, ?stdClass $parentcontext, stdClass $currentcontext)
 Return a list of page types. More...
 
 h5pactivity_pluginfile ($course, $cm, context $context, string $filearea, array $args, bool $forcedownload, array $options=[])
 Serves the files from the mod_h5pactivity file areas. More...
 
 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. More...
 
 h5pactivity_reset_course_form_defaults (stdClass $course)
 Course reset form defaults. More...
 
 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. More...
 
 h5pactivity_reset_gradebook (int $courseid, string $type='')
 Removes all grades from gradebook. More...
 
 h5pactivity_reset_userdata (stdClass $data)
 This function is used by the reset_course_userdata function in moodlelib. More...
 
 h5pactivity_scale_used_anywhere (int $scaleid)
 Checks if scale is being used by any instance of mod_h5pactivity. More...
 
 h5pactivity_set_mainfile (stdClass $data)
 Saves draft files as the activity package. More...
 
 h5pactivity_supports (string $feature)
 Checks if H5P activity supports a specific feature. More...
 
 h5pactivity_update_grades (stdClass $moduleinstance, int $userid=0)
 Update mod_h5pactivity grades in the gradebook. More...
 
 h5pactivity_update_instance (stdClass $data, mod_h5pactivity_mod_form $mform=null)
 Updates an instance of the mod_h5pactivity in the database. More...
 
 xmldb_h5pactivity_upgrade ($oldversion)
 Function to upgrade mod_h5pactivity. More...
 

Variables

 $capabilities
 
global mod_h5pactivity\external::$CFG
 
global mod_h5pactivity\local\report::$CFG
 
global mod_h5pactivity\xapi::$CFG
 
global $CFG
 
 $functions
 
 $plugin = 2020060900
 
$plugin component = 'mod_h5pactivity'
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ h5pactivity_add_instance()

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.

Parameters
stdClass$dataAn object from the form.
mod_h5pactivity_mod_form$mformThe form.
Return values
intThe id of the newly inserted record.

◆ h5pactivity_check_updates_since()

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.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not

◆ h5pactivity_delete_instance()

h5pactivity_delete_instance ( int  $id)

Removes an instance of the mod_h5pactivity from the database.

Parameters
int$idId of the module instance.
Return values
boolTrue if successful, false on failure.

◆ h5pactivity_dndupload_handle()

h5pactivity_dndupload_handle (   $uploadinfo)

Handle a file that has been uploaded.

Parameters
object$uploadinfodetails of the file / content that has been uploaded
Return values
intinstance id of the newly created mod

◆ h5pactivity_dndupload_register()

h5pactivity_dndupload_register ( )

Register the ability to handle drag and drop file uploads.

Return values
arraycontaining details of the files / types the mod can handle

◆ h5pactivity_get_file_areas()

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().

Parameters
stdClass$coursecourse object
stdClass$cmcourse module object
stdClass$contextcontext object
Return values
string[]array of pair file area => human file area name

◆ h5pactivity_get_file_info()

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.

Parameters
file_browser$browser
array$areas
stdClass$course
stdClass$cm
context$context
string$filearea
int | null$itemid
string | null$filepath
string | null$filename
Return values
file_info_stored|nullfile_info_stored instance or null if not found

◆ h5pactivity_grade_item_delete()

h5pactivity_grade_item_delete ( stdClass  $moduleinstance)

Delete grade item for given mod_h5pactivity instance.

Parameters
stdClass$moduleinstanceInstance object.
Return values
intReturns GRADE_UPDATE_OK, GRADE_UPDATE_FAILED, GRADE_UPDATE_MULTIPLE or GRADE_UPDATE_ITEM_LOCKED

◆ h5pactivity_grade_item_update()

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().

Parameters
stdClass$moduleinstanceInstance object with extra cmidnumber and modname property.
mixed$gradesoptional array/object of grade(s); 'reset' means reset grades in gradebook
Return values
intint 0 if ok, error code otherwise

◆ h5pactivity_page_type_list()

h5pactivity_page_type_list ( string  $pagetype,
?stdClass  $parentcontext,
stdClass  $currentcontext 
)

Return a list of page types.

Parameters
string$pagetypecurrent page type
stdClass | null$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block
Return values
arrayarray of page types and it's names

◆ h5pactivity_pluginfile()

h5pactivity_pluginfile (   $course,
  $cm,
context  $context,
string  $filearea,
array  $args,
bool  $forcedownload,
array  $options = [] 
)

Serves the files from the mod_h5pactivity file areas.

Parameters
mixed$coursecourse or id of the course
mixed$cmcourse module or id of the course module
context$context
string$filearea
array$args
bool$forcedownload
array$optionsadditional options affecting the file serving
Return values
boolfalse if file not found, does not return if found - just send the file

◆ h5pactivity_rescale_activity_grades()

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.

Parameters
stdClass$courseCourse db record
stdClass$cmCourse module db record
float$oldmin
float$oldmax
float$newmin
float$newmax
Return values
booltrue if reescale is successful

◆ h5pactivity_reset_course_form_defaults()

h5pactivity_reset_course_form_defaults ( stdClass  $course)

Course reset form defaults.

Parameters
stdClass$coursethe course object
Return values
array

◆ h5pactivity_reset_course_form_definition()

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.

Parameters
object$mformform passed by reference

◆ h5pactivity_reset_gradebook()

h5pactivity_reset_gradebook ( int  $courseid,
string  $type = '' 
)

Removes all grades from gradebook.

Parameters
int$courseidCoude ID
string$typeoptional type (default '')

◆ h5pactivity_reset_userdata()

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.

Parameters
stdClass$datathe data submitted from the reset course.
Return values
arrayof reseting status

◆ h5pactivity_scale_used_anywhere()

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.

Parameters
int$scaleidID of the scale.
Return values
boolTrue if the scale is used by any mod_h5pactivity instance.

◆ h5pactivity_set_mainfile()

h5pactivity_set_mainfile ( stdClass  $data)

Saves draft files as the activity package.

Parameters
stdClass$dataan object from the form

◆ h5pactivity_supports()

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

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
mixedTrue if module supports feature, false if not, null if doesn't know

◆ h5pactivity_update_grades()

h5pactivity_update_grades ( stdClass  $moduleinstance,
int  $userid = 0 
)

Update mod_h5pactivity grades in the gradebook.

Needed by grade_update_mod_grades().

Parameters
stdClass$moduleinstanceInstance object with extra cmidnumber and modname property.
int$useridUpdate grade of specific user only, 0 means all participants.

◆ h5pactivity_update_instance()

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.

Parameters
stdClass$dataAn object from the form in mod_form.php.
mod_h5pactivity_mod_form$mformThe form.
Return values
boolTrue if successful, false otherwise.

◆ xmldb_h5pactivity_upgrade()

xmldb_h5pactivity_upgrade (   $oldversion)

Function to upgrade mod_h5pactivity.

Parameters
int$oldversionthe version we are upgrading from
Return values
boolresult