Merge branch 'MDL-47363' of git://github.com/marinaglancy/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 17 Oct 2014 13:46:30 +0000 (14:46 +0100)
committerDan Poltawski <dan@moodle.com>
Fri, 17 Oct 2014 13:46:30 +0000 (14:46 +0100)
17 files changed:
course/moodleform_mod.php
grade/report/singleview/db/access.php [changed mode: 0755->0644]
grade/report/singleview/index.php [changed mode: 0755->0644]
grade/report/singleview/lang/en/gradereport_singleview.php [changed mode: 0755->0644]
grade/report/singleview/lib.php [changed mode: 0755->0644]
grade/report/singleview/version.php [changed mode: 0755->0644]
lang/en/rating.php
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/autosave.js
mod/assign/tests/lib_test.php
mod/lti/edit_form.php
mod/lti/register_form.php
mod/lti/registersettings.php
mod/scorm/locallib.php
version.php

index 33014d6..1f5b051 100644 (file)
@@ -291,14 +291,6 @@ abstract class moodleform_mod extends moodleform {
             }
         }
 
-        // Ratings: Don't let them select an aggregate type without selecting a scale.
-        // If the user has selected to use ratings but has not chosen a scale or set max points then the form is
-        // invalid. If ratings have been selected then the user must select either a scale or max points.
-        // This matches (horrible) logic in data_preprocessing.
-        if (isset($data['assessed']) && $data['assessed'] > 0 && empty($data['scale'])) {
-            $errors['assessed'] = get_string('scaleselectionrequired', 'rating');
-        }
-
         // Completion: Don't let them choose automatic completion without turning
         // on some conditions. Ignore this check when completion settings are
         // locked, as the options are then disabled.
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1282b05..79cc8d2 100644 (file)
@@ -55,4 +55,3 @@ $string['ratingtime'] = 'Restrict ratings to items with dates in this range:';
 $string['ratings'] = 'Ratings';
 $string['rolewarning'] = 'Roles with permission to rate';
 $string['rolewarning_help'] = 'To submit ratings users require the moodle/rating:rate capability and any module specific capabilities. Users assigned the following roles should be able to rate items. The list of roles may be amended via the permissions link in the administration block.';
-$string['scaleselectionrequired'] = 'When selecting a ratings aggregate type you must also select to use either a scale or set a maximum points.';
\ No newline at end of file
index 2254cc0..9b9e076 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js differ
index 0a8ea93..3a7076c 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js differ
index 8f3a664..0b12292 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js differ
index ee2ec44..44195eb 100644 (file)
@@ -142,16 +142,14 @@ EditorAutosave.prototype = {
             context: this,
             on: {
                 success: function(id,o) {
-                    if (typeof o.responseText !== "undefined" &&
-                            o.responseText !== "" &&
-                            o.responseText !== this.textarea.get('value')) {
+                    if (typeof o.responseText !== "undefined" && o.responseText !== "") {
                         response_json = JSON.parse(o.responseText);
-                        if (!response_json.error && response_json.result) {
-                            Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
-                            this.recoverText(response_json.result);
-                        } else {
+                        if (response_json.error || typeof response_json.result === 'undefined') {
                             Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
                             this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
+                        } else if (response_json !== this.textarea.get('value')) {
+                            Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
+                            this.recoverText(response_json.result);
                         }
                         this._fireSelectionChanged();
                     }
index 92773ac..367a2b7 100644 (file)
@@ -105,7 +105,6 @@ class mod_assign_lib_testcase extends mod_assign_base_testcase {
         global $DB;
         $courses = $DB->get_records('course', array('id' => $this->course->id));
 
-
         // Check the overview as the different users.
         $this->setUser($this->students[0]);
         $overview = array();
@@ -124,6 +123,10 @@ class mod_assign_lib_testcase extends mod_assign_base_testcase {
     }
 
     public function test_print_recent_activity() {
+        // Submitting an assignment generates a notification.
+        $this->preventResetByRollback();
+        $sink = $this->redirectMessages();
+
         $this->setUser($this->editingteachers[0]);
         $assign = $this->create_instance();
         $data = new stdClass();
@@ -135,10 +138,16 @@ class mod_assign_lib_testcase extends mod_assign_base_testcase {
         $this->setUser($this->editingteachers[0]);
         $this->expectOutputRegex('/submitted:/');
         assign_print_recent_activity($this->course, true, time() - 3600);
+
+        $sink->close();
     }
 
     /** Make sure fullname dosn't trigger any warnings when assign_print_recent_activity is triggered. */
     public function test_print_recent_activity_fullname() {
+        // Submitting an assignment generates a notification.
+        $this->preventResetByRollback();
+        $sink = $this->redirectMessages();
+
         $this->setUser($this->editingteachers[0]);
         $assign = $this->create_instance();
 
@@ -152,9 +161,15 @@ class mod_assign_lib_testcase extends mod_assign_base_testcase {
         $this->expectOutputRegex('/submitted:/');
         set_config('fullnamedisplay', 'firstname, lastnamephonetic');
         assign_print_recent_activity($this->course, false, time() - 3600);
+
+        $sink->close();
     }
 
     public function test_assign_get_recent_mod_activity() {
+        // Submitting an assignment generates a notification.
+        $this->preventResetByRollback();
+        $sink = $this->redirectMessages();
+
         $this->setUser($this->editingteachers[0]);
         $assign = $this->create_instance();
 
@@ -180,6 +195,7 @@ class mod_assign_lib_testcase extends mod_assign_base_testcase {
                                         $assign->get_course_module()->id);
 
         $this->assertEquals("assign", $activities[1]->type);
+        $sink->close();
     }
 
     public function test_assign_user_complete() {
index d57a0dc..e07a30d 100644 (file)
@@ -58,7 +58,7 @@ class mod_lti_edit_types_form extends moodleform{
 
         $mform    =& $this->_form;
 
-        $istool = $this->_customdata->istool;
+        $istool = $this->_customdata && $this->_customdata->istool;
 
         // Add basiclti elements.
         $mform->addElement('header', 'setup', get_string('tool_settings', 'lti'));
index 42473a2..a108101 100644 (file)
@@ -50,16 +50,18 @@ class mod_lti_register_types_form extends moodleform {
 
         // Tool Provider name.
 
+        $strrequired = get_string('required');
         $mform->addElement('text', 'lti_registrationname', get_string('registrationname', 'lti'));
         $mform->setType('lti_registrationname', PARAM_TEXT);
         $mform->addHelpButton('lti_registrationname', 'registrationname', 'lti');
-        $mform->addRule('lti_registrationname', null, 'required', null, 'client');
+        $mform->addRule('lti_registrationname', $strrequired, 'required', null, 'client');
 
         // Registration URL.
 
         $mform->addElement('text', 'lti_registrationurl', get_string('registrationurl', 'lti'), array('size' => '64'));
-        $mform->setType('lti_registrationurl', PARAM_TEXT);
+        $mform->setType('lti_registrationurl', PARAM_URL);
         $mform->addHelpButton('lti_registrationurl', 'registrationurl', 'lti');
+        $mform->addRule('lti_registrationurl', $strrequired, 'required', null, 'client');
 
         // LTI Capabilities.
 
@@ -70,6 +72,7 @@ class mod_lti_register_types_form extends moodleform {
             array_combine($options, $options), $attributes);
         $mform->setType('lti_capabilities', PARAM_TEXT);
         $mform->addHelpButton('lti_capabilities', 'capabilities', 'lti');
+        $mform->addRule('lti_capabilities', $strrequired, 'required', null, 'client');
 
         // LTI Services.
 
@@ -82,6 +85,7 @@ class mod_lti_register_types_form extends moodleform {
         $mform->addElement('select', 'lti_services', get_string('services', 'lti'), $options, $attributes);
         $mform->setType('lti_services', PARAM_TEXT);
         $mform->addHelpButton('lti_services', 'services', 'lti');
+        $mform->addRule('lti_services', $strrequired, 'required', null, 'client');
 
         $mform->addElement('hidden', 'toolproxyid');
         $mform->setType('toolproxyid', PARAM_INT);
@@ -97,7 +101,6 @@ class mod_lti_register_types_form extends moodleform {
         // Add standard buttons, common to all modules.
 
         $this->add_action_buttons();
-
     }
 
     /**
@@ -112,16 +115,4 @@ class mod_lti_register_types_form extends moodleform {
         $mform->disabledIf('lti_services', null);
 
     }
-
-    /**
-     * Set up rules for required fields.
-     */
-    public function required_fields() {
-
-        $mform    =& $this->_form;
-
-        $mform->addRule('lti_registrationurl', null, 'required', null, 'client');
-
-    }
-
 }
index a96a6f1..c58bf0e 100644 (file)
@@ -81,11 +81,7 @@ if ($form->is_cancelled()) {
         $form->set_data($toolproxy);
         if ($toolproxy->state == LTI_TOOL_PROXY_STATE_ACCEPTED) {
             $form->disable_fields();
-        } else {
-            $form->required_fields();
         }
-    } else {
-        $form->required_fields();
     }
     $form->display();
 
index 2afe218..06f1863 100644 (file)
@@ -848,9 +848,9 @@ function scorm_get_all_attempts($scormid, $userid) {
 }
 
 function scorm_view_display ($user, $scorm, $action, $cm) {
-    global $CFG, $DB, $OUTPUT;
+    global $CFG, $DB, $PAGE, $OUTPUT, $COURSE;
 
-    if ($scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
+    if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
         scorm_parse($scorm, false);
     }
 
@@ -952,7 +952,7 @@ function scorm_simple_play($scorm, $user, $context, $cmid) {
         return $result;
     }
 
-    if ($scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
+    if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
         scorm_parse($scorm, false);
     }
     $scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND '.
index e93a48e..da6ae39 100644 (file)
 
 defined('MOODLE_INTERNAL') || die();
 
-$version  = 2014101500.00;              // YYYYMMDD      = weekly release date of this DEV branch.
+$version  = 2014101700.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                         //         RR    = release increments - 00 in DEV branches.
                                         //           .XX = incremental changes.
 
-$release  = '2.8beta+ (Build: 20141015)'; // Human-friendly version name
+$release  = '2.8beta+ (Build: 20141017)'; // Human-friendly version name
 
 $branch   = '28';                       // This version's branch.
 $maturity = MATURITY_BETA;             // This version's maturity level.