Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'm23_MDL-34374' of git://github.com/danmarsden/moodle in…

…to MOODLE_23_STABLE
  • Loading branch information...
commit f315e3e184a3cabef6a3b7bc28b6d040769fed34 2 parents 93c3b29 + fece4fd
@samhemelryk samhemelryk authored
Showing with 15 additions and 4 deletions.
  1. +7 −3 mod/scorm/locallib.php
  2. +8 −1 mod/scorm/mod_form.php
View
10 mod/scorm/locallib.php
@@ -22,6 +22,10 @@
define('SCORM_UPDATE_EVERYDAY', '2');
define('SCORM_UPDATE_EVERYTIME', '3');
+define('SCORM_SKIPVIEW_NEVER', '0');
+define('SCORM_SKIPVIEW_FIRST', '1');
+define('SCORM_SKIPVIEW_ALWAYS', '2');
+
define('SCO_ALL', 0);
define('SCO_DATA', 1);
define('SCO_ONLY', 2);
@@ -109,9 +113,9 @@ function scorm_get_what_grade_array() {
* @return array an array of skip view options
*/
function scorm_get_skip_view_array() {
- return array(0 => get_string('never'),
- 1 => get_string('firstaccess', 'scorm'),
- 2 => get_string('always'));
+ return array(SCORM_SKIPVIEW_NEVER => get_string('never'),
+ SCORM_SKIPVIEW_FIRST => get_string('firstaccess', 'scorm'),
+ SCORM_SKIPVIEW_ALWAYS => get_string('always'));
}
/**
View
9 mod/scorm/mod_form.php
@@ -124,7 +124,14 @@ function definition() {
$mform->setAdvanced('winoptgrp', $cfg_scorm->winoptgrp_adv);
// Skip view page
- $mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), scorm_get_skip_view_array());
+ $skipviewoptions = scorm_get_skip_view_array();
+ if ($COURSE->format == 'scorm') { // Remove option that would cause a constant redirect.
+ unset($skipviewoptions[SCORM_SKIPVIEW_ALWAYS]);
+ if ($cfg_scorm->skipview == SCORM_SKIPVIEW_ALWAYS) {
+ $cfg_scorm->skipview = SCORM_SKIPVIEW_FIRST;
+ }
+ }
+ $mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $skipviewoptions);
$mform->addHelpButton('skipview', 'skipview', 'scorm');
$mform->setDefault('skipview', $cfg_scorm->skipview);
$mform->setAdvanced('skipview', $cfg_scorm->skipview_adv);
Please sign in to comment.
Something went wrong with that request. Please try again.