本文整理汇总了PHP中scorm_has_tracks函数的典型用法代码示例。如果您正苦于以下问题:PHP scorm_has_tracks函数的具体用法?PHP scorm_has_tracks怎么用?PHP scorm_has_tracks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scorm_has_tracks函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scorm_simple_play
function scorm_simple_play($scorm, $user, $context, $cmid)
{
global $DB;
$result = false;
if (has_capability('mod/scorm:viewreport', $context)) {
//if this user can view reports, don't skipview so they can see links to reports.
return $result;
}
if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
scorm_parse($scorm, false);
}
$scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND ' . $DB->sql_isnotempty('scorm_scoes', 'launch', false, true), array($scorm->id), 'sortorder, id', 'id');
if ($scoes) {
$orgidentifier = '';
if ($sco = scorm_get_sco($scorm->launch, SCO_ONLY)) {
if ($sco->organization == '' && $sco->launch == '') {
$orgidentifier = $sco->identifier;
} else {
$orgidentifier = $sco->organization;
}
}
if ($scorm->skipview >= SCORM_SKIPVIEW_FIRST) {
$sco = current($scoes);
$url = new moodle_url('/mod/scorm/player.php', array('a' => $scorm->id, 'currentorg' => $orgidentifier, 'scoid' => $sco->id));
if ($scorm->skipview == SCORM_SKIPVIEW_ALWAYS || !scorm_has_tracks($scorm->id, $user->id)) {
if (!empty($scorm->forcenewattempt)) {
$result = scorm_get_toc($user, $scorm, $cmid, TOCFULLURL, $orgidentifier);
if ($result->incomplete === false) {
$url->param('newattempt', 'on');
}
}
redirect($url);
}
}
}
return $result;
}
示例2: get_config
$forcejs = get_config('scorm', 'forcejavascript');
if (!empty($forcejs)) {
$PAGE->add_body_class('forcejavascript');
}
require_login($course, false, $cm);
$context = context_course::instance($course->id);
$contextmodule = context_module::instance($cm->id);
$launch = false;
// Does this automatically trigger a launch based on skipview.
if (!empty($scorm->popup)) {
$orgidentifier = '';
$scoid = 0;
if ($scorm->skipview >= SCORM_SKIPVIEW_FIRST && has_capability('mod/scorm:skipview', $contextmodule) && !has_capability('mod/scorm:viewreport', $contextmodule)) {
// Don't skip users with the capability to view reports.
// do we launch immediately and redirect the parent back ?
if ($scorm->skipview == SCORM_SKIPVIEW_ALWAYS || !scorm_has_tracks($scorm->id, $USER->id)) {
$orgidentifier = '';
if ($sco = scorm_get_sco($scorm->launch, SCO_ONLY)) {
if ($sco->organization == '' && $sco->launch == '') {
$orgidentifier = $sco->identifier;
} else {
$orgidentifier = $sco->organization;
}
$scoid = $sco->id;
}
$launch = true;
}
}
// Redirect back to the section with one section per page ?
$courseformat = course_get_format($course)->get_course();
$sectionid = '';