Merge branch 'MDL-38935' of git://github.com/timhunt/moodle
authorDamyon Wiese <damyon@moodle.com>
Wed, 10 Apr 2013 03:17:31 +0000 (11:17 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 10 Apr 2013 03:17:31 +0000 (11:17 +0800)
mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-coverage.js
mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js
mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-min.js
mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js
mod/quiz/yui/src/autosave/js/autosave.js

index b0ac14d..1540646 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-coverage.js and b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-coverage.js differ
index 76a2f50..043c560 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js and b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js differ
index 5960b48..64d9bad 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-min.js and b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-min.js differ
index b8b072d..b884cf2 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js and b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js differ
index 4f5dafb..feb8054 100644 (file)
@@ -119,9 +119,11 @@ M.mod_quiz.autosave = {
      * or enough time has passed.
      */
     init_tinymce: function(repeatcount) {
-        if (typeof tinymce === 'undefined') {
+        if (typeof tinyMCE === 'undefined') {
             if (repeatcount > 0) {
                 Y.later(this.TINYMCE_DETECTION_DELAY, this, this.init_tinymce, [repeatcount - 1]);
+            } else {
+                Y.log('Gave up looking for TinyMCE.');
             }
             return;
         }
@@ -145,7 +147,8 @@ M.mod_quiz.autosave = {
     },
 
     value_changed: function(e) {
-        if (e.target.get('name') === 'thispage' || e.target.get('name').match(/_:flagged$/)) {
+        if (e.target.get('name') === 'thispage' || e.target.get('name') === 'scrollpos' ||
+                e.target.get('name').match(/_:flagged$/)) {
             return; // Not interesting.
         }
         Y.log('Detected a value change in element ' + e.target.get('name') + '.');
@@ -191,6 +194,9 @@ M.mod_quiz.autosave = {
         }
 
         Y.log('Doing a save.');
+        if (typeof tinyMCE !== 'undefined') {
+            tinyMCE.triggerSave();
+        }
         this.save_transaction = Y.io(this.AUTOSAVE_HANDLER, {
             method:  'POST',
             form:    {id: this.form},