Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  defined('MOODLE_INTERNAL') || die;
  18  
  19  if ($ADMIN->fulltree) {
  20      require_once($CFG->dirroot . '/mod/scorm/locallib.php');
  21      $yesno = array(0 => get_string('no'),
  22                     1 => get_string('yes'));
  23  
  24      // Default display settings.
  25      $settings->add(new admin_setting_heading('scorm/displaysettings', get_string('defaultdisplaysettings', 'scorm'), ''));
  26  
  27      $settings->add(new admin_setting_configselect_with_advanced('scorm/displaycoursestructure',
  28          get_string('displaycoursestructure', 'scorm'), get_string('displaycoursestructuredesc', 'scorm'),
  29          array('value' => 0, 'adv' => false), $yesno));
  30  
  31      $settings->add(new admin_setting_configselect_with_advanced('scorm/popup',
  32          get_string('display', 'scorm'), get_string('displaydesc', 'scorm'),
  33          array('value' => 0, 'adv' => false), scorm_get_popup_display_array()));
  34  
  35      $settings->add(new admin_setting_configcheckbox('scorm/displayactivityname',
  36          get_string('displayactivityname', 'scorm'), get_string('displayactivityname_help', 'scorm'), 1));
  37  
  38      $settings->add(new admin_setting_configtext_with_advanced('scorm/framewidth',
  39          get_string('width', 'scorm'), get_string('framewidth', 'scorm'),
  40          array('value' => '100', 'adv' => true)));
  41  
  42      $settings->add(new admin_setting_configtext_with_advanced('scorm/frameheight',
  43          get_string('height', 'scorm'), get_string('frameheight', 'scorm'),
  44          array('value' => '500', 'adv' => true)));
  45  
  46      $settings->add(new admin_setting_configcheckbox('scorm/winoptgrp_adv',
  47           get_string('optionsadv', 'scorm'), get_string('optionsadv_desc', 'scorm'), 1));
  48  
  49      foreach (scorm_get_popup_options_array() as $key => $value) {
  50          $settings->add(new admin_setting_configcheckbox('scorm/'.$key,
  51              get_string($key, 'scorm'), '', $value));
  52      }
  53  
  54      $settings->add(new admin_setting_configselect_with_advanced('scorm/skipview',
  55          get_string('skipview', 'scorm'), get_string('skipviewdesc', 'scorm'),
  56          array('value' => 0, 'adv' => true), scorm_get_skip_view_array()));
  57  
  58      $settings->add(new admin_setting_configselect_with_advanced('scorm/hidebrowse',
  59          get_string('hidebrowse', 'scorm'), get_string('hidebrowsedesc', 'scorm'),
  60          array('value' => 0, 'adv' => true), $yesno));
  61  
  62      $settings->add(new admin_setting_configselect_with_advanced('scorm/hidetoc',
  63          get_string('hidetoc', 'scorm'), get_string('hidetocdesc', 'scorm'),
  64          array('value' => 0, 'adv' => true), scorm_get_hidetoc_array()));
  65  
  66      $settings->add(new admin_setting_configselect_with_advanced('scorm/nav',
  67          get_string('nav', 'scorm'), get_string('navdesc', 'scorm'),
  68          array('value' => SCORM_NAV_UNDER_CONTENT, 'adv' => true), scorm_get_navigation_display_array()));
  69  
  70      $settings->add(new admin_setting_configtext_with_advanced('scorm/navpositionleft',
  71          get_string('fromleft', 'scorm'), get_string('navpositionleft', 'scorm'),
  72          array('value' => -100, 'adv' => true)));
  73  
  74      $settings->add(new admin_setting_configtext_with_advanced('scorm/navpositiontop',
  75          get_string('fromtop', 'scorm'), get_string('navpositiontop', 'scorm'),
  76          array('value' => -100, 'adv' => true)));
  77  
  78      $settings->add(new admin_setting_configtext_with_advanced('scorm/collapsetocwinsize',
  79          get_string('collapsetocwinsize', 'scorm'), get_string('collapsetocwinsizedesc', 'scorm'),
  80          array('value' => 767, 'adv' => true)));
  81  
  82      $settings->add(new admin_setting_configselect_with_advanced('scorm/displayattemptstatus',
  83          get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'),
  84          array('value' => 1, 'adv' => false), scorm_get_attemptstatus_array()));
  85  
  86      // Default grade settings.
  87      $settings->add(new admin_setting_heading('scorm/gradesettings', get_string('defaultgradesettings', 'scorm'), ''));
  88      $settings->add(new admin_setting_configselect('scorm/grademethod',
  89          get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'),
  90          GRADEHIGHEST, scorm_get_grade_method_array()));
  91  
  92      for ($i = 0; $i <= 100; $i++) {
  93          $grades[$i] = "$i";
  94      }
  95  
  96      $settings->add(new admin_setting_configselect('scorm/maxgrade',
  97          get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'), 100, $grades));
  98  
  99      $settings->add(new admin_setting_heading('scorm/othersettings', get_string('defaultothersettings', 'scorm'), ''));
 100  
 101      // Default attempts settings.
 102      $settings->add(new admin_setting_configselect('scorm/maxattempt',
 103          get_string('maximumattempts', 'scorm'), '', '0', scorm_get_attempts_array()));
 104  
 105      $settings->add(new admin_setting_configselect('scorm/whatgrade',
 106          get_string('whatgrade', 'scorm'), get_string('whatgradedesc', 'scorm'), HIGHESTATTEMPT, scorm_get_what_grade_array()));
 107  
 108      $settings->add(new admin_setting_configselect('scorm/forcecompleted',
 109          get_string('forcecompleted', 'scorm'), get_string('forcecompleteddesc', 'scorm'), 0, $yesno));
 110  
 111      $forceattempts = scorm_get_forceattempt_array();
 112      $settings->add(new admin_setting_configselect('scorm/forcenewattempt',
 113          get_string('forcenewattempts', 'scorm'), get_string('forcenewattempts_help', 'scorm'), 0, $forceattempts));
 114  
 115      $settings->add(new admin_setting_configselect('scorm/autocommit',
 116      get_string('autocommit', 'scorm'), get_string('autocommitdesc', 'scorm'), 0, $yesno));
 117  
 118      $settings->add(new admin_setting_configselect('scorm/masteryoverride',
 119          get_string('masteryoverride', 'scorm'), get_string('masteryoverridedesc', 'scorm'), 1, $yesno));
 120  
 121      $settings->add(new admin_setting_configselect('scorm/lastattemptlock',
 122          get_string('lastattemptlock', 'scorm'), get_string('lastattemptlockdesc', 'scorm'), 0, $yesno));
 123  
 124      $settings->add(new admin_setting_configselect('scorm/auto',
 125          get_string('autocontinue', 'scorm'), get_string('autocontinuedesc', 'scorm'), 0, $yesno));
 126  
 127      $settings->add(new admin_setting_configselect('scorm/updatefreq',
 128          get_string('updatefreq', 'scorm'), get_string('updatefreqdesc', 'scorm'), 0, scorm_get_updatefreq_array()));
 129  
 130      // Admin level settings.
 131      $settings->add(new admin_setting_heading('scorm/adminsettings', get_string('adminsettings', 'scorm'), ''));
 132  
 133      $settings->add(new admin_setting_configcheckbox('scorm/scormstandard', get_string('scormstandard', 'scorm'),
 134                                                      get_string('scormstandarddesc', 'scorm'), 0));
 135  
 136      $settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));
 137  
 138      $settings->add(new admin_setting_configcheckbox('scorm/allowtypelocalsync', get_string('allowtypelocalsync', 'scorm'), '', 0));
 139  
 140      $settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternalaicc',
 141          get_string('allowtypeexternalaicc', 'scorm'), get_string('allowtypeexternalaicc_desc', 'scorm'), 0));
 142  
 143      $settings->add(new admin_setting_configcheckbox('scorm/allowaicchacp', get_string('allowtypeaicchacp', 'scorm'),
 144                                                      get_string('allowtypeaicchacp_desc', 'scorm'), 0));
 145  
 146      $settings->add(new admin_setting_configtext('scorm/aicchacptimeout',
 147          get_string('aicchacptimeout', 'scorm'), get_string('aicchacptimeout_desc', 'scorm'),
 148          30, PARAM_INT));
 149  
 150      $settings->add(new admin_setting_configtext('scorm/aicchacpkeepsessiondata',
 151          get_string('aicchacpkeepsessiondata', 'scorm'), get_string('aicchacpkeepsessiondata_desc', 'scorm'),
 152          1, PARAM_INT));
 153  
 154      $settings->add(new admin_setting_configcheckbox('scorm/aiccuserid', get_string('aiccuserid', 'scorm'),
 155                                                      get_string('aiccuserid_desc', 'scorm'), 1));
 156  
 157      $settings->add(new admin_setting_configcheckbox('scorm/forcejavascript', get_string('forcejavascript', 'scorm'),
 158                                                      get_string('forcejavascript_desc', 'scorm'), 1));
 159  
 160      $settings->add(new admin_setting_configcheckbox('scorm/allowapidebug', get_string('allowapidebug', 'scorm'), '', 0));
 161  
 162      $settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '.*'));
 163  
 164      $settings->add(new admin_setting_configcheckbox('scorm/protectpackagedownloads', get_string('protectpackagedownloads', 'scorm'),
 165                                                      get_string('protectpackagedownloads_desc', 'scorm'), 0));
 166  
 167  }