Go to the source code of this file.
Namespaces |
| namespace | mod |
| | Local Library of functions for module scorm.
|
Enumerations |
| enum | SCORM_TYPE_LOCAL |
| enum | SCORM_TYPE_LOCALSYNC |
| enum | SCORM_TYPE_EXTERNAL |
| enum | SCORM_TYPE_IMSREPOSITORY |
| enum | SCORM_TYPE_AICCURL |
| enum | SCORM_TOC_SIDE |
| enum | SCORM_TOC_HIDDEN |
| enum | SCORM_TOC_POPUP |
| enum | SCORM_TOC_DISABLED |
| enum | SCORM_12 |
| enum | SCORM_13 |
| enum | SCORM_AICC |
Functions |
| | scorm_add_instance ($scorm, $mform=null) |
| | scorm_update_instance ($scorm, $mform=null) |
| | scorm_delete_instance ($id) |
| | scorm_user_outline ($course, $user, $mod, $scorm) |
| | scorm_user_complete ($course, $user, $mod, $scorm) |
| | scorm_cron () |
| | scorm_get_user_grades ($scorm, $userid=0) |
| | scorm_update_grades ($scorm, $userid=0, $nullifnone=true) |
| | scorm_upgrade_grades () |
| | scorm_grade_item_update ($scorm, $grades=null) |
| | scorm_grade_item_delete ($scorm) |
| | scorm_get_view_actions () |
| | scorm_get_post_actions () |
| | scorm_option2text ($scorm) |
| | scorm_reset_course_form_definition (&$mform) |
| | scorm_reset_course_form_defaults ($course) |
| | scorm_reset_gradebook ($courseid, $type='') |
| | scorm_reset_userdata ($data) |
| | scorm_get_extra_capabilities () |
| | scorm_get_file_areas ($course, $cm, $context) |
| | scorm_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) |
| | scorm_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload) |
| | scorm_supports ($feature) |
| | scorm_extend_navigation ($navigation, $course, $module, $cm) |
| | scorm_debug_log_filename ($type, $scoid) |
| | scorm_debug_log_write ($type, $text, $scoid) |
| | scorm_debug_log_remove ($type, $scoid) |
| | scorm_print_overview ($courses, &$htmlarray) |
| | scorm_page_type_list ($pagetype, $parentcontext, $currentcontext) |
| | scorm_version_check ($scormversion, $version='') |
Enumeration Type Documentation
SCORM_TYPE_AICCURL = external AICC url
Definition at line 32 of file lib.php.
SCORM_TYPE_EXTERNAL = external
Definition at line 28 of file lib.php.
SCORM_TYPE_IMSREPOSITORY = imsrepository
Definition at line 30 of file lib.php.
SCORM_TYPE_LOCAL = local
Definition at line 24 of file lib.php.
SCORM_TYPE_LOCALSYNC = localsync
Definition at line 26 of file lib.php.
Function Documentation
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 new instance.
stdClass object CONTEXT_MODULE SCORM_TYPE_LOCAL SCORM_TYPE_LOCALSYNC SCORM_TYPE_EXTERNAL SCORM_TYPE_IMSREPOSITORY
- Parameters:
-
| object | $scorm | Form data |
| object | $mform | |
- Returns:
- int new instance id
update course module record - from now on this instance properly exists and all function may be used
reload scorm instance
store the package and verify
extra fields required in grade related functions
Definition at line 61 of file lib.php.
Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ...
stdClass object
- Returns:
- boolean
Now see if there are any scorm updates to be done
Definition at line 484 of file lib.php.
Get the filename for a temp log file
- Parameters:
-
| string | $type | - type of log(aicc,scorm12,scorm13) used as prefix for filename |
| integer | $scoid | - scoid of object this log entry is for |
- Returns:
- string The filename as an absolute path
Definition at line 985 of file lib.php.
Remove debug log file
- Parameters:
-
| string | $type | - type of log(aicc,scorm12,scorm13) used as prefix for filename |
| integer | $scoid | - scoid of object this log entry is for |
- Returns:
- boolean True if the file is successfully deleted, false otherwise
Definition at line 1019 of file lib.php.
writes log output to a temp log file
- Parameters:
-
| string | $type | - type of log(aicc,scorm12,scorm13) used as prefix for filename |
| string | $text | - text to be written to file. |
| integer | $scoid | - scoid of object this log entry is for. |
Definition at line 1000 of file lib.php.
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
stdClass object
- Parameters:
-
- Returns:
- boolean
Definition at line 230 of file lib.php.
This function extends the global navigation for the site. It is important to note that you should not rely on PAGE objects within this body of code as there is no guarantee that during an AJAX request they are available
- Parameters:
-
| navigation_node | $navigation | The scorm node within the global navigation |
| stdClass | $course | The course object returned from the DB |
| stdClass | $module | The module object returned from the DB |
| stdClass | $cm | The course module instance returned from the DB |
This is currently just a stub so that it can be easily expanded upon. When expanding just remove this comment and the line below and then add you content.
Definition at line 969 of file lib.php.
Returns all other caps used in module
- Returns:
- array
Definition at line 800 of file lib.php.
Lists all file areas current user may browse
- Parameters:
-
| object | $course | |
| object | $cm | |
| object | $context | |
- Returns:
- array
Definition at line 812 of file lib.php.
| scorm_get_file_info |
( |
$ |
browser, |
|
|
$ |
areas, |
|
|
$ |
course, |
|
|
$ |
cm, |
|
|
$ |
context, |
|
|
$ |
filearea, |
|
|
$ |
itemid, |
|
|
$ |
filepath, |
|
|
$ |
filename |
|
) |
| |
File browsing support for SCORM file areas
- Parameters:
-
| stdclass | $browser | |
| stdclass | $areas | |
| stdclass | $course | |
| stdclass | $cm | |
| stdclass | $context | |
| string | $filearea | |
| int | $itemid | |
| string | $filepath | |
| string | $filename | |
- Returns:
- stdclass file_info instance or null if not found
Definition at line 833 of file lib.php.
- Returns:
- array
Definition at line 686 of file lib.php.
Return grade for given user or all users.
stdClass object
- Parameters:
-
| int | $scormid | id of scorm |
| int | $userid | optional user id, 0 means all users |
- Returns:
- array array of grades, false if none
Definition at line 530 of file lib.php.
- Returns:
- array
Definition at line 679 of file lib.php.
Delete grade item for given scorm
stdClass
- Parameters:
-
- Returns:
- object grade_item
Definition at line 669 of file lib.php.
Update/create grade item for given scorm
stdClass object GRADE_TYPE_VALUE GRADE_TYPE_NONE
- Parameters:
-
| object | $scorm | object with extra cmidnumber |
| mixed | $grades | optional array/object of grade(s); 'reset' means reset grades in gradebook |
- Returns:
- object grade_item
Definition at line 628 of file lib.php.
- Parameters:
-
- Returns:
- object $scorm
Definition at line 694 of file lib.php.
Return a list of page types
- Parameters:
-
| string | $pagetype | current page type |
| stdClass | $parentcontext | Block's parent context |
| stdClass | $currentcontext | Current context of block |
Definition at line 1098 of file lib.php.
| scorm_pluginfile |
( |
$ |
course, |
|
|
$ |
cm, |
|
|
$ |
context, |
|
|
$ |
filearea, |
|
|
$ |
args, |
|
|
$ |
forcedownload |
|
) |
| |
Serves scorm content, introduction images and packages. Implements needed access control ;-)
- Parameters:
-
| object | $course | |
| object | $cm | |
| object | $context | |
| string | $filearea | |
| array | $args | |
| bool | $forcedownload | |
- Returns:
- bool false if file not found, does not return if found - just send the file
Definition at line 893 of file lib.php.
writes overview info for course_overview block - displays upcoming scorm objects that have a due date
- Parameters:
-
| object | $type | - type of log(aicc,scorm12,scorm13) used as prefix for filename |
| array | $htmlarray | |
- Returns:
- mixed
Definition at line 1037 of file lib.php.
Course reset form defaults.
- Returns:
- array
Definition at line 734 of file lib.php.
Implementation of the function for printing the form elements that control whether the course reset functionality affects the scorm.
- Parameters:
-
| object | $mform | form passed by reference |
Definition at line 724 of file lib.php.
Removes all grades from gradebook
stdClass object
- Parameters:
-
| int | $courseid | |
| string | optional type |
Definition at line 746 of file lib.php.
Actual implementation of the reset course functionality, delete all the scorm attempts for course $data->courseid.
stdClass object
- Parameters:
-
| object | $data | the data submitted from the reset course. |
- Returns:
- array status array
Definition at line 769 of file lib.php.
FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES
- Parameters:
-
| string | $feature | FEATURE_xx constant for requested feature |
- Returns:
- mixed True if module supports feature, false if not, null if doesn't know
Definition at line 942 of file lib.php.
Update grades in central gradebook
stdClass object
- Parameters:
-
| object | $scorm | |
| int | $userid | specific user only, 0 mean all |
| bool | $nullifnone | |
Definition at line 569 of file lib.php.
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.
stdClass object CONTEXT_MODULE SCORM_TYPE_LOCAL SCORM_TYPE_LOCALSYNC SCORM_TYPE_EXTERNAL SCORM_TYPE_IMSREPOSITORY
- Parameters:
-
| object | $scorm | Form data |
| object | $mform | |
- Returns:
- bool
extra fields required in grade related functions
Definition at line 149 of file lib.php.
Update all grades in gradebook.
object
Definition at line 592 of file lib.php.
Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.
stdClass object
- Parameters:
-
| object | $course | |
| object | $user | |
| object | $mod | |
| object | $scorm | |
- Returns:
- boolean
Definition at line 333 of file lib.php.
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports.
stdClass
- Parameters:
-
| int | $course | Course id |
| int | $user | User id |
| int | $mod | |
| int | $scorm | The scorm id |
- Returns:
- mixed
Definition at line 296 of file lib.php.
Returns the SCORM version used.
- Parameters:
-
| string | $scormversion | comes from $scorm->version |
| string | $version | one of the defined vars SCORM_12, SCORM_13, SCORM_AICC (or empty) |
- Returns:
- Scorm version.
Definition at line 1109 of file lib.php.