Index: lang/en_utf8/scorm.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/scorm.php,v retrieving revision 1.18.4.9 diff -u -r1.18.4.9 scorm.php --- lang/en_utf8/scorm.php 24 Sep 2008 07:02:46 -0000 1.18.4.9 +++ lang/en_utf8/scorm.php 7 Oct 2008 05:27:56 -0000 @@ -12,6 +12,7 @@ $string['attemptsx'] = '$a attempts'; $string['attr_error'] = 'Bad value for attribute ($a->attr) in tag $a->tag.'; $string['autocontinue'] = 'Auto-Continue'; +$string['autocontinuedesc'] = 'This preferences sets the default auto continue for the activity'; $string['averageattempt'] = 'Average attempts'; $string['badmanifest'] = 'Some manifest errors: see errors log'; $string['badpackage'] = 'The specified package/manifest is not valid. Check it and try again.'; @@ -30,6 +31,7 @@ $string['details'] = 'Track details'; $string['directories'] = 'Show the directory links'; $string['display'] = 'Display package'; +$string['displaydesc'] = 'This preference set the default of whether to display the package or not for an activity'; $string['domxml'] = 'DOMXML external library'; $string['element'] = 'Element'; $string['entercourse'] = 'Enter course'; @@ -52,15 +54,19 @@ $string['gradeaverage'] = 'Average grade'; $string['gradehighest'] = 'Highest grade'; $string['grademethod'] = 'Grading method'; +$string['grademethoddesc'] = 'This preferences sets the default grade method for an activity'; $string['gradescoes'] = 'Learning Objects'; $string['gradesum'] = 'Sum grade'; $string['height'] = 'Height'; $string['hidden'] = 'Hidden'; $string['hidebrowse'] = 'Disable preview mode'; +$string['hidebrowsedesc'] = 'This preferences sets the default or whether to disable or enable the preview mode'; $string['hideexit'] = 'Hide exit link'; $string['hidenav'] = 'Hide navigation buttons'; +$string['hidenavdesc'] = 'This preferences sets the default or whether to show or hide the navigation buttons'; $string['hidereview'] = 'Hide review button'; $string['hidetoc'] = 'Course structure display (TOC)'; +$string['hidetocdesc'] = 'This preferences sets the default for whether to show or hide the course structure display (TOC)'; $string['highestattempt'] = 'Highest attempt'; $string['identifier'] = 'Question Identifier'; $string['iframe'] = 'Current window'; @@ -73,6 +79,8 @@ $string['location'] = 'Show the location bar'; $string['max'] = 'Max score'; $string['maximumattempts'] = 'Number of attempts'; +$string['maximumattemptsdesc'] = 'This preferences sets the default number of maximum attempts for an activity'; +$string['maximumgradedesc'] = 'This preferences sets the default maximum grade for an activity'; $string['menubar'] = 'Show the menu bar'; $string['min'] = 'Min score'; $string['missing_attribute'] = 'Missing attribute $a->attr in tag $a->tag'; @@ -104,6 +112,8 @@ $string['passed'] = 'Passed'; $string['php5'] = 'PHP 5 (DOMXML native library)'; $string['popup'] = 'New window'; +$string['popupblocked'] = 'If a new windows doesn\'t apprear click $a to open a new window'; +$string['popupblockedlinkname'] = 'here'; $string['popupmenu'] = 'In a drop down menu'; $string['popupopen'] = 'Open package in a new window'; $string['position_error'] = 'The $a->tag tag can\'t be child of $a->parent tag'; @@ -126,6 +136,7 @@ $string['scrollbars'] = 'Allow the window to be scrolled'; $string['sided'] = 'On the left side'; $string['skipview'] = 'Student skip content structure page'; +$string['skipviewdesc'] = 'This preferences sets the default of when to skip content structure for a page'; $string['slashargs'] = 'WARNING: slash arguments is disabled on this site and objects may not function as expected!'; $string['stagesize'] = 'Stage size'; $string['started'] = 'Started on'; @@ -151,10 +162,12 @@ $string['viewallreports'] = 'View reports for $a attempts'; $string['viewalluserreports'] = 'View reports for $a users'; $string['whatgrade'] = 'Attempts grading'; +$string['whatgradedesc'] = 'This preferences sets the default attempts grading'; $string['width'] = 'Width'; $string['window'] = 'Window'; $string['unziperror'] = 'An error occurs during package unzip'; $string['othersettings'] = 'Additional settings'; +$string['updatefreqdesc'] = 'This preferences sets the default auto-update frequency of an activity'; $string['updatefreq'] = 'Auto-update frequency'; $string['options'] = 'Options'; $string['activityloading'] = "You will be automatically redirected to the activity in"; // used in conjunction with numseconds Index: mod/scorm/locallib.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/scorm/locallib.php,v retrieving revision 1.46.2.18 diff -u -r1.46.2.18 locallib.php --- mod/scorm/locallib.php 26 Sep 2008 00:35:10 -0000 1.46.2.18 +++ mod/scorm/locallib.php 13 Oct 2008 18:06:58 -0000 @@ -1,4 +1,4 @@ - get_string('gradescoes', 'scorm'), - GRADEHIGHEST => get_string('gradehighest', 'scorm'), - GRADEAVERAGE => get_string('gradeaverage', 'scorm'), - GRADESUM => get_string('gradesum', 'scorm')); define('HIGHESTATTEMPT', '0'); define('AVERAGEATTEMPT', '1'); define('FIRSTATTEMPT', '2'); define('LASTATTEMPT', '3'); -$SCORM_WHAT_GRADE = array (HIGHESTATTEMPT => get_string('highestattempt', 'scorm'), - AVERAGEATTEMPT => get_string('averageattempt', 'scorm'), - FIRSTATTEMPT => get_string('firstattempt', 'scorm'), - LASTATTEMPT => get_string('lastattempt', 'scorm')); - -$SCORM_POPUP_OPTIONS = array('resizable'=>1, - 'scrollbars'=>1, - 'directories'=>0, - 'location'=>0, - 'menubar'=>0, - 'toolbar'=>0, - 'status'=>0); + +/** + * Returns an array of the popup options for SCORM and each options default value + * + * @return array an array of popup options as the key and their defaults as the value + */ +function scorm_get_popup_options_array(){ + global $CFG; + return array('resizable'=> $CFG->scorm_resizable, + 'scrollbars'=> $CFG->scorm_scrollbars, + 'directories'=> $CFG->scorm_directories, + 'location'=> $CFG->scorm_location, + 'menubar'=> $CFG->scorm_menubar, + 'toolbar'=> $CFG->scorm_toolbar, + 'status'=> $CFG->scorm_status); +} + $stdoptions = ''; -foreach ($SCORM_POPUP_OPTIONS as $popupopt => $value) { +foreach (scorm_get_popup_options_array() as $popupopt => $value) { $stdoptions .= $popupopt.'='.$value; if ($popupopt != 'status') { $stdoptions .= ','; } } -if (!isset($CFG->scorm_maxattempts)) { - set_config('scorm_maxattempts','6'); -} - -if (!isset($CFG->scorm_frameheight)) { - set_config('scorm_frameheight','500'); -} - -if (!isset($CFG->scorm_framewidth)) { - set_config('scorm_framewidth','100%'); -} - if (!isset($CFG->scorm_updatetime)) { set_config('scorm_updatetime','2'); } @@ -68,6 +57,88 @@ } /// Local Library of functions for module scorm +/** + * Returns an array of the array of what grade options + * + * @return array an array of what grade options + */ +function scorm_get_grade_method_array(){ + return array (GRADESCOES => get_string('gradescoes', 'scorm'), + GRADEHIGHEST => get_string('gradehighest', 'scorm'), + GRADEAVERAGE => get_string('gradeaverage', 'scorm'), + GRADESUM => get_string('gradesum', 'scorm')); +} + +/** + * Returns an array of the array of what grade options + * + * @return array an array of what grade options + */ +function scorm_get_what_grade_array(){ + return array (HIGHESTATTEMPT => get_string('highestattempt', 'scorm'), + AVERAGEATTEMPT => get_string('averageattempt', 'scorm'), + FIRSTATTEMPT => get_string('firstattempt', 'scorm'), + LASTATTEMPT => get_string('lastattempt', 'scorm')); +} + +/** + * Returns an array of the array of skip view options + * + * @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')); +} + +/** + * Returns an array of the array of hide table of contents options + * + * @return array an array of hide table of contents options + */ +function scorm_get_hidetoc_array(){ + return array(0 =>get_string('sided','scorm'), + 1 => get_string('hidden','scorm'), + 2 => get_string('popupmenu','scorm')); +} + +/** + * Returns an array of the array of update frequency options + * + * @return array an array of update frequency options + */ +function scorm_get_updatefreq_array(){ + return array(0 => get_string('never'), + 1 => get_string('everyday','scorm'), + 2 => get_string('everytime','scorm')); +} + +/** + * Returns an array of the array of popup display options + * + * @return array an array of popup display options + */ +function scorm_get_popup_display_array(){ + return array(0 => get_string('iframe', 'scorm'), + 1 => get_string('popup', 'scorm')); +} + +/** + * Returns an array of the array of attempt options + * + * @return array an array of attempt options + */ +function scorm_get_attempts_array(){ + $attempts = array(0 => get_string('nolimit','scorm'), + 1 => get_string('attempt1','scorm')); + + for ($i=2; $i<=6; $i++) { + $attempts[$i] = get_string('attemptsx','scorm', $i); + } + + return $attempts; +} /** * This function will permanently delete the given Index: mod/scorm/mod_form.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/scorm/mod_form.php,v retrieving revision 1.11.2.7 diff -u -r1.11.2.7 mod_form.php --- mod/scorm/mod_form.php 27 Aug 2008 22:02:53 -0000 1.11.2.7 +++ mod/scorm/mod_form.php 10 Oct 2008 23:27:40 -0000 @@ -6,7 +6,7 @@ function definition() { - global $CFG, $COURSE, $SCORM_GRADE_METHOD, $SCORM_WHAT_GRADE; + global $CFG, $COURSE; $mform =& $this->_form; if (isset($CFG->slasharguments) && !$CFG->slasharguments) { $mform->addElement('static', '', '',notify(get_string('slashargs', 'scorm'), 'notifyproblem', 'center', true)); @@ -40,39 +40,31 @@ $mform->addElement('header', 'advanced', get_string('othersettings', 'form')); // Grade Method - $mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), $SCORM_GRADE_METHOD); + $mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), scorm_get_grade_method_array()); $mform->setHelpButton('grademethod', array('grademethod',get_string('grademethod', 'scorm'),'scorm')); - $mform->setDefault('grademethod', 0); + $mform->setDefault('grademethod', $CFG->scorm_grademethod); // Maximum Grade for ($i=0; $i<=100; $i++) { $grades[$i] = "$i"; } $mform->addElement('select', 'maxgrade', get_string('maximumgrade'), $grades); - $mform->setDefault('maxgrade', 0); + $mform->setDefault('maxgrade', $CFG->scorm_maxgrade); $mform->disabledIf('maxgrade', 'grademethod','eq',GRADESCOES); // Attempts $mform->addElement('static', '', '' ,'