mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-73448-master' of https://github.com/peterRd/moodle
This commit is contained in:
commit
2a736da1ee
@ -46,7 +46,7 @@ class backup_scorm_activity_structure_step extends backup_activity_structure_ste
|
||||
'auto', 'popup', 'options', 'width',
|
||||
'height', 'timeopen', 'timeclose', 'timemodified',
|
||||
'completionstatusrequired', 'completionscorerequired',
|
||||
'completionstatusallscos', 'displayactivityname',
|
||||
'completionstatusallscos',
|
||||
'autocommit'));
|
||||
|
||||
$scoes = new backup_nested_element('scoes');
|
||||
|
@ -66,9 +66,6 @@ class restore_scorm_activity_structure_step extends restore_activity_structure_s
|
||||
$data->timeopen = $this->apply_date_offset($data->timeopen);
|
||||
$data->timeclose = $this->apply_date_offset($data->timeclose);
|
||||
|
||||
if (!isset($data->displayactivityname)) {
|
||||
$data->displayactivityname = true;
|
||||
}
|
||||
if (!isset($data->completionstatusallscos)) {
|
||||
$data->completionstatusallscos = false;
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ class mod_scorm_external extends external_api {
|
||||
'forcenewattempt', 'lastattemptlock', 'displayattemptstatus', 'displaycoursestructure',
|
||||
'sha1hash', 'md5hash', 'revision', 'launch', 'skipview', 'hidebrowse', 'hidetoc', 'nav',
|
||||
'navpositionleft', 'navpositiontop', 'auto', 'popup', 'width', 'height', 'timeopen',
|
||||
'timeclose', 'displayactivityname', 'scormtype', 'reference');
|
||||
'timeclose', 'scormtype', 'reference');
|
||||
|
||||
// Check additional permissions for returning optional private settings.
|
||||
if (has_capability('moodle/course:manageactivities', $context)) {
|
||||
@ -808,8 +808,6 @@ class mod_scorm_external extends external_api {
|
||||
'height' => new external_value(PARAM_INT, 'Frame height', VALUE_OPTIONAL),
|
||||
'timeopen' => new external_value(PARAM_INT, 'Available from', VALUE_OPTIONAL),
|
||||
'timeclose' => new external_value(PARAM_INT, 'Available to', VALUE_OPTIONAL),
|
||||
'displayactivityname' => new external_value(PARAM_BOOL, 'Display the activity name above the player?',
|
||||
VALUE_OPTIONAL),
|
||||
'scormtype' => new external_value(PARAM_ALPHA, 'SCORM type', VALUE_OPTIONAL),
|
||||
'reference' => new external_value(PARAM_NOTAGS, 'Reference to the package', VALUE_OPTIONAL),
|
||||
'protectpackagedownloads' => new external_value(PARAM_BOOL, 'Protect package downloads?',
|
||||
|
@ -107,8 +107,10 @@ class actionbar implements renderable, templatable {
|
||||
|
||||
$url = new moodle_url('/mod/scorm/report.php', $PAGE->url->remove_params('attemptsmode'));
|
||||
$urlselect = new url_select($reportmenu, $url->out(false), null, 'selectscormreports');
|
||||
$heading = $reportmenu[$url->out(false)] ?? null;
|
||||
|
||||
$data = [
|
||||
'heading' => $heading,
|
||||
'scormreports' => $urlselect->export_for_template($output),
|
||||
'candownload' => $this->download,
|
||||
'downloadods' => ($this->download) ? $downloadodslink->out(false) : '',
|
||||
|
@ -94,6 +94,7 @@ class userreportsactionbar implements renderable, templatable {
|
||||
}
|
||||
$urlselect = new url_select($reportmenu, $userreporturl, [], 'userscormreport');
|
||||
$data ['userreport'] = $urlselect->export_for_template($output);
|
||||
$data ['heading'] = $reportmenu[$userreporturl] ?? null;
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/scorm/db" VERSION="20180315" COMMENT="XMLDB file for Moodle mod/scorm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
<XMLDB PATH="mod/scorm/db" VERSION="20220127" COMMENT="XMLDB file for Moodle mod/scorm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
<TABLES>
|
||||
<TABLE NAME="scorm" COMMENT="each table is one SCORM module and its configuration">
|
||||
@ -46,7 +46,6 @@
|
||||
<FIELD NAME="completionstatusrequired" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="completionscorerequired" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="completionstatusallscos" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="displayactivityname" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
|
||||
<FIELD NAME="autocommit" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
@ -224,4 +223,4 @@
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
</XMLDB>
|
||||
</XMLDB>
|
||||
|
@ -59,5 +59,14 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2021052501) {
|
||||
$table = new xmldb_table('scorm');
|
||||
$field = new xmldb_field('displayactivityname');
|
||||
if ($dbman->field_exists($table, $field)) {
|
||||
$dbman->drop_field($table, $field);
|
||||
}
|
||||
upgrade_mod_savepoint(true, 2021052501, 'scorm');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -48,9 +48,6 @@ $PAGE->set_title($strscorms);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strscorms);
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading($strscorms);
|
||||
}
|
||||
|
||||
$usesections = course_format_uses_sections($course->format);
|
||||
|
||||
|
@ -1 +1,3 @@
|
||||
info,mod_scorm
|
||||
displayactivityname,mod_scorm
|
||||
displayactivityname_help,mod_scorm
|
||||
|
@ -114,8 +114,6 @@ $string['details'] = 'Track details';
|
||||
$string['directories'] = 'Show the directory links';
|
||||
$string['disabled'] = 'Disabled';
|
||||
$string['display'] = 'Display package';
|
||||
$string['displayactivityname'] = 'Display activity name';
|
||||
$string['displayactivityname_help'] = 'Whether or not to display the activity name above the SCORM player.';
|
||||
$string['displayattemptstatus'] = 'Display attempt status';
|
||||
$string['displayattemptstatus_help'] = 'This preference allows a summary of the users attempts to show in the course overview block in Dashboard and/or the SCORM entry page.';
|
||||
$string['displayattemptstatusdesc'] = 'Whether a summary of the user\'s attempts is shown in the course overview block in Dashboard and/or the SCORM entry page.';
|
||||
@ -458,3 +456,5 @@ $string['youmustselectastatus'] = 'You must select a status to require';
|
||||
|
||||
// Deprecated since Moodle 4.0.
|
||||
$string['info'] = 'Info';
|
||||
$string['displayactivityname'] = 'Display activity name';
|
||||
$string['displayactivityname_help'] = 'Whether or not to display the activity name above the SCORM player.';
|
||||
|
@ -936,7 +936,7 @@ function scorm_print_launch ($user, $scorm, $action, $cm) {
|
||||
$organization = optional_param('organization', '', PARAM_INT);
|
||||
|
||||
if ($scorm->displaycoursestructure == 1) {
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter toc container', 'toc');
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter toc', 'toc');
|
||||
echo html_writer::div(get_string('contents', 'scorm'), 'structurehead');
|
||||
}
|
||||
if (empty($organization)) {
|
||||
@ -992,31 +992,29 @@ function scorm_print_launch ($user, $scorm, $action, $cm) {
|
||||
echo html_writer::start_div('scorm-center');
|
||||
echo html_writer::start_tag('form', array('id' => 'scormviewform',
|
||||
'method' => 'post',
|
||||
'action' => $CFG->wwwroot.'/mod/scorm/player.php',
|
||||
'class' => 'container'));
|
||||
'action' => $CFG->wwwroot.'/mod/scorm/player.php'));
|
||||
if ($scorm->hidebrowse == 0) {
|
||||
echo html_writer::empty_tag('button',
|
||||
[
|
||||
'class' => 'btn btn-secondary mr-1', 'name' => 'mode',
|
||||
'type' => 'submit', 'id' => 'b', 'value' => 'browse']) .
|
||||
get_string('browse', 'scorm') . html_writer::end_tag('button');
|
||||
echo html_writer::empty_tag('button',
|
||||
[
|
||||
'class' => 'btn btn-primary mx-1', 'name' => 'mode',
|
||||
'type' => 'submit', 'id' => 'n', 'value' => 'normal']) .
|
||||
get_string('enter', 'scorm') . html_writer::end_tag('button');
|
||||
echo html_writer::tag('button', get_string('browse', 'scorm'),
|
||||
['class' => 'btn btn-secondary mr-1', 'name' => 'mode',
|
||||
'type' => 'submit', 'id' => 'b', 'value' => 'browse'])
|
||||
. html_writer::end_tag('button');
|
||||
} else {
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'mode', 'value' => 'normal'));
|
||||
}
|
||||
echo html_writer::tag('button', get_string('enter', 'scorm'),
|
||||
['class' => 'btn btn-primary mx-1', 'name' => 'mode',
|
||||
'type' => 'submit', 'id' => 'n', 'value' => 'normal'])
|
||||
. html_writer::end_tag('button');
|
||||
if (!empty($scorm->forcenewattempt)) {
|
||||
if ($scorm->forcenewattempt == SCORM_FORCEATTEMPT_ALWAYS ||
|
||||
($scorm->forcenewattempt == SCORM_FORCEATTEMPT_ONCOMPLETE && $incomplete === false)) {
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'newattempt', 'value' => 'on'));
|
||||
}
|
||||
} else if (!empty($attemptcount) && ($incomplete === false) && (($result->attemptleft > 0)||($scorm->maxattempt == 0))) {
|
||||
echo html_writer::empty_tag('br');
|
||||
echo html_writer::checkbox('newattempt', 'on', false, '', array('id' => 'a'));
|
||||
echo html_writer::label(get_string('newattempt', 'scorm'), 'a');
|
||||
echo html_writer::start_div('pt-1');
|
||||
echo html_writer::checkbox('newattempt', 'on', false, '', array('id' => 'a'));
|
||||
echo html_writer::label(get_string('newattempt', 'scorm'), 'a', true, ['class' => 'pl-1']);
|
||||
echo html_writer::end_div();
|
||||
}
|
||||
if (!empty($scorm->popup)) {
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'display', 'value' => 'popup'));
|
||||
|
@ -130,11 +130,6 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->hideIf('winoptgrp', 'popup', 'eq', 0);
|
||||
$mform->setAdvanced('winoptgrp', $cfgscorm->winoptgrp_adv);
|
||||
|
||||
// Display activity name.
|
||||
$mform->addElement('advcheckbox', 'displayactivityname', get_string('displayactivityname', 'scorm'));
|
||||
$mform->addHelpButton('displayactivityname', 'displayactivityname', 'scorm');
|
||||
$mform->setDefault('displayactivityname', $cfgscorm->displayactivityname);
|
||||
|
||||
// Skip view page.
|
||||
$skipviewoptions = scorm_get_skip_view_array();
|
||||
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $skipviewoptions);
|
||||
@ -276,7 +271,9 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$this->standard_coursemodule_elements();
|
||||
|
||||
// A SCORM module should define this within itself and is not needed here.
|
||||
$mform->removeElement('completionpassgrade');
|
||||
if ($mform->elementExists('completionpassgrade')) {
|
||||
$mform->removeElement('completionpassgrade');
|
||||
}
|
||||
|
||||
// Buttons.
|
||||
$this->add_action_buttons();
|
||||
|
@ -160,7 +160,8 @@ $SESSION->scorm->attempt = $attempt;
|
||||
$completion = new completion_info($course);
|
||||
$completion->set_module_viewed($cm);
|
||||
|
||||
// Print the page header.
|
||||
// Generate the exit button.
|
||||
$exiturl = "";
|
||||
if (empty($scorm->popup) || $displaymode == 'popup') {
|
||||
if ($course->format == 'singleactivity' && $scorm->skipview == SCORM_SKIPVIEW_ALWAYS
|
||||
&& !has_capability('mod/scorm:viewreport', context_module::instance($cm->id))) {
|
||||
@ -168,13 +169,11 @@ if (empty($scorm->popup) || $displaymode == 'popup') {
|
||||
$exiturl = $CFG->wwwroot;
|
||||
} else {
|
||||
// Redirect back to the correct section if one section per page is being used.
|
||||
$exiturl = course_get_url($course, $cm->sectionnum);
|
||||
$exiturl = course_get_url($course, $cm->sectionnum)->out();
|
||||
}
|
||||
|
||||
$exitlink = html_writer::link($exiturl, $strexit, array('title' => $strexit, 'class' => 'btn btn-secondary'));
|
||||
$PAGE->set_button($exitlink);
|
||||
}
|
||||
|
||||
// Print the page header.
|
||||
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => false,
|
||||
'currentorg' => '',
|
||||
'sco' => 0,
|
||||
@ -191,11 +190,14 @@ if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js')) {
|
||||
} else {
|
||||
$PAGE->requires->js('/mod/scorm/datamodels/scorm_12.js', true);
|
||||
}
|
||||
$activityheader = $PAGE->activityheader;
|
||||
$headerconfig = [
|
||||
'description' => '',
|
||||
'hidecompletion' => true
|
||||
];
|
||||
|
||||
$activityheader->set_attrs($headerconfig);
|
||||
echo $OUTPUT->header();
|
||||
if (!empty($scorm->displayactivityname) && !$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$PAGE->requires->string_for_js('navigation', 'scorm');
|
||||
$PAGE->requires->string_for_js('toc', 'scorm');
|
||||
@ -205,19 +207,22 @@ $PAGE->requires->string_for_js('popupsblocked', 'scorm');
|
||||
|
||||
$name = false;
|
||||
|
||||
$scrompagestyle = "margin-top: 1em";
|
||||
if ($mode === 'normal') {
|
||||
$scrompagestyle = "margin-top: 3em";
|
||||
// Exit button should ONLY be displayed when in the current window.
|
||||
if ($displaymode !== 'popup') {
|
||||
$renderer = $PAGE->get_renderer('mod_scorm');
|
||||
echo $renderer->generate_exitbar($exiturl);
|
||||
}
|
||||
echo html_writer::start_div('', array('id' => 'scormpage', 'style' => $scrompagestyle));
|
||||
|
||||
echo html_writer::start_div('', array('id' => 'scormpage'));
|
||||
echo html_writer::start_div('', array('id' => 'tocbox'));
|
||||
echo html_writer::div(html_writer::tag('script', '', array('id' => 'external-scormapi', 'type' => 'text/JavaScript')), '',
|
||||
array('id' => 'scormapi-parent'));
|
||||
|
||||
if ($scorm->hidetoc == SCORM_TOC_POPUP or $mode == 'browse' or $mode == 'review') {
|
||||
echo html_writer::start_div('', array('id' => 'scormtop'));
|
||||
echo $mode == 'browse' ? html_writer::div(get_string('browsemode', 'scorm'), 'scorm-left', array('id' => 'scormmode')) : '';
|
||||
echo $mode == 'review' ? html_writer::div(get_string('reviewmode', 'scorm'), 'scorm-left', array('id' => 'scormmode')) : '';
|
||||
echo html_writer::start_div('mb-3', array('id' => 'scormtop'));
|
||||
if ($mode == 'browse' || $mode == 'review') {
|
||||
echo html_writer::div(get_string("{$mode}mode", 'scorm'), 'scorm-left h3', ['id' => 'scormmode']);
|
||||
}
|
||||
if ($scorm->hidetoc == SCORM_TOC_POPUP) {
|
||||
echo html_writer::div($result->tocmenu, 'scorm-right', array('id' => 'scormnav'));
|
||||
}
|
||||
|
@ -95,6 +95,16 @@ class mod_scorm_renderer extends plugin_renderer_base {
|
||||
public function user_report_actionbar(\mod_scorm\output\userreportsactionbar $userreportsactionbar): string {
|
||||
return $this->render_from_template('mod_scorm/user_report_actionbar', $userreportsactionbar->export_for_template($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the SCORM's "Exit activity" button
|
||||
*
|
||||
* @param string $url The url to be hooked up to the exit button
|
||||
* @return string
|
||||
*/
|
||||
public function generate_exitbar(string $url): string {
|
||||
return $this->render_from_template('mod_scorm/player_exitbar', ['action' => $url]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,11 +77,12 @@ $PAGE->set_title("$course->shortname: ".format_string($scorm->name));
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreport, new moodle_url('/mod/scorm/report.php', array('id' => $cm->id)));
|
||||
$PAGE->navbar->add(fullname($user). " - $strattempt $attempt");
|
||||
|
||||
$PAGE->activityheader->set_attrs([
|
||||
'hidecompletion' => true,
|
||||
'description' => ''
|
||||
]);
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
// End of Print the page header.
|
||||
$currenttab = 'scoes';
|
||||
|
||||
|
@ -94,8 +94,13 @@ if (!$table->is_downloading($download, $exportfilename)) {
|
||||
|
||||
$PAGE->navbar->add(fullname($user). " - $strattempt $attempt");
|
||||
|
||||
$PAGE->activityheader->set_attrs([
|
||||
'hidecompletion' => true,
|
||||
'description' => ''
|
||||
]);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
|
||||
// End of Print the page header.
|
||||
$currenttab = 'interactions';
|
||||
|
||||
|
@ -97,10 +97,11 @@ $exportfilename = $courseshortname . '-' . format_string($scorm->name, true) . '
|
||||
$table = new flexible_table('mod_scorm-userreporttracks');
|
||||
|
||||
if (!$table->is_downloading($download, $exportfilename)) {
|
||||
$PAGE->activityheader->set_attrs([
|
||||
'hidecompletion' => true,
|
||||
'description' => ''
|
||||
]);
|
||||
echo $OUTPUT->header();
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
}
|
||||
$currenttab = '';
|
||||
$renderer = $PAGE->get_renderer('mod_scorm');
|
||||
$useractionreport = new \mod_scorm\output\userreportsactionbar($id, $userid, $attempt, 'attempt', $mode, $scoid);
|
||||
|
@ -32,9 +32,6 @@ if ($ADMIN->fulltree) {
|
||||
get_string('display', 'scorm'), get_string('displaydesc', 'scorm'),
|
||||
array('value' => 0, 'adv' => false), scorm_get_popup_display_array()));
|
||||
|
||||
$settings->add(new admin_setting_configcheckbox('scorm/displayactivityname',
|
||||
get_string('displayactivityname', 'scorm'), get_string('displayactivityname_help', 'scorm'), 1));
|
||||
|
||||
$settings->add(new admin_setting_configtext_with_advanced('scorm/framewidth',
|
||||
get_string('width', 'scorm'), get_string('framewidth', 'scorm'),
|
||||
array('value' => '100', 'adv' => true)));
|
||||
|
32
mod/scorm/templates/player_exitbar.mustache
Normal file
32
mod/scorm/templates/player_exitbar.mustache
Normal file
@ -0,0 +1,32 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_scorm/player_exitbar
|
||||
Actions bar for the user reports page UI.
|
||||
Classes required for JS:
|
||||
* none
|
||||
Data attributes required for JS:
|
||||
* none
|
||||
Context variables required for this template:
|
||||
* action
|
||||
Example context (json):
|
||||
{
|
||||
"action": "http://localhost/moodle/mod/scorm/report.php?id=70&mode=interactions"
|
||||
}
|
||||
}}
|
||||
<div class="d-flex flex-row-reverse mb-2">
|
||||
<a class="btn btn-secondary" href="{{{action}}}" title="{{#str}}exitactivity, mod_scorm{{/str}}">
|
||||
{{#str}}exitactivity, mod_scorm{{/str}}
|
||||
</a>
|
||||
</div>
|
@ -22,6 +22,7 @@
|
||||
* see mod/scorm/classes/output/actionbar.php
|
||||
Example context (json):
|
||||
{
|
||||
"heading": "Heading",
|
||||
"scormreports": {
|
||||
"id": "url_select_test",
|
||||
"options": [
|
||||
@ -39,25 +40,26 @@
|
||||
}}
|
||||
<div class="container-fluid mb-3">
|
||||
<div class="row justify-content-between">
|
||||
<div class="mr-5">
|
||||
{{#scormreports}}
|
||||
{{>core/url_select}}
|
||||
{{/scormreports}}
|
||||
{{#scormreports}}
|
||||
<div>
|
||||
{{>core/url_select}}
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
{{#candownload}}
|
||||
<div class="dropdown show">
|
||||
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{#str}} download {{/str}}
|
||||
</a>
|
||||
{{/scormreports}}
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<a class="dropdown-item" href="{{ downloadods }}">{{#str}} downloadods {{/str}}</a>
|
||||
<a class="dropdown-item" href="{{ downloadexcel }}">{{#str}} downloadexcel {{/str}}</a>
|
||||
<a class="dropdown-item" href="{{ downloadtext }}">{{#str}} downloadtext {{/str}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{/candownload}}
|
||||
{{#candownload}}
|
||||
<div class="dropdown show">
|
||||
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{#str}} download {{/str}}
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<a class="dropdown-item" href="{{ downloadods }}">{{#str}} downloadods {{/str}}</a>
|
||||
<a class="dropdown-item" href="{{ downloadexcel }}">{{#str}} downloadexcel {{/str}}</a>
|
||||
<a class="dropdown-item" href="{{ downloadtext }}">{{#str}} downloadtext {{/str}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{/candownload}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{#heading}}<h2>{{heading}}</h2>{{/heading}}
|
||||
|
@ -29,7 +29,8 @@
|
||||
{"name": "Interactions", "value": "/mod/scorm/report/userreportinteractions.php?id=70&user=13&attempt=1"}
|
||||
]
|
||||
},
|
||||
"backurl": "http://localhost/moodle/mod/scorm/report.php?id=70&mode=interactions"
|
||||
"backurl": "http://localhost/moodle/mod/scorm/report.php?id=70&mode=interactions",
|
||||
"heading": "Sub page heading"
|
||||
}
|
||||
}}
|
||||
<div class="container-fluid mb-3">
|
||||
@ -40,3 +41,4 @@
|
||||
{{/userreport}}
|
||||
</div>
|
||||
</div>
|
||||
{{#heading}}<h2>{{heading}}</h2>{{/heading}}
|
||||
|
@ -672,7 +672,7 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
'grademethod', 'whatgrade', 'maxattempt', 'forcecompleted', 'forcenewattempt', 'lastattemptlock',
|
||||
'displayattemptstatus', 'displaycoursestructure', 'sha1hash', 'md5hash', 'revision', 'launch',
|
||||
'skipview', 'hidebrowse', 'hidetoc', 'nav', 'navpositionleft', 'navpositiontop', 'auto',
|
||||
'popup', 'width', 'height', 'timeopen', 'timeclose', 'displayactivityname', 'packagesize',
|
||||
'popup', 'width', 'height', 'timeopen', 'timeclose', 'packagesize',
|
||||
'packageurl', 'scormtype', 'reference');
|
||||
|
||||
// Add expected coursemodule and data.
|
||||
|
@ -68,8 +68,7 @@ class mod_scorm_generator extends testing_module_generator {
|
||||
'lastattemptlock' => $cfgscorm->lastattemptlock,
|
||||
'forcecompleted' => $cfgscorm->forcecompleted,
|
||||
'masteryoverride' => $cfgscorm->masteryoverride,
|
||||
'auto' => $cfgscorm->auto,
|
||||
'displayactivityname' => $cfgscorm->displayactivityname
|
||||
'auto' => $cfgscorm->auto
|
||||
);
|
||||
if (empty($record['packagefilepath'])) {
|
||||
$record['packagefilepath'] = $CFG->dirroot.'/mod/scorm/tests/packages/singlescobasic.zip';
|
||||
|
@ -1,5 +1,8 @@
|
||||
This files describes API changes in the mod_scorm code.
|
||||
|
||||
=== 4.0 ===
|
||||
* Setting 'displayactivityname' has been removed from scorm. This will be handled by activityheader and is theme dependent.
|
||||
|
||||
=== 3.6 ===
|
||||
|
||||
* The following renamed classes have been completely removed:
|
||||
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2021052500; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2021052501; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2021052500; // Requires this Moodle version.
|
||||
$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics).
|
@ -64,11 +64,9 @@ M.mod_scormform.init = function(Y) {
|
||||
}
|
||||
|
||||
// Set mode and newattempt correctly.
|
||||
var setlaunchoptions = function() {
|
||||
var mode = Y.one('#scormviewform input[name=mode]:checked');
|
||||
var setlaunchoptions = function(mode) {
|
||||
if (mode) {
|
||||
var modevalue = mode.get('value');
|
||||
launch_url += '&mode=' + (modevalue ? modevalue : 'normal');
|
||||
launch_url += '&mode=' + (mode ? mode : 'normal');
|
||||
} else {
|
||||
launch_url += '&mode=normal';
|
||||
}
|
||||
@ -86,13 +84,13 @@ M.mod_scormform.init = function(Y) {
|
||||
}
|
||||
// Listen for view form submit and generate popup on user interaction.
|
||||
if (scormform) {
|
||||
Y.on('submit', function(e) {
|
||||
setlaunchoptions();
|
||||
scormform.delegate('click', function(e) {
|
||||
setlaunchoptions(e.currentTarget.getAttribute('value'));
|
||||
winobj = window.open(launch_url, 'Popup', poptions);
|
||||
this.target = 'Popup';
|
||||
scormredirect(winobj);
|
||||
winobj.opener = null;
|
||||
e.preventDefault();
|
||||
}, scormform);
|
||||
}, 'button[name=mode]');
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,12 @@ if (empty($preventskip) && empty($launch) && (has_capability('mod/scorm:skipview
|
||||
$PAGE->set_title($pagetitle);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
// Let the module handle the display.
|
||||
$PAGE->activityheader->set_description('');
|
||||
if (!empty($action) && $action == 'delete' && confirm_sesskey() && has_capability('mod/scorm:deleteownresponses', $contextmodule)) {
|
||||
$PAGE->activityheader->disable();
|
||||
} else {
|
||||
$PAGE->activityheader->set_description('');
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if (!empty($action) && confirm_sesskey() && has_capability('mod/scorm:deleteownresponses', $contextmodule)) {
|
||||
if ($action == 'delete') {
|
||||
@ -159,7 +164,7 @@ if (empty($launch) && ($scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTAT
|
||||
$scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTATUS_ENTRY)) {
|
||||
$attemptstatus = scorm_get_attempt_status($USER, $scorm, $cm);
|
||||
}
|
||||
echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id), 'container', 'intro');
|
||||
echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id), '', 'intro');
|
||||
|
||||
// Check if SCORM available. No need to display warnings because activity dates are displayed at the top of the page.
|
||||
list($available, $warnings) = scorm_get_availability_status($scorm);
|
||||
@ -168,10 +173,10 @@ if ($available && empty($launch)) {
|
||||
scorm_print_launch($USER, $scorm, 'view.php?id='.$cm->id, $cm);
|
||||
}
|
||||
|
||||
echo $OUTPUT->box($attemptstatus, 'container');
|
||||
echo $OUTPUT->box($attemptstatus);
|
||||
|
||||
if (!empty($forcejs)) {
|
||||
$message = $OUTPUT->box(get_string("forcejavascriptmessage", "scorm"), "container forcejavascriptmessage");
|
||||
$message = $OUTPUT->box(get_string("forcejavascriptmessage", "scorm"), "forcejavascriptmessage");
|
||||
echo html_writer::tag('noscript', $message);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user