"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mod/scorm/classes/external.php" between
moodle-3.6.5.tgz and moodle-3.6.6.tgz

About: moodle is a learning management system for producing Internet-based course Web sites. Latest 3.6 release.

external.php  (moodle-3.6.5.tgz):external.php  (moodle-3.6.6.tgz)
skipping to change at line 862 skipping to change at line 862
/** /**
* Trigger the course module viewed event. * Trigger the course module viewed event.
* *
* @param int $scormid the SCORM instance id * @param int $scormid the SCORM instance id
* @param int $scoid the SCO id * @param int $scoid the SCO id
* @return array of warnings and status result * @return array of warnings and status result
* @since Moodle 3.1 * @since Moodle 3.1
* @throws moodle_exception * @throws moodle_exception
*/ */
public static function launch_sco($scormid, $scoid = 0) { public static function launch_sco($scormid, $scoid = 0) {
global $DB; global $DB, $CFG;
require_once($CFG->libdir . '/completionlib.php');
$params = self::validate_parameters(self::launch_sco_parameters(), $params = self::validate_parameters(self::launch_sco_parameters(),
array( array(
'scormid' => $scormid, 'scormid' => $scormid,
'scoid' => $scoid 'scoid' => $scoid
)); ));
$warnings = array(); $warnings = array();
// Request and permission validation. // Request and permission validation.
$scorm = $DB->get_record('scorm', array('id' => $params['scormid']), '*' , MUST_EXIST); $scorm = $DB->get_record('scorm', array('id' => $params['scormid']), '*' , MUST_EXIST);
skipping to change at line 885 skipping to change at line 887
$context = context_module::instance($cm->id); $context = context_module::instance($cm->id);
self::validate_context($context); self::validate_context($context);
// If the SCORM is not open this function will throw exceptions. // If the SCORM is not open this function will throw exceptions.
scorm_require_available($scorm); scorm_require_available($scorm);
if (!empty($params['scoid']) and !($sco = scorm_get_sco($params['scoid'] , SCO_ONLY))) { if (!empty($params['scoid']) and !($sco = scorm_get_sco($params['scoid'] , SCO_ONLY))) {
throw new moodle_exception('cannotfindsco', 'scorm'); throw new moodle_exception('cannotfindsco', 'scorm');
} }
// Mark module viewed.
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
list($sco, $scolaunchurl) = scorm_get_sco_and_launch_url($scorm, $params ['scoid'], $context); list($sco, $scolaunchurl) = scorm_get_sco_and_launch_url($scorm, $params ['scoid'], $context);
// Trigger the SCO launched event. // Trigger the SCO launched event.
scorm_launch_sco($scorm, $sco, $cm, $context, $scolaunchurl); scorm_launch_sco($scorm, $sco, $cm, $context, $scolaunchurl);
$result = array(); $result = array();
$result['status'] = true; $result['status'] = true;
$result['warnings'] = $warnings; $result['warnings'] = $warnings;
return $result; return $result;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)