Merge branch 'MDL-54629-master' of git://github.com/jleyva/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 12 Jul 2016 19:01:02 +0000 (21:01 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 12 Jul 2016 19:01:02 +0000 (21:01 +0200)
597 files changed:
.csslintrc
.eslintrc
.jshintrc
.travis.yml
Gruntfile.js
admin/cli/install.php
admin/cli/install_database.php
admin/cli/reset_password.php
admin/environment.xml
admin/index.php
admin/roles/ajax.php
admin/searchareas.php [new file with mode: 0644]
admin/settings/plugins.php
admin/tool/behat/cli/run.php
admin/tool/health/styles.css
admin/tool/lp/amd/build/actionselector.min.js
admin/tool/lp/amd/build/competencies.min.js
admin/tool/lp/amd/build/competency_rule_points.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/competencytree.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/tree.min.js
admin/tool/lp/amd/build/user_competency_info.min.js
admin/tool/lp/amd/build/user_competency_plan_popup.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_plan_navigation.js
admin/tool/lp/amd/src/competency_rule.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/dialogue.js
admin/tool/lp/amd/src/dragdrop-reorder.js
admin/tool/lp/amd/src/event_base.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/frameworks_datasource.js
admin/tool/lp/amd/src/grade_dialogue.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/scalevalues.js
admin/tool/lp/amd/src/templateactions.js
admin/tool/lp/amd/src/tree.js
admin/tool/lp/amd/src/user_competency_course_navigation.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_competency_workflow.js
admin/tool/lp/amd/src/user_evidence_actions.js
admin/tool/lp/classes/external/course_module_summary_exporter.php
admin/tool/lp/coursecompetencies.php
admin/tool/lp/lib.php
admin/tool/lp/styles.css
admin/tool/mobile/classes/api.php
admin/tool/mobile/classes/external.php
admin/tool/mobile/db/services.php
admin/tool/mobile/tests/externallib_test.php
admin/tool/mobile/version.php
admin/tool/monitor/classes/eventobservers.php
admin/tool/monitor/classes/subscription.php
admin/tool/monitor/classes/subscription_manager.php
admin/tool/monitor/classes/task/check_subscriptions.php [new file with mode: 0644]
admin/tool/monitor/db/install.xml
admin/tool/monitor/db/tasks.php
admin/tool/monitor/db/upgrade.php
admin/tool/monitor/lang/en/tool_monitor.php
admin/tool/monitor/tests/subscription_test.php [new file with mode: 0644]
admin/tool/monitor/tests/task_check_subscriptions_test.php [new file with mode: 0644]
admin/tool/monitor/version.php
admin/tool/recyclebin/lib.php
admin/tool/recyclebin/tests/category_bin_test.php
admin/tool/templatelibrary/amd/build/display.min.js
admin/tool/templatelibrary/amd/src/display.js
admin/tool/templatelibrary/amd/src/search.js
admin/tool/xmldb/actions/edit_field/edit_field.class.php
admin/tool/xmldb/actions/edit_index/edit_index.class.php
admin/tool/xmldb/actions/edit_key/edit_key.class.php
admin/tool/xmldb/actions/edit_table/edit_table.class.php
auth/db/auth.php
backup/util/ui/restore_ui.class.php
blocks/activity_results/block_activity_results.php
blocks/activity_results/edit_form.php
blocks/activity_results/lang/en/block_activity_results.php
blocks/activity_results/settings.php [new file with mode: 0644]
blocks/activity_results/tests/behat/defaultsettings.feature [new file with mode: 0644]
blocks/activity_results/version.php
blocks/community/styles.css
blocks/navigation/amd/build/ajax_response_renderer.min.js
blocks/navigation/amd/src/ajax_response_renderer.js
blocks/navigation/amd/src/nav_loader.js
blocks/private_files/tests/behat/block_private_files_dashboard.feature
blocks/private_files/tests/behat/block_private_files_frontpage.feature
comment/lib.php
competency/classes/api.php
competency/classes/course_competency_settings.php
competency/classes/evidence.php
competency/tests/api_test.php
completion/criteria/completion_criteria_activity.php
completion/data_object.php
composer.json
composer.lock
course/classes/search/mycourse.php
course/completion_form.php
course/externallib.php
course/format/README.txt
course/format/topics/tests/behat/edit_delete_sections.feature
course/format/upgrade.txt
course/renderer.php
course/tests/behat/behat_course.php
course/tests/behat/restrict_available_activities.feature
course/tests/externallib_test.php
course/upgrade.txt [new file with mode: 0644]
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-modchooser/moodle-course-modchooser-debug.js
course/yui/build/moodle-course-modchooser/moodle-course-modchooser-min.js
course/yui/build/moodle-course-modchooser/moodle-course-modchooser.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/modchooser/js/modchooser.js
course/yui/src/toolboxes/js/resource.js
course/yui/src/toolboxes/js/section.js
course/yui/src/toolboxes/js/toolbox.js
enrol/externallib.php
enrol/lti/classes/helper.php
enrol/tests/behat/behat_enrol.php
enrol/tests/externallib_test.php
enrol/upgrade.txt
enrol/yui/rolemanager/assets/skins/sam/rolemanager.css
filter/mathjaxloader/filter.php
filter/mediaplugin/styles.css
grade/amd/build/edittree_index.min.js [new file with mode: 0644]
grade/amd/src/edittree_index.js [new file with mode: 0644]
grade/edit/tree/functions.js [deleted file]
grade/edit/tree/index.php
grade/edit/tree/lib.php
grade/grading/form/guide/amd/build/comment_chooser.min.js
grade/grading/form/guide/amd/src/comment_chooser.js
grade/grading/form/guide/lang/en/gradingform_guide.php
grade/grading/form/guide/tests/behat/behat_gradingform_guide.php
grade/grading/form/guide/tests/behat/edit_guide.feature
grade/lib.php
grade/report/grader/styles.css
grade/report/grader/tests/behat/ajax_grader.feature
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-min.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
grade/report/singleview/styles.css
group/clientlib.js
install.php
install/lang/da/error.php
install/lang/da/moodle.php
install/lang/da_rum/langconfig.php [new file with mode: 0644]
install/lang/dz/admin.php
install/lang/dz/moodle.php
install/lang/pt/moodle.php
install/lang/ro/install.php
install/lang/ru/admin.php
install/lang/ru/moodle.php
install/lang/zh_tw/install.php
lang/en/admin.php
lang/en/auth.php
lang/en/backup.php
lang/en/badges.php
lang/en/deprecated.txt
lang/en/install.php
lang/en/moodle.php
lang/en/question.php
lang/en/search.php
lib/adminlib.php
lib/amd/build/form-autocomplete.min.js
lib/amd/build/form-course-selector.min.js
lib/amd/build/fragment.min.js
lib/amd/build/inplace_editable.min.js
lib/amd/build/localstorage.min.js
lib/amd/build/loglevel.min.js
lib/amd/build/mustache.min.js
lib/amd/build/notification.min.js
lib/amd/build/permissionmanager.min.js
lib/amd/build/search-input.min.js
lib/amd/build/tag.min.js
lib/amd/build/templates.min.js
lib/amd/build/tree.min.js
lib/amd/src/ajax.js
lib/amd/src/event.js
lib/amd/src/first.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/log.js
lib/amd/src/notification.js
lib/amd/src/permissionmanager.js
lib/amd/src/str.js
lib/amd/src/tag.js
lib/amd/src/templates.js
lib/amd/src/tree.js
lib/amd/src/url.js
lib/badgeslib.php
lib/behat/behat_base.php
lib/behat/form_field/behat_form_select.php
lib/classes/grades_external.php
lib/classes/plugin_manager.php
lib/classes/requirejs.php
lib/classes/update/code_manager.php
lib/classes/user.php
lib/db/services.php
lib/db/upgrade.php
lib/db/upgradelib.php
lib/ddl/tests/ddl_test.php
lib/dml/pgsql_native_moodle_database.php
lib/dml/pgsql_native_moodle_recordset.php
lib/dml/tests/dml_test.php
lib/editor/atto/styles.css
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/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/notify.js
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/filelib.php
lib/filestorage/file_storage.php
lib/form/form.js
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/moodlelib.php
lib/navigationlib.php
lib/phpmailer/moodle_phpmailer.php
lib/setup.php
lib/tests/behat/behat_general.php
lib/tests/behat/behat_hooks.php
lib/tests/externallib_test.php
lib/tests/filelib_test.php
lib/tests/fixtures/update_validator/zips/multidir.zip [new file with mode: 0644]
lib/tests/moodlelib_test.php
lib/tests/requirejs_test.php [new file with mode: 0644]
lib/tests/text_test.php
lib/tests/update_code_manager_test.php
lib/tests/upgradelib_test.php
lib/tests/user_test.php
lib/tests/weblib_test.php
lib/upgrade.txt
lib/upgradelib.php
lib/weblib.php
lib/xmldb/xmldb_table.php
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
login/tests/behat/behat_login.php [new file with mode: 0644]
login/tests/behat/change_password.feature [new file with mode: 0644]
message/output/airnotifier/message_output_airnotifier.php
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_actions.min.js
mod/assign/amd/build/grading_events.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_form_change_checker.min.js
mod/assign/amd/build/grading_navigation.min.js
mod/assign/amd/build/grading_navigation_user_info.min.js
mod/assign/amd/build/grading_panel.min.js
mod/assign/amd/build/grading_review_panel.min.js
mod/assign/amd/src/grading_actions.js
mod/assign/amd/src/grading_events.js [moved from course/category.php with 62% similarity]
mod/assign/amd/src/grading_navigation.js
mod/assign/amd/src/grading_navigation_user_info.js
mod/assign/amd/src/grading_panel.js
mod/assign/amd/src/grading_review_panel.js
mod/assign/amd/src/participant_selector.js
mod/assign/db/services.php
mod/assign/externallib.php
mod/assign/feedback/editpdf/styles.css
mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
mod/assign/feedback/editpdf/tests/behat/group_annotations.feature
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/assign/lang/en/assign.php
mod/assign/locallib.php
mod/assign/pix/layout-default.png [new file with mode: 0644]
mod/assign/pix/layout-default.svg [new file with mode: 0644]
mod/assign/pix/layout-expand-left.png [new file with mode: 0644]
mod/assign/pix/layout-expand-left.svg [new file with mode: 0644]
mod/assign/pix/layout-expand-right.png [new file with mode: 0644]
mod/assign/pix/layout-expand-right.svg [new file with mode: 0644]
mod/assign/styles.css
mod/assign/submission/file/locallib.php
mod/assign/submission/file/tests/locallib_test.php [new file with mode: 0644]
mod/assign/submission/onlinetext/locallib.php
mod/assign/submission/onlinetext/tests/locallib_test.php [new file with mode: 0644]
mod/assign/submission_form.php
mod/assign/submissionplugin.php
mod/assign/templates/grading_actions.mustache
mod/assign/templates/grading_app.mustache
mod/assign/tests/behat/quickgrading.feature
mod/assign/tests/externallib_test.php
mod/assign/tests/locallib_test.php
mod/assign/upgrade.txt
mod/assign/version.php
mod/book/classes/external.php
mod/book/locallib.php
mod/book/tests/externallib_test.php
mod/book/tests/search_test.php
mod/book/tool/print/print.css
mod/chat/classes/external.php
mod/chat/gui_header_js/jsupdate.php
mod/chat/gui_header_js/jsupdated.php
mod/chat/tests/externallib_test.php
mod/choice/backup/moodle2/backup_choice_stepslib.php
mod/choice/classes/external.php
mod/choice/db/access.php
mod/choice/lang/en/choice.php
mod/choice/lib.php
mod/choice/locallib.php [new file with mode: 0644]
mod/choice/mod_form.php
mod/choice/renderer.php
mod/choice/styles.css
mod/choice/tests/behat/allow_preview.feature
mod/choice/tests/behat/publish_results.feature
mod/choice/tests/behat/remove_choice_options.feature [new file with mode: 0644]
mod/choice/version.php
mod/data/classes/external.php
mod/data/lang/en/data.php
mod/data/lib.php
mod/data/mod_form.php
mod/data/preset/imagegallery/csstemplate.css
mod/data/tests/externallib_test.php
mod/feedback/classes/observer.php [new file with mode: 0644]
mod/feedback/db/events.php [moved from report/search/settings.php with 57% similarity]
mod/feedback/lang/en/feedback.php
mod/feedback/lib.php
mod/feedback/mod_form.php
mod/feedback/tests/behat/behat_mod_feedback.php
mod/feedback/tests/events_test.php
mod/feedback/version.php
mod/forum/externallib.php
mod/forum/lang/en/forum.php
mod/forum/lib.php
mod/forum/styles.css
mod/forum/tests/behat/discussion_navigation.feature
mod/forum/tests/externallib_test.php
mod/forum/tests/lib_test.php
mod/forum/tests/search_test.php
mod/glossary/classes/external.php
mod/glossary/classes/search/entry.php
mod/glossary/lib.php
mod/glossary/tests/search_test.php
mod/imscp/classes/external.php
mod/lesson/lib.php
mod/lesson/mod_form.php
mod/lesson/pagetypes/numerical.php
mod/lesson/report.php
mod/lti/amd/build/cartridge_registration_form.min.js
mod/lti/amd/build/external_registration.min.js
mod/lti/amd/build/tool_card_controller.min.js
mod/lti/amd/build/tool_proxy_card_controller.min.js
mod/lti/amd/src/cartridge_registration_form.js
mod/lti/amd/src/external_registration.js
mod/lti/amd/src/external_registration_return.js
mod/lti/amd/src/tool_card_controller.js
mod/lti/amd/src/tool_configure_controller.js
mod/lti/amd/src/tool_proxy.js
mod/lti/amd/src/tool_proxy_card_controller.js
mod/lti/amd/src/tool_type.js
mod/lti/classes/external.php
mod/lti/lang/en/lti.php
mod/lti/lib.php
mod/lti/locallib.php
mod/lti/tests/behat/addtool.feature
mod/lti/tests/behat/toolconfigure.feature
mod/lti/tests/externallib_test.php
mod/lti/typessettings.php
mod/lti/view.php
mod/quiz/amd/src/preflightcheck.js
mod/quiz/classes/external.php
mod/quiz/lib.php
mod/quiz/tests/behat/attempt_begin.feature
mod/quiz/tests/behat/editing_add.feature
mod/quiz/tests/external_test.php
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/scorm/classes/external.php
mod/scorm/datamodels/scormlib.php
mod/scorm/lang/en/scorm.php
mod/scorm/mod_form.php
mod/scorm/styles.css
mod/scorm/tests/externallib_test.php
mod/survey/backup/moodle2/backup_survey_stepslib.php
mod/survey/classes/external.php
mod/survey/classes/search/activity.php
mod/survey/db/install.xml
mod/survey/db/upgrade.php
mod/survey/lang/en/survey.php
mod/survey/lib.php
mod/survey/mod_form.php
mod/survey/save.php
mod/survey/tests/behat/survey_completion.feature [new file with mode: 0644]
mod/survey/tests/externallib_test.php
mod/survey/version.php
mod/upgrade.txt
mod/wiki/classes/external.php
mod/wiki/tests/externallib_test.php
mod/wiki/tests/search_test.php
mod/workshop/lang/en/workshop.php
mod/workshop/renderer.php
mod/workshop/submission.php
mod/workshop/view.php
my/lib.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
question/type/multichoice/lang/en/qtype_multichoice.php
question/type/multichoice/renderer.php
question/type/multichoice/tests/behat/preview.feature
report/competency/amd/build/grading_popup.min.js
report/competency/amd/src/grading_popup.js
report/competency/amd/src/user_course_navigation.js
report/eventlist/tests/behat/mainsection.feature
report/progress/styles.css
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/upgrade.txt
repository/filepicker.php
repository/filesystem/lib.php
repository/lib.php
repository/repository_ajax.php
repository/upgrade.txt
search/classes/area/base.php
search/classes/area/base_activity.php
search/classes/document.php
search/classes/manager.php
search/classes/output/form/search.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/fixtures/testable_core_search.php
search/tests/generator/lib.php
search/tests/manager_test.php
theme/base/style/admin.css
theme/base/style/autocomplete.css
theme/base/style/blocks.css
theme/base/style/calendar.css
theme/base/style/core.css
theme/base/style/course.css
theme/base/style/dock.css
theme/base/style/editor.css
theme/base/style/filemanager.css
theme/base/style/grade.css
theme/base/style/message.css
theme/base/style/pagelayout.css
theme/base/style/question.css
theme/base/style/tabs.css
theme/base/style/user.css
theme/bootstrapbase/amd/build/bootstrap.min.js
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
theme/canvas/style/admin.css
theme/canvas/style/blocks.css
theme/canvas/style/core.css
theme/canvas/style/course.css
theme/canvas/style/editor.css
theme/canvas/style/mods.css
theme/canvas/style/pagelayout.css
theme/canvas/style/popups.css
theme/canvas/style/text.css
theme/clean/classes/core_renderer.php
user/classes/course_form.php [new file with mode: 0644]
user/classes/search/user.php [new file with mode: 0644]
user/course.php [new file with mode: 0644]
user/edit.php
user/editadvanced.php
user/editadvanced_form.php
user/editlib.php
user/externallib.php
user/messageselect.php
user/tests/behat/course_preference.feature [new file with mode: 0644]
user/tests/externallib_test.php
user/tests/search_test.php [new file with mode: 0644]
version.php
webservice/lib.php
webservice/soap/locallib.php
webservice/tests/externallib_test.php
webservice/upgrade.txt
webservice/upload.php
webservice/xmlrpc/locallib.php
webservice/xmlrpc/tests/locallib_test.php [new file with mode: 0644]
webservice/xmlrpc/tests/xmlrpc_server_test.php [new file with mode: 0644]

index 5b01fd1..4203daa 100644 (file)
@@ -1,3 +1,3 @@
 --errors=errors,duplicate-properties
 --warnings=known-properties,display-property-grouping,empty-rules,important
---exclude-list=vendor/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/
+--exclude-list=vendor/,node_modules/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/,lib/jquery/,lib/htmlpurifier,theme/clean/style/custom.css,theme/more/style/custom.css,
index 31bd8ab..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',
     'no-unreachable': 'warn',
     'no-unsafe-finally': 'error',
     'use-isnan': 'error',
-    'valid-jsdoc': ['warn', { 'requireReturn': false }],
+    'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
     'valid-typeof': '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',
-    'new-cap': 'warn',
+    '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 ee94a05..b93ac60 100644 (file)
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,3 +1,6 @@
+// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
+// here because shifter uses jshint after modules have been concating. Eslint can't
+// currently do this.
 {
     "asi":          false,
     "bitwise":      true,
index d1438f3..da666ee 100644 (file)
@@ -14,15 +14,13 @@ language: php
 php:
     # We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
     - 7.0
-    # - 5.6
-    # - 5.5
-    - 5.4
+    - 5.6
 
 env:
     # Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
     # start first so that the total run time is not too high.
     #
-    # We only run MySQL on PHP 5.6, so run that first.
+    # We only run MySQL on PHP 7.0, so run that first.
     # CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
     # Postgres is significantly is pretty reasonable in its run-time.
 
@@ -38,29 +36,26 @@ env:
     # Perform an upgrade test too.
     - DB=pgsql    TASK=UPGRADE
 
-    # Run a check for unbuilt files with Grunt.
-    - DB=none     TASK=GRUNT
-
 matrix:
     # Enable fast finish.
     # This will fail the build if a single job fails (except those in allow_failures).
     # It will not stop the jobs from running.
     fast_finish: true
 
+    include:
+          # Run grunt/npm install on lowest supported npm version
+        - php: 7
+          env: DB=none     TASK=GRUNT   NVM_VERSION='4'
+          # Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
+        - php: 7
+          env: DB=none     TASK=GRUNT   NVM_VERSION='node'
+
     exclude:
         # MySQL - it's just too slow.
         # Exclude it on all versions except for 7.0
-        # - env: DB=mysqli   TASK=PHPUNIT
-        #   php: 5.6
-        #
-        # - env: DB=mysqli   TASK=PHPUNIT
-        #   php: 5.5
 
         - env: DB=mysqli   TASK=PHPUNIT
-          php: 5.4
-
-        - env: DB=none     TASK=GRUNT
-          php: 5.4
+          php: 5.6
 
         # Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
         - env: DB=pgsql    TASK=UPGRADE
@@ -75,14 +70,26 @@ install:
     # Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
     - rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
 
-    # Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
-    - if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
-    - echo 'auth.json' >> .git/info/exclude
+    - >
+        if [ "$TASK" = 'PHPUNIT' ];
+        then
+            if [ -n "$GITHUB_APITOKEN" ]; then
+                composer config github-oauth.github.com $GITHUB_APITOKEN;
+                echo 'auth.json' >> .git/info/exclude
+            fi
+
+            # Install composer dependencies.
+            # We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
+            # Typically it should be able to use the Composer cache if any other job has already completed before we started here.
+            travis_retry composer install --prefer-dist --no-interaction;
+        fi
 
-    # Install composer dependencies.
-    # We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
-    # Typically it should be able to use the Composer cache if any other job has already completed before we started here.
-    - travis_retry composer install --prefer-dist --no-interaction
+    - >
+        if [ "$TASK" = 'GRUNT' ];
+        then
+            nvm install $NVM_VERSION ;
+            nvm use $NVM_VERSION ;
+        fi
 
 before_script:
     - >
@@ -149,9 +156,8 @@ before_script:
     - >
       if [ "$TASK" = 'GRUNT' ];
       then
-        npm install ;
-        npm install -g grunt ;
-        grunt ;
+        npm install --no-spin;
+        npm install --no-spin -g grunt ;
       fi
 
     ########################################################################
@@ -223,6 +229,7 @@ script:
     - >
       if [ "$TASK" = 'GRUNT' ];
       then
+        grunt ;
         # Add all files to the git index and then run diff --cached to see all changes.
         # This ensures that we get the status of all files, including new files.
         git add . ;
index b728341..467f13b 100644 (file)
@@ -101,25 +101,29 @@ module.exports = function(grunt) {
 
     // Project configuration.
     grunt.initConfig({
-        jshint: {
-            options: {jshintrc: '.jshintrc'},
-            amd: { src: amdSrc }
-        },
         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: {
@@ -128,7 +132,8 @@ module.exports = function(grunt) {
                     expand: true,
                     src: amdSrc,
                     rename: uglifyRename
-                }]
+                }],
+                options: {report: 'none'}
             }
         },
         less: {
@@ -286,7 +291,8 @@ module.exports = function(grunt) {
     var changedFiles = Object.create(null);
     var onChange = grunt.util._.debounce(function() {
           var files = Object.keys(changedFiles);
-          grunt.config('jshint.amd.src', files);
+          grunt.config('eslint.amd.src', files);
+          grunt.config('eslint.yui.src', files);
           grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglifyRename }]);
           grunt.config('shifter.options.paths', files);
           changedFiles = Object.create(null);
@@ -299,7 +305,6 @@ module.exports = function(grunt) {
 
     // Register NPM tasks.
     grunt.loadNpmTasks('grunt-contrib-uglify');
-    grunt.loadNpmTasks('grunt-contrib-jshint');
     grunt.loadNpmTasks('grunt-contrib-less');
     grunt.loadNpmTasks('grunt-contrib-watch');
     grunt.loadNpmTasks('grunt-eslint');
@@ -308,7 +313,7 @@ module.exports = function(grunt) {
     grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
     grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
     grunt.registerTask('yui', ['eslint:yui', 'shifter']);
-    grunt.registerTask('amd', ['eslint:amd', 'jshint', 'uglify']);
+    grunt.registerTask('amd', ['eslint:amd', 'uglify']);
     grunt.registerTask('js', ['amd', 'yui']);
 
     // Register CSS taks.
index 9f3c0df..0b6c5ca 100644 (file)
@@ -147,10 +147,10 @@ define('PHPUNIT_TEST', false);
 define('IGNORE_COMPONENT_CACHE', true);
 
 // Check that PHP is of a sufficient version
-if (version_compare(phpversion(), "5.4.4") < 0) {
+if (version_compare(phpversion(), "5.6.5") < 0) {
     $phpversion = phpversion();
     // do NOT localise - lang strings would not work here and we CAN NOT move it after installib
-    fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
+    fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
     fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
     exit(1);
 }
index b66805e..f41263e 100644 (file)
@@ -63,10 +63,10 @@ Example:
 ";
 
 // Check that PHP is of a sufficient version
-if (version_compare(phpversion(), "5.4.4") < 0) {
+if (version_compare(phpversion(), "5.6.5") < 0) {
     $phpversion = phpversion();
     // do NOT localise - lang strings would not work here and we CAN NOT move it after installib
-    fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
+    fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
     fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
     exit(1);
 }
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.
index f281b45..7bef8fc 100644 (file)
       </CUSTOM_CHECK>
     </CUSTOM_CHECKS>
   </MOODLE>
+  <MOODLE version="3.2" requires="2.7">
+    <UNICODE level="required">
+      <FEEDBACK>
+        <ON_ERROR message="unicoderequired" />
+      </FEEDBACK>
+    </UNICODE>
+    <DATABASE level="required">
+      <VENDOR name="mariadb" version="5.5.31" />
+      <VENDOR name="mysql" version="5.5.31" />
+      <VENDOR name="postgres" version="9.1" />
+      <VENDOR name="mssql" version="10.0" />
+      <VENDOR name="oracle" version="10.2" />
+    </DATABASE>
+    <PHP version="5.6.5" level="required">
+    </PHP>
+    <PCREUNICODE level="optional">
+      <FEEDBACK>
+        <ON_CHECK message="pcreunicodewarning" />
+      </FEEDBACK>
+    </PCREUNICODE>
+    <PHP_EXTENSIONS>
+      <PHP_EXTENSION name="iconv" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="iconvrequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="mbstring" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="mbstringrecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="curl" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="curlrequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="openssl" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="opensslrecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="tokenizer" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="tokenizerrecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="xmlrpc" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="xmlrpcrecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="soap" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="soaprecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="ctype" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="ctyperequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="zip" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="ziprequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="zlib" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="gd" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="gdrequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="simplexml" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="simplexmlrequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="spl" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="splrequired" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="pcre" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="dom" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="xml" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="xmlreader" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="intl" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="intlrecommended" />
+        </FEEDBACK>
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="json" level="required">
+      </PHP_EXTENSION>
+      <PHP_EXTENSION name="hash" level="required"/>
+    </PHP_EXTENSIONS>
+    <PHP_SETTINGS>
+      <PHP_SETTING name="memory_limit" value="96M" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="settingmemorylimit" />
+        </FEEDBACK>
+      </PHP_SETTING>
+      <PHP_SETTING name="file_uploads" value="1" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="settingfileuploads" />
+        </FEEDBACK>
+      </PHP_SETTING>
+      <PHP_SETTING name="opcache.enable" value="1" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="opcacherecommended" />
+        </FEEDBACK>
+      </PHP_SETTING>
+    </PHP_SETTINGS>
+    <CUSTOM_CHECKS>
+      <CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="unsupporteddbstorageengine" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+      <CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="quizattemptsupgradedmessage" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+      <CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="slashargumentswarning" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+      <CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="unsupporteddbtablerowformat" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+      <CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
+        <FEEDBACK>
+          <ON_CHECK message="unoconvwarning" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+    </CUSTOM_CHECKS>
+  </MOODLE>
 </COMPATIBILITY_MATRIX>
index 1000f93..382c252 100644 (file)
@@ -30,10 +30,10 @@ if (!file_exists('../config.php')) {
 }
 
 // Check that PHP is of a sufficient version as soon as possible
-if (version_compare(phpversion(), '5.4.4') < 0) {
+if (version_compare(phpversion(), '5.6.5') < 0) {
     $phpversion = phpversion();
     // do NOT localise - lang strings would not work here and we CAN NOT move it to later place
-    echo "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).<br />";
+    echo "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).<br />";
     echo "Please upgrade your server software or install older Moodle version.";
     die();
 }
index 717b8f2..2b66c9f 100644 (file)
@@ -36,6 +36,8 @@ require_login($course, false, $cm);
 require_capability('moodle/role:review', $context);
 require_sesskey();
 
+$OUTPUT->header();
+
 list($overridableroles, $overridecounts, $nameswithcounts) = get_overridable_roles($context,
         ROLENAME_BOTH, true);
 
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 1beaca5..0711b23 100644 (file)
@@ -40,7 +40,9 @@ if ($hassiteconfig) {
         get_string('requiremodintro', 'admin'), get_string('requiremodintro_desc', 'admin'), 0));
     $ADMIN->add('modsettings', $temp);
 
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('mod') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('mod');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\mod $plugin */
         $plugin->load_settings($ADMIN, 'modsettings', $hassiteconfig);
     }
@@ -50,7 +52,9 @@ if ($hassiteconfig) {
     $temp = new admin_settingpage('manageformats', new lang_string('manageformats', 'core_admin'));
     $temp->add(new admin_setting_manageformats());
     $ADMIN->add('formatsettings', $temp);
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('format') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('format');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\format $plugin */
         $plugin->load_settings($ADMIN, 'formatsettings', $hassiteconfig);
     }
@@ -58,7 +62,9 @@ if ($hassiteconfig) {
     // blocks
     $ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
     $ADMIN->add('blocksettings', new admin_page_manageblocks());
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('block') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('block');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\block $plugin */
         $plugin->load_settings($ADMIN, 'blocksettings', $hassiteconfig);
     }
@@ -67,7 +73,9 @@ if ($hassiteconfig) {
     $ADMIN->add('modules', new admin_category('messageoutputs', new lang_string('messageoutputs', 'message')));
     $ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
     $ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('message') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('message');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\message $plugin */
         $plugin->load_settings($ADMIN, 'messageoutputs', $hassiteconfig);
     }
@@ -108,7 +116,9 @@ if ($hassiteconfig) {
     $temp = new admin_externalpage('authtestsettings', get_string('testsettings', 'core_auth'), new moodle_url("/auth/test_settings.php"), 'moodle/site:config', true);
     $ADMIN->add('authsettings', $temp);
 
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('auth') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('auth');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\auth $plugin */
         $plugin->load_settings($ADMIN, 'authsettings', $hassiteconfig);
     }
@@ -122,7 +132,9 @@ if ($hassiteconfig) {
     $temp = new admin_externalpage('enroltestsettings', get_string('testsettings', 'core_enrol'), new moodle_url("/enrol/test_settings.php"), 'moodle/site:config', true);
     $ADMIN->add('enrolments', $temp);
 
-    foreach(core_plugin_manager::instance()->get_plugins_of_type('enrol') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('enrol');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\enrol $plugin */
         $plugin->load_settings($ADMIN, 'enrolments', $hassiteconfig);
     }
@@ -133,7 +145,9 @@ if ($hassiteconfig) {
     $temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
     $temp->add(new admin_setting_manageeditors());
     $ADMIN->add('editorsettings', $temp);
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('editor') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('editor');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\editor $plugin */
         $plugin->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
     }
@@ -143,7 +157,9 @@ if ($hassiteconfig) {
     $temp = new admin_settingpage('manageantiviruses', new lang_string('antivirussettings', 'antivirus'));
     $temp->add(new admin_setting_manageantiviruses());
     $ADMIN->add('antivirussettings', $temp);
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('antivirus') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('antivirus');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /* @var \core\plugininfo\antivirus $plugin */
         $plugin->load_settings($ADMIN, 'antivirussettings', $hassiteconfig);
     }
@@ -182,7 +198,9 @@ if ($hassiteconfig) {
     }
     $ADMIN->add('filtersettings', $temp);
 
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('filter') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('filter');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\filter $plugin */
         $plugin->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
     }
@@ -283,7 +301,9 @@ if ($hassiteconfig) {
         new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true));
     $ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
         new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true));
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('repository') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('repository');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\repository $plugin */
         $plugin->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
     }
@@ -337,7 +357,9 @@ if ($hassiteconfig) {
                         'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
     $ADMIN->add('webservicesettings', $temp);
     /// links to protocol pages
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('webservice') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('webservice');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\webservice $plugin */
         $plugin->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
     }
@@ -409,7 +431,9 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
             get_string('responsehistory', 'question'), '', 0, $hiddenofvisible));
 
     // Settings for particular question types.
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('qtype') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('qtype');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\qtype $plugin */
         $plugin->load_settings($ADMIN, 'qtypesettings', $hassiteconfig);
     }
@@ -421,7 +445,9 @@ if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
     $ADMIN->add('plagiarism', new admin_externalpage('manageplagiarismplugins', new lang_string('manageplagiarism', 'plagiarism'),
         $CFG->wwwroot . '/' . $CFG->admin . '/plagiarism.php'));
 
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('plagiarism') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('plagiarism');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\plagiarism $plugin */
         $plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
     }
@@ -445,6 +471,7 @@ if ($hassiteconfig) {
     }
     if (!empty($pages)) {
         $ADMIN->add('modules', new admin_category('coursereports', new lang_string('coursereports')));
+        core_collator::asort_objects_by_property($pages, 'visiblename');
         foreach ($pages as $page) {
             $ADMIN->add('coursereports', $page);
         }
@@ -468,6 +495,7 @@ foreach (core_component::get_plugin_list('report') as $report => $plugindir) {
 $ADMIN->add('modules', new admin_category('reportplugins', new lang_string('reports')));
 $ADMIN->add('reportplugins', new admin_externalpage('managereports', new lang_string('reportsmanage', 'admin'),
                                                     $CFG->wwwroot . '/' . $CFG->admin . '/reports.php'));
+core_collator::asort_objects_by_property($pages, 'visiblename');
 foreach ($pages as $page) {
     $ADMIN->add('reportplugins', $page);
 }
@@ -500,16 +528,11 @@ 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) {
         $ADMIN->add('searchplugins', $page);
     }
@@ -523,7 +546,9 @@ if ($hassiteconfig) {
 }
 
 // Now add various admin tools.
-foreach (core_plugin_manager::instance()->get_plugins_of_type('tool') as $plugin) {
+$plugins = core_plugin_manager::instance()->get_plugins_of_type('tool');
+core_collator::asort_objects_by_property($plugins, 'displayname');
+foreach ($plugins as $plugin) {
     /** @var \core\plugininfo\tool $plugin */
     $plugin->load_settings($ADMIN, null, $hassiteconfig);
 }
@@ -534,6 +559,7 @@ if ($hassiteconfig) {
     $ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
     $ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
     $ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
+    $ADMIN->locate('cachestores')->set_sorting(true);
     foreach (core_component::get_plugin_list('cachestore') as $plugin => $path) {
         $settingspath = $path.'/settings.php';
         if (file_exists($settingspath)) {
@@ -547,7 +573,9 @@ if ($hassiteconfig) {
 // Add Calendar type settings.
 if ($hassiteconfig) {
     $ADMIN->add('modules', new admin_category('calendartype', new lang_string('calendartypes', 'calendar')));
-    foreach (core_plugin_manager::instance()->get_plugins_of_type('calendartype') as $plugin) {
+    $plugins = core_plugin_manager::instance()->get_plugins_of_type('calendartype');
+    core_collator::asort_objects_by_property($plugins, 'displayname');
+    foreach ($plugins as $plugin) {
         /** @var \core\plugininfo\calendartype $plugin */
         $plugin->load_settings($ADMIN, 'calendartype', $hassiteconfig);
     }
@@ -562,7 +590,9 @@ if ($hassiteconfig) {
 
 // Extend settings for each local plugin. Note that their settings may be in any part of the
 // settings tree and may be visible not only for administrators.
-foreach (core_plugin_manager::instance()->get_plugins_of_type('local') as $plugin) {
+$plugins = core_plugin_manager::instance()->get_plugins_of_type('local');
+core_collator::asort_objects_by_property($plugins, 'displayname');
+foreach ($plugins as $plugin) {
     /** @var \core\plugininfo\local $plugin */
     $plugin->load_settings($ADMIN, null, $hassiteconfig);
 }
index 98fc305..f8a37e7 100644 (file)
@@ -101,6 +101,9 @@ if (empty($options['torun'])) {
 if (extension_loaded('pcntl')) {
     $disabled = explode(',', ini_get('disable_functions'));
     if (!in_array('pcntl_signal', $disabled)) {
+        // Handle interrupts on PHP7.
+        declare(ticks = 1);
+
         pcntl_signal(SIGTERM, "signal_handler");
         pcntl_signal(SIGINT, "signal_handler");
     }
index 7994a8c..6a625f6 100644 (file)
 .path-admin-tool-health dl.notice dd {
     background-color: #e5db36;
 }
-.path-admin-tool-health dt.solution,
-.path-admin-tool-health dd.solution,
+.path-admin-tool-health dl dt.solution,
+.path-admin-tool-health dl dd.solution,
 .path-admin-tool-health div#healthnoproblemsfound {
-    background-color: #5BB83E !important;
+    background-color: #5BB83E;
 }
 .path-admin-tool-health dl.healthissues dt,
 .path-admin-tool-health dl.healthissues dd {
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 cf57df2..6177d34 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 39eaef7..4afbdab 100644 (file)
Binary files a/admin/tool/lp/amd/build/competency_rule_points.min.js and b/admin/tool/lp/amd/build/competency_rule_points.min.js differ
index 2ca219d..594bc75 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..e4312d2 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..bf54916 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..f5f7f43 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 4955f99..4de971d 100644 (file)
Binary files a/admin/tool/lp/amd/build/competencytree.min.js and b/admin/tool/lp/amd/build/competencytree.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..f249b03 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..4212884 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 4cc8611..2113400 100644 (file)
Binary files a/admin/tool/lp/amd/build/tree.min.js and b/admin/tool/lp/amd/build/tree.min.js differ
index 8d95549..edd32c2 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_info.min.js and b/admin/tool/lp/amd/build/user_competency_info.min.js differ
index 1c320c8..610c935 100644 (file)
Binary files a/admin/tool/lp/amd/build/user_competency_plan_popup.min.js and b/admin/tool/lp/amd/build/user_competency_plan_popup.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 d36f06f..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,13 +131,14 @@ define(['jquery',
                 html,
                 self._afterRender.bind(self)
             );
-        }.bind(self)).fail(Notification.exception);
+        }).fail(Notification.exception);
     };
 
     /**
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery} The node
      * @method _find
      */
     ActionSelector.prototype._find = function(selector) {
@@ -155,7 +156,7 @@ define(['jquery',
         return self._render().then(function(html) {
             self._find('[data-region="action-selector"]').replaceWith(html);
             self._afterRender();
-        }.bind(self));
+        });
     };
 
     /**
@@ -170,8 +171,8 @@ define(['jquery',
         for (var i in self._actions) {
             choices.push(self._actions[i]);
         }
-        var content = {'message': self._message, 'choices' : choices,
-            'confirm' : self._confirm, 'cancel' : self._cancel};
+        var content = {'message': self._message, 'choices': choices,
+            'confirm': self._confirm, 'cancel': self._cancel};
 
         return Templates.render('tool_lp/action_selector', content);
     };
index 6e1973c..79e1aa9 100644 (file)
@@ -35,6 +35,7 @@ define(['jquery',
      *
      * @param {Number} itemid
      * @param {String} itemtype
+     * @param {Number} pagectxid
      */
     var competencies = function(itemid, itemtype, pagectxid) {
         this.itemid = itemid;
@@ -58,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);
@@ -88,25 +89,25 @@ 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 {
-            return null;
+            return;
         }
 
         requests[0].fail(notification.exception);
@@ -138,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';
@@ -155,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';
@@ -170,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';
@@ -208,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';
@@ -267,16 +268,16 @@ 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' }
-            ]).done(function (strings) {
+                {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.
                     strings[1], // Unlink the competency X from the course?
@@ -300,17 +301,17 @@ define(['jquery',
 
         if (localthis.itemtype == 'course') {
             // Course completion rule handling.
-            $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e){
+            $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e) {
                 var requests = [];
                 var pagerender = 'tool_lp/course_competencies_page';
                 var pageregion = 'coursecompetenciespage';
                 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 1ff679e..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;
             });
         },
@@ -64,7 +64,7 @@ define(['jquery',
          * Get the string for an outcome.
          *
          * @param  {Number} id The outcome code.
-         * @return {Promise Resolved with the string.
+         * @return {Promise} Resolved with the string.
          * @method getString
          */
         getString: function(id) {
index 34a70c7..3a3e505 100644 (file)
@@ -26,11 +26,11 @@ define(['jquery'], function($) {
     /**
      * CompetencyPlanNavigation
      *
-     * @param {String} The selector of the competency element.
-     * @param {String} The base url for the page (no params).
-     * @param {Number} The user id
-     * @param {Number} The competency id
-     * @param {Number} The plan id
+     * @param {String} competencySelector The selector of the competency element.
+     * @param {String} baseUrl The base url for the page (no params).
+     * @param {Number} userId The user id
+     * @param {Number} competencyId The competency id
+     * @param {Number} planId The plan id
      */
     var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {
         this._baseUrl = baseUrl;
index 35def4a..e631bc2 100644 (file)
@@ -71,6 +71,7 @@ define(['jquery'], function($) {
         return null;
     };
 
+    // eslint-disable-next-line valid-jsdoc
     /**
      * Return the type of the module.
      *
@@ -152,7 +153,7 @@ define(['jquery'], function($) {
      * Trigger an event.
      *
      * @param {String} type The type of event.
-     * @param {Object} The data to pass to the listeners.
+     * @param {Object} data The data to pass to the listeners.
      * @method _trigger
      * @protected
      */
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 21e084e..522e827 100644 (file)
@@ -66,7 +66,7 @@ define(['jquery',
         var parent = $('[data-region="competencyactions"]').data('competency');
 
         var params = {
-            competencyframeworkid : treeModel.getCompetencyFrameworkId(),
+            competencyframeworkid: treeModel.getCompetencyFrameworkId(),
             pagecontextid: pageContextId
         };
 
@@ -82,11 +82,11 @@ 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' }
-            ]).done(function (strings) {
+                {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],
                     strings[1],
@@ -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,11 +153,11 @@ 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' }
-            ]).done(function (strings) {
+                {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.
                     strings[1], // Delete competency X?
@@ -187,8 +187,13 @@ define(['jquery',
         });
         treeRoot.show();
 
-        body.on('click', '[data-action="move"]', function() { popup.close(); confirmMove(); });
-        body.on('click', '[data-action="cancel"]', function() { popup.close(); });
+        body.on('click', '[data-action="move"]', function() {
+          popup.close();
+          confirmMove();
+        });
+        body.on('click', '[data-action="cancel"]', function() {
+          popup.close();
+        });
     };
 
     /**
@@ -213,6 +218,7 @@ define(['jquery',
 
     /**
      * A node was chosen and "Move" was selected from the menu. Open a popup to select the target.
+     * @param {Event} e
      * @method moveHandler
      */
     var moveHandler = function(e) {
@@ -230,7 +236,7 @@ define(['jquery',
                     competencyframeworkid: competency.competencyframeworkid,
                     searchtext: ''
                 }
-            },{
+            }, {
                 methodname: 'core_competency_read_competency_framework',
                 args: {
                     id: competency.competencyframeworkid
@@ -242,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") {
@@ -254,10 +261,10 @@ define(['jquery',
             }
 
             str.get_strings([
-                { key: 'movecompetency', component: 'tool_lp', param: competency.shortname },
-                { key: 'move', component: 'tool_lp' },
-                { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+                {key: 'movecompetency', component: 'tool_lp', param: competency.shortname},
+                {key: 'move', component: 'tool_lp'},
+                {key: 'cancel', component: 'moodle'}
+            ]).done(function(strings) {
 
                 var context = {
                     framework: framework,
@@ -288,8 +295,8 @@ define(['jquery',
         var competency = $('[data-region="competencyactions"]').data('competency');
 
         var params = {
-            competencyframeworkid : treeModel.getCompetencyFrameworkId(),
-            id : competency.id,
+            competencyframeworkid: treeModel.getCompetencyFrameworkId(),
+            id: competency.id,
             parentid: competency.parentid,
             pagecontextid: pageContextId
         };
@@ -300,6 +307,7 @@ define(['jquery',
 
     /**
      * Re-render the page with the latest data.
+     * @param {Object} context
      * @method reloadPage
      */
     var reloadPage = function(context) {
@@ -313,6 +321,7 @@ define(['jquery',
 
     /**
      * Perform a search and render the page with the new search results.
+     * @param {Event} e
      * @method updateSearchHandler
      */
     var updateSearchHandler = function(e) {
@@ -322,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);
     };
@@ -337,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);
     };
@@ -355,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);
     };
@@ -373,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) {
@@ -381,7 +390,7 @@ define(['jquery',
                 courses: courses
             };
             templates.render('tool_lp/linked_courses_summary', context).done(function(html) {
-                str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) {
+                str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) {
                     new Dialogue(
                         linkedcourses, // Title.
                         html, // The linked courses.
@@ -409,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( {
+                calls.push({
                     methodname: 'tool_lp_data_for_related_competencies_section',
-                    args: { competencyid: relatedTarget.id }
+                    args: {competencyid: relatedTarget.id}
                 });
 
                 var promises = ajax.call(calls);
@@ -454,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) {
@@ -475,18 +484,18 @@ 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' }
-                ]).done(function (strings) {
+                {key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname},
+                {key: 'cancel', component: 'moodle'}
+                ]).done(function(strings) {
                     notification.alert(
                         null,
                         strings[0]
@@ -510,11 +519,11 @@ 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' }
-        ]).done(function (strings) {
+            {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.
                 strings[1], // Delete competency X?
@@ -528,6 +537,7 @@ define(['jquery',
     /**
      * HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
      * @method dragStart
+     * @param {Event} e
      */
     var dragStart = function(e) {
         e.originalEvent.dataTransfer.setData('text', $(e.target).parent().data('id'));
@@ -536,6 +546,7 @@ define(['jquery',
     /**
      * HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
      * @method allowDrop
+     * @param {Event} e
      */
     var allowDrop = function(e) {
         e.originalEvent.dataTransfer.dropEffect = 'move';
@@ -545,6 +556,7 @@ define(['jquery',
     /**
      * HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
      * @method dragEnter
+     * @param {Event} e
      */
     var dragEnter = function(e) {
         e.preventDefault();
@@ -554,6 +566,7 @@ define(['jquery',
     /**
      * HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
      * @method dragLeave
+     * @param {Event} e
      */
     var dragLeave = function(e) {
         e.preventDefault();
@@ -563,6 +576,7 @@ define(['jquery',
     /**
      * HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
      * @method dropOver
+     * @param {Event} e
      */
     var dropOver = function(e) {
         e.preventDefault();
@@ -585,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);
     };
 
     /**
@@ -614,7 +628,7 @@ define(['jquery',
     /**
      * Log the competency viewed event.
      *
-     * @param  {Object} The competency.
+     * @param  {Object} competency The competency.
      * @method triggerCompetencyViewedEvent
      */
     var triggerCompetencyViewedEvent = function(competency) {
@@ -623,7 +637,7 @@ define(['jquery',
             selectedCompetencyId = competency.id;
             ajax.call([{
                     methodname: 'core_competency_competency_viewed',
-                    args: { id: competency.id }
+                    args: {id: competency.id}
             }]);
         }
     };
@@ -690,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);
@@ -729,6 +743,7 @@ define(['jquery',
      * @method selectionChanged
      * @param {Event} evt The event that triggered the selection change.
      * @param {Object} params The parameters for the event. Contains a list of selected nodes.
+     * @return {Boolean}
      */
     var selectionChanged = function(evt, params) {
         var node = params.selected,
@@ -781,7 +796,7 @@ define(['jquery',
      * Return the string "Selected <taxonomy>".
      *
      * @function parseTaxonomies
-     * @param  {String} Comma separated list of taxonomies.
+     * @param  {String} taxonomiesstr Comma separated list of taxonomies.
      * @return {Array} of level => taxonomystr
      */
     var parseTaxonomies = function(taxonomiesstr) {
index affcea6..012d70b 100644 (file)
@@ -43,18 +43,19 @@ define(['jquery',
      *
      */
     var Competencydialogue = function() {
+      // Intentionally left empty.
     };
 
     /**
      * Log the competency viewed event.
      *
-     * @param  {Number} The competency ID.
+     * @param  {Number} competencyId The competency ID.
      * @method triggerCompetencyViewedEvent
      */
     Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {
         ajax.call([{
                 methodname: 'core_competency_competency_viewed',
-                args: { id: competencyId }
+                args: {id: competencyId}
         }]);
     };
 
@@ -112,7 +113,7 @@ define(['jquery',
     /**
      * The action on the click event.
      *
-     * @param {Event} event click
+     * @param {Event} e event click
      * @method clickEventHandler
      */
     Competencydialogue.prototype.clickEventHandler = function(e) {
@@ -135,14 +136,15 @@ define(['jquery',
      * Get a promise on data competency.
      *
      * @param {Number} competencyid
+     * @param {Object} options
      * @return {Promise} return promise on data request
      * @method getCompetencyDataPromise
      */
     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
                     }
@@ -160,8 +162,6 @@ define(['jquery',
          * Initialise the competency dialogue module.
          *
          * Only the first call matters.
-         *
-         * @return {Void}
          */
         init: function() {
             if (typeof instance !== 'undefined') {
@@ -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 d6247fe..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,12 +226,15 @@ define(['jquery',
         var self = this;
 
         return Ajax.call([
-            { methodname: 'core_competency_search_competencies', args: {
+            {methodname: 'core_competency_search_competencies', args: {
                 searchtext: searchText,
                 competencyframeworkid: frameworkId
             }}
         ])[0].done(function(competencies) {
-
+          /**
+           * @param {Object} parent
+           * @param {Array} competencies
+           */
             function addCompetencyChildren(parent, competencies) {
                 for (var i = 0; i < competencies.length; i++) {
                     if (competencies[i].parentid == parent.id) {
@@ -245,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.
@@ -258,13 +262,14 @@ define(['jquery',
 
             self._competencies = tree;
 
-        }.bind(self)).fail(Notification.exception);
+        }).fail(Notification.exception);
     };
 
     /**
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery}
      * @method _find
      */
     Picker.prototype._find = function(selector) {
@@ -275,6 +280,7 @@ define(['jquery',
      * Convenience method to get a framework object.
      *
      * @param {Number} fid The framework ID.
+     * @return {Object}
      * @method _getFramework
      */
     Picker.prototype._getFramework = function(fid) {
@@ -282,7 +288,7 @@ define(['jquery',
         $.each(this._frameworks, function(i, f) {
             if (f.id == fid) {
                 frm = f;
-                return false;
+                return;
             }
         });
         return frm;
@@ -315,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) {
@@ -323,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
                 }}
@@ -368,7 +374,7 @@ define(['jquery',
             }
 
             return self._loadCompetencies();
-        }.bind(self));
+        });
     };
 
     /**
@@ -382,7 +388,7 @@ define(['jquery',
         return self._render().then(function(html) {
             self._find('[data-region="competencylinktree"]').replaceWith(html);
             self._afterRender();
-        }.bind(self));
+        });
     };
 
     /**
@@ -414,7 +420,7 @@ define(['jquery',
             };
 
             return Templates.render('tool_lp/competency_picker', context);
-        }.bind(self));
+        });
     };
 
     /**
@@ -437,7 +443,7 @@ define(['jquery',
      *
      * This needs to be set after reset/close.
      *
-     * @params {Number[]} The IDs.
+     * @param {Number[]} ids The IDs.
      * @method _setDisallowedCompetencyIDs
      */
     Picker.prototype.setDisallowedCompetencyIDs = function(ids) {
@@ -448,7 +454,7 @@ define(['jquery',
      * Trigger an event.
      *
      * @param {String} type The type of event.
-     * @param {Object} The data to pass to the listeners.
+     * @param {Object} data The data to pass to the listeners.
      * @method _reset
      */
     Picker.prototype._trigger = function(type, data) {
index 7291829..8d5b536 100644 (file)
@@ -39,8 +39,8 @@ define(['jquery',
     /**
      * Competency picker in plan class.
      *
+     * @param {Number} userId
      * @param {Number|false} singlePlan The ID of the plan when limited to one.
-     * @param {String} pageContextIncludes One of 'children', 'parents', 'self'.
      * @param {Boolean} multiSelect Support multi-select in the tree.
      */
     var Picker = function(userId, singlePlan, multiSelect) {
@@ -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));
+            });
         }
     };
 
@@ -88,19 +88,20 @@ define(['jquery',
      * @param {Number} planId The planId.
      * @param {String} searchText Limit the competencies to those matching the text.
      * @method _fetchCompetencies
-     * @return {Promise}
+     * @return {Promise} The promise object.
      */
     Picker.prototype._fetchCompetencies = function(planId, searchText) {
         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 4894d36..3a956cb 100644 (file)
@@ -70,7 +70,6 @@ define(['jquery',
      *
      * Triggered when a change occured.
      *
-     * @return {Void}
      * @method _afterChange
      * @protected
      */
@@ -87,9 +86,10 @@ define(['jquery',
      *
      * Triggered when a change occured in a specific rule config.
      *
-     * @return {Void}
      * @method _afterRuleConfigChange
      * @protected
+     * @param {Event} e
+     * @param {Rule} rule
      */
     RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {
         if (rule != this._getRule()) {
@@ -102,7 +102,6 @@ define(['jquery',
     /**
      * After render hook.
      *
-     * @return {Promise}
      * @method _afterRender
      * @protected
      */
@@ -138,7 +137,7 @@ define(['jquery',
         $.each(this._rules, function(index, rule) {
             if (rule.canConfig()) {
                 can = true;
-                return false;
+                return;
             }
         });
         return can;
@@ -164,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) {
@@ -181,6 +180,7 @@ define(['jquery',
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery}
      * @method _find
      * @protected
      */
@@ -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;
@@ -444,7 +444,6 @@ define(['jquery',
     /**
      * Set up the instance.
      *
-     * @return {Void}
      * @method _setUp
      * @protected
      */
@@ -482,7 +481,6 @@ define(['jquery',
     /**
      * Called when the user switches outcome.
      *
-     * @return {Void}
      * @method _switchedOutcome
      * @protected
      */
@@ -507,7 +505,6 @@ define(['jquery',
     /**
      * Called when the user switches rule.
      *
-     * @return {Void}
      * @method _switchedRule
      * @protected
      */
@@ -535,7 +532,7 @@ define(['jquery',
      * Trigger an event.
      *
      * @param {String} type The type of event.
-     * @param {Object} The data to pass to the listeners.
+     * @param {Object} data The data to pass to the listeners.
      * @method _trigger
      * @protected
      */
index bff7349..06af055 100644 (file)
@@ -52,12 +52,12 @@ define(['jquery',
         var currentValue = $(e.target).closest('a').data('pushratingstouserplans');
         var context = {
             courseid: courseid,
-            settings: { pushratingstouserplans: currentValue }
+            settings: {pushratingstouserplans: currentValue}
         };
         e.preventDefault();
 
         templates.render('tool_lp/course_competency_settings', context).done(function(html) {
-            str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function (title) {
+            str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function(title) {
                 this._dialogue = new Dialogue(
                     title,
                     html,
@@ -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 882ee5b..04a570f 100644 (file)
@@ -43,7 +43,7 @@ define(['core/yui'], function(Y) {
             wide = false;
         }
 
-        Y.use('moodle-core-notification', 'timers', function () {
+        Y.use('moodle-core-notification', 'timers', function() {
             var width = '480px';
             if (wide) {
                 width = '800px';
@@ -92,6 +92,7 @@ define(['core/yui'], function(Y) {
 
     /**
      * Get content.
+     * @return {node}
      */
     dialogue.prototype.getContent = function() {
         return this.yuiDialogue.bodyNode.getDOMNode();
index d14c9dd..367cb00 100644 (file)
@@ -67,11 +67,11 @@ 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' },
-            ]).done( function () {
-                Y.use('moodle-tool_lp-dragdrop-reorder', function () {
+                {key: 'emptydragdropregion', component: 'moodle'},
+                {key: 'movecontent', component: 'moodle'},
+                {key: 'tocontent', component: 'moodle'},
+            ]).done(function() {
+                Y.use('moodle-tool_lp-dragdrop-reorder', function() {
 
                     var context = {
                         callback: callback
index 1bda7ed..fe8433c 100644 (file)
@@ -48,7 +48,7 @@ define(['jquery'], function($) {
      * Trigger an event.
      *
      * @param {String} type The type of event.
-     * @param {Object} The data to pass to the listeners.
+     * @param {Object} data The data to pass to the listeners.
      * @method _trigger
      */
     Base.prototype._trigger = function(type, data) {
index 19a5534..ac59ad9 100644 (file)
@@ -35,7 +35,6 @@ define(['jquery',
      *
      * @param {String} triggerSelector The node on which the click will happen.
      * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.
-     * @return {Void}
      */
     var register = function(triggerSelector, containerSelector) {
         if (typeof selectors[triggerSelector] !== 'undefined') {
@@ -58,11 +57,11 @@ define(['jquery',
             e.stopPropagation();
 
             Str.get_strings([
-                { key: 'confirm', component: 'moodle' },
-                { key: 'areyousure', component: 'moodle' },
-                { key: 'delete', component: 'moodle' },
-                { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+                {key: 'confirm', component: 'moodle'},
+                {key: 'areyousure', component: 'moodle'},
+                {key: 'delete', component: 'moodle'},
+                {key: 'cancel', component: 'moodle'}
+            ]).done(function(strings) {
                 Notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Are you sure?
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 a783033..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: {
@@ -93,17 +93,17 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
                 }
             }
         }]);
-        requests[0].done(function (success) {
+        requests[0].done(function(success) {
             if (success === false) {
                 var req = ajax.call([{
                     methodname: 'core_competency_read_competency_framework',
-                    args: { id: frameworkid }
+                    args: {id: frameworkid}
                 }]);
-                req[0].done(function (framework) {
+                req[0].done(function(framework) {
                     str.get_strings([
-                        { key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname },
-                        { key: 'cancel', component: 'moodle' }
-                    ]).done(function (strings) {
+                        {key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname},
+                        {key: 'cancel', component: 'moodle'}
+                    ]).done(function(strings) {
                         notification.alert(
                             null,
                             strings[0]
@@ -127,16 +127,16 @@ 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' }
-            ]).done(function (strings) {
+                {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.
                     strings[1], // Delete competency framework X?
index a4c9274..3638830 100644 (file)
@@ -75,7 +75,6 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
          * @param {String} selector The selector of the auto complete element.
          * @param {String} query The query string.
          * @param {Function} callback A callback function receiving an array of results.
-         * @return {Void}
          */
         transport: function(selector, query, callback) {
             var el = $(selector),
index 9063b50..576b511 100644 (file)
@@ -31,6 +31,7 @@ define(['jquery',
 
     /**
      * Grade dialogue class.
+     * @param {Array} ratingOptions
      */
     var Grade = function(ratingOptions) {
         EventBase.prototype.constructor.apply(this, []);
@@ -46,7 +47,6 @@ define(['jquery',
     /**
      * After render hook.
      *
-     * @return {Promise}
      * @method _afterRender
      * @protected
      */
@@ -118,6 +118,7 @@ define(['jquery',
      *
      * @param {String} selector
      * @method _find
+     * @returns {node} The node
      * @protected
      */
     Grade.prototype._find = function(selector) {
index fd9d6ac..7a030b6 100644 (file)
@@ -34,12 +34,12 @@ define(['jquery',
      * InlineEditor
      *
      * @param {String} selector The selector to trigger the grading.
-     * @param {Number} The id of the scale for this competency.
-     * @param {Number} The id of the competency.
-     * @param {Number} The id of the user.
-     * @param {Number} The id of the plan.
-     * @param {Number} The id of the course.
-     * @param {String} Language string for choose a rating.
+     * @param {Number} scaleId The id of the scale for this competency.
+     * @param {Number} competencyId The id of the competency.
+     * @param {Number} userId The id of the user.
+     * @param {Number} planId The id of the plan.
+     * @param {Number} courseId The id of the course.
+     * @param {String} chooseStr Language string for choose a rating.
      */
     var InlineEditor = function(selector, scaleId, competencyId, userId, planId, courseId, chooseStr) {
         EventBase.prototype.constructor.apply(this, []);
@@ -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 a91d770..0434b56 100644 (file)
@@ -44,7 +44,7 @@ define(['jquery'], function($) {
     /**
      * Constructor
      *
-     * @param {$} Jquery collection matching the root of the menu.
+     * @param {$} menuRoot Jquery collection matching the root of the menu.
      * @param {Function[]} handlers, called when a menu item is chosen.
      */
     var Menubar = function(menuRoot, handlers) {
@@ -144,7 +144,7 @@ define(['jquery'], function($) {
      * @method handleClick
      * @param {Object} item is the jquery object of the item firing the event
      * @param {Event} e is the associated event object
-     * @return boolean Returns false
+     * @return {boolean} Returns false
      */
     Menubar.prototype.handleClick = function(item, e) {
         e.stopPropagation();
@@ -166,7 +166,7 @@ define(['jquery'], function($) {
             this.activeItem = null;
 
             // Close the menu.
-            this.menuRoot.find('ul').not('.root-level').attr('aria-hidden','true');
+            this.menuRoot.find('ul').not('.root-level').attr('aria-hidden', 'true');
             // Follow any link, or call the click handlers.
             var anchor = item.find('a').first();
             var clickEvent = new $.Event('click');
@@ -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);
@@ -290,7 +290,7 @@ define(['jquery'], function($) {
                 subMenuContainer.css('margin-right', '-' + marginright + 'px');
             }
         } else {
-            if ( pos.left + menuRealWidth > $(window).width()) {
+            if (pos.left + menuRealWidth > $(window).width()) {
                 marginleft = menuRealWidth - widthmenuRoot;
                 subMenuContainer.css('margin-left', '-' + marginleft + 'px');
             }
@@ -319,7 +319,7 @@ define(['jquery'], function($) {
             return true;
         }
 
-        switch(e.keyCode) {
+        switch (e.keyCode) {
             case this.keys.tab: {
 
                 // Hide all menu items and update their aria attributes.
@@ -438,7 +438,7 @@ define(['jquery'], function($) {
             // This is the root level move to next sibling. This will require closing
             // the current child menu and opening the new one.
 
-            if (menuIndex < menuNum-1) {
+            if (menuIndex < menuNum - 1) {
                 // Not the last root menu.
                 newItem = item.next();
             } else { // Wrap to first item.
@@ -501,7 +501,7 @@ define(['jquery'], function($) {
                 menuIndex = this.rootMenus.index(rootItem);
 
                 // If this is not the last root menu item, move to the next one.
-                if (menuIndex < this.rootMenus.length-1) {
+                if (menuIndex < this.rootMenus.length - 1) {
                     newItem = rootItem.next();
                 } else {
                     // Loop.
@@ -687,7 +687,7 @@ define(['jquery'], function($) {
         // to the next item with a title that begins with that character.
         if (startChr) {
             var match = false;
-            var curNdx = menuIndex+1;
+            var curNdx = menuIndex + 1;
 
             // Check if the active item was the last one on the list.
             if (curNdx == menuNum) {
@@ -696,7 +696,7 @@ define(['jquery'], function($) {
 
             // Iterate through the menu items (starting from the current item and wrapping) until a match is found
             // or the loop returns to the current menu item.
-            while (curNdx != menuIndex)  {
+            while (curNdx != menuIndex) {
 
                 var titleChr = menuItems.eq(curNdx).html().charAt(0);
 
@@ -705,7 +705,7 @@ define(['jquery'], function($) {
                     break;
                 }
 
-                curNdx = curNdx+1;
+                curNdx = curNdx + 1;
 
                 if (curNdx == menuNum) {
                     // Reached the end of the list, start again at the beginning.
@@ -724,8 +724,8 @@ define(['jquery'], function($) {
                 return item;
             }
         } else {
-            if (menuIndex < menuNum-1) {
-                newItem = menuItems.eq(menuIndex+1);
+            if (menuIndex < menuNum - 1) {
+                newItem = menuItems.eq(menuIndex + 1);
             } else {
                 newItem = menuItems.first();
             }
@@ -763,7 +763,7 @@ define(['jquery'], function($) {
 
         // If item is not the first item in its menu, move to the previous item.
         if (menuIndex > 0) {
-            newItem = menuItems.eq(menuIndex-1);
+            newItem = menuItems.eq(menuIndex - 1);
         } else {
             // Loop to top of menu.
             newItem = menuItems.last();
@@ -823,7 +823,7 @@ define(['jquery'], function($) {
          *                             { "[data-action='add']" : callAddFunction }
          */
         enhance: function(selector, handler) {
-            $(selector).each(function (index, element) {
+            $(selector).each(function(index, element) {
                 var menuRoot = $(element);
                 // Don't enhance the same menu twice.
                 if (menuRoot.data("menubarEnhanced") !== true) {
index 2dabb3c..705ab29 100644 (file)
@@ -61,7 +61,7 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
     /**
      * Set the parent competency in the competency form.
      *
-     * @param {Object} Data containing selected cmpetency.
+     * @param {Object} data Data containing selected competency.
      * @method setParent
      */
     ParentCompetencyForm.prototype.setParent = function(data) {
@@ -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();
         });
@@ -129,7 +129,7 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
         /**
          * Main initialisation.
          * @param {String} buttonSelector The parent competency button selector.
-         * @param {String} inputHiddenSelector The hidden input field selector.
+         * @param {String} inputSelector The hidden input field selector.
          * @param {String} staticElementSelector The static element displaying the parent competency.
          * @param {Number} frameworkId The competency framework ID.
          * @param {Number} pageContextId The page context ID.
index 8d3e050..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,16 +169,16 @@ 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' }
-            ]).done(function (strings) {
+                {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.
                     strings[1], // Delete plan X?
@@ -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,16 +216,16 @@ 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' }
-            ]).done(function (strings) {
+                {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.
                     strings[1], // Reopen plan X?
@@ -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, planDa