mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 13:33:52 +02:00
MDL-35870 mod_scorm : Adding phpdocs for new functions
get_scorm_default in scorm_12lib.php get_scorm_default in scorm_13lib.php get_scorm_default in aicclib.php scorm_isset in locallib.php scorm_empty in locallib.php
This commit is contained in:
parent
3ad5eeedcf
commit
ad88d3ed2a
@ -479,6 +479,16 @@ function scorm_aicc_generate_simple_sco($scorm) {
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up $userdata array and default values for AICC package.
|
||||
*
|
||||
* @param stdClass $userdata an empty stdClass variable that should be set up with user values
|
||||
* @param object $scorm package record
|
||||
* @param string $scoid SCO Id
|
||||
* @param string $attempt attempt number for the user
|
||||
* @param string $mode scorm display mode type
|
||||
* @return array The default values that should be used for AICC package
|
||||
*/
|
||||
function get_scorm_default (&$userdata, $scorm, $scoid, $attempt, $mode) {
|
||||
global $USER;
|
||||
|
||||
|
@ -121,6 +121,16 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
return eval('return '.implode($stack).';');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up $userdata array and default values for SCORM 1.2 .
|
||||
*
|
||||
* @param stdClass $userdata an empty stdClass variable that should be set up with user values
|
||||
* @param object $scorm package record
|
||||
* @param string $scoid SCO Id
|
||||
* @param string $attempt attempt number for the user
|
||||
* @param string $mode scorm display mode type
|
||||
* @return array The default values that should be used for SCORM 1.2 package
|
||||
*/
|
||||
function get_scorm_default (&$userdata, $scorm, $scoid, $attempt, $mode) {
|
||||
global $USER;
|
||||
|
||||
|
@ -1181,6 +1181,16 @@ function scorm_seq_flow ($activity, $direction, $seq, $childrenflag, $userid) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up $userdata array and default values for SCORM 1.3 .
|
||||
*
|
||||
* @param stdClass $userdata an empty stdClass variable that should be set up with user values
|
||||
* @param object $scorm package record
|
||||
* @param string $scoid SCO Id
|
||||
* @param string $attempt attempt number for the user
|
||||
* @param string $mode scorm display mode type
|
||||
* @return array The default values that should be used for SCORM 1.3 package
|
||||
*/
|
||||
function get_scorm_default (&$userdata, $scorm, $scoid, $attempt, $mode) {
|
||||
global $DB, $USER;
|
||||
|
||||
|
@ -998,7 +998,7 @@ function scorm_get_count_users($scormid, $groupingid=null) {
|
||||
* @param array $userdata User track data
|
||||
* @param string $elementname Name of array element to get values for
|
||||
* @param array $children list of sub elements of this array element that also need instantiating
|
||||
* @return None
|
||||
* @return Javascript array elements
|
||||
*/
|
||||
function scorm_reconstitute_array_element($sversion, $userdata, $elementname, $children) {
|
||||
// Reconstitute comments_from_learner and comments_from_lms.
|
||||
@ -1938,7 +1938,15 @@ function scorm_check_url($url) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Helper function.
|
||||
/**
|
||||
* Check for a parameter in userdata and return it if it's set
|
||||
* or return the value from $ifempty if its empty
|
||||
*
|
||||
* @param stdClass $userdata Contains user's data
|
||||
* @param string $param parameter that should be checked
|
||||
* @param string $ifempty value to be replaced with if $param is not set
|
||||
* @return string value from $userdata->$param if its not empty, or $ifempty
|
||||
*/
|
||||
function scorm_isset($userdata, $param, $ifempty = '') {
|
||||
if (isset($userdata->$param)) {
|
||||
return $userdata->$param;
|
||||
@ -1947,6 +1955,16 @@ function scorm_isset($userdata, $param, $ifempty = '') {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for a parameter in userdata and return it with or without slashes it it's not empty
|
||||
* or return the value from $ifempty if its empty
|
||||
*
|
||||
* @param stdClass $userdata Contains user's data
|
||||
* @param string $param parameter that should be checked
|
||||
* @param string $ifempty value to be replaced with if $param is not set
|
||||
* @param bool $addslash if True - add slashes, if False - Don't add slash
|
||||
* @return string value from $userdata->$param with or without if its not empty, or $ifempty
|
||||
*/
|
||||
function scorm_empty($userdata, $param, $ifempty = '', $addslash = false) {
|
||||
if (!empty($userdata->$param)) {
|
||||
return $addslash ? '\''.$userdata->$param.'\'' : $userdata->$param;
|
||||
|
Loading…
x
Reference in New Issue
Block a user