Merge branch 'MDL-55170_master' of https://github.com/nadavkav/moodle
authorDavid Monllao <davidm@moodle.com>
Tue, 12 Jul 2016 08:30:31 +0000 (10:30 +0200)
committerDavid Monllao <davidm@moodle.com>
Tue, 12 Jul 2016 08:30:31 +0000 (10:30 +0200)
Conflicts:
theme/bootstrapbase/style/moodle.css

228 files changed:
.eslintrc
Gruntfile.js
admin/cli/reset_password.php
admin/searchareas.php [new file with mode: 0644]
admin/settings/plugins.php
admin/tool/lp/amd/build/actionselector.min.js
admin/tool/lp/amd/build/competencies.min.js
admin/tool/lp/amd/build/competencyactions.min.js
admin/tool/lp/amd/build/competencypicker.min.js
admin/tool/lp/amd/build/competencypicker_user_plans.min.js
admin/tool/lp/amd/build/competencyruleconfig.min.js
admin/tool/lp/amd/build/grade_user_competency_inline.min.js
admin/tool/lp/amd/build/menubar.min.js
admin/tool/lp/amd/build/parentcompetency_form.min.js
admin/tool/lp/amd/build/planactions.min.js
admin/tool/lp/amd/build/scaleconfig.min.js
admin/tool/lp/amd/build/user_evidence_actions.min.js
admin/tool/lp/amd/src/actionselector.js
admin/tool/lp/amd/src/competencies.js
admin/tool/lp/amd/src/competency_outcomes.js
admin/tool/lp/amd/src/competency_rule_points.js
admin/tool/lp/amd/src/competencyactions.js
admin/tool/lp/amd/src/competencydialogue.js
admin/tool/lp/amd/src/competencypicker.js
admin/tool/lp/amd/src/competencypicker_user_plans.js
admin/tool/lp/amd/src/competencyruleconfig.js
admin/tool/lp/amd/src/course_competency_settings.js
admin/tool/lp/amd/src/dragdrop-reorder.js
admin/tool/lp/amd/src/evidence_delete.js
admin/tool/lp/amd/src/form-cohort-selector.js
admin/tool/lp/amd/src/frameworkactions.js
admin/tool/lp/amd/src/grade_user_competency_inline.js
admin/tool/lp/amd/src/menubar.js
admin/tool/lp/amd/src/parentcompetency_form.js
admin/tool/lp/amd/src/planactions.js
admin/tool/lp/amd/src/scaleconfig.js
admin/tool/lp/amd/src/templateactions.js
admin/tool/lp/amd/src/tree.js
admin/tool/lp/amd/src/user_competency_info.js
admin/tool/lp/amd/src/user_competency_plan_popup.js
admin/tool/lp/amd/src/user_evidence_actions.js
admin/tool/templatelibrary/amd/src/search.js
course/classes/search/mycourse.php
course/view.php
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-debug.js
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop.js
course/yui/build/moodle-course-management/moodle-course-management-debug.js
course/yui/build/moodle-course-management/moodle-course-management.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js
course/yui/src/dragdrop/js/dragdrop.js
course/yui/src/management/js/category.js
course/yui/src/management/js/console.js
course/yui/src/management/js/course.js
course/yui/src/management/js/dd.js
course/yui/src/toolboxes/js/resource.js
course/yui/src/toolboxes/js/section.js
course/yui/src/toolboxes/js/toolbox.js
filter/mathjaxloader/filter.php
grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-debug.js
grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable.js
grade/report/grader/yui/src/gradereporttable/js/floatingheaders.js
grade/report/grader/yui/src/gradereporttable/js/gradereporttable.js
lang/en/admin.php
lib/adminlib.php
lib/amd/build/fragment.min.js
lib/amd/build/notification.min.js
lib/amd/build/tag.min.js
lib/amd/src/event.js
lib/amd/src/form-autocomplete.js
lib/amd/src/form-course-selector.js
lib/amd/src/fragment.js
lib/amd/src/localstorage.js
lib/amd/src/notification.js
lib/amd/src/tag.js
lib/amd/src/templates.js
lib/amd/src/tree.js
lib/classes/grades_external.php
lib/classes/plugin_manager.php
lib/db/services.php
lib/db/upgrade.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.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js
lib/editor/atto/yui/src/editor/js/autosave.js
lib/editor/atto/yui/src/editor/js/clean.js
lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js
lib/editor/atto/yui/src/editor/js/editor.js
lib/editor/atto/yui/src/editor/js/lintconfig.js [deleted file]
lib/editor/atto/yui/src/editor/js/selection.js
lib/editor/atto/yui/src/editor/js/styling.js
lib/editor/atto/yui/src/editor/js/toolbar-keyboardnav.js
lib/externallib.php
lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js
lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector.js
lib/form/yui/src/dateselector/js/dateselector.js
lib/tests/externallib_test.php
lib/upgrade.txt
lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js
lib/yui/build/moodle-core-dock/moodle-core-dock.js
lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm-debug.js
lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm.js
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception.js
lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-debug.js
lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert.js
lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js
lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-debug.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception.js
lib/yui/src/blocks/js/blockregion.js
lib/yui/src/blocks/js/blocks.js
lib/yui/src/blocks/js/manager.js
lib/yui/src/dock/js/block.js
lib/yui/src/dock/js/dock.js
lib/yui/src/dock/js/dockeditem.js
lib/yui/src/dock/js/panel.js
lib/yui/src/dock/js/tabheightmanager.js
lib/yui/src/languninstallconfirm/js/languninstallconfirm.js
lib/yui/src/notification/js/ajaxexception.js
lib/yui/src/notification/js/alert.js
lib/yui/src/notification/js/confirm.js
lib/yui/src/notification/js/dialogue.js
lib/yui/src/notification/js/exception.js
lib/yui/src/notification/js/info.js
lib/yui/src/notification/js/shared.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js
message/yui/src/messenger/js/constants.js
message/yui/src/messenger/js/manager.js
message/yui/src/messenger/js/sendmessage.js
mod/assign/amd/build/grading_navigation.min.js
mod/assign/amd/src/grading_navigation.js
mod/assign/amd/src/grading_panel.js
mod/assign/amd/src/participant_selector.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationline.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationoval.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationpen.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationrectangle.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/globals.js
mod/assign/feedback/editpdf/yui/src/editor/js/quickcommentlist.js
mod/book/tests/search_test.php
mod/choice/db/access.php
mod/choice/lang/en/choice.php
mod/choice/version.php
mod/data/lib.php
mod/forum/externallib.php
mod/forum/lib.php
mod/forum/tests/lib_test.php
mod/forum/tests/search_test.php
mod/glossary/classes/search/entry.php
mod/glossary/tests/search_test.php
mod/lesson/pagetypes/numerical.php
mod/lti/amd/build/cartridge_registration_form.min.js
mod/lti/amd/src/cartridge_registration_form.js
mod/lti/amd/src/tool_proxy.js
mod/lti/amd/src/tool_type.js
mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop-debug.js
mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop.js
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-debug.js
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-min.js
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes.js
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-debug.js
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page.js
mod/quiz/yui/src/dragdrop/js/dragdrop.js
mod/quiz/yui/src/dragdrop/js/resource.js
mod/quiz/yui/src/toolboxes/js/resource.js
mod/quiz/yui/src/toolboxes/js/section.js
mod/quiz/yui/src/toolboxes/js/toolbox.js
mod/quiz/yui/src/util/js/page.js
mod/survey/classes/search/activity.php
mod/wiki/tests/search_test.php
mod/workshop/lang/en/workshop.php
mod/workshop/renderer.php
npm-shrinkwrap.json
package.json
question/type/ddimageortext/yui/build/moodle-qtype_ddimageortext-form/moodle-qtype_ddimageortext-form-debug.js
question/type/ddimageortext/yui/build/moodle-qtype_ddimageortext-form/moodle-qtype_ddimageortext-form.js
question/type/ddimageortext/yui/src/form/js/form.js
question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-debug.js
question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form.js
question/type/ddmarker/yui/src/form/js/form.js
report/competency/amd/src/grading_popup.js
report/search/classes/output/form.php [deleted file]
report/search/classes/output/renderer.php [deleted file]
report/search/index.php [deleted file]
report/search/lang/en/report_search.php [deleted file]
report/search/settings.php [deleted file]
search/classes/area/base.php
search/classes/area/base_activity.php
search/classes/document.php
search/classes/manager.php
search/templates/result.mustache
search/tests/document_test.php [new file with mode: 0644]
search/tests/fixtures/mock_search_area.php
search/tests/fixtures/mock_search_engine.php
search/tests/generator/lib.php
search/tests/manager_test.php
theme/bootstrapbase/less/moodle/bootstrapoverride.less
theme/bootstrapbase/less/moodle/core.less
theme/bootstrapbase/less/moodle/course.less
theme/bootstrapbase/less/moodle/expendable.less
theme/bootstrapbase/less/moodle/filemanager.less
theme/bootstrapbase/less/moodle/forms.less
theme/bootstrapbase/less/moodle/grade.less
theme/bootstrapbase/less/moodle/message.less
theme/bootstrapbase/less/moodle/modules.less
theme/bootstrapbase/less/moodle/question.less
theme/bootstrapbase/less/moodle/responsive.less
theme/bootstrapbase/less/moodle/search.less
theme/bootstrapbase/less/moodle/templates.less
theme/bootstrapbase/less/moodle/undo.less
theme/bootstrapbase/style/moodle.css
version.php

index 03dc85a..c701962 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -9,10 +9,10 @@
   },
   'rules': {
     // See http://eslint.org/docs/rules/ for all rules and explanations of all
-    // rules. Commented out rules with 'DEFINE POLICY' are rules Dan P has flagged
-    // for discussion and possible enable soon.
+    // rules.
+
     // === Possible Errors ===
-    // DEFINE POLICY: 'comma-dangle': ['off', 'always'],
+    'comma-dangle': 'off',
     'no-cond-assign': 'error',
     'no-console': 'error',
     'no-constant-condition': 'error',
@@ -21,7 +21,7 @@
     'no-dupe-args': 'error',
     'no-dupe-keys': 'error',
     'no-duplicate-case': 'error',
-    // Disabled for YUI rollups, enabled by grunt for AMD: 'no-empty': 'error',
+    'no-empty': 'warn',
     'no-empty-character-class': 'error',
     'no-ex-assign': 'error',
     'no-extra-boolean-cast': 'error',
 
     // === Best Practices ===
     // (these mostly match our jshint config)
+    'array-callback-return': 'warn',
+    'block-scoped-var': 'warn',
+    'complexity': 'warn',
+    'consistent-return': 'warn',
     'curly': 'error',
     'dot-notation': 'warn',
     'no-alert': 'warn',
     'no-caller': 'error',
     'no-case-declarations': 'error',
+    'no-div-regex': 'error',
     'no-empty-pattern': 'error',
     'no-empty-function': 'warn',
-    //DEFINE POLICY: 'no-eq-null': 'warn',
+    'no-eq-null': 'error',
     'no-eval': 'error',
-    //DEFINE POLICY: 'no-extra-bind': 'warn',
+    'no-extend-native': 'error',
+    'no-extra-bind': 'warn',
     'no-fallthrough': 'error',
-    //DEFINE POLICY: 'no-implicit-globals': 'warn',
+    'no-floating-decimal': 'warn',
+    // Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
     'no-implied-eval': 'error',
     'no-invalid-this': 'error',
     'no-iterator': 'error',
     'no-native-reassign': 'warn',
     'no-new-func': 'error',
     'no-new-wrappers': 'error',
-    // DEFINE POLICY: no-octal: "error"
-    // DEFINE POLICY: no-octal-escape: "error"
+    'no-octal': 'error',
+    'no-octal-escape': 'error',
     'no-proto': 'error',
     'no-redeclare': 'warn',
     'no-return-assign': 'error',
     'no-script-url': 'error',
     'no-self-assign': 'error',
     'no-self-compare': 'error',
+    'no-sequences': 'warn',
+    'no-throw-literal': 'warn',
     'no-unmodified-loop-condition': 'error',
-    // Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-expressions': 'error',
+    'no-unused-expressions': 'error',
     'no-unused-labels': 'error',
-    //DEFINE POLICY: 'no-useless-call': 'error',
+    'no-useless-call': 'warn',
     'no-useless-escape': 'warn',
-    //DEFINE POLICY: 'no-with': 'error',
+    'no-with': 'error',
     'wrap-iife': ['error', 'any'],
 
     // === Variables ===
     'no-delete-var': 'error',
-    // Disabled for YUI rollups, enabled by grunt for AMD: 'no-undef': 'off',
-    //DEFINE POLICY: 'no-undef-init': 'error',
-    // Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-vars': 'error',
+    'no-undef': 'error',
+    'no-undef-init': 'error',
+    'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }],
 
     // === Stylistic Issues ===
     'array-bracket-spacing': 'warn',
     'lines-around-comment': 'off',
     'max-len': ['error', 132],
     'max-lines': 'off',
-    // DEFINE POLICY: turn on some of these max values?
-    'max-depth': 'off',
-    'max-nested-callbacks': 'off',
+    'max-depth': 'warn',
+    'max-nested-callbacks': ['warn', 5],
     'max-params': 'off',
     'max-statements': 'off',
-    'max-statements-per-line': 'off',
+    'max-statements-per-line': ['warn', { max: 2 }],
     'new-cap': ['warn', { 'properties': false }],
     'new-parens': 'warn',
     'newline-after-var': 'off',
     'newline-before-return': 'off',
-    // REVIST POLICY: 'newline-per-chained-call': 'warn',
+    'newline-per-chained-call': 'off',
     'no-array-constructor': 'off',
     'no-bitwise': 'error',
     'no-continue': 'off',
     'no-ternary': 'off',
     'no-trailing-spaces': 'error',
     'no-underscore-dangle': 'off',
-    // DEFINE POLICY: 'no-unneeded-ternary': 'off',
+    'no-unneeded-ternary': 'off',
     'no-whitespace-before-property': 'warn',
-    // DEFINE POLICY: 'object-curly-newline': 'off,
-    // DEFINE POLICY: 'object-curly-spacing': 'off',
-    // DEFINE POLICY: 'object-property-newline': 'off',
+    'object-curly-newline': 'off',
+    'object-curly-spacing': 'warn',
+    'object-property-newline': 'off',
     'one-var': 'off',
-    // DEFINE POLICY: 'one-var-declaration-per-line': 'off',
+    'one-var-declaration-per-line': ['warn', 'initializations'],
     'operator-assignment': 'off',
     'operator-linebreak': 'off',
     'padded-blocks': 'off',
-    // DEFINE POLICY: 'quote-props': 'off',
+    'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
     'quotes': 'off',
     'require-jsdoc': 'warn',
     'semi': 'error',
index 0b52cc8..4e22a6e 100644 (file)
@@ -104,18 +104,26 @@ module.exports = function(grunt) {
         eslint: {
             // Even though warnings dont stop the build we don't display warnings by default because
             // at this moment we've got too many core warnings.
-            options: { quiet: !grunt.option('show-lint-warnings') },
-            // Check AMD files. We add some stricter rules which we can't apply to the default configuration due
-            // to YUI rollups.
+            options: {quiet: !grunt.option('show-lint-warnings')},
             amd: {
               src: amdSrc,
-              options: {
-                  rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'}
+              // Check AMD with some slightly stricter rules.
+              rules: {
+                'no-unused-vars': 'error',
+                'no-implicit-globals': 'error'
               }
             },
             // Check YUI module source files.
             yui: {
                src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
+               options: {
+                   // Disable some rules which we can't safely define for YUI rollups.
+                   rules: {
+                     'no-undef': 'off',
+                     'no-unused-vars': 'off',
+                     'no-unused-expressions': 'off'
+                   }
+               }
             }
         },
         uglify: {
index 27f4ca9..a1535d1 100644 (file)
@@ -29,10 +29,23 @@ define('CLI_SCRIPT', true);
 require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 
+// Define the input options.
+$longparams = array(
+        'help' => false,
+        'username' => '',
+        'password' => '',
+        'ignore-password-policy' => false
+);
+
+$shortparams = array(
+        'h' => 'help',
+        'u' => 'username',
+        'p' => 'password',
+        'i' => 'ignore-password-policy'
+);
 
 // now get cli options
-list($options, $unrecognized) = cli_get_params(array('help'=>false),
-                                               array('h'=>'help'));
+list($options, $unrecognized) = cli_get_params($longparams, $shortparams);
 
 if ($unrecognized) {
     $unrecognized = implode("\n  ", $unrecognized);
@@ -47,29 +60,43 @@ There are no security checks here because anybody who is able to
 execute this file may execute any PHP too.
 
 Options:
--h, --help            Print out this help
+-h, --help                    Print out this help
+-u, --username=username       Specify username to change
+-p, --password=newpassword    Specify new password
+--ignore-password-policy      Ignore password policy when setting password
 
 Example:
 \$sudo -u www-data /usr/bin/php admin/cli/reset_password.php
+\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php --username=rosaura --password=jiu3jiu --ignore-password-policy
 "; //TODO: localize - to be translated later when everything is finished
 
     echo $help;
     die;
 }
-cli_heading('Password reset'); // TODO: localize
-$prompt = "enter username (manual authentication only)"; // TODO: localize
-$username = cli_input($prompt);
+if ($options['username'] == '' ) {
+    cli_heading('Password reset'); // TODO: localize.
+    $prompt = "enter username (manual authentication only)"; // TODO: localize.
+    $username = cli_input($prompt);
+} else {
+    $username = $options['username'];
+}
 
 if (!$user = $DB->get_record('user', array('auth'=>'manual', 'username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
     cli_error("Can not find user '$username'");
 }
 
-$prompt = "Enter new password"; // TODO: localize
-$password = cli_input($prompt);
+if ($options['password'] == '' ) {
+    $prompt = "Enter new password"; // TODO: localize.
+    $password = cli_input($prompt);
+} else {
+    $password = $options['password'];
+}
 
 $errmsg = '';//prevent eclipse warning
-if (!check_password_policy($password, $errmsg)) {
-    cli_error($errmsg);
+if (!$options['ignore-password-policy'] ) {
+    if (!check_password_policy($password, $errmsg)) {
+        cli_error($errmsg);
+    }
 }
 
 $hashedpassword = hash_internal_user_password($password);
@@ -78,4 +105,4 @@ $DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
 
 echo "Password changed\n";
 
-exit(0); // 0 means success
\ No newline at end of file
+exit(0); // 0 means success.
diff --git a/admin/searchareas.php b/admin/searchareas.php
new file mode 100644 (file)
index 0000000..884d5b8
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Manage global search areas.
+ *
+ * @package   core_search
+ * @copyright 2016 Dan Poltawski <dan@moodle.com>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+require_once(__DIR__ . '/../config.php');
+require_once($CFG->libdir . '/adminlib.php');
+
+admin_externalpage_setup('searchareas');
+
+$areaid = optional_param('areaid', null, PARAM_ALPHAEXT);
+$action = optional_param('action', null, PARAM_ALPHA);
+
+try {
+    $searchmanager = \core_search\manager::instance();
+} catch (core_search\engine_exception $searchmanagererror) {
+    // Continue, we return an error later depending on the requested action.
+}
+
+echo $OUTPUT->header();
+
+if ($action) {
+    require_sesskey();
+
+    if ($areaid) {
+        // We need to check that the area exists.
+        $area = \core_search\manager::get_search_area($areaid);
+        if ($area === false) {
+            throw new moodle_exception('invalidrequest');
+        }
+    }
+
+    // All actions but enable/disable need the search engine to be ready.
+    if ($action !== 'enable' && $action !== 'disable') {
+        if (!empty($searchmanagererror)) {
+            throw $searchmanagererror;
+        }
+    }
+
+    switch ($action) {
+        case 'enable':
+            $area->set_enabled(true);
+            echo $OUTPUT->notification(get_string('searchareaenabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        case 'disable':
+            $area->set_enabled(false);
+            echo $OUTPUT->notification(get_string('searchareadisabled', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        case 'delete':
+            $search = \core_search\manager::instance();
+            $search->delete_index($areaid);
+            echo $OUTPUT->notification(get_string('searchindexdeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        case 'indexall':
+            $searchmanager->index();
+            echo $OUTPUT->notification(get_string('searchindexupdated', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        case 'reindexall':
+            $searchmanager->index(true);
+            echo $OUTPUT->notification(get_string('searchreindexed', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        case 'deleteall':
+            $searchmanager->delete_index();
+            echo $OUTPUT->notification(get_string('searchalldeleted', 'admin'), \core\output\notification::NOTIFY_SUCCESS);
+            break;
+        default:
+            throw new moodle_exception('invalidaction');
+            break;
+    }
+}
+
+$searchareas = \core_search\manager::get_search_areas_list();
+if (empty($searchmanagererror)) {
+    $areasconfig = $searchmanager->get_areas_config($searchareas);
+} else {
+    $areasconfig = false;
+}
+
+if (!empty($searchmanagererror)) {
+    $errorstr = get_string($searchmanagererror->errorcode, $searchmanagererror->module);
+    echo $OUTPUT->notification($errorstr, \core\output\notification::NOTIFY_ERROR);
+} else {
+    echo $OUTPUT->notification(get_string('indexinginfo', 'admin'), \core\output\notification::NOTIFY_INFO);
+}
+
+$table = new html_table();
+$table->id = 'core-search-areas';
+
+$table->head = array(get_string('searcharea', 'search'), get_string('enable'), get_string('newestdocindexed', 'admin'),
+    get_string('searchlastrun', 'admin'), get_string('searchindexactions', 'admin'));
+
+foreach ($searchareas as $area) {
+    $areaid = $area->get_area_id();
+    $columns = array(new html_table_cell($area->get_visible_name()));
+
+    if ($area->is_enabled()) {
+        $columns[] = $OUTPUT->action_icon(admin_searcharea_action_url('disable', $areaid),
+            new pix_icon('t/hide', get_string('disable'), 'moodle', array('title' => '', 'class' => 'iconsmall')),
+            null, array('title' => get_string('disable')));
+
+        if ($areasconfig) {
+            $columns[] = $areasconfig[$areaid]->lastindexrun;
+
+            if ($areasconfig[$areaid]->indexingstart) {
+                $timediff = $areasconfig[$areaid]->indexingend - $areasconfig[$areaid]->indexingstart;
+                $laststatus = $timediff . ' , ' .
+                    $areasconfig[$areaid]->docsprocessed . ' , ' .
+                    $areasconfig[$areaid]->recordsprocessed . ' , ' .
+                    $areasconfig[$areaid]->docsignored;
+            } else {
+                $laststatus = '';
+            }
+            $columns[] = $laststatus;
+            $columns[] = html_writer::link(admin_searcharea_action_url('delete', $areaid), 'Delete index');
+
+        } else {
+            $blankrow = new html_table_cell(get_string('searchnotavailable', 'admin'));
+            $blankrow->colspan = 3;
+            $columns[] = $blankrow;
+        }
+
+    } else {
+        $columns[] = $OUTPUT->action_icon(admin_searcharea_action_url('enable', $areaid),
+            new pix_icon('t/show', get_string('enable'), 'moodle', array('title' => '', 'class' => 'iconsmall')),
+                null, array('title' => get_string('enable')));
+
+        $blankrow = new html_table_cell(get_string('searchareadisabled', 'admin'));
+        $blankrow->colspan = 3;
+        $columns[] = $blankrow;
+    }
+    $row = new html_table_row($columns);
+    $table->data[] = $row;
+}
+
+// Cross-search area tasks.
+$options = array();
+if (!empty($searchmanagererror)) {
+    $options['disabled'] = true;
+}
+echo $OUTPUT->box_start('search-areas-actions');
+echo $OUTPUT->single_button(admin_searcharea_action_url('indexall'), get_string('searchupdateindex', 'admin'), 'get', $options);
+echo $OUTPUT->single_button(admin_searcharea_action_url('reindexall'), get_string('searchreindexindex', 'admin'), 'get', $options);
+echo $OUTPUT->single_button(admin_searcharea_action_url('deleteall'), get_string('searchdeleteindex', 'admin'), 'get', $options);
+echo $OUTPUT->box_end();
+
+echo html_writer::table($table);
+echo $OUTPUT->footer();
+
+/**
+ * Helper for generating url for management actions.
+ *
+ * @param string $action
+ * @param string $areaid
+ * @return moodle_url
+ */
+function admin_searcharea_action_url($action, $areaid = false) {
+    $params = array('action' => $action, 'sesskey' => sesskey());
+    if ($areaid) {
+        $params['areaid'] = $areaid;
+    }
+    return new moodle_url('/admin/searchareas.php', $params);
+}
index 680bd3d..0711b23 100644 (file)
@@ -528,15 +528,9 @@ if ($hassiteconfig) {
     $temp->add(new admin_setting_configselect('searchengine',
                                 new lang_string('selectsearchengine', 'admin'), '', 'solr', $engines));
 
-    // Enable search areas.
-    $temp->add(new admin_setting_heading('searchareasheading', new lang_string('availablesearchareas', 'admin'), ''));
-    $searchareas = \core_search\manager::get_search_areas_list();
-    foreach ($searchareas as $areaid => $searcharea) {
-        list($componentname, $varname) = $searcharea->get_config_var_name();
-        $temp->add(new admin_setting_configcheckbox($componentname . '/' . $varname . '_enabled', $searcharea->get_visible_name(true),
-            '', 1, 1, 0));
-    }
     $ADMIN->add('searchplugins', $temp);
+    $ADMIN->add('searchplugins', new admin_externalpage('searchareas', new lang_string('searchareas', 'admin'),
+        new moodle_url('/admin/searchareas.php')));
 
     core_collator::asort_objects_by_property($pages, 'visiblename');
     foreach ($pages as $page) {
index 90062ca..0d03dea 100644 (file)
Binary files a/admin/tool/lp/amd/build/actionselector.min.js and b/admin/tool/lp/amd/build/actionselector.min.js differ
index c14f771..96285e7 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencies.min.js and b/admin/tool/lp/amd/build/competencies.min.js differ
index 2ca219d..415efaa 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencyactions.min.js and b/admin/tool/lp/amd/build/competencyactions.min.js differ
index 61eec30..ec656c2 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencypicker.min.js and b/admin/tool/lp/amd/build/competencypicker.min.js differ
index faf4bd4..2117b30 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencypicker_user_plans.min.js and b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js differ
index 8a0f0a2..9f5801d 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencyruleconfig.min.js and b/admin/tool/lp/amd/build/competencyruleconfig.min.js differ
index ac0c28f..6ea9624 100644 (file)
Binary files a/admin/tool/lp/amd/build/grade_user_competency_inline.min.js and b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js differ
index 7ab1169..0259b87 100644 (file)
Binary files a/admin/tool/lp/amd/build/menubar.min.js and b/admin/tool/lp/amd/build/menubar.min.js differ
index d7732ee..6392ca6 100644 (file)
Binary files a/admin/tool/lp/amd/build/parentcompetency_form.min.js and b/admin/tool/lp/amd/build/parentcompetency_form.min.js differ
index d590b7e..aeb8b9e 100644 (file)
Binary files a/admin/tool/lp/amd/build/planactions.min.js and b/admin/tool/lp/amd/build/planactions.min.js differ
index db0ffd8..4c5b700 100644 (file)
Binary files a/admin/tool/lp/amd/build/scaleconfig.min.js and b/admin/tool/lp/amd/build/scaleconfig.min.js differ
index e479a60..a69a9d8 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_evidence_actions.min.js and b/admin/tool/lp/amd/build/user_evidence_actions.min.js differ
index 8b32a48..582478b 100644 (file)
@@ -87,13 +87,13 @@ define(['jquery',
             self._selectedValue = $("input[type='radio']:checked").val();
             self._find('[data-action="action-selector-confirm"]').removeAttr('disabled');
             self._refresh.bind(self);
-        }.bind(self));
+        });
 
         // Add listener for cancel.
         self._find('[data-action="action-selector-cancel"]').click(function(e) {
             e.preventDefault();
             self.close();
-        }.bind(self));
+        });
 
         // Add listener for confirm.
         self._find('[data-action="action-selector-confirm"]').click(function(e) {
@@ -101,9 +101,9 @@ define(['jquery',
             if (!self._selectedValue.length) {
                 return;
             }
-            self._trigger('save', { action: self._selectedValue });
+            self._trigger('save', {action: self._selectedValue});
             self.close();
-        }.bind(self));
+        });
     };
 
     /**
@@ -131,7 +131,7 @@ define(['jquery',
                 html,
                 self._afterRender.bind(self)
             );
-        }.bind(self)).fail(Notification.exception);
+        }).fail(Notification.exception);
     };
 
     /**
@@ -156,7 +156,7 @@ define(['jquery',
         return self._render().then(function(html) {
             self._find('[data-region="action-selector"]').replaceWith(html);
             self._afterRender();
-        }.bind(self));
+        });
     };
 
     /**
index 8b5ae2e..79e1aa9 100644 (file)
@@ -59,13 +59,13 @@ define(['jquery',
             function(movestring) {
                 dragdrop.dragdrop('movecompetency',
                                   movestring,
-                                  { identifier: 'movecompetency', component: 'tool_lp'},
-                                  { identifier: 'movecompetencyafter', component: 'tool_lp'},
+                                  {identifier: 'movecompetency', component: 'tool_lp'},
+                                  {identifier: 'movecompetencyafter', component: 'tool_lp'},
                                   'drag-samenode',
                                   'drag-parentnode',
                                   'drag-handlecontainer',
                                   function(drag, drop) {
-                                      localthis.handleDrop.call(localthis, drag, drop);
+                                      localthis.handleDrop(drag, drop);
                                   });
             }
         ).fail(notification.exception);
@@ -89,21 +89,21 @@ define(['jquery',
             requests = ajax.call([
                 {
                     methodname: 'core_competency_reorder_course_competency',
-                    args: { courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid }
+                    args: {courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
                 }
             ]);
         } else if (localthis.itemtype == 'template') {
             requests = ajax.call([
                 {
                     methodname: 'core_competency_reorder_template_competency',
-                    args: { templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid }
+                    args: {templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
                 }
             ]);
         } else if (localthis.itemtype == 'plan') {
             requests = ajax.call([
                 {
                     methodname: 'core_competency_reorder_plan_competency',
-                    args: { planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid }
+                    args: {planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
                 }
             ]);
         } else {
@@ -139,12 +139,12 @@ define(['jquery',
                     $.each(compIds, function(index, compId) {
                         requests.push({
                             methodname: 'core_competency_add_competency_to_course',
-                            args: { courseid: self.itemid, competencyid: compId }
+                            args: {courseid: self.itemid, competencyid: compId}
                         });
                     });
                     requests.push({
                         methodname: 'tool_lp_data_for_course_competencies_page',
-                        args: { courseid: self.itemid }
+                        args: {courseid: self.itemid}
                     });
 
                     pagerender = 'tool_lp/course_competencies_page';
@@ -156,12 +156,12 @@ define(['jquery',
                     $.each(compIds, function(index, compId) {
                         requests.push({
                             methodname: 'core_competency_add_competency_to_template',
-                            args: { templateid: self.itemid, competencyid: compId }
+                            args: {templateid: self.itemid, competencyid: compId}
                         });
                     });
                     requests.push({
                         methodname: 'tool_lp_data_for_template_competencies_page',
-                        args: { templateid: self.itemid, pagecontext: { contextid: self.pageContextId }}
+                        args: {templateid: self.itemid, pagecontext: {contextid: self.pageContextId}}
                     });
                     pagerender = 'tool_lp/template_competencies_page';
                     pageregion = 'templatecompetenciespage';
@@ -171,12 +171,12 @@ define(['jquery',
                     $.each(compIds, function(index, compId) {
                         requests.push({
                             methodname: 'core_competency_add_competency_to_plan',
-                            args: { planid: self.itemid, competencyid: compId }
+                            args: {planid: self.itemid, competencyid: compId}
                         });
                     });
                     requests.push({
                          methodname: 'tool_lp_data_for_plan_page',
-                         args: { planid: self.itemid}
+                         args: {planid: self.itemid}
                     });
                     pagerender = 'tool_lp/plan_page';
                     pageregion = 'plan-page';
@@ -209,28 +209,28 @@ define(['jquery',
         // Delete the link and reload the page template.
         if (localthis.itemtype == 'course') {
             requests = ajax.call([
-                { methodname: 'core_competency_remove_competency_from_course',
-                    args: { courseid: localthis.itemid, competencyid: deleteid } },
-                { methodname: 'tool_lp_data_for_course_competencies_page',
-                    args: { courseid: localthis.itemid } }
+                {methodname: 'core_competency_remove_competency_from_course',
+                    args: {courseid: localthis.itemid, competencyid: deleteid}},
+                {methodname: 'tool_lp_data_for_course_competencies_page',
+                    args: {courseid: localthis.itemid}}
             ]);
             pagerender = 'tool_lp/course_competencies_page';
             pageregion = 'coursecompetenciespage';
         } else if (localthis.itemtype == 'template') {
             requests = ajax.call([
-                { methodname: 'core_competency_remove_competency_from_template',
-                    args: { templateid: localthis.itemid, competencyid: deleteid } },
-                { methodname: 'tool_lp_data_for_template_competencies_page',
-                    args: { templateid: localthis.itemid, pagecontext: { contextid: localthis.pageContextId } } }
+                {methodname: 'core_competency_remove_competency_from_template',
+                    args: {templateid: localthis.itemid, competencyid: deleteid}},
+                {methodname: 'tool_lp_data_for_template_competencies_page',
+                    args: {templateid: localthis.itemid, pagecontext: {contextid: localthis.pageContextId}}}
             ]);
             pagerender = 'tool_lp/template_competencies_page';
             pageregion = 'templatecompetenciespage';
         } else if (localthis.itemtype == 'plan') {
             requests = ajax.call([
-                { methodname: 'core_competency_remove_competency_from_plan',
-                    args: { planid: localthis.itemid, competencyid: deleteid } },
-                { methodname: 'tool_lp_data_for_plan_page',
-                    args: { planid: localthis.itemid } }
+                {methodname: 'core_competency_remove_competency_from_plan',
+                    args: {planid: localthis.itemid, competencyid: deleteid}},
+                {methodname: 'tool_lp_data_for_plan_page',
+                    args: {planid: localthis.itemid}}
             ]);
             pagerender = 'tool_lp/plan_page';
             pageregion = 'plan-page';
@@ -268,15 +268,15 @@ define(['jquery',
 
         requests = ajax.call([{
             methodname: 'core_competency_read_competency',
-            args: { id: deleteid }
+            args: {id: deleteid}
         }]);
 
         requests[0].done(function(competency) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: message, component: 'tool_lp', param: competency.shortname },
-                { key: 'confirm', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: message, component: 'tool_lp', param: competency.shortname},
+                {key: 'confirm', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -308,10 +308,10 @@ define(['jquery',
                 var coursecompetencyid = $(e.target).data('id');
                 var ruleoutcome = $(e.target).val();
                 requests = ajax.call([
-                    { methodname: 'core_competency_set_course_competency_ruleoutcome',
-                      args: { coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome } },
-                    { methodname: 'tool_lp_data_for_course_competencies_page',
-                      args: { courseid: localthis.itemid } }
+                    {methodname: 'core_competency_set_course_competency_ruleoutcome',
+                      args: {coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome}},
+                    {methodname: 'tool_lp_data_for_course_competencies_page',
+                      args: {courseid: localthis.itemid}}
                 ]);
 
                 requests[1].done(function(context) {
index 36b2a68..829b892 100644 (file)
@@ -46,16 +46,16 @@ define(['jquery',
         getAll: function() {
             var self = this;
             return Str.get_strings([
-                { key: 'competencyoutcome_none', component: 'tool_lp' },
-                { key: 'competencyoutcome_evidence', component: 'tool_lp' },
-                { key: 'competencyoutcome_recommend', component: 'tool_lp' },
-                { key: 'competencyoutcome_complete', component: 'tool_lp' },
+                {key: 'competencyoutcome_none', component: 'tool_lp'},
+                {key: 'competencyoutcome_evidence', component: 'tool_lp'},
+                {key: 'competencyoutcome_recommend', component: 'tool_lp'},
+                {key: 'competencyoutcome_complete', component: 'tool_lp'},
             ]).then(function(strings) {
                 var outcomes = {};
-                outcomes[self.NONE] = { code: self.NONE, name: strings[0] };
-                outcomes[self.EVIDENCE] = { code: self.EVIDENCE, name: strings[1] };
-                outcomes[self.RECOMMEND] = { code: self.RECOMMEND, name: strings[2] };
-                outcomes[self.COMPLETE] = { code: self.COMPLETE, name: strings[3] };
+                outcomes[self.NONE] = {code: self.NONE, name: strings[0]};
+                outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};
+                outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};
+                outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};
                 return outcomes;
             });
         },
index db4bfe4..5c4ec17 100644 (file)
@@ -115,7 +115,7 @@ define(['jquery',
             children = this._tree.getChildren(this._competency.id),
             context,
             config = {
-                base: { points: 2 },
+                base: {points: 2},
                 competencies: []
             };
 
index c9c37bc..522e827 100644 (file)
@@ -82,10 +82,10 @@ define(['jquery',
 
         if (parent !== null && treeModel.hasRule(parent.id)) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname },
-                { key: 'yes', component: 'core' },
-                { key: 'no', component: 'core' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname},
+                {key: 'yes', component: 'core'},
+                {key: 'no', component: 'core'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0],
@@ -108,11 +108,11 @@ define(['jquery',
         var frameworkid = $('[data-region="filtercompetencies"]').data('frameworkid');
         var requests = ajax.call([{
             methodname: 'core_competency_set_parent_competency',
-            args: { competencyid: moveSource, parentid: moveTarget }
+            args: {competencyid: moveSource, parentid: moveTarget}
         }, {
             methodname: 'tool_lp_data_for_competencies_manage_page',
-            args: { competencyframeworkid: frameworkid,
-                    search: $('[data-region="filtercompetencies"] input').val() }
+            args: {competencyframeworkid: frameworkid,
+                    search: $('[data-region="filtercompetencies"] input').val()}
         }]);
         requests[1].done(reloadPage).fail(notification.exception);
     };
@@ -153,10 +153,10 @@ define(['jquery',
         // Show confirm, and/or do the things.
         if (showConfirm) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: confirmMessage, component: 'tool_lp' },
-                { key: 'yes', component: 'moodle' },
-                { key: 'no', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: confirmMessage, component: 'tool_lp'},
+                {key: 'yes', component: 'moodle'},
+                {key: 'no', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -248,7 +248,8 @@ define(['jquery',
         $.when.apply(null, requests).done(function(competencies, framework) {
 
             // Expand the list of competencies into a tree.
-            var i, competenciestree = [];
+            var i;
+            var competenciestree = [];
             for (i = 0; i < competencies.length; i++) {
                 var onecompetency = competencies[i];
                 if (onecompetency.parentid == "0") {
@@ -260,9 +261,9 @@ define(['jquery',
             }
 
             str.get_strings([
-                { key: 'movecompetency', component: 'tool_lp', param: competency.shortname },
-                { key: 'move', component: 'tool_lp' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'movecompetency', component: 'tool_lp', param: competency.shortname},
+                {key: 'move', component: 'tool_lp'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
 
                 var context = {
@@ -330,8 +331,8 @@ define(['jquery',
 
         var requests = ajax.call([{
             methodname: 'tool_lp_data_for_competencies_manage_page',
-            args: { competencyframeworkid: frameworkid,
-                    search: $('[data-region="filtercompetencies"] input').val() }
+            args: {competencyframeworkid: frameworkid,
+                    search: $('[data-region="filtercompetencies"] input').val()}
         }]);
         requests[0].done(reloadPage).fail(notification.exception);
     };
@@ -345,11 +346,11 @@ define(['jquery',
         var competency = $('[data-region="competencyactions"]').data('competency');
         var requests = ajax.call([{
             methodname: 'core_competency_move_up_competency',
-            args: { id: competency.id }
+            args: {id: competency.id}
         }, {
             methodname: 'tool_lp_data_for_competencies_manage_page',
-            args: { competencyframeworkid: competency.competencyframeworkid,
-                    search: $('[data-region="filtercompetencies"] input').val() }
+            args: {competencyframeworkid: competency.competencyframeworkid,
+                    search: $('[data-region="filtercompetencies"] input').val()}
         }]);
         requests[1].done(reloadPage).fail(notification.exception);
     };
@@ -363,11 +364,11 @@ define(['jquery',
         var competency = $('[data-region="competencyactions"]').data('competency');
         var requests = ajax.call([{
             methodname: 'core_competency_move_down_competency',
-            args: { id: competency.id }
+            args: {id: competency.id}
         }, {
             methodname: 'tool_lp_data_for_competencies_manage_page',
-            args: { competencyframeworkid: competency.competencyframeworkid,
-                    search: $('[data-region="filtercompetencies"] input').val() }
+            args: {competencyframeworkid: competency.competencyframeworkid,
+                    search: $('[data-region="filtercompetencies"] input').val()}
         }]);
         requests[1].done(reloadPage).fail(notification.exception);
     };
@@ -381,7 +382,7 @@ define(['jquery',
 
         var requests = ajax.call([{
             methodname: 'tool_lp_list_courses_using_competency',
-            args: { id: competency.id }
+            args: {id: competency.id}
         }]);
 
         requests[0].done(function(courses) {
@@ -417,13 +418,13 @@ define(['jquery',
                 $.each(compIds, function(index, value) {
                     calls.push({
                         methodname: 'core_competency_add_related_competency',
-                        args: { competencyid: value, relatedcompetencyid: relatedTarget.id }
+                        args: {competencyid: value, relatedcompetencyid: relatedTarget.id}
                     });
                 });
 
                 calls.push({
                     methodname: 'tool_lp_data_for_related_competencies_section',
-                    args: { competencyid: relatedTarget.id }
+                    args: {competencyid: relatedTarget.id}
                 });
 
                 var promises = ajax.call(calls);
@@ -462,7 +463,7 @@ define(['jquery',
         };
         var promise = ajax.call([{
             methodname: 'core_competency_update_competency',
-            args: { competency: update }
+            args: {competency: update}
         }]);
         promise[0].then(function(result) {
             if (result) {
@@ -483,17 +484,17 @@ define(['jquery',
         var competency = $('[data-region="competencyactions"]').data('competency');
         var requests = ajax.call([{
             methodname: 'core_competency_delete_competency',
-            args: { id: competency.id }
+            args: {id: competency.id}
         }, {
             methodname: 'tool_lp_data_for_competencies_manage_page',
-            args: { competencyframeworkid: competency.competencyframeworkid,
-                    search: $('[data-region="filtercompetencies"] input').val() }
+            args: {competencyframeworkid: competency.competencyframeworkid,
+                    search: $('[data-region="filtercompetencies"] input').val()}
         }]);
         requests[0].done(function(success) {
             if (success === false) {
                 str.get_strings([
-                { key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname},
+                {key: 'cancel', component: 'moodle'}
                 ]).done(function(strings) {
                     notification.alert(
                         null,
@@ -518,10 +519,10 @@ define(['jquery',
         }
 
         str.get_strings([
-            { key: 'confirm', component: 'moodle' },
-            { key: confirmMessage, component: 'tool_lp', param: competency.shortname },
-            { key: 'delete', component: 'moodle' },
-            { key: 'cancel', component: 'moodle' }
+            {key: 'confirm', component: 'moodle'},
+            {key: confirmMessage, component: 'tool_lp', param: competency.shortname},
+            {key: 'delete', component: 'moodle'},
+            {key: 'cancel', component: 'moodle'}
         ]).done(function(strings) {
             notification.confirm(
                 strings[0], // Confirm.
@@ -598,18 +599,18 @@ define(['jquery',
         var relatedid = this.id.substr(11);
         var competency = $('[data-region="competencyactions"]').data('competency');
         var removeRelated = ajax.call([
-            { methodname: 'core_competency_remove_related_competency',
-              args: { relatedcompetencyid: relatedid, competencyid: competency.id } },
-            { methodname: 'tool_lp_data_for_related_competencies_section',
-              args: { competencyid: competency.id } }
+            {methodname: 'core_competency_remove_related_competency',
+              args: {relatedcompetencyid: relatedid, competencyid: competency.id}},
+            {methodname: 'tool_lp_data_for_related_competencies_section',
+              args: {competencyid: competency.id}}
         ]);
 
         removeRelated[1].done(function(context) {
             templates.render('tool_lp/related_competencies', context).done(function(html) {
                 $('[data-region="relatedcompetencies"]').replaceWith(html);
                 updatedRelatedCompetencies();
-            }.bind(this)).fail(notification.exception);
-        }.bind(this)).fail(notification.exception);
+            }).fail(notification.exception);
+        }).fail(notification.exception);
     };
 
     /**
@@ -636,7 +637,7 @@ define(['jquery',
             selectedCompetencyId = competency.id;
             ajax.call([{
                     methodname: 'core_competency_competency_viewed',
-                    args: { id: competency.id }
+                    args: {id: competency.id}
             }]);
         }
     };
@@ -703,7 +704,7 @@ define(['jquery',
         }).done(function() {
             ajax.call([{
                 methodname: 'tool_lp_data_for_related_competencies_section',
-                args: { competencyid: competency.id },
+                args: {competencyid: competency.id},
                 done: function(context) {
                     return templates.render('tool_lp/related_competencies', context).done(function(html, js) {
                         $('[data-region="relatedcompetencies"]').replaceWith(html);
index 9902eed..012d70b 100644 (file)
@@ -55,7 +55,7 @@ define(['jquery',
     Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {
         ajax.call([{
                 methodname: 'core_competency_competency_viewed',
-                args: { id: competencyId }
+                args: {id: competencyId}
         }]);
     };
 
@@ -143,8 +143,8 @@ define(['jquery',
     Competencydialogue.prototype.getCompetencyDataPromise = function(competencyid, options) {
 
         var requests = ajax.call([
-            { methodname: 'tool_lp_data_for_competency_summary',
-              args: { competencyid: competencyid,
+            {methodname: 'tool_lp_data_for_competency_summary',
+              args: {competencyid: competencyid,
                       includerelated: options.includerelated || false,
                       includecourses: options.includecourses || false
                     }
@@ -170,7 +170,7 @@ define(['jquery',
 
             // Instantiate the one instance and delegate event on the body.
             instance = new Competencydialogue();
-            $('body').delegate('[data-action="competency-dialogue"]', 'click', { compdialogue: instance },
+            $('body').delegate('[data-action="competency-dialogue"]', 'click', {compdialogue: instance},
                 instance.clickEventHandler.bind(instance));
         }
     };
index 272d3e0..1aebe05 100644 (file)
@@ -118,7 +118,7 @@ define(['jquery',
                 if (valid) {
                     validIds.push(compId);
                 }
-            }.bind(self));
+            });
 
             self._selectedCompetencies = validIds;
 
@@ -128,14 +128,14 @@ define(['jquery',
             } else {
                 self._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr('disabled');
             }
-        }.bind(self));
+        });
 
         // Add listener for framework change.
         if (!self._singleFramework) {
             self._find('[data-action="chooseframework"]').change(function(e) {
                 self._frameworkId = $(e.target).val();
                 self._loadCompetencies().then(self._refresh.bind(self));
-            }.bind(self));
+            });
         }
 
         // Add listener for search.
@@ -146,13 +146,13 @@ define(['jquery',
             return self._refresh().always(function() {
                 $(e.target).removeAttr('disabled');
             });
-        }.bind(self));
+        });
 
         // Add listener for cancel.
         self._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(e) {
             e.preventDefault();
             self.close();
-        }.bind(self));
+        });
 
         // Add listener for add.
         self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) {
@@ -162,14 +162,14 @@ define(['jquery',
             }
 
             if (self._multiSelect) {
-                self._trigger('save', { competencyIds: self._selectedCompetencies });
+                self._trigger('save', {competencyIds: self._selectedCompetencies});
             } else {
                 // We checked above that the array has at least one value.
-                self._trigger('save', { competencyId: self._selectedCompetencies[0] });
+                self._trigger('save', {competencyId: self._selectedCompetencies[0]});
             }
 
             self.close();
-        }.bind(self));
+        });
 
         // The list of selected competencies will be modified while looping (because of the listeners above).
         var currentItems = self._selectedCompetencies.slice(0);
@@ -180,7 +180,7 @@ define(['jquery',
                 tree.toggleItem(node);
                 tree.updateFocus(node);
             }
-        }.bind(self));
+        });
 
     };
 
@@ -210,8 +210,8 @@ define(['jquery',
                     html,
                     self._afterRender.bind(self)
                 );
-            }.bind(self));
-        }.bind(self)).fail(Notification.exception);
+            });
+        }).fail(Notification.exception);
     };
 
     /**
@@ -226,7 +226,7 @@ define(['jquery',
         var self = this;
 
         return Ajax.call([
-            { methodname: 'core_competency_search_competencies', args: {
+            {methodname: 'core_competency_search_competencies', args: {
                 searchtext: searchText,
                 competencyframeworkid: frameworkId
             }}
@@ -248,7 +248,8 @@ define(['jquery',
             }
 
             // Expand the list of competencies into a tree.
-            var i, tree = [], comp;
+            var i, comp;
+            var tree = [];
             for (i = 0; i < competencies.length; i++) {
                 comp = competencies[i];
                 if (comp.parentid == "0") { // Loose check for now, because WS returns a string.
@@ -261,7 +262,7 @@ define(['jquery',
 
             self._competencies = tree;
 
-        }.bind(self)).fail(Notification.exception);
+        }).fail(Notification.exception);
     };
 
     /**
@@ -287,7 +288,7 @@ define(['jquery',
         $.each(this._frameworks, function(i, f) {
             if (f.id == fid) {
                 frm = f;
-                return false;
+                return;
             }
         });
         return frm;
@@ -320,7 +321,7 @@ define(['jquery',
 
         if (self._singleFramework) {
             promise = Ajax.call([
-                { methodname: 'core_competency_read_competency_framework', args: {
+                {methodname: 'core_competency_read_competency_framework', args: {
                     id: this._frameworkId
                 }}
             ])[0].then(function(framework) {
@@ -328,9 +329,9 @@ define(['jquery',
             });
         } else {
             promise = Ajax.call([
-                { methodname: 'core_competency_list_competency_frameworks', args: {
+                {methodname: 'core_competency_list_competency_frameworks', args: {
                     sort: 'shortname',
-                    context: { contextid: self._pageContextId },
+                    context: {contextid: self._pageContextId},
                     includes: self._pageContextIncludes,
                     onlyvisible: self._onlyVisible
                 }}
@@ -373,7 +374,7 @@ define(['jquery',
             }
 
             return self._loadCompetencies();
-        }.bind(self));
+        });
     };
 
     /**
@@ -387,7 +388,7 @@ define(['jquery',
         return self._render().then(function(html) {
             self._find('[data-region="competencylinktree"]').replaceWith(html);
             self._afterRender();
-        }.bind(self));
+        });
     };
 
     /**
@@ -419,7 +420,7 @@ define(['jquery',
             };
 
             return Templates.render('tool_lp/competency_picker', context);
-        }.bind(self));
+        });
     };
 
     /**
index b417b67..8d5b536 100644 (file)
@@ -78,7 +78,7 @@ define(['jquery',
             self._find('[data-action="chooseplan"]').change(function(e) {
                 self._planId = $(e.target).val();
                 self._loadCompetencies().then(self._refresh.bind(self));
-            }.bind(self));
+            });
         }
     };
 
@@ -94,13 +94,14 @@ define(['jquery',
         var self = this;
 
         return Ajax.call([
-            { methodname: 'core_competency_list_plan_competencies', args: {
+            {methodname: 'core_competency_list_plan_competencies', args: {
                 id: planId
             }}
         ])[0].done(function(competencies) {
 
             // Expand the list of competencies into a fake tree.
-            var i, tree = [], comp;
+            var i, comp;
+            var tree = [];
             for (i = 0; i < competencies.length; i++) {
                 comp = competencies[i].competency;
                 if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) {
@@ -128,7 +129,7 @@ define(['jquery',
         $.each(this._plans, function(i, f) {
             if (f.id == id) {
                 plan = f;
-                return false;
+                return;
             }
         });
         return plan;
@@ -161,7 +162,7 @@ define(['jquery',
 
         if (self._singlePlan) {
             promise = Ajax.call([
-                { methodname: 'core_competency_read_plan', args: {
+                {methodname: 'core_competency_read_plan', args: {
                     id: this._planId
                 }}
             ])[0].then(function(plan) {
@@ -169,7 +170,7 @@ define(['jquery',
             });
         } else {
             promise = Ajax.call([
-                { methodname: 'core_competency_list_user_plans', args: {
+                {methodname: 'core_competency_list_user_plans', args: {
                     userid: self._userId
                 }}
             ])[0];
@@ -200,7 +201,7 @@ define(['jquery',
             }
 
             return self._loadCompetencies();
-        }.bind(self));
+        });
     };
 
     /**
@@ -232,7 +233,7 @@ define(['jquery',
             };
 
             return Templates.render('tool_lp/competency_picker_user_plans', context);
-        }.bind(self));
+        });
     };
 
     return /** @alias module:tool_lp/competencypicker_user_plans */ Picker;
index f207939..3a956cb 100644 (file)
@@ -137,7 +137,7 @@ define(['jquery',
         $.each(this._rules, function(index, rule) {
             if (rule.canConfig()) {
                 can = true;
-                return false;
+                return;
             }
         });
         return can;
@@ -163,7 +163,7 @@ define(['jquery',
     RuleConfig.prototype.display = function() {
         var self = this;
         if (!self._competency) {
-            return;
+            return false;
         }
         return self._render().then(function(html) {
             return Str.get_string('competencyrule', 'tool_lp').then(function(title) {
@@ -276,7 +276,7 @@ define(['jquery',
         $.each(this._rules, function(index, rule) {
             if (rule.getType() == type) {
                 result = rule;
-                return false;
+                return;
             }
         });
 
@@ -297,7 +297,7 @@ define(['jquery',
         $.each(self._rulesModules, function(index, modInfo) {
             if (modInfo.type == type) {
                 name = modInfo.name;
-                return false;
+                return;
             }
         });
         return name;
index 1cc3933..06af055 100644 (file)
@@ -52,7 +52,7 @@ define(['jquery',
         var currentValue = $(e.target).closest('a').data('pushratingstouserplans');
         var context = {
             courseid: courseid,
-            settings: { pushratingstouserplans: currentValue }
+            settings: {pushratingstouserplans: currentValue}
         };
         e.preventDefault();
 
@@ -112,11 +112,11 @@ define(['jquery',
 
         var newValue = this._find('input[name="pushratingstouserplans"]:checked').val();
         var courseId = this._find('input[name="courseid"]').val();
-        var settings = { pushratingstouserplans: newValue };
+        var settings = {pushratingstouserplans: newValue};
 
         ajax.call([
-            { methodname: 'core_competency_update_course_competency_settings',
-              args: { courseid: courseId, settings: settings } }
+            {methodname: 'core_competency_update_course_competency_settings',
+              args: {courseid: courseId, settings: settings}}
         ])[0].done(function() {
             this.refreshCourseCompetenciesPage();
         }.bind(this)).fail(notification.exception);
@@ -133,8 +133,8 @@ define(['jquery',
         var courseId = this._find('input[name="courseid"]').val();
 
         ajax.call([
-            { methodname: 'tool_lp_data_for_course_competencies_page',
-              args: { courseid: courseId } }
+            {methodname: 'tool_lp_data_for_course_competencies_page',
+              args: {courseid: courseId}}
         ])[0].done(function(context) {
             templates.render('tool_lp/course_competencies_page', context).done(function(html, js) {
                 $('[data-region="coursecompetenciespage"]').replaceWith(html);
index a94eb30..367cb00 100644 (file)
@@ -67,9 +67,9 @@ define(['core/str', 'core/yui'], function(str, Y) {
             // Here we are wrapping YUI. This allows us to start transitioning, but
             // wait for a good alternative without having inconsistent UIs.
             str.get_strings([
-                { key: 'emptydragdropregion', component: 'moodle' },
-                { key: 'movecontent', component: 'moodle' },
-                { key: 'tocontent', component: 'moodle' },
+                {key: 'emptydragdropregion', component: 'moodle'},
+                {key: 'movecontent', component: 'moodle'},
+                {key: 'tocontent', component: 'moodle'},
             ]).done(function() {
                 Y.use('moodle-tool_lp-dragdrop-reorder', function() {
 
index 44698d1..ac59ad9 100644 (file)
@@ -57,10 +57,10 @@ define(['jquery',
             e.stopPropagation();
 
             Str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'areyousure', component: 'moodle' },
-                { key: 'delete', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'areyousure', component: 'moodle'},
+                {key: 'delete', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 Notification.confirm(
                     strings[0], // Confirm.
index 9172c19..486c25c 100644 (file)
@@ -47,7 +47,7 @@ define(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {
                 methodname: 'tool_lp_search_cohorts',
                 args: {
                     query: query,
-                    context: { contextid: contextid },
+                    context: {contextid: contextid},
                     includes: includes
                 }
             }]);
index b554495..cb9685f 100644 (file)
@@ -65,7 +65,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
         // We are chaining ajax requests here.
         var requests = ajax.call([{
             methodname: 'core_competency_duplicate_competency_framework',
-            args: { id: frameworkid }
+            args: {id: frameworkid}
         }, {
             methodname: 'tool_lp_data_for_competency_frameworks_manage_page',
             args: {
@@ -84,7 +84,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
         // We are chaining ajax requests here.
         var requests = ajax.call([{
             methodname: 'core_competency_delete_competency_framework',
-            args: { id: frameworkid }
+            args: {id: frameworkid}
         }, {
             methodname: 'tool_lp_data_for_competency_frameworks_manage_page',
             args: {
@@ -97,12 +97,12 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
             if (success === false) {
                 var req = ajax.call([{
                     methodname: 'core_competency_read_competency_framework',
-                    args: { id: frameworkid }
+                    args: {id: frameworkid}
                 }]);
                 req[0].done(function(framework) {
                     str.get_strings([
-                        { key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname },
-                        { key: 'cancel', component: 'moodle' }
+                        {key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname},
+                        {key: 'cancel', component: 'moodle'}
                     ]).done(function(strings) {
                         notification.alert(
                             null,
@@ -127,15 +127,15 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
 
         var requests = ajax.call([{
             methodname: 'core_competency_read_competency_framework',
-            args: { id: frameworkid }
+            args: {id: frameworkid}
         }]);
 
         requests[0].done(function(framework) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname },
-                { key: 'delete', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname},
+                {key: 'delete', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
index 3558b9f..7a030b6 100644 (file)
@@ -118,11 +118,11 @@ define(['jquery',
                     methodname: self._methodName,
                     args: args,
                     done: function(evidence) {
-                        self._trigger('competencyupdated', { args: args, evidence: evidence });
-                    }.bind(self),
+                        self._trigger('competencyupdated', {args: args, evidence: evidence});
+                    },
                     fail: notification.exception
                 }]);
-            }.bind(self));
+            });
         }).fail(notification.exception);
     };
 
index 6889936..0434b56 100644 (file)
@@ -175,7 +175,7 @@ define(['jquery'], function($) {
             if (this.handlers) {
                 $.each(this.handlers, function(selector, handler) {
                     if (eventHandled) {
-                        return false;
+                        return;
                     }
                     if (item.find(selector).length > 0) {
                         var callable = $.proxy(handler, anchor);
index 5a2648b..705ab29 100644 (file)
@@ -69,7 +69,7 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
 
         if (data.competencyId !== 0) {
             ajax.call([
-                { methodname: 'core_competency_read_competency', args: {
+                {methodname: 'core_competency_read_competency', args: {
                     id: data.competencyId
                 }}
             ])[0].done(function(competency) {
@@ -112,13 +112,13 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
                     };
 
                     return Templates.render('tool_lp/competency_picker_competencyform', context);
-                }.bind(self));
+                });
             };
 
             // On selected competency.
             picker.on('save', function(e, data) {
                 self.setParent(data);
-            }.bind(self));
+            });
 
             picker.display();
         });
index 39efd98..932318f 100644 (file)
@@ -117,7 +117,7 @@ define(['jquery',
             .done(function(newhtml, newjs) {
                 $(self._region).replaceWith(newhtml);
                 templates.runTemplateJS(newjs);
-            }.bind(self))
+            })
             .fail(notification.exception);
     };
 
@@ -139,7 +139,7 @@ define(['jquery',
         // Apply all the promises, and refresh when the last one is resolved.
         return $.when.apply($.when, ajax.call(calls))
             .then(function() {
-                self._renderView.call(self, arguments[arguments.length - 1]);
+                self._renderView(arguments[arguments.length - 1]);
             })
             .fail(notification.exception);
     };
@@ -153,7 +153,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_delete_plan',
-                args: { id: planData.id }
+                args: {id: planData.id}
             }];
         self._callAndRefresh(calls, planData);
     };
@@ -169,15 +169,15 @@ define(['jquery',
 
         requests = ajax.call([{
             methodname: 'core_competency_read_plan',
-            args: { id: planData.id }
+            args: {id: planData.id}
         }]);
 
         requests[0].done(function(plan) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'deleteplan', component: 'tool_lp', param: plan.name },
-                { key: 'delete', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'deleteplan', component: 'tool_lp', param: plan.name},
+                {key: 'delete', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -186,7 +186,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doDelete(planData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
@@ -202,7 +202,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_reopen_plan',
-                args: { planid: planData.id}
+                args: {planid: planData.id}
             }];
         self._callAndRefresh(calls, planData);
     };
@@ -216,15 +216,15 @@ define(['jquery',
         var self = this,
             requests = ajax.call([{
                 methodname: 'core_competency_read_plan',
-                args: { id: planData.id }
+                args: {id: planData.id}
             }]);
 
         requests[0].done(function(plan) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name },
-                { key: 'reopenplan', component: 'tool_lp' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name},
+                {key: 'reopenplan', component: 'tool_lp'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -233,7 +233,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doReopenPlan(planData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
@@ -249,7 +249,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_complete_plan',
-                args: { planid: planData.id}
+                args: {planid: planData.id}
             }];
         self._callAndRefresh(calls, planData);
     };
@@ -263,15 +263,15 @@ define(['jquery',
         var self = this,
             requests = ajax.call([{
                 methodname: 'core_competency_read_plan',
-                args: { id: planData.id }
+                args: {id: planData.id}
             }]);
 
         requests[0].done(function(plan) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'completeplanconfirm', component: 'tool_lp', param: plan.name },
-                { key: 'completeplan', component: 'tool_lp' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'completeplanconfirm', component: 'tool_lp', param: plan.name},
+                {key: 'completeplan', component: 'tool_lp'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -280,7 +280,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doCompletePlan(planData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
@@ -295,7 +295,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_unlink_plan_from_template',
-                args: { planid: planData.id}
+                args: {planid: planData.id}
             }];
         self._callAndRefresh(calls, planData);
     };
@@ -309,15 +309,15 @@ define(['jquery',
         var self = this,
             requests = ajax.call([{
                 methodname: 'core_competency_read_plan',
-                args: { id: planData.id }
+                args: {id: planData.id}
             }]);
 
         requests[0].done(function(plan) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name },
-                { key: 'unlinkplantemplate', component: 'tool_lp' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name},
+                {key: 'unlinkplantemplate', component: 'tool_lp'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -326,7 +326,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doUnlinkPlan(planData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
@@ -499,7 +499,7 @@ define(['jquery',
         var competencyid = $(e.target).data('id');
         var requests = ajax.call([{
             methodname: 'tool_lp_list_courses_using_competency',
-            args: { id: competencyid }
+            args: {id: competencyid}
         }]);
 
         requests[0].done(function(courses) {
index 9ba1fd4..67c41ee 100644 (file)
@@ -140,7 +140,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
         }.bind(this));
         body.on('click', '[data-action="cancel"]', function() {
             popup.close();
-        }.bind(this));
+        });
     };
 
     /**
@@ -151,7 +151,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
     ScaleConfig.prototype.setScaleConfig = function() {
         var body = $(this.popup.getContent());
         // Get the data.
-        var data = [{ scaleid: this.scaleid}];
+        var data = [{scaleid: this.scaleid}];
         this.scalevalues.forEach(function(value) {
             var scaledefault = 0;
             var proficient = 0;
index e0ceecb..02fb4c5 100644 (file)
@@ -67,8 +67,8 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
         // We are chaining ajax requests here.
         var requests = ajax.call([{
             methodname: 'core_competency_delete_template',
-            args: { id: templateid,
-                    deleteplans: deleteplans }
+            args: {id: templateid,
+                    deleteplans: deleteplans}
         }, {
             methodname: 'tool_lp_data_for_templates_manage_page',
             args: {
@@ -93,7 +93,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
         // We are chaining ajax requests here.
         var requests = ajax.call([{
             methodname: 'core_competency_duplicate_template',
-            args: { id: templateid }
+            args: {id: templateid}
         }, {
             methodname: 'tool_lp_data_for_templates_manage_page',
             args: {
@@ -119,22 +119,22 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
 
         var requests = ajax.call([{
             methodname: 'core_competency_read_template',
-            args: { id: templateid }
+            args: {id: templateid}
         }, {
             methodname: 'core_competency_template_has_related_data',
-            args: { id: templateid }
+            args: {id: templateid}
         }]);
 
         requests[0].done(function(template) {
             requests[1].done(function(templatehasrelateddata) {
                 if (templatehasrelateddata) {
                     str.get_strings([
-                        { key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
-                        { key: 'deletetemplatewithplans', component: 'tool_lp' },
-                        { key: 'deleteplans', component: 'tool_lp' },
-                        { key: 'unlinkplanstemplate', component: 'tool_lp' },
-                        { key: 'confirm', component: 'moodle' },
-                        { key: 'cancel', component: 'moodle' }
+                        {key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
+                        {key: 'deletetemplatewithplans', component: 'tool_lp'},
+                        {key: 'deleteplans', component: 'tool_lp'},
+                        {key: 'unlinkplanstemplate', component: 'tool_lp'},
+                        {key: 'confirm', component: 'moodle'},
+                        {key: 'cancel', component: 'moodle'}
                     ]).done(function(strings) {
                         var actions = [{'text': strings[2], 'value': 'delete'},
                                        {'text': strings[3], 'value': 'unlink'}];
@@ -154,10 +154,10 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
                     }).fail(notification.exception);
                 } else {
                     str.get_strings([
-                        { key: 'confirm', component: 'moodle' },
-                        { key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
-                        { key: 'delete', component: 'moodle' },
-                        { key: 'cancel', component: 'moodle' }
+                        {key: 'confirm', component: 'moodle'},
+                        {key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
+                        {key: 'delete', component: 'moodle'},
+                        {key: 'cancel', component: 'moodle'}
                     ]).done(function(strings) {
                         notification.confirm(
                         strings[0], // Confirm.
index 179dcf6..8d784f2 100644 (file)
@@ -168,7 +168,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
         if (!this.multiSelect) {
             allSelected = allSelected.first();
         }
-        this.treeRoot.trigger('selectionchanged', { selected: allSelected });
+        this.treeRoot.trigger('selectionchanged', {selected: allSelected});
     };
 
     /**
@@ -274,6 +274,8 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @param {Event} e The event.
      * @return {Boolean}
      */
+     // This function should be simplified. In the meantime..
+    // eslint-disable-next-line complexity
     Tree.prototype.handleKeyDown = function(item, e) {
         var currentIndex = this.visibleItems.index(item);
         var newItem = null;
index 334e8ff..0e6df71 100644 (file)
@@ -44,15 +44,15 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function(
 
         if (this._planId) {
             this._methodName = 'tool_lp_data_for_user_competency_summary_in_plan';
-            this._args = { competencyid: this._competencyId, planid: this._planId };
+            this._args = {competencyid: this._competencyId, planid: this._planId};
             this._templateName = 'tool_lp/user_competency_summary_in_plan';
         } else if (this._courseId) {
             this._methodName = 'tool_lp_data_for_user_competency_summary_in_course';
-            this._args = { userid: this._userId, competencyid: this._competencyId, courseid: this._courseId };
+            this._args = {userid: this._userId, competencyid: this._competencyId, courseid: this._courseId};
             this._templateName = 'tool_lp/user_competency_summary_in_course';
         } else {
             this._methodName = 'tool_lp_data_for_user_competency_summary';
-            this._args = { userid: this._userId, competencyid: this._competencyId };
+            this._args = {userid: this._userId, competencyid: this._competencyId};
             this._templateName = 'tool_lp/user_competency_summary';
         }
     };
index 5001991..6600b1f 100644 (file)
@@ -54,7 +54,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
 
         var requests = ajax.call([{
             methodname: 'tool_lp_data_for_user_competency_summary_in_plan',
-            args: { competencyid: competencyId, planid: planId },
+            args: {competencyid: competencyId, planid: planId},
             done: this._contextLoaded.bind(this),
             fail: notification.exception
         }]);
@@ -99,7 +99,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
 
         ajax.call([{
             methodname: 'tool_lp_data_for_plan_page',
-            args: { planid: planId},
+            args: {planid: planId},
             done: this._pageContextLoaded.bind(this),
             fail: notification.exception
         }]);
index f1f5cd3..b9ef686 100644 (file)
@@ -104,7 +104,7 @@ define(['jquery',
         templates.render(self._template, context)
             .done(function(newhtml, newjs) {
                 templates.replaceNode($(self._region), newhtml, newjs);
-            }.bind(self))
+            })
             .fail(notification.exception);
     };
 
@@ -126,7 +126,7 @@ define(['jquery',
         // Apply all the promises, and refresh when the last one is resolved.
         return $.when.apply($.when, ajax.call(calls))
             .then(function() {
-                self._renderView.call(self, arguments[arguments.length - 1]);
+                self._renderView(arguments[arguments.length - 1]);
             })
             .fail(notification.exception);
     };
@@ -140,7 +140,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_delete_user_evidence',
-                args: { id: evidenceData.id }
+                args: {id: evidenceData.id}
             }];
         self._callAndRefresh(calls, evidenceData);
     };
@@ -156,15 +156,15 @@ define(['jquery',
 
         requests = ajax.call([{
             methodname: 'core_competency_read_user_evidence',
-            args: { id: evidenceData.id }
+            args: {id: evidenceData.id}
         }]);
 
         requests[0].done(function(evidence) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name },
-                { key: 'delete', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name},
+                {key: 'delete', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -173,7 +173,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doDelete(evidenceData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
@@ -227,7 +227,7 @@ define(['jquery',
         picker.on('save', function(e, data) {
             var competencyIds = data.competencyIds;
             self._doCreateUserEvidenceCompetency(evidenceData, competencyIds, data.requestReview);
-        }.bind(self));
+        });
 
         picker.display();
     };
@@ -295,7 +295,7 @@ define(['jquery',
         var self = this,
             calls = [{
                 methodname: 'core_competency_request_review_of_user_evidence_linked_competencies',
-                args: { id: evidenceData.id }
+                args: {id: evidenceData.id}
             }];
         self._callAndRefresh(calls, evidenceData);
     };
@@ -311,15 +311,15 @@ define(['jquery',
 
         requests = ajax.call([{
             methodname: 'core_competency_read_user_evidence',
-            args: { id: evidenceData.id }
+            args: {id: evidenceData.id}
         }]);
 
         requests[0].done(function(evidence) {
             str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name },
-                { key: 'confirm', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
+                {key: 'confirm', component: 'moodle'},
+                {key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name},
+                {key: 'confirm', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
             ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
@@ -328,7 +328,7 @@ define(['jquery',
                     strings[3], // Cancel.
                     function() {
                         self._doReviewUserEvidenceCompetencies(evidenceData);
-                    }.bind(self)
+                    }
                 );
             }).fail(notification.exception);
         }).fail(notification.exception);
index 2fabeb2..8b115e6 100644 (file)
@@ -31,7 +31,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
      * @param {String[]} templateList List of template ids.
      */
     var reloadListTemplate = function(templateList) {
-        templates.render('tool_templatelibrary/search_results', { templates: templateList })
+        templates.render('tool_templatelibrary/search_results', {templates: templateList})
             .done(function(result, js) {
                 templates.replaceNode($('[data-region="searchresults"]'), result, js);
             }).fail(notification.exception);
@@ -49,10 +49,10 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
         // Trigger the search.
 
         ajax.call([
-            { methodname: 'tool_templatelibrary_list_templates',
-              args: { component: componentStr, search: searchStr },
+            {methodname: 'tool_templatelibrary_list_templates',
+              args: {component: componentStr, search: searchStr},
               done: reloadListTemplate,
-              fail: notification.exception }
+              fail: notification.exception}
         ], true, false);
     };
 
index 7a5f30b..b75defd 100644 (file)
@@ -49,7 +49,7 @@ class mycourse extends \core_search\area\base {
      */
     public function get_recordset_by_timestamp($modifiedfrom = 0) {
         global $DB;
-        return $DB->get_recordset_select('course', 'timemodified >= ?', array($modifiedfrom));
+        return $DB->get_recordset_select('course', 'timemodified >= ?', array($modifiedfrom), 'timemodified ASC');
     }
 
     /**
index 2bd50f0..6bb4865 100644 (file)
@@ -7,7 +7,7 @@
     require_once($CFG->libdir.'/completionlib.php');
 
     $id          = optional_param('id', 0, PARAM_INT);
-    $name        = optional_param('name', '', PARAM_RAW);
+    $name        = optional_param('name', '', PARAM_TEXT);
     $edit        = optional_param('edit', -1, PARAM_BOOL);
     $hide        = optional_param('hide', 0, PARAM_INT);
     $show        = optional_param('show', 0, PARAM_INT);
index fe94ff0..d10c10e 100644 (file)
Binary files a/course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-debug.js and b/course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-debug.js differ
index 7befde3..76a249b 100644 (file)
Binary files a/course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop.js and b/course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop.js differ
index 0b3587a..57e0b16 100644 (file)
Binary files a/course/yui/build/moodle-course-management/moodle-course-management-debug.js and b/course/yui/build/moodle-course-management/moodle-course-management-debug.js differ
index 883b964..35520d1 100644 (file)
Binary files a/course/yui/build/moodle-course-management/moodle-course-management.js and b/course/yui/build/moodle-course-management/moodle-course-management.js differ
index 212e98d..4d7656b 100644 (file)
Binary files a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js and b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js differ
index 212e98d..4d7656b 100644 (file)
Binary files a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js and b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js differ
index 00b30d4..b1e3ef5 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
 /**
  * Drag and Drop for course sections and course modules.
  *
index b7fac22..889ccec 100644 (file)
@@ -1,3 +1,5 @@
+/* global Item */
+
 /**
  * A managed category.
  *
index 0a00ab1..12ca9be 100644 (file)
@@ -1,3 +1,5 @@
+/* global DragDrop, Category, Course */
+
 /**
  * Provides drop down menus for list of action links.
  *
index 474180a..893b21c 100644 (file)
@@ -1,3 +1,5 @@
+/* global Item */
+
 /**
  * A managed course.
  *
index 3ad3e0f..f622d29 100644 (file)
@@ -1,3 +1,5 @@
+/* global Console */
+
 /**
  * Drag and Drop handler
  *
index f475b89..4d87574 100644 (file)
@@ -1,3 +1,5 @@
+/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
+
 /**
  * Resource and activity toolbox class.
  *
index fe9b84e..a28ca9a 100644 (file)
@@ -1,3 +1,5 @@
+/* global SELECTOR, TOOLBOX */
+
 /**
  * Resource and activity toolbox class.
  *
index e3f6c8a..019b359 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
 /**
  * Resource and activity toolbox class.
  *
@@ -196,4 +197,3 @@ Y.extend(TOOLBOX, Y.Base, {
     }
 }
 );
-
index 3726c95..c5428c8 100644 (file)
@@ -163,7 +163,22 @@ class filter_mathjaxloader extends moodle_text_filter {
         }
         if ($hasinline || $hasdisplay || $hasextra) {
             $PAGE->requires->yui_module('moodle-filter_mathjaxloader-loader', 'M.filter_mathjaxloader.typeset');
-            return '<span class="nolink"><span class="filter_mathjaxloader_equation">' . $text . '</span></span>';
+            if ($hasextra) {
+                // If custom dilimeters are used, wrap whole text to prevent autolinking.
+                $text = '<span class="nolink">' + $text + '</span>';
+            } else {
+                if ($hasinline) {
+                    // If the default inline TeX delimiters \( \) are present, wrap each pair in nolink.
+                    $text = preg_replace('/\\\\\\([\S\s]*?\\\\\\)/u',
+                        '<span class="nolink">\0</span>', $text);
+                }
+                if ($hasdisplay) {
+                    // If default display TeX is used, wrap $$ $$ or \[ \] individually.
+                    $text = preg_replace('/\$\$[\S\s]*?\$\$|\\\\\\[[\S\s]*?\\\\\\]/u',
+                        '<span class="nolink">\0</span>', $text);
+                }
+            }
+            return '<span class="filter_mathjaxloader_equation">' . $text . '</span>';
         }
         return $text;
     }
index c185c23..e3a184c 100644 (file)
Binary files a/grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-debug.js and b/grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-debug.js differ
index ac36953..f9fa8f6 100644 (file)
Binary files a/grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable.js and b/grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable.js differ
index a57aed8..4343ba7 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global SELECTORS */
 
 /**
  * @module moodle-gradereport_grader-gradereporttable
index bbdbd8f..8cc3e10 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* eslint-disable no-unused-vars */
 
 /**
  * Grader Report Functionality.
index e4398be..eafa560 100644 (file)
@@ -65,7 +65,7 @@ $string['authpreventaccountcreation_help'] = 'When a user authenticates, an acco
 $string['authsettings'] = 'Manage authentication';
 $string['autolang'] = 'Language autodetect';
 $string['autologinguests'] = 'Auto-login guests';
-$string['availablesearchareas'] = 'Available areas for search';
+$string['searchareas'] = 'Search areas';
 $string['availableto'] = 'Available to';
 $string['availablelicenses'] = 'Available licences';
 $string['backgroundcolour'] = 'Transparent colour';
@@ -586,6 +586,7 @@ $string['ignore'] = 'Ignore';
 $string['includemoduleuserdata'] = 'Include module user data';
 $string['incompatibleblocks'] = 'Incompatible blocks';
 $string['indexdata'] = 'Index data';
+$string['indexinginfo'] = 'The recommended way to index your site\'s contents is using "Global search indexing" scheduled task which runs automatically by Cron.';
 $string['installhijacked'] = 'Installation must be finished from the original IP address, sorry.';
 $string['installsessionerror'] = 'Can not initialise PHP session, please verify that your browser accepts cookies.';
 $string['intlrecommended'] = 'Intl extension is used to improve internationalization support, such as locale aware sorting.';
@@ -750,6 +751,7 @@ $string['navshowmycoursecategories_help'] = 'If enabled courses in the users my
 $string['navsortmycoursessort'] = 'Sort my courses';
 $string['navsortmycoursessort_help'] = 'This determines whether courses are listed under My courses according to the sort order (i.e. the order set in Site administration > Courses > Manage courses and categories) or alphabetically by course setting.';
 $string['neverdeleteruns'] = 'Never delete runs';
+$string['newestdocindexed'] = 'Newest document indexed';
 $string['nobookmarksforuser'] = 'You do not have any bookmarks.';
 $string['nodatabase'] = 'No database';
 $string['nohttpsformobilewarning'] = 'It is recommended to enable HTTPS with a valid certificate. The Moodle app will always try to use a secured connection first.';
@@ -937,10 +939,22 @@ $string['rssglobaldisabled'] = 'Disabled at server level';
 $string['save'] = 'Save';
 $string['savechanges'] = 'Save changes';
 $string['search'] = 'Search';
+$string['searchalldeleted'] = 'All indexed contents have been deleted';
+$string['searchareaenabled'] = 'Search area enabled';
+$string['searchareadisabled'] = 'Search area disabled';
+$string['searchdeleteindex'] = 'Delete all indexed contents';
 $string['searchengine'] = 'Search engine';
+$string['searchindexactions'] = 'Index actions';
+$string['searchindexdeleted'] = 'Index deleted';
+$string['searchindexupdated'] = 'Search engine contents have been updated';
 $string['searchinsettings'] = 'Search in settings';
+$string['searchlastrun'] = 'Last run (time, # docs, # records, # ignores)';
+$string['searchnotavailable'] = 'Search is not available';
+$string['searchreindexed'] = 'All site\'s contents have been reindexed';
+$string['searchreindexindex'] = 'Reindex all site contents';
 $string['searchresults'] = 'Search results';
 $string['searchsetupinfo'] = 'Search setup';
+$string['searchupdateindex'] = 'Update indexed contents';
 $string['sectionerror'] = 'Section error!';
 $string['secureforms'] = 'Use additional form security';
 $string['security'] = 'Security';
index c8f24f6..75b9789 100644 (file)
@@ -9715,7 +9715,7 @@ class admin_setting_searchsetupinfo extends admin_setting {
 
         // Available areas.
         $row = array();
-        $url = new moodle_url('/admin/settings.php?section=manageglobalsearch#admin-searchengine');
+        $url = new moodle_url('/admin/searchareas.php');
         $row[0] = '2. ' . html_writer::tag('a', get_string('enablesearchareas', 'admin'),
                         array('href' => $url));
 
@@ -9750,7 +9750,7 @@ class admin_setting_searchsetupinfo extends admin_setting {
 
         // Indexed data.
         $row = array();
-        $url = new moodle_url('/report/search/index.php#searchindexform');
+        $url = new moodle_url('/admin/searchareas.php');
         $row[0] = '4. ' . html_writer::tag('a', get_string('indexdata', 'admin'), array('href' => $url));
         if ($anyindexed) {
             $status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));
index 0a9a0d8..907a905 100644 (file)
Binary files a/lib/amd/build/fragment.min.js and b/lib/amd/build/fragment.min.js differ
index cf10e4f..272be32 100644 (file)
Binary files a/lib/amd/build/notification.min.js and b/lib/amd/build/notification.min.js differ
index fdb2a95..aed3712 100644 (file)
Binary files a/lib/amd/build/tag.min.js and b/lib/amd/build/tag.min.js differ
index b440364..b43c704 100644 (file)
@@ -44,7 +44,7 @@ define(['jquery', 'core/yui'],
                 var yuiNodes = new Y.NodeList(nodes.get());
 
                 // And again for YUI.
-                Y.fire(M.core.event.FILTER_CONTENT_UPDATED, { nodes: yuiNodes });
+                Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: yuiNodes});
             });
         },
 
index 3467c48..ca7f034 100644 (file)
@@ -90,10 +90,10 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
         }
         originalSelect.children('option').each(function(index, ele) {
             if ($(ele).prop('selected')) {
-                items.push({ label: $(ele).html(), value: $(ele).attr('value') });
+                items.push({label: $(ele).html(), value: $(ele).attr('value')});
             }
         });
-        var context = $.extend({ items: items }, options, state);
+        var context = $.extend({items: items}, options, state);
 
         // Render the template.
         templates.render('core/form_autocomplete_selection', context).done(function(newHTML) {
@@ -317,13 +317,13 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
         var suggestions = [];
         originalSelect.children('option').each(function(index, option) {
             if ($(option).prop('selected') !== true) {
-                suggestions[suggestions.length] = { label: option.innerHTML, value: $(option).attr('value') };
+                suggestions[suggestions.length] = {label: option.innerHTML, value: $(option).attr('value')};
             }
         });
 
         // Re-render the list of suggestions.
         var searchquery = state.caseSensitive ? query : query.toLocaleLowerCase();
-        var context = $.extend({ options: suggestions}, options, state);
+        var context = $.extend({options: suggestions}, options, state);
         templates.render(
             'core/form_autocomplete_suggestions',
             context
@@ -752,7 +752,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
             // Create the new markup and insert it after the select.
             var suggestions = [];
             originalSelect.children('option').each(function(index, option) {
-                suggestions[index] = { label: option.innerHTML, value: $(option).attr('value') };
+                suggestions[index] = {label: option.innerHTML, value: $(option).attr('value')};
             });
 
             // Render all the parts of our UI.
index 4e1b8c7..0914918 100644 (file)
@@ -29,12 +29,13 @@ define(['core/ajax', 'jquery'], function(ajax, $) {
         // Public variables and functions.
         processResults: function(selector, data) {
             // Mangle the results into an array of objects.
-            var results = [], i = 0;
+            var results = [];
+            var i = 0;
             var excludelist = String($(selector).data('exclude')).split(',');
 
             for (i = 0; i < data.courses.length; i++) {
                 if (excludelist.indexOf(String(data.courses[i].id)) === -1) {
-                    results.push({ value: data.courses[i].id, label: data.courses[i].displayname });
+                    results.push({value: data.courses[i].id, label: data.courses[i].displayname});
                 }
             }
             return results;
index f12e49a..28627fc 100644 (file)
@@ -109,7 +109,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
                             allScript += ' ' + scriptNode.text();
                         }
                     }
-                }.bind(this));
+                });
                 promise.resolve(data.html, allScript);
             }).fail(function(ex) {
                 promise.reject(ex);
index 27da8e4..adb2c80 100644 (file)
@@ -106,7 +106,8 @@ define(['core/config'], function(config) {
         // From http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery.
         /* jshint bitwise: false */
         /* eslint no-bitwise: "off" */
-        var hash = 0, i, chr, len;
+        var hash = 0;
+        var i, chr, len;
         if (source.length === 0) {
             return hash;
         }
index 1bf0e6c..f7880a6 100644 (file)
@@ -66,7 +66,7 @@ function(Y, $, log) {
         setupTargetRegion: function() {
             var targetRegion = $('#' + notificationModule.fieldName);
             if (targetRegion.length) {
-                return;
+                return false;
             }
 
             var newRegion = $('<span>').attr('id', notificationModule.fieldName);
index 3076d4b..c65122f 100644 (file)
@@ -46,7 +46,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
 
                 var promises = ajax.call([{
                     methodname: 'core_tag_get_tagindex',
-                    args: { tagindex: args }
+                    args: {tagindex: args}
                 }], true);
 
                 $.when.apply($, promises)
@@ -102,7 +102,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
                 var form = $(this).closest('form').get(0),
                     cnt = $(form).find("input[type=checkbox]:checked").length;
                 if (!cnt) {
-                    return false;
+                    return;
                 }
                 var tempElement = $("<input type='hidden'/>").attr('name', this.name);
                 e.preventDefault();
@@ -134,7 +134,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
                             notification.alert(s[0], s[1], s[2]);
                         }
                     );
-                    return false;
+                    return;
                 }
                 var tempElement = $("<input type='hidden'/>").attr('name', this.name);
                 str.get_strings([
@@ -323,7 +323,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
                 var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey;
                 str.get_strings([
                         {key: 'delete'},
-                        {key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname') },
+                        {key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname')},
                         {key: 'yes'},
                         {key: 'no'},
                     ]).done(function(s) {
index 75f7d9d..503c351 100644 (file)
@@ -161,9 +161,9 @@ define(['core/mustache',
 
         var templatecontext = {
             attributes: [
-                { name: 'src', value: url},
-                { name: 'alt', value: helper(text)},
-                { name: 'class', value: 'smallicon'}
+                {name: 'src', value: url},
+                {name: 'alt', value: helper(text)},
+                {name: 'class', value: 'smallicon'}
             ]
         };
         // We forced loading of this early, so it will be in the cache.
@@ -272,7 +272,7 @@ define(['core/mustache',
         context.quote = function() {
           return quoteHelper;
         };
-        context.globals = { config: config };
+        context.globals = {config: config};
         context.currentTheme = themeName;
     };
 
index c3fff8b..0938056 100644 (file)
@@ -343,6 +343,8 @@ define(['jquery'], function($) {
      * @param {Event} e The event.
      * @return {Boolean}
      */
+     // This function should be simplified. In the meantime..
+     // eslint-disable-next-line complexity
     Tree.prototype.handleKeyDown = function(item, e) {
         var currentIndex = this.getVisibleItems().index(item);
 
index 565f268..f2a0e6d 100644 (file)
@@ -38,6 +38,8 @@ class core_grades_external extends external_api {
      *
      * @return external_function_parameters
      * @since Moodle 2.7
+     * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more.
+     * @see gradereport_user_external::get_grades_table for a similar function
      */
     public static function get_grades_parameters() {
         return new external_function_parameters(
@@ -65,6 +67,8 @@ class core_grades_external extends external_api {
      * @param  array  $userids      Array of user ids
      * @return array                Array of grades
      * @since Moodle 2.7
+     * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more.
+     * @see gradereport_user_external::get_grades_table for a similar function
      */
     public static function get_grades($courseid, $component = null, $activityid = null, $userids = array()) {
         global $CFG, $USER, $DB;
@@ -293,6 +297,8 @@ class core_grades_external extends external_api {
      * @param  int $iteminstance    Item instance
      * @param  int $itemnumber      Item number
      * @return grade_item           A grade_item instance
+     * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more.
+     * @see gradereport_user_external::get_grades_table for a similar function
      */
     private static function get_grade_item($courseid, $itemtype, $itemmodule = null, $iteminstance = null, $itemnumber = null) {
         $gradeiteminstance = null;
@@ -311,6 +317,8 @@ class core_grades_external extends external_api {
      *
      * @return external_description
      * @since Moodle 2.7
+     * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more.
+     * @see gradereport_user_external::get_grades_table for a similar function
      */
     public static function get_grades_returns() {
         return new external_single_structure(
@@ -405,6 +413,15 @@ class core_grades_external extends external_api {
 
     }
 
+    /**
+     * Marking the method as deprecated.
+     *
+     * @return bool
+     */
+    public static function get_grades_is_deprecated() {
+        return true;
+    }
+
     /**
      * Returns description of method parameters
      *
index 6a978eb..0b983f3 100644 (file)
@@ -1660,6 +1660,7 @@ class core_plugin_manager {
         $plugins = array(
             'qformat' => array('blackboard', 'learnwise'),
             'enrol' => array('authorize'),
+            'report' => array('search'),
             'tinymce' => array('dragmath'),
             'tool' => array('bloglevelupgrade', 'qeupgradehelper', 'timezoneimport'),
             'theme' => array('mymobile', 'afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white',
@@ -1870,7 +1871,7 @@ class core_plugin_manager {
 
             'report' => array(
                 'backups', 'competency', 'completion', 'configlog', 'courseoverview', 'eventlist',
-                'log', 'loglive', 'outline', 'participation', 'progress', 'questioninstances', 'search',
+                'log', 'loglive', 'outline', 'participation', 'progress', 'questioninstances',
                 'security', 'stats', 'performance', 'usersessions'
             ),
 
index 0cc9443..3148646 100644 (file)
@@ -393,7 +393,8 @@ $functions = array(
     'core_grades_get_grades' => array(
         'classname' => 'core_grades_external',
         'methodname' => 'get_grades',
-        'description' => 'Returns student course total grade and grades for activities.
+        'description' => '** DEPRECATED ** Please do not call this function any more.
+                                     Returns student course total grade and grades for activities.
                                      This function does not return category or manual items.
                                      This function is suitable for managers or teachers not students.',
         'type' => 'read',
index ee468b6..629ab19 100644 (file)
@@ -2072,5 +2072,16 @@ function xmldb_main_upgrade($oldversion) {
     // Moodle v3.1.0 release upgrade line.
     // Put any upgrade step following this.
 
+    if ($oldversion < 2016070700.01) {
+
+        // If someone is emotionally attached to it let's leave the config (basically the version) there.
+        if (!file_exists($CFG->dirroot . '/report/search/classes/output/form.php')) {
+            unset_all_config_for_plugin('report_search');
+        }
+
+        // Savepoint reached.
+        upgrade_main_savepoint(true, 2016070700.01);
+    }
+
     return true;
 }
index d10c55a..731161c 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 41bd2cd..0c89fae 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 41e53ad..73ae0b5 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js differ
index e436da5..6096475 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js and b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js differ
index 27f227a..7df539e 100644 (file)
@@ -12,6 +12,8 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global NOTIFY_WARNING, NOTIFY_INFO */
+/* eslint-disable no-unused-vars */
 
 /**
  * A autosave function for the Atto editor.
index 5b86018..cbcce69 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global LOGNAME */
 
 /**
  * @module moodle-editor_atto-editor
index b7f5eff..5048ddf 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global YUI */
 
 /**
  * @module moodle-editor_atto-plugin
index 8089a11..cba8839 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* eslint-disable no-unused-vars */
 
 /**
  * The Atto WYSIWG pluggable editor, written for Moodle.
diff --git a/lib/editor/atto/yui/src/editor/js/lintconfig.js b/lib/editor/atto/yui/src/editor/js/lintconfig.js
deleted file mode 100644 (file)
index 9291d3b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* globals rangy */
index 3f6c460..077794e 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global rangy */
 
 /**
  * @module moodle-editor_atto-editor
index 6c31d81..3e5c1a4 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global rangy */
 
 /**
  * @module moodle-editor_atto-editor
index 3c056a3..26cf46e 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global LOGNAME */
 
 /**
  * @module moodle-editor_atto-editor
index a92d6f7..26eac65 100644 (file)
@@ -904,6 +904,7 @@ function external_format_string($str, $contextid, $striplinks = true, $options =
  *                      returned. Default false.
  *      allowid     :   If true then id attributes will not be removed, even when using htmlpurifier. Default (different from
  *                      format_text) true. Default changed id attributes are commonly needed.
+ *      blanktarget :   If true all <a> tags will have target="_blank" added unless target is explicitly specified.
  * </pre>
  *
  * @param string $text The content that may contain ULRs in need of rewriting.
index 3c6e027..a9831d9 100644 (file)
Binary files a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js and b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector-debug.js differ
index 3c6e027..a9831d9 100644 (file)
Binary files a/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector.js and b/lib/form/yui/build/moodle-form-dateselector/moodle-form-dateselector.js differ
index a0b09a4..aa9c4fb 100644 (file)
@@ -1,3 +1,5 @@
+/* global CALENDAR, MOODLECALENDAR */
+
 /**
  * Add some custom methods to the node class to make our lives a little
  * easier within this module.
index cda9bd3..01c6a47 100644 (file)
@@ -105,8 +105,8 @@ class core_externallib_testcase extends advanced_testcase {
 
         $test = '$$ \pi $$';
         $testformat = FORMAT_MARKDOWN;
-        $correct = array('<span class="nolink"><span class="filter_mathjaxloader_equation"><p>$$ \pi $$</p>
-</span></span>', FORMAT_HTML);
+        $correct = array('<span class="filter_mathjaxloader_equation"><p><span class="nolink">$$ \pi $$</span></p>
+</span>', FORMAT_HTML);
         $this->assertSame(external_format_text($test, $testformat, $context->id, 'core', '', 0), $correct);
 
         // Filters can be opted out from by the developer.
index a8cccd7..f8398e2 100644 (file)
@@ -13,6 +13,9 @@ information provided here is intended especially for developers.
   - get_user_max_upload_file_size()
 * The following functions have been removed and should not be used any more:
     - file_modify_html_header() - See MDL-29738 for more information.
+* core_grades_external::get_grades has been deprecated. Please do not call this function any more.
+  External function gradereport_user_external::get_grades_table can be used for retrieving the course grades table.
+  Please note that the information returned from that WS is intended for displaying (not for data consumption).
 
 === 3.1 ===
 
index bf0bb93..f0fc38a 100644 (file)
Binary files a/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js and b/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js differ
index 5deddfc..81585d1 100644 (file)
Binary files a/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js and b/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js differ
index 6d060fb..b41f36d 100644 (file)
Binary files a/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js and b/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js differ
index 35bb1e3..8c1be7e 100644 (file)
Binary files a/lib/yui/build/moodle-core-dock/moodle-core-dock.js and b/lib/yui/build/moodle-core-dock/moodle-core-dock.js differ
index 93c4c97..f0568c9 100644 (file)
Binary files a/lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm-debug.js and b/lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm-debug.js differ
index 93c4c97..f0568c9 100644 (file)
Binary files a/lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm.js and b/lib/yui/build/moodle-core-languninstallconfirm/moodle-core-languninstallconfirm.js differ
index bebacc1..262fce7 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js and b/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js differ
index bebacc1..262fce7 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception.js and b/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception.js differ
index 1fa7732..7c299a7 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-debug.js and b/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-debug.js differ
index 1fa7732..7c299a7 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert.js and b/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert.js differ
index 459e595..8f30935 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js and b/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js differ
index 459e595..8f30935 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js and b/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js differ
index 86f372c..e385329 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js and b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js differ
index 26caaf2..78d4e12 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js and b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js differ
index 6f43932..137b746 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-debug.js and b/lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-debug.js differ
index 6f43932..137b746 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception.js and b/lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception.js differ
index cf981d2..98d6401 100644 (file)
@@ -1,3 +1,5 @@
+/* global MANAGER */
+
 /**
  * This file contains the Block Region class used by the drag and drop manager.
  *
index f2e3eab..ca1a15d 100644 (file)
@@ -1,3 +1,5 @@
+/* global MANAGER */
+
 /**
  * Provides drag and drop functionality for blocks.
  *
index 97b28f8..f8eab03 100644 (file)
@@ -1,3 +1,5 @@
+/* global BLOCKREGION, SELECTOR, AJAXURL */
+
 /**
  * This file contains the drag and drop manager class.
  *
index 824fd3c..68693ef 100644 (file)
@@ -1,3 +1,5 @@
+/* global BLOCK, LOGNS, DOCKEDITEM */
+
 /**
  * Dock JS.
  *
index e16d3e4..7c8a0df 100644 (file)
@@ -6,7 +6,6 @@
  * @module moodle-core-dock
  */
 
-
 var LOGNS = 'moodle-core-dock',
     BODY = Y.one(Y.config.doc.body),
     CSS = {
@@ -32,7 +31,7 @@ var LOGNS = 'moodle-core-dock',
     DOCKPANEL,
     TABHEIGHTMANAGER,
     BLOCK,
-    DOCKEDITEM;
+    DOCKEDITEM; // eslint-disable-line no-unused-vars
 
 M.core = M.core || {};
 M.core.dock = M.core.dock || {};
index d0d6431..b18eac8 100644 (file)
@@ -1,3 +1,5 @@
+/* global LOGNS, DOCKEDITEM */
+
 /**
  * Dock JS.
  *
index fd50c44..59e39e3 100644 (file)
@@ -1,3 +1,5 @@
+/* global DOCKPANEL, LOGNS */
+
 /**
  * Dock JS.
  *
index 28aaff4..b8d4851 100644 (file)
@@ -1,3 +1,5 @@
+/* global TABHEIGHTMANAGER, LOGNS */
+
 /**
  * Dock JS.
  *
index b4dddc9..c157115 100644 (file)
@@ -1,3 +1,5 @@
+/* global BASE, DIALOGUE_PREFIX */
+
 /**
  * A dialogue type designed to display an appropriate error when an error
  * thrown in the Moodle codebase was reported during an AJAX request.
index d2acd6c..5e001a5 100644 (file)
@@ -1,3 +1,5 @@
+/* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */
+
 /**
  * A dialogue type designed to display an alert to the user.
  *
index f26a159..94e6553 100644 (file)
@@ -1,3 +1,5 @@
+/* global CONFIRMYES, CONFIRMNO, QUESTION, BASE, TITLE, DIALOGUE_PREFIX */
+
 /**
  * A dialogue type designed to display a confirmation to the user.
  *
index 8f0220c..7910276 100644 (file)
@@ -1,3 +1,5 @@
+/* global DIALOGUE_PREFIX, BASE */
+
 /**
  * The generic dialogue class for use in Moodle.
  *
index cddb8f3..2dff285 100644 (file)
@@ -1,3 +1,5 @@
+/* global BASE, DIALOGUE_PREFIX */
+
 /**
  * A dialogue type designed to display an appropriate error when a generic
  * javascript error was thrown and caught.
index 70b76a7..a863e9f 100644 (file)
@@ -1,3 +1,5 @@
+/* global DIALOGUE_PREFIX */
+
 /**
  * A dialogue type designed to display informative messages to users.
  *
index 362bd76..f271df3 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars, no-unused-expressions */
 var DIALOGUE_PREFIX,
     BASE,
     CONFIRMYES,
index f24feb0..61d6d44 100644 (file)
Binary files a/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js and b/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js differ
index f24feb0..61d6d44 100644 (file)
Binary files a/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js and b/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js differ
index b667fcd..4e3adb1 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* eslint-disable no-unused-vars */
 
 /**
  * Messenger constants.
index 916d51d..559529a 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global SELECTORS */
 
 /**
  * Messenger manager.
index 8998638..1196010 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global CSSR, SELECTORS */
 
 /**
  * Send message dialog.
index f14a5af..2b33e3a 100644 (file)
Binary files a/mod/assign/amd/build/grading_navigation.min.js and b/mod/assign/amd/build/grading_navigation.min.js differ
index 3c4e8a1..97087e0 100644 (file)
@@ -64,7 +64,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
 
         str.get_string('changeuser', 'mod_assign').done(function(s) {
                 autocomplete.enhance('[data-action=change-user]', false, 'mod_assign/participant_selector', s);
-            }.bind(this)
+            }
         ).fail(notification.exception);
 
         // We do not allow navigation while ajax requests are pending.
@@ -105,7 +105,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
 
         ajax.call([{
             methodname: 'mod_assign_list_participants',
-            args: { assignid: assignmentid, groupid: groupid, filter: '', onlyids: true },
+            args: {assignid: assignmentid, groupid: groupid, filter: '', onlyids: true},
             done: this._usersLoaded.bind(this),
             fail: notification.exception
         }]);
@@ -180,7 +180,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
             if ($(ele).prop('checked')) {
                 filterlist[filterlist.length] = $(ele).closest('label').text();
             }
-        }.bind(this));
+        });
         if (filterlist.length) {
             this._region.find('[data-region="user-filters"] span').text(filterlist.join(', '));
         } else {
@@ -213,7 +213,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
                         show = false;
                     }
                 }
-            }.bind(this));
+            });
 
             if (show) {
                 this._filteredUsers[this._filteredUsers.length] = user;
@@ -244,15 +244,15 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
         if (checker.checkFormForChanges('[data-region="grade-panel"] .gradeform')) {
             // Form has changes, so we need to confirm before switching users.
             str.get_strings([
-                { key: 'unsavedchanges', component: 'mod_assign' },
-                { key: 'unsavedchangesquestion', component: 'mod_assign' },
-                { key: 'saveandcontinue', component: 'mod_assign' },
-                { key: 'cancel', component: 'core' },
+                {key: 'unsavedchanges', component: 'mod_assign'},
+                {key: 'unsavedchangesquestion', component: 'mod_assign'},
+                {key: 'saveandcontinue', component: 'mod_assign'},
+                {key: 'cancel', component: 'core'},
             ]).done(function(strs) {
                 notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
                     $(document).trigger('save-changes', -1);
                 });
-            }.bind(this));
+            });
         } else {
             $(document).trigger('user-changed', -1);
         }
@@ -276,15 +276,15 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
         if (checker.checkFormForChanges('[data-region="grade-panel"] .gradeform')) {
             // Form has changes, so we need to confirm before switching users.
             str.get_strings([
-                { key: 'unsavedchanges', component: 'mod_assign' },
-                { key: 'unsavedchangesquestion', component: 'mod_assign' },
-                { key: 'saveandcontinue', component: 'mod_assign' },
-                { key: 'cancel', component: 'core' },
+                {key: 'unsavedchanges', component: 'mod_assign'},
+                {key: 'unsavedchangesquestion', component: 'mod_assign'},
+                {key: 'saveandcontinue', component: 'mod_assign'},
+                {key: 'cancel', component: 'core'},
             ]).done(function(strs) {
                 notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
                     $(document).trigger('save-changes', useridnumber);
                 });
-            }.bind(this));
+            });
         } else {
             select.attr('data-selected', userid);
 
@@ -332,7 +332,8 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
         e.preventDefault();
         var select = this._region.find('[data-action=change-user]');
         var currentUserId = select.attr('data-selected');
-        var i = 0, currentIndex = 0;
+        var i = 0;
+        var currentIndex = 0;
 
         for (i = 0; i < this._filteredUsers.length; i++) {
             if (this._filteredUsers[i].id == currentUserId) {
@@ -361,7 +362,8 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
         e.preventDefault();
         var select = this._region.find('[data-action=change-user]');
         var currentUserId = select.attr('data-selected');
-        var i = 0, currentIndex = 0;
+        var i = 0;
+        var currentIndex = 0;
 
         for (i = 0; i < this._filteredUsers.length; i++) {
             if (this._filteredUsers[i].id == currentUserId) {
@@ -405,7 +407,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
             if (count) {
                 currentIndex += 1;
             }
-            var param = { x: currentIndex, y: count };
+            var param = {x: currentIndex, y: count};
 
             str.get_string('xofy', 'mod_assign', param).done(function(s) {
                 this._region.find('[data-region="user-count-summary"]').text(s);
@@ -448,15 +450,15 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
         if (checker.checkFormForChanges('[data-region="grade-panel"] .gradeform')) {
             // Form has changes, so we need to confirm before switching users.
             str.get_strings([
-                { key: 'unsavedchanges', component: 'mod_assign' },
-                { key: 'unsavedchangesquestion', component: 'mod_assign' },
-                { key: 'saveandcontinue', component: 'mod_assign' },
-                { key: 'cancel', component: 'core' },
+                {key: 'unsavedchanges', component: 'mod_assign'},
+                {key: 'unsavedchangesquestion', component: 'mod_assign'},
+                {key: 'saveandcontinue', component: 'mod_assign'},
+                {key: 'cancel', component: 'core'},
             ]).done(function(strs) {
                 notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
                     $(document).trigger('save-changes', userid);
                 });
-            }.bind(this));
+            });
         } else {
             if (!isNaN(userid) && userid > 0) {
                 select.attr('data-selected', userid);
index 9d9e328..4809c75 100644 (file)
@@ -142,8 +142,8 @@ define(['jquery', 'core/notification', 'core/templates', 'core/fragment',
             $(document).trigger('reset', [this._lastUserId, formdata]);
         } else {
             str.get_strings([
-                { key: 'changessaved', component: 'core' },
-                { key: 'gradechangessaveddetail', component: 'mod_assign' },
+                {key: 'changessaved', component: 'core'},
+                {key: 'gradechangessaveddetail', component: 'mod_assign'},
             ]).done(function(strs) {
                 notification.alert(strs[0], strs[1]);
             }).fail(notification.exception);
@@ -193,9 +193,9 @@ define(['jquery', 'core/notification', 'core/templates', 'core/fragment',
         var formhtml = formcopy.wrap($('<form/>')).html();
 
         str.get_strings([
-            { key: 'viewadifferentattempt', component: 'mod_assign' },
-            { key: 'view', component: 'core' },
-            { key: 'cancel', component: 'core' },
+            {key: 'viewadifferentattempt', component: 'mod_assign'},
+            {key: 'view', component: 'core'},
+            {key: 'cancel', component: 'core'},
         ]).done(function(strs) {
             notification.confirm(strs[0], formhtml, strs[1], strs[2], function() {
                 var attemptnumber = $("input:radio[name='select-attemptnumber']:checked").val();
@@ -277,7 +277,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/fragment',
                 if (userid > 0) {
                     this._region.show();
                     // Reload the grading form "fragment" for this user.
-                    var params = { userid: userid, attemptnumber: attemptnumber, jsonformdata: JSON.stringify(submissiondata) };
+                    var params = {userid: userid, attemptnumber: attemptnumber, jsonformdata: JSON.stringify(submissiondata)};
                     fragment.loadFragment('mod_assign', 'gradingpanel', contextid, params).done(function(html, js) {
                         this._niceReplaceNodeContents(this._region, html, js)
                         .done(function() {
index f084b0a..71312a6 100644 (file)
@@ -35,9 +35,10 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
          * @return {Array}
          */
         processResults: function(selector, data) {
-            var results = [], i = 0;
+            var results = [];
+            var i = 0;
             for (i = 0; i < data.length; i++) {
-                results[i] = { value: data[i].id, label: data[i].label };
+                results[i] = {value: data[i].id, label: data[i].label};
             }
             return results;
         },
@@ -61,7 +62,7 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
             });
 
             var promise = ajax.call([{
-                methodname: 'mod_assign_list_participants', args: { assignid: assignmentid, groupid: 0, filter: query, limit: 30 }
+                methodname: 'mod_assign_list_participants', args: {assignid: assignmentid, groupid: 0, filter: query, limit: 30}
             }]);
 
             promise[0].then(function(results) {
index d872488..3d815bd 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js differ
index d872488..3d815bd 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js differ
index 5415add..536b214 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global STROKEWEIGHT, SELECTOR, SELECTEDBORDERCOLOUR, SELECTEDFILLCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 3a2719b..f80f629 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global ANNOTATIONCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 9bf2499..fedd717 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global STROKEWEIGHT, ANNOTATIONCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 9b878e8..0584e38 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global STROKEWEIGHT, ANNOTATIONCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 6a857d1..55fb5c4 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global STROKEWEIGHT, ANNOTATIONCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 2b640ae..3e04084 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global STROKEWEIGHT, ANNOTATIONCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 9d1c646..9d209c5 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global SELECTOR */
 
 /**
  * Provides an in browser PDF editor.
index 53f91c7..0d5a965 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global SELECTOR, COMMENTCOLOUR, COMMENTTEXTCOLOUR */
 
 /**
  * Provides an in browser PDF editor.
index 73b2657..ac378ca 100644 (file)
@@ -1,3 +1,5 @@
+/* eslint-disable no-unused-vars */
+/* global SELECTOR */
 var COMMENTSEARCHNAME = "commentsearch",
     COMMENTSEARCH;
 
index 21e368c..d17fad0 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global SELECTOR */
 
 /**
  * Provides an in browser PDF editor.
index 8d842f8..d0fc76a 100644 (file)
@@ -12,6 +12,8 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* eslint-disable no-unused-vars */
+/* global SELECTOR, TOOLSELECTOR, AJAXBASE, COMMENTCOLOUR, ANNOTATIONCOLOUR, AJAXBASEPROGRESS, CLICKTIMEOUT */
 
 /**
  * Provides an in browser PDF editor.
index 7b5eba1..4a2b3df 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* eslint-disable no-unused-vars */
 
 /**
  * A list of globals used by this module.
index e92f664..9893191 100644 (file)
@@ -12,6 +12,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+/* global AJAXBASE */
 
 /**
  * Provides an in browser PDF editor.
index 3f6d79c..ba96a63 100644 (file)
@@ -66,10 +66,10 @@ class mod_book_search_testcase extends advanced_testcase {
         // Enabled by default once global search is enabled.
         $this->assertTrue($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', false, $componentname);
+        set_config($varname . '_enabled', 0, $componentname);
         $this->assertFalse($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', true, $componentname);
+        set_config($varname . '_enabled', 1, $componentname);
         $this->assertTrue($searcharea->is_enabled());
     }
 
index 1f5d597..2996472 100644 (file)
@@ -80,6 +80,15 @@ $capabilities = array(
             'editingteacher' => CAP_ALLOW,
             'manager' => CAP_ALLOW
         )
+    ),
+
+    'mod/choice:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_MODULE,
+        'archetypes' => array(
+            'user' => CAP_ALLOW,
+            'guest' => CAP_ALLOW
+        )
     )
 );
 
index d7d4df0..bdfa60a 100644 (file)
@@ -63,6 +63,7 @@ If limits are disabled then any number of participants can select each of the op
 $string['choice:readresponses'] = 'View responses';
 $string['choicesaved'] = 'Your choice has been saved';
 $string['choicetext'] = 'Choice text';
+$string['choice:view'] = 'View choice activity';
 $string['chooseaction'] = 'Choose an action ...';
 $string['description'] = 'Description';
 $string['includeinactive'] = 'Include responses from inactive/suspended users';
index a108978..2a1e112 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2016052300;       // The current module version (Date: YYYYMMDDXX)
+$plugin->version   = 2016070700;       // The current module version (Date: YYYYMMDDXX)
 $plugin->requires  = 2016051900;    // Requires this Moodle version
 $plugin->component = 'mod_choice';     // Full name of the plugin (used for diagnostics)
 $plugin->cron      = 0;
index 0902635..d4da9cb 100644 (file)
@@ -1332,9 +1332,9 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
         if (!$data->approval) {
             $replacement[] = '';
         } else if ($record->approved) {
-            $replacement[] = 'approved';
+            $replacement[] = get_string('approved', 'data');
         } else {
-            $replacement[] = 'notapproved';
+            $replacement[] = get_string('notapproved', 'data');
         }
 
         $patterns[]='##comments##';
index 8df9913..132f5ea 100644 (file)
@@ -633,7 +633,7 @@ class mod_forum_external extends external_api {
         $warnings = array();
 
         // Request and permission validation.
-        $forum = $DB->get_record('forum', array('id' => $params['forumid']), 'id', MUST_EXIST);
+        $forum = $DB->get_record('forum', array('id' => $params['forumid']), '*', MUST_EXIST);
         list($course, $cm) = get_course_and_cm_from_instance($forum, 'forum');
 
         $context = context_module::instance($cm->id);
index 4940d41..cb0bbbb 100644 (file)
@@ -1602,27 +1602,34 @@ function forum_print_recent_activity($course, $viewfullnames, $timestart) {
     }
 
     echo $OUTPUT->heading(get_string('newforumposts', 'forum').':', 3);
-    echo "\n<ul class='unlist'>\n";
+    $list = html_writer::start_tag('ul', ['class' => 'unlist']);
 
     foreach ($printposts as $post) {
         $subjectclass = empty($post->parent) ? ' bold' : '';
+        $authorhidden = forum_is_author_hidden($post, (object) ['type' => $post->forumtype]);
 
-        echo '<li><div class="head">'.
-               '<div class="date">'.userdate($post->modified, $strftimerecent).'</div>'.
-               '<div class="name">'.fullname($post, $viewfullnames).'</div>'.
-             '</div>';
-        echo '<div class="info'.$subjectclass.'">';
-        if (empty($post->parent)) {
-            echo '"<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'">';
-        } else {
-            echo '"<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'&amp;parent='.$post->parent.'#p'.$post->id.'">';
+        $list .= html_writer::start_tag('li');
+        $list .= html_writer::start_div('head');
+        $list .= html_writer::div(userdate($post->modified, $strftimerecent), 'date');
+        if (!$authorhidden) {
+            $list .= html_writer::div(fullname($post, $viewfullnames), 'name');
+        }
+        $list .= html_writer::end_div(); // Head.
+
+        $list .= html_writer::start_div('info' . $subjectclass);
+        $discussionurl = new moodle_url('/mod/forum/discuss.php', ['d' => $post->discussion]);
+        if (!empty($post->parent)) {
+            $discussionurl->param('parent', $post->parent);
+            $discussionurl->set_anchor('p'. $post->id);
         }
         $post->subject = break_up_long_words(format_string($post->subject, true));
-        echo $post->subject;
-        echo "</a>\"</div></li>\n";
+        $list .= html_writer::link($discussionurl, $post->subject);
+        $list .= html_writer::end_div(); // Info.
+        $list .= html_writer::end_tag('li');
     }
 
-    echo "</ul>\n";
+    $list .= html_writer::end_tag('ul');
+    echo $list;
 
     return true;
 }
@@ -3319,53 +3326,69 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
         $forumpostclass .= ' lastpost';
     }
 
+    // Flag to indicate whether we should hide the author or not.
+    $authorhidden = forum_is_author_hidden($post, $forum);
     $postbyuser = new stdClass;
     $postbyuser->post = $post->subject;
     $postbyuser->user = $postuser->fullname;
     $discussionbyuser = get_string('postbyuser', 'forum', $postbyuser);
     $output .= html_writer::tag('a', '', array('id'=>'p'.$post->id));
-    $output .= html_writer::start_tag('div', array('class'=>'forumpost clearfix'.$forumpostclass.$topicclass,
-                                                   'role' => 'region',
-                                                   'aria-label' => $discussionbyuser));
-    $output .= html_writer::start_tag('div', array('class'=>'row header clearfix'));
-    $output .= html_writer::start_tag('div', array('class'=>'left picture'));
-    $output .= $OUTPUT->user_picture($postuser, array('courseid'=>$course->id));
-    $output .= html_writer::end_tag('div');
+    // Begin forum post.
+    $output .= html_writer::start_div('forumpost clearfix' . $forumpostclass . $topicclass,
+        ['role' => 'region', 'aria-label' => $discussionbyuser]);
+    // Begin header row.
+    $output .= html_writer::start_div('row header clearfix');
 
+    // User picture.
+    if (!$authorhidden) {
+        $picture = $OUTPUT->user_picture($postuser, ['courseid' => $course->id]);
+        $output .= html_writer::div($picture, 'left picture');
+        $topicclass = 'topic' . $topicclass;
+    }
 
-    $output .= html_writer::start_tag('div', array('class'=>'topic'.$topicclass));
-
+    // Begin topic column.
+    $output .= html_writer::start_div($topicclass);
     $postsubject = $post->subject;
     if (empty($post->subjectnoformat)) {
         $postsubject = format_string($postsubject);
     }
-    $output .= html_writer::tag('div', $postsubject, array('class'=>'subject',
-                                                           'role' => 'heading',
-                                                           'aria-level' => '2'));
+    $output .= html_writer::div($postsubject, 'subject', ['role' => 'heading', 'aria-level' => '2']);
 
-    $by = new stdClass();
-    $by->name = html_writer::link($postuser->profilelink, $postuser->fullname);
-    $by->date = userdate($post->modified);
-    $output .= html_writer::tag('div', get_string('bynameondate', 'forum', $by), array('class'=>'author',
-                                                                                       'role' => 'heading',
-                                                                                       'aria-level' => '2'));
-
-    $output .= html_writer::end_tag('div'); //topic
-    $output .= html_writer::end_tag('div'); //row
-
-    $output .= html_writer::start_tag('div', array('class'=>'row maincontent clearfix'));
-    $output .= html_writer::start_tag('div', array('class'=>'left'));
-
-    $groupoutput = '';
-    if ($groups) {
-        $groupoutput = print_group_picture($groups, $course->id, false, true, true);
-    }
-    if (empty($groupoutput)) {
-        $groupoutput = '&nbsp;';
+    if ($authorhidden) {
+        $bytext = userdate($post->modified);
+    } else {
+        $by = new stdClass();
+        $by->date = userdate($post->modified);
+        $by->name = html_writer::link($postuser->profilelink, $postuser->fullname);
+        $bytext = get_string('bynameondate', 'forum', $by);
+    }
+    $bytextoptions = [
+        'role' => 'heading',
+        'aria-level' => '2',
+    ];
+    $output .= html_writer::div($bytext, 'author', $bytextoptions);
+    // End topic column.
+    $output .= html_writer::end_div();
+
+    // End header row.
+    $output .= html_writer::end_div();
+
+    // Row with the forum post content.
+    $output .= html_writer::start_div('row maincontent clearfix');
+    // Show if author is not hidden or we have groups.
+    if (!$authorhidden || $groups) {
+        $output .= html_writer::start_div('left');
+        $groupoutput = '';
+        if ($groups) {
+            $groupoutput = print_group_picture($groups, $course->id, false, true, true);
+        }
+        if (empty($groupoutput)) {
+            $groupoutput = '&nbsp;';
+        }
+        $output .= html_writer::div($groupoutput, 'grouppictures');
+        $output .= html_writer::end_div(); // Left side.
     }
-    $output .= html_writer::tag('div', $groupoutput, array('class'=>'grouppictures'));
 
-    $output .= html_writer::end_tag('div'); //left side
     $output .= html_writer::start_tag('div', array('class'=>'no-overflow'));
     $output .= html_writer::start_tag('div', array('class'=>'content'));
 
@@ -5899,6 +5922,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours
         $tmpactivity->content->discussion = $post->discussion;
         $tmpactivity->content->subject    = format_string($post->subject);
         $tmpactivity->content->parent     = $post->parent;
+        $tmpactivity->content->forumtype  = $post->forumtype;
 
         $tmpactivity->user = new stdClass();
         $additionalfields = array('id' => 'userid', 'picture', 'imagealt', 'email');
@@ -5913,48 +5937,85 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours
 }
 
 /**
- * @todo Document this function
- * @global object
+ * Outputs the forum post indicated by $activity.
+ *
+ * @param object $activity      the activity object the forum resides in
+ * @param int    $courseid      the id of the course the forum resides in
+ * @param bool   $detail        not used, but required for compatibilty with other modules
+ * @param int    $modnames      not used, but required for compatibilty with other modules
+ * @param bool   $viewfullnames not used, but required for compatibilty with other modules
  */
 function forum_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) {
-    global $CFG, $OUTPUT;
+    global $OUTPUT;
 
-    if ($activity->content->parent) {
+    $content = $activity->content;
+    if ($content->parent) {
         $class = 'reply';
     } else {
         $class = 'discussion';
     }
 
-    echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
-
-    echo "<tr><td class=\"userpicture\" valign=\"top\">";
-    echo $OUTPUT->user_picture($activity->user, array('courseid'=>$courseid));
-    echo "</td><td class=\"$class\">";
-
-    if ($activity->content->parent) {
+    $tableoptions = [
+        'border' => '0',
+        'cellpadding' => '3',
+        'cellspacing' => '0',
+        'class' => 'forum-recent'
+    ];
+    $output = html_writer::start_tag('table', $tableoptions);
+    $output .= html_writer::start_tag('tr');
+
+    $post = (object) ['parent' => $content->parent];
+    $forum = (object) ['type' => $content->forumtype];
+    $authorhidden = forum_is_author_hidden($post, $forum);
+
+    // Show user picture if author should not be hidden.
+    if (!$authorhidden) {
+        $pictureoptions = [
+            'courseid' => $courseid,
+            'link' => $authorhidden,
+            'alttext' => $authorhidden,
+        ];
+        $picture = $OUTPUT->user_picture($activity->user, $pictureoptions);
+        $output .= html_writer::tag('td', $picture, ['class' => 'userpicture', 'valign' => 'top']);
+    }
+
+    // Discussion title and author.
+    $output .= html_writer::start_tag('td', ['class' => $class]);
+    if ($content->parent) {
         $class = 'title';
     } else {
         // Bold the title of new discussions so they stand out.
         $class = 'title bold';
     }
-    echo "<div class=\"{$class}\">";
+
+    $output .= html_writer::start_div($class);
     if ($detail) {
         $aname = s($activity->name);
-        echo "<img src=\"" . $OUTPUT->pix_url('icon', $activity->type) . "\" ".
-             "class=\"icon\" alt=\"{$aname}\" />";
+        $output .= html_writer::img($OUTPUT->pix_url('icon', $activity->type), $aname, ['class' => 'icon']);
     }
-    echo "<a href=\"$CFG->wwwroot/mod/forum/discuss.php?d={$activity->content->discussion}"
-         ."#p{$activity->content->id}\">{$activity->content->subject}</a>";
-    echo '</div>';
+    $discussionurl = new moodle_url('/mod/forum/discuss.php', ['d' => $content->discussion]);
+    $discussionurl->set_anchor('p' . $activity->content->id);
+    $output .= html_writer::link($discussionurl, $content->subject);
+    $output .= html_writer::end_div();
 
-    echo '<div class="user">';
-    $fullname = fullname($activity->user, $viewfullnames);
-    echo "<a href=\"$CFG->wwwroot/user/view.php?id={$activity->user->id}&amp;course=$courseid\">"
-         ."{$fullname}</a> - ".userdate($activity->timestamp);
-    echo '</div>';
-      echo "</td></tr></table>";
+    $timestamp = userdate($activity->timestamp);
+    if ($authorhidden) {
+        $authornamedate = $timestamp;
+    } else {
+        $fullname = fullname($activity->user, $viewfullnames);
+        $userurl = new moodle_url('/user/view.php');
+        $userurl->params(['id' => $activity->user->id, 'course' => $courseid]);
+        $by = new stdClass();
+        $by->name = html_writer::link($userurl, $fullname);
+        $by->date = $timestamp;
+        $authornamedate = get_string('bynameondate', 'forum', $by);
+    }
+    $output .= html_writer::div($authornamedate, 'user');
+    $output .= html_writer::end_tag('td');
+    $output .= html_writer::end_tag('tr');
+    $output .= html_writer::end_tag('table');
 
-    return;
+    echo $output;
 }
 
 /**
@@ -7910,3 +7971,24 @@ function mod_forum_myprofile_navigation(core_user\output\myprofile\tree $tree, $
 
     return true;
 }
+
+/**
+ * Checks whether the author's name and picture for a given post should be hidden or not.
+ *
+ * @param object $post The forum post.
+ * @param object $forum The forum object.
+ * @return bool
+ * @throws coding_exception
+ */
+function forum_is_author_hidden($post, $forum) {
+    if (!isset($post->parent)) {
+        throw new coding_exception('$post->parent must be set.');
+    }
+    if (!isset($forum->type)) {
+        throw new coding_exception('$forum->type must be set.');
+    }
+    if ($forum->type === 'single' && empty($post->parent)) {
+        return true;
+    }
+    return false;
+}
index cf29d4f..8e551a5 100644 (file)
@@ -3012,6 +3012,39 @@ class mod_forum_lib_testcase extends advanced_testcase {
         $this->assertCount($expectedreplycount, $unmailed);
     }
 
+    /**
+     * Test for forum_is_author_hidden.
+     */
+    public function test_forum_is_author_hidden() {
+        // First post, different forum type.
+        $post = (object) ['parent' => 0];
+        $forum = (object) ['type' => 'standard'];
+        $this->assertFalse(forum_is_author_hidden($post, $forum));
+
+        // Child post, different forum type.
+        $post->parent = 1;
+        $this->assertFalse(forum_is_author_hidden($post, $forum));
+
+        // First post, single simple discussion forum type.
+        $post->parent = 0;
+        $forum->type = 'single';
+        $this->assertTrue(forum_is_author_hidden($post, $forum));
+
+        // Child post, single simple discussion forum type.
+        $post->parent = 1;
+        $this->assertFalse(forum_is_author_hidden($post, $forum));
+
+        // Incorrect parameters: $post.
+        $this->setExpectedException('coding_exception', '$post->parent must be set.');
+        unset($post->parent);
+        forum_is_author_hidden($post, $forum);
+
+        // Incorrect parameters: $forum.
+        $this->setExpectedException('coding_exception', '$forum->type must be set.');
+        unset($forum->type);
+        forum_is_author_hidden($post, $forum);
+    }
+
     public function forum_get_unmailed_posts_provider() {
         return [
             'Untimed discussion; Single post; maxeditingtime not expired' => [
index c5bc5ab..87ac58e 100644 (file)
@@ -68,10 +68,10 @@ class mod_forum_search_testcase extends advanced_testcase {
         // Enabled by default once global search is enabled.
         $this->assertTrue($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', false, $componentname);
+        set_config($varname . '_enabled', 0, $componentname);
         $this->assertFalse($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', true, $componentname);
+        set_config($varname . '_enabled', 1, $componentname);
         $this->assertTrue($searcharea->is_enabled());
     }
 
index e030e4e..72f1671 100644 (file)
@@ -53,7 +53,7 @@ class entry extends \core_search\area\base_mod {
 
         $sql = "SELECT ge.*, g.course FROM {glossary_entries} ge
                   JOIN {glossary} g ON g.id = ge.glossaryid
-                WHERE ge.timemodified >= ?";
+                WHERE ge.timemodified >= ? ORDER BY ge.timemodified ASC";
         return $DB->get_recordset_sql($sql, array($modifiedfrom));
     }
 
index 5263eeb..ff7d183 100644 (file)
@@ -67,10 +67,10 @@ class mod_glossary_search_testcase extends advanced_testcase {
         // Enabled by default once global search is enabled.
         $this->assertTrue($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', false, $componentname);
+        set_config($varname . '_enabled', 0, $componentname);
         $this->assertFalse($searcharea->is_enabled());
 
-        set_config($varname . '_enabled', true, $componentname);
+        set_config($varname . '_enabled', 1, $componentname);
         $this->assertTrue($searcharea->is_enabled());
     }
 
index 52b6ad6..4840ca9 100644 (file)
@@ -79,6 +79,10 @@ class lesson_page_type_numerical extends lesson_page {
         $data = $mform->get_data();
         require_sesskey();
 
+        $formattextdefoptions = new stdClass();
+        $formattextdefoptions->noclean = true;
+        $formattextdefoptions->para = false;
+
         // set defaults
         $result->response = '';
         $result->newpageid = 0;
@@ -93,6 +97,7 @@ class lesson_page_type_numerical extends lesson_page {
         $result->studentanswer = $result->userresponse = $result->useranswer;
         $answers = $this->get_answers();
         foreach ($answers as $answer) {
+            $answer = parent::rewrite_answers_urls($answer);
             if (strpos($answer->answer, ':')) {
                 // there's a pairs of values
                 list($min, $max) = explode(':', $answer->answer);
@@ -105,7 +110,7 @@ class lesson_page_type_numerical extends lesson_page {
             }
             if (($result->useranswer >= $minimum) && ($result->useranswer <= $maximum)) {
                 $result->newpageid = $answer->jumpto;
-                $result->response = trim($answer->response);
+                $result->response = format_text($answer->response, $answer->responseformat, $formattextdefoptions);
                 if ($this->lesson->jumpto_is_correct($this->properties->id, $result->newpageid)) {
                     $result->correctanswer = true;
                 }
index 55a303e..57834b1 100644 (file)
Binary files a/mod/lti/amd/build/cartridge_registration_form.min.js and b/mod/lti/amd/build/cartridge_registration_form.min.js differ
index a4acef3..7af41a6 100644 (file)
@@ -138,13 +138,13 @@ define(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lt
      */
     var submitCartridgeURL = function() {
         if (isLoading()) {
-            return;
+            return false;
         }
 
         var url = getCartridgeURL();
         // No URL? Do nothing.
         if (url === "") {
-            return;
+            return false;
         }
 
         startLoading();
index 5d27685..2ad61e9 100644 (file)
@@ -57,7 +57,7 @@ define(['core/ajax', 'core/notification'], function(ajax, notification) {
          * @param {Integer} id Tool proxy ID
          * @return {Promise} jQuery Deferred object
          */
-        delete: function(id) {
+        'delete': function(id) {
             var request = {
                 methodname: 'mod_lti_delete_tool_proxy',
                 args: {
index 9c4017b..9286071 100644 (file)
@@ -106,7 +106,7 @@ define(['core/ajax', 'core/notification'], function(ajax, notification) {
          * @param {Integer} id Tool type ID
          * @return {Promise} jQuery Deferred object
          */
-        delete: function(id) {
+        'delete': function(id) {
             var request = {
                 methodname: 'mod_lti_delete_tool_type',
                 args: {
index d733d38..8dee2d6 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop-debug.js and b/mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop-debug.js differ
index 825813e..19c19ae 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop.js and b/mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop.js differ
index 8e3221b..1b26a9f 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-debug.js and b/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-debug.js differ
index a766e4b..859fa0a 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-min.js and b/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-min.js differ
index 8e3221b..1b26a9f 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes.js and b/mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes.js differ
index 66a404c..644f407 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-debug.js and b/mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-debug.js differ
index 66a404c..644f407 100644 (file)
Binary files a/mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page.js and b/mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page.js differ
index 39ed5de..f5ee89c 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
 /**
  * Drag and Drop for Quiz sections and slots.
  *
index b213807..6585f71 100644 (file)
@@ -1,3 +1,4 @@
+/* global SELECTOR */
 /**
  * Resource drag and drop.
  *
index ec32959..a5ce6af 100644 (file)
@@ -1,3 +1,5 @@
+/* global TOOLBOX, BODY, SELECTOR */
+
 /**
  * Resource and activity toolbox class.
  *
@@ -245,12 +247,6 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
             instance.insert(editinstructions, 'before');
             anchor.replace(editform);
 
-            // Force the editing instruction to match the mod-indent position.
-            var padside = 'left';
-            if (window.right_to_left()) {
-                padside = 'right';
-            }
-
             // We hide various components whilst editing:
             activity.addClass(CSS.EDITINGMAXMARK);
 
index efbda57..ca34a3c 100644 (file)
@@ -1,3 +1,5 @@
+/* global TOOLBOX, BODY, SELECTOR */
+
 /**
  * Section toolbox class.
  *
index 4301ed2..b8b6b4b 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
 /**
  * Resource and activity toolbox class.
  *
index a7469fc..4ad006a 100644 (file)
@@ -1,3 +1,5 @@
+/* global YUI */
+
 /**
  * A collection of utility classes for use with pages.
  *
index 3cb9ee7..f4033eb 100644 (file)
@@ -46,7 +46,8 @@ class activity extends \core_search\area\base_activity {
     public function get_recordset_by_timestamp($modifiedfrom = 0) {
         global $DB;
         $select = 'course != ? AND ' . static::MODIFIED_FIELD_NAME . ' >= ?';
-        return $DB->get_recordset_select($this->get_module_name(), $select, array(0, $modifiedfrom));
+        return $DB->get_recordset_select($this->get_module_name(), $select, array(0, $modifiedfrom),
+                static::MODIFIED_FIELD_NAME . ' ASC');
     }
 
 }