Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/scorm/lib.php File Reference

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

enum SCORM_12

Definition at line 40 of file lib.php.

enum SCORM_13

Definition at line 41 of file lib.php.

enum SCORM_AICC

Definition at line 42 of file lib.php.

Definition at line 37 of file lib.php.

Definition at line 35 of file lib.php.

Definition at line 36 of file lib.php.

Definition at line 34 of file lib.php.

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

scorm_add_instance ( scorm,
mform = null 
)

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$scormForm 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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

scorm_debug_log_filename ( type,
scoid 
)

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.

Here is the caller graph for this function:

scorm_debug_log_remove ( type,
scoid 
)

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.

Here is the call graph for this function:

scorm_debug_log_write ( type,
text,
scoid 
)

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.

Here is the call graph for this function:

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:
int$idScorm instance id
Returns:
boolean

Definition at line 230 of file lib.php.

Here is the call graph for this function:

scorm_extend_navigation ( navigation,
course,
module,
cm 
)

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$navigationThe scorm node within the global navigation
stdClass$courseThe course object returned from the DB
stdClass$moduleThe module object returned from the DB
stdClass$cmThe 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.

scorm_get_file_areas ( course,
cm,
context 
)

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.

Here is the call graph for this function:

Returns:
array

Definition at line 686 of file lib.php.

scorm_get_user_grades ( scorm,
userid = 0 
)

Return grade for given user or all users.

stdClass object

Parameters:
int$scormidid of scorm
int$useridoptional user id, 0 means all users
Returns:
array array of grades, false if none

Definition at line 530 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
array

Definition at line 679 of file lib.php.

Delete grade item for given scorm

stdClass

Parameters:
object$scormobject
Returns:
object grade_item

Definition at line 669 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

scorm_grade_item_update ( scorm,
grades = null 
)

Update/create grade item for given scorm

stdClass object GRADE_TYPE_VALUE GRADE_TYPE_NONE

Parameters:
object$scormobject with extra cmidnumber
mixed$gradesoptional array/object of grade(s); 'reset' means reset grades in gradebook
Returns:
object grade_item

Definition at line 628 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

scorm_option2text ( scorm)
Parameters:
object$scorm
Returns:
object $scorm

Definition at line 694 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

scorm_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent 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.

Here is the call graph for this function:

scorm_print_overview ( courses,
&$  htmlarray 
)

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.

Here is the call graph for this function:

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$mformform passed by reference

Definition at line 724 of file lib.php.

scorm_reset_gradebook ( courseid,
type = '' 
)

Removes all grades from gradebook

stdClass object

Parameters:
int$courseid
stringoptional type

Definition at line 746 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

scorm_reset_userdata ( data)

Actual implementation of the reset course functionality, delete all the scorm attempts for course $data->courseid.

stdClass object

Parameters:
object$datathe data submitted from the reset course.
Returns:
array status array

Definition at line 769 of file lib.php.

Here is the call graph for this function:

scorm_supports ( feature)

FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES

Parameters:
string$featureFEATURE_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.

scorm_update_grades ( scorm,
userid = 0,
nullifnone = true 
)

Update grades in central gradebook

stdClass object

Parameters:
object$scorm
int$useridspecific user only, 0 mean all
bool$nullifnone

Definition at line 569 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

scorm_update_instance ( scorm,
mform = null 
)

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$scormForm data
object$mform
Returns:
bool

extra fields required in grade related functions

Definition at line 149 of file lib.php.

Here is the call graph for this function:

Update all grades in gradebook.

object

Definition at line 592 of file lib.php.

Here is the call graph for this function:

scorm_user_complete ( course,
user,
mod,
scorm 
)

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.

Here is the call graph for this function:

scorm_user_outline ( course,
user,
mod,
scorm 
)

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$courseCourse id
int$userUser id
int$mod
int$scormThe scorm id
Returns:
mixed

Definition at line 296 of file lib.php.

Here is the call graph for this function:

scorm_version_check ( scormversion,
version = '' 
)

Returns the SCORM version used.

Parameters:
string$scormversioncomes from $scorm->version
string$versionone of the defined vars SCORM_12, SCORM_13, SCORM_AICC (or empty)
Returns:
Scorm version.

Definition at line 1109 of file lib.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations