Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Classes | Functions | Variables
locallib.php File Reference

Library of internal classes and functions for module SCORM. More...

Classes

class  scorm_package_file_info
 

Functions

 scorm_array_search ($item, $needle, $haystacks, $strict=false)
 
 scorm_check_launchable_sco ($scorm, $scoid)
 Check if the current sco is launchable If not, find the next launchable sco. More...
 
 scorm_check_url ($url)
 Check for the availability of a resource by URL. More...
 
 scorm_count_launchable ($scormid, $organization='')
 
 scorm_debugging ($scorm)
 Figure out with this is a debug situation. More...
 
 scorm_delete_attempt ($userid, $scorm, $attemptid)
 Delete Scorm tracks for selected users. More...
 
 scorm_delete_responses ($attemptids, $scorm)
 Delete Scorm tracks for selected users. More...
 
 scorm_element_cmp ($a, $b)
 Build up the JavaScript representation of an array element. More...
 
 scorm_eval_prerequisites ($prerequisites, $usertracks)
 This is really a little language parser for AICC_SCRIPT evaluates the expression and returns a boolean answer see 2.3.2.5.1. More...
 
 scorm_external_link ($link)
 
 scorm_format_duration ($duration)
 Converts SCORM duration notation to human-readable format The function works with both SCORM 1.2 and SCORM 2004 time formats. More...
 
 scorm_format_interactions ($trackdata)
 helper function to return a formatted list of interactions for reports. More...
 
 scorm_format_toc_for_droplist ($scorm, $scoes, $usertracks, $currentorg='', $organizationsco=null, $children=false, $level=0, $tocmenus=array())
 
 scorm_format_toc_for_treeview ($user, $scorm, $scoes, $usertracks, $cmid, $toclink=TOCJSLINK, $currentorg='', $attempt='', $play=false, $organizationsco=null, $children=false)
 
 scorm_get_adlnav_json ($scoes, &$adlnav=array(), $parentscoid=null)
 
 scorm_get_all_attempts ($scormid, $userid)
 Returns the full list of attempts a user has made. More...
 
 scorm_get_attempt_count ($userid, $scorm, $returnobjects=false, $ignoremissingcompletion=false)
 Get SCORM attempt count. More...
 
 scorm_get_attempt_status ($user, $scorm, $cm='')
 Generate the user attempt status string. More...
 
 scorm_get_attempts_array ()
 Returns an array of the array of attempt options. More...
 
 scorm_get_attemptstatus_array ()
 Returns an array of the attempt status options. More...
 
 scorm_get_availability_status ($scorm, $checkviewreportcap=false, $context=null, $userid=null)
 Check if a SCORM is available for the current user. More...
 
 scorm_get_count_users ($scormid, $groupingid=null)
 
 scorm_get_first_attempt ($scormid, $userid)
 Returns the first attempt used - if no attempts yet, returns 1 for first attempt. More...
 
 scorm_get_forceattempt_array ()
 Returns an array of the force attempt options. More...
 
 scorm_get_grade_method_array ()
 Returns an array of the array of what grade options. More...
 
 scorm_get_hidetoc_array ()
 Returns an array of the array of hide table of contents options. More...
 
 scorm_get_last_attempt ($scormid, $userid)
 Returns the last attempt used - if no attempts yet, returns 1 for first attempt. More...
 
 scorm_get_last_completed_attempt ($scormid, $userid)
 Returns the last completed attempt used - if no completed attempts yet, returns 1 for first attempt. More...
 
 scorm_get_navigation_display_array ()
 Returns an array of the array of navigation buttons display options. More...
 
 scorm_get_popup_display_array ()
 Returns an array of the array of popup display options. More...
 
 scorm_get_popup_options_array ()
 Returns an array of the popup options for SCORM and each options default value. More...
 
 scorm_get_sco ($id, $what=SCO_ALL)
 Returns an object containing all datas relative to the given sco ID. More...
 
 scorm_get_sco_and_launch_url ($scorm, $scoid, $context)
 Return a SCO object and the SCO launch URL. More...
 
 scorm_get_sco_runtime ($scormid, $scoid, $userid, $attempt=1)
 
 scorm_get_scoes ($id, $organisation=false)
 Returns an object (array) containing all the scoes data related to the given sco ID. More...
 
 scorm_get_skip_view_array ()
 Returns an array of the array of skip view options. More...
 
 scorm_get_toc ($user, $scorm, $cmid, $toclink=TOCJSLINK, $currentorg='', $scoid='', $mode='normal', $attempt='', $play=false, $tocheader=false)
 
 scorm_get_toc_get_parent_child (&$result, $currentorg)
 
 scorm_get_toc_object ($user, $scorm, $currentorg='', $scoid='', $mode='normal', $attempt='', $play=false, $organizationsco=null)
 
 scorm_get_tracks ($scoid, $userid, $attempt='')
 
 scorm_get_updatefreq_array ()
 Returns an array of the array of update frequency options. More...
 
 scorm_get_what_grade_array ()
 Returns an array of the array of what grade options. More...
 
 scorm_grade_user ($scorm, $userid)
 
 scorm_grade_user_attempt ($scorm, $userid, $attempt=1)
 
 scorm_has_tracks ($scormid, $userid)
 simple quick function to return true/false if this user has tracks in this scorm More...
 
 scorm_insert_track ($userid, $scormid, $scoid, $attempt, $element, $value, $forcecompleted=false, $trackdata=null)
 
 scorm_isset ($userdata, $param, $ifempty='')
 Check for a parameter in userdata and return it if it's set or return the value from $ifempty if its empty. More...
 
 scorm_launch_sco ($scorm, $sco, $cm, $context, $scourl)
 Trigger the scorm_launched event. More...
 
 scorm_parse ($scorm, $full)
 Extracts scrom package, sets up all variables. More...
 
 scorm_print_launch ($user, $scorm, $action, $cm)
 Displays the entry form and toc if required. More...
 
 scorm_reconstitute_array_element ($sversion, $userdata, $elementname, $children)
 Build up the JavaScript representation of an array element. More...
 
 scorm_repeater ($what, $times)
 
 scorm_require_available ($scorm, $checkviewreportcap=false, $context=null)
 Requires a SCORM package to be available for the current user. More...
 
 scorm_simple_play ($scorm, $user, $context, $cmid)
 
 scorm_update_calendar (stdClass $scorm, $cmid)
 Update the calendar entries for this scorm activity. More...
 

Variables

const AVERAGEATTEMPT '1'
 
const FIRSTATTEMPT '2'
 
const GRADEAVERAGE '2'
 
const GRADEHIGHEST '1'
 
const GRADESCOES '0'
 
const GRADESUM '3'
 
const HIGHESTATTEMPT '0'
 
const LASTATTEMPT '3'
 
const SCO_ALL 0
 
const SCO_DATA 1
 
const SCO_ONLY 2
 
const SCORM_FORCEATTEMPT_ALWAYS 2
 
const SCORM_FORCEATTEMPT_NO 0
 
const SCORM_FORCEATTEMPT_ONCOMPLETE 1
 
const SCORM_SKIPVIEW_ALWAYS '2'
 
const SCORM_SKIPVIEW_FIRST '1'
 
const SCORM_SKIPVIEW_NEVER '0'
 
const SCORM_UPDATE_EVERYDAY '2'
 
const SCORM_UPDATE_EVERYTIME '3'
 
const SCORM_UPDATE_NEVER '0'
 
const TOCFULLURL 2
 
const TOCJSLINK 1
 

Detailed Description

Library of internal classes and functions for module SCORM.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later