Merge branch 'MDL-53111_m32v1' of https://github.com/sbourget/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 27 Jun 2016 05:30:51 +0000 (13:30 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 27 Jun 2016 05:30:51 +0000 (13:30 +0800)
578 files changed:
.eslintignore [new file with mode: 0644]
.eslintrc [new file with mode: 0644]
Gruntfile.js
admin/cli/automated_backups.php
admin/cli/backup.php
admin/cli/cron.php
admin/cli/install.php
admin/cli/install_database.php
admin/cli/mysql_collation.php
admin/cli/mysql_compressed_rows.php
admin/cli/mysql_engine.php
admin/cli/purge_caches.php
admin/cli/reset_password.php
admin/cli/upgrade.php
admin/filters.php
admin/localplugins.php
admin/mailout-debugger.php
admin/message.php
admin/mnet/access_control.php
admin/mnet/delete.php
admin/mnet/index.php
admin/mnet/peers.php
admin/mnet/profilefields.php
admin/mnet/services.php
admin/mnet/testclient.php
admin/mnet/trustedhosts.php
admin/oauth2callback.php
admin/plagiarism.php
admin/plugins.php
admin/portfolio.php
admin/process_email.php
admin/qbehaviours.php
admin/qtypes.php
admin/reports.php
admin/repository.php
admin/repositoryinstance.php
admin/resetemoticons.php
admin/roles/allow.php
admin/roles/check.php
admin/roles/define.php
admin/roles/manage.php
admin/settings/courses.php
admin/tool/assignmentupgrade/batchupgrade.php
admin/tool/assignmentupgrade/index.php
admin/tool/assignmentupgrade/listnotupgraded.php
admin/tool/assignmentupgrade/upgradesingle.php
admin/tool/assignmentupgrade/upgradesingleconfirm.php
admin/tool/capability/index.php
admin/tool/cohortroles/index.php
admin/tool/customlang/edit.php
admin/tool/customlang/index.php
admin/tool/generator/cli/maketestcourse.php
admin/tool/generator/cli/maketestplan.php
admin/tool/generator/index.php
admin/tool/health/styles.css
admin/tool/installaddon/index.php
admin/tool/installaddon/permcheck.php
admin/tool/lp/amd/build/competencies.min.js
admin/tool/lp/amd/build/tree.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/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/lib.php
admin/tool/lp/pix/competency.png [deleted file]
admin/tool/lp/pix/competency.svg [deleted file]
admin/tool/lp/styles.css
admin/tool/lp/upgrade.txt [new file with mode: 0644]
admin/tool/messageinbound/index.php
admin/tool/multilangupgrade/index.php
admin/tool/phpunit/index.php
admin/tool/phpunit/webrunner.php
admin/tool/profiling/export.php
admin/tool/profiling/import.php
admin/tool/profiling/index.php
admin/tool/recyclebin/index.php
admin/tool/task/scheduledtasks.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/unsuproles/index.php
admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php
admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php
admin/tools.php
admin/user/user_bulk.php
admin/user/user_bulk_enrol.php [deleted file]
admin/user/user_bulk_forms.php
auth/cas/cli/sync_users.php
auth/ldap/cli/sync_users.php
auth/ldap/ntlmsso_attempt.php
auth/ldap/ntlmsso_finish.php
auth/ldap/ntlmsso_magic.php
auth/mnet/jump.php
auth/mnet/land.php
auth/upgrade.txt
backup/backupfilesedit.php
backup/cc/cc_lib/gral_lib/ccdependencyparser.php
backup/cc/cc_lib/gral_lib/functions.php
backup/converter/moodle1/lib.php
backup/restorefile.php
badges/action.php
badges/ajax.php
badges/assertion.php
badges/award.php
badges/backpackconnect.php
badges/badge.php
badges/criteria.php
badges/criteria_action.php
badges/criteria_settings.php
badges/edit.php
badges/external.php
badges/index.php
badges/mybackpack.php
badges/mybadges.php
badges/newbadge.php
badges/overview.php
badges/preferences.php
badges/recipients.php
badges/view.php
blocks/community/styles.css
blocks/completionstatus/block_completionstatus.php
blocks/completionstatus/details.php
blocks/course_overview/move.php
blocks/course_overview/save.php
blocks/myprofile/edit_form.php
blocks/myprofile/lang/en/block_myprofile.php
blocks/myprofile/lang/en/deprecated.txt [new file with mode: 0644]
blocks/navigation/amd/src/ajax_response_renderer.js
blocks/navigation/amd/src/nav_loader.js
blocks/online_users/block_online_users.php
blocks/private_files/tests/behat/block_private_files_dashboard.feature
blocks/private_files/tests/behat/block_private_files_frontpage.feature
blocks/rss_client/editfeed.php
blocks/rss_client/managefeeds.php
blocks/rss_client/tests/cron_test.php
blocks/rss_client/viewfeed.php
blocks/selfcompletion/block_selfcompletion.php
blog/edit.php
blog/index.php
calendar/classes/export_form.php
calendar/export_execute.php
calendar/tests/behat/export.feature [new file with mode: 0644]
comment/lib.php
completion/criteria/completion_criteria_activity.php
composer.json
composer.lock
config-dist.php
course/category.ajax.php
course/changenumsections.php
course/completion_form.php
course/delete.php
course/dndupload.php
course/format/README.txt
course/format/topics/tests/behat/edit_delete_sections.feature
course/format/upgrade.txt
course/lib.php
course/modduplicate.php
course/pending.php
course/renderer.php
course/request.php
course/rest.php
course/tests/behat/behat_course.php
course/tests/behat/restrict_available_activities.feature
course/view.php
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-min.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js
course/yui/src/modchooser/js/modchooser.js
course/yui/src/toolboxes/js/resource.js
enrol/imsenterprise/importnow.php
enrol/lti/index.php
enrol/lti/tool.php
enrol/meta/cli/sync.php
enrol/mnet/enrol.php
enrol/tests/behat/behat_enrol.php
files/coursefilesedit.php
filter/manage.php
filter/mediaplugin/dev/perftest.php
filter/mediaplugin/styles.css
grade/edit/outcome/import.php
grade/edit/outcome/index.php
grade/grading/form/guide/amd/src/comment_chooser.js
grade/grading/form/guide/edit.php
grade/grading/form/guide/edit_form.php
grade/grading/form/guide/preview.php
grade/grading/form/rubric/edit.php
grade/grading/form/rubric/edit_form.php
grade/grading/form/rubric/preview.php
grade/grading/manage.php
grade/grading/pick.php
grade/import/keymanager.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/singleview/styles.css
group/clientlib.js
group/members.php
help.php
install.php
install/css.php
install/lang/da_rum/langconfig.php [new file with mode: 0644]
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/calendar.php
lang/en/deprecated.txt
lang/en/install.php
lang/en/moodle.php
lib/adminlib.php
lib/ajax/blocks.php
lib/ajax/getnavbranch.php
lib/ajax/getsiteadminbranch.php
lib/ajax/service.php
lib/ajax/setuserpref.php
lib/amd/build/form-autocomplete.min.js
lib/amd/build/permissionmanager.min.js
lib/amd/build/templates.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/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/amd/src/yui.js
lib/authlib.php
lib/badgeslib.php
lib/behat/behat_base.php
lib/behat/form_field/behat_form_select.php
lib/classes/user.php
lib/editor/atto/autosave-ajax.php
lib/editor/atto/plugins/equation/ajax.php
lib/editor/tinymce/plugins/moodleemoticon/dialog.php
lib/editor/tinymce/plugins/moodlemedia/preview.php
lib/editor/tinymce/plugins/spellchecker/includes/general.php
lib/filestorage/file_storage.php
lib/form/form.js
lib/form/tags.php
lib/installlib.php
lib/messagelib.php
lib/moodlelib.php
lib/navigationlib.php
lib/outputrenderers.php
lib/pdflib.php
lib/sessionkeepalive_ajax.php
lib/setup.php
lib/setuplib.php
lib/tests/behat/behat_general.php
lib/tests/moodlelib_test.php
lib/tests/other/jquerypage.php
lib/tests/other/pdflibtestpage.php
lib/tests/other/todochecker.php
lib/tests/performance/filtersettingsperformancetester.php
lib/tests/string_manager_standard_test.php
lib/upgrade.txt
lib/upgradelib.php
login/token.php
message/defaultoutputs.php
message/discussion.php
message/edit.php
message/output/airnotifier/rest.php
message/output/popup/message_output_popup.php
mnet/publickey.php
mnet/service/enrol/course.php
mnet/service/enrol/host.php
mnet/service/enrol/index.php
mnet/xmlrpc/server.php
mod/assign/adminmanageplugins.php
mod/assign/amd/src/grading_actions.js
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/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/testunoconv.php
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-min.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
mod/assign/tests/behat/quickgrading.feature
mod/book/delete.php
mod/book/edit.php
mod/book/index.php
mod/book/lib.php
mod/book/locallib.php
mod/book/mod_form.php
mod/book/move.php
mod/book/settings.php
mod/book/show.php
mod/book/tool/exportimscp/index.php
mod/book/tool/exportimscp/locallib.php
mod/book/tool/importhtml/index.php
mod/book/tool/importhtml/locallib.php
mod/book/tool/print/index.php
mod/book/tool/print/locallib.php
mod/book/tool/print/print.css
mod/book/view.php
mod/chat/chat_ajax.php
mod/chat/chatd.php
mod/chat/gui_ajax/index.php
mod/chat/view.php
mod/choice/styles.css
mod/data/classes/search/activity.php [moved from course/category.php with 62% similarity]
mod/data/lang/en/data.php
mod/data/preset/imagegallery/csstemplate.css
mod/data/view.php
mod/feedback/ajax.php
mod/feedback/classes/observer.php [new file with mode: 0644]
mod/feedback/db/events.php [new file with mode: 0644]
mod/feedback/lib.php
mod/feedback/tests/behat/behat_mod_feedback.php
mod/feedback/tests/events_test.php
mod/feedback/version.php
mod/forum/index.php
mod/forum/lib.php
mod/forum/maildigest.php
mod/forum/styles.css
mod/forum/subscribe.php
mod/forum/subscribe_ajax.php
mod/forum/tests/behat/discussion_navigation.feature
mod/forum/user.php
mod/lesson/lib.php
mod/lesson/overridedelete.php
mod/lesson/overrideedit.php
mod/lesson/overrides.php
mod/lesson/view.php
mod/lti/ajax.php
mod/lti/amd/build/cartridge_registration_form.min.js
mod/lti/amd/build/external_registration.min.js
mod/lti/amd/build/tool_configure_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/locallib.php
mod/lti/service.php
mod/lti/services.php
mod/quiz/amd/src/preflightcheck.js
mod/quiz/attempt.php
mod/quiz/autosave.ajax.php
mod/quiz/grade.php
mod/quiz/lib.php
mod/quiz/overridedelete.php
mod/quiz/overrideedit.php
mod/quiz/overrides.php
mod/quiz/processattempt.php
mod/quiz/report.php
mod/quiz/report/overview/overviewgraph.php
mod/quiz/report/overview/report.php
mod/quiz/report/statistics/statistics_graph.php
mod/quiz/review.php
mod/quiz/reviewquestion.php
mod/quiz/startattempt.php
mod/quiz/styles.css
mod/quiz/summary.php
mod/quiz/tests/behat/attempt_begin.feature
mod/quiz/tests/behat/editing_add.feature
mod/quiz/view.php
mod/scorm/report/graphs/graph.php
mod/scorm/styles.css
mod/upgrade.txt
mod/wiki/create.php
mod/wiki/create_form.php
mod/wiki/filesedit.php
mod/wiki/pagelib.php
mod/workshop/aggregate.php
mod/workshop/allocation.php
mod/workshop/allocation/manual/lib.php
mod/workshop/allocation/random/lib.php
mod/workshop/allocation/random/settings.php
mod/workshop/allocation/scheduled/lib.php
mod/workshop/allocation/scheduled/settings_form.php
mod/workshop/assessment.php
mod/workshop/backup/moodle1/lib.php
mod/workshop/editform.php
mod/workshop/editformpreview.php
mod/workshop/eval/best/lib.php
mod/workshop/exassessment.php
mod/workshop/excompare.php
mod/workshop/exsubmission.php
mod/workshop/form/accumulative/assessment_form.php
mod/workshop/form/accumulative/edit_form.php
mod/workshop/form/accumulative/lib.php
mod/workshop/form/comments/assessment_form.php
mod/workshop/form/comments/edit_form.php
mod/workshop/form/comments/lib.php
mod/workshop/form/numerrors/assessment_form.php
mod/workshop/form/numerrors/edit_form.php
mod/workshop/form/numerrors/lib.php
mod/workshop/form/rubric/assessment_form.php
mod/workshop/form/rubric/edit_form.php
mod/workshop/form/rubric/lib.php
mod/workshop/index.php
mod/workshop/lib.php
mod/workshop/locallib.php
mod/workshop/mod_form.php
mod/workshop/submission.php
mod/workshop/switchphase.php
mod/workshop/toolbox.php
mod/workshop/view.php
my/index.php
my/indexsys.php
npm-shrinkwrap.json
package.json
pix/i/competencies.png [new file with mode: 0644]
pix/i/competencies.svg [new file with mode: 0644]
portfolio/add.php
portfolio/download/file.php
portfolio/file.php
portfolio/mahara/preconfig.php
question/addquestion.php
question/behaviour/adaptive/tests/behaviourtype_test.php
question/behaviour/adaptive/tests/mark_display_test.php
question/behaviour/adaptive/tests/walkthrough_test.php
question/behaviour/adaptivenopenalty/behaviour.php
question/behaviour/adaptivenopenalty/behaviourtype.php
question/behaviour/adaptivenopenalty/renderer.php
question/behaviour/adaptivenopenalty/tests/walkthrough_test.php
question/behaviour/deferredcbm/behaviour.php
question/behaviour/deferredcbm/behaviourtype.php
question/behaviour/deferredcbm/tests/behaviourtype_test.php
question/behaviour/deferredcbm/tests/question_cbm_test.php
question/behaviour/deferredcbm/tests/walkthrough_test.php
question/behaviour/deferredfeedback/tests/behaviourtype_test.php
question/behaviour/deferredfeedback/tests/walkthrough_test.php
question/behaviour/immediatecbm/behaviour.php
question/behaviour/immediatecbm/behaviourtype.php
question/behaviour/immediatecbm/renderer.php
question/behaviour/immediatecbm/tests/behaviourtype_test.php
question/behaviour/immediatecbm/tests/walkthrough_test.php
question/behaviour/immediatefeedback/tests/behaviourtype_test.php
question/behaviour/immediatefeedback/tests/walkthrough_test.php
question/behaviour/informationitem/tests/behaviourtype_test.php
question/behaviour/informationitem/tests/walkthrough_test.php
question/behaviour/interactive/tests/behaviourtype_test.php
question/behaviour/interactive/tests/walkthrough_test.php
question/behaviour/interactivecountback/behaviour.php
question/behaviour/interactivecountback/behaviourtype.php
question/behaviour/interactivecountback/renderer.php
question/behaviour/interactivecountback/tests/behaviourtype_test.php
question/behaviour/interactivecountback/tests/walkthrough_test.php
question/behaviour/manualgraded/tests/behaviourtype_test.php
question/behaviour/manualgraded/tests/walkthrough_test.php
question/behaviour/missing/tests/behaviourtype_test.php
question/behaviour/missing/tests/missingbehaviour_test.php
question/edit.php
question/engine/bank.php
question/engine/lib.php
question/engine/tests/datalib_reporting_queries_test.php
question/engine/tests/datalib_test.php
question/engine/tests/qubaid_condition_test.php
question/engine/tests/questionattempt_db_test.php
question/engine/tests/questionattempt_test.php
question/engine/tests/questionattempt_with_steps_test.php
question/engine/tests/questionattemptiterator_test.php
question/engine/tests/questionattemptstep_db_test.php
question/engine/tests/questionattemptstep_test.php
question/engine/tests/questionattemptstepiterator_test.php
question/engine/tests/questionbank_test.php
question/engine/tests/questionengine_test.php
question/engine/tests/questionstate_test.php
question/engine/tests/questionusage_autosave_test.php
question/engine/tests/questionusagebyactivity_data_test.php
question/engine/tests/questionusagebyactivity_test.php
question/engine/tests/questionutils_test.php
question/engine/tests/unitofwork_test.php
question/engine/upgrade/tests/helper.php
question/export.php
question/import.php
question/preview.php
question/question.php
question/type/calculated/styles.css
question/type/calculatedsimple/styles.css
question/type/missingtype/tests/missingtype_test.php
question/type/numerical/styles.css
question/type/shortanswer/styles.css
report/competency/amd/src/grading_popup.js
report/competency/amd/src/user_course_navigation.js
report/completion/index.php
report/configlog/index.php
report/eventlist/tests/behat/mainsection.feature
report/log/locallib.php
report/outline/locallib.php
report/questioninstances/index.php
report/stats/locallib.php
report/upgrade.txt
repository/dropbox/lib.php
repository/dropbox/thumbnail.php
repository/equella/callback.php
repository/filepicker.php
repository/filesystem/lib.php
repository/flickr_public/lib.php
repository/lib.php
repository/manage_instances.php
repository/repository_ajax.php
repository/repository_callback.php
repository/upgrade.txt
repository/url/lib.php
repository/wikimedia/lib.php
tag/classes/output/tagareacollection.php
tag/classes/tag.php
theme/base/style/core.css
theme/bootstrapbase/less/moodle/modules.less
theme/bootstrapbase/less/moodle/search.less
theme/bootstrapbase/style/moodle.css
theme/index.php
user/classes/course_form.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/portfolio.php
user/portfoliologs.php
user/profile.php
user/profile/definelib.php
user/profilesys.php
user/repository.php
user/selector/search.php
user/tests/behat/course_preference.feature [new file with mode: 0644]
user/tests/externallib_test.php
version.php
webservice/pluginfile.php
webservice/tests/externallib_test.php
webservice/upload.php

diff --git a/.eslintignore b/.eslintignore
new file mode 100644 (file)
index 0000000..4c89fdb
--- /dev/null
@@ -0,0 +1,57 @@
+# Generated by "grunt ignorefiles"
+*/**/yui/src/*/meta/
+*/**/build/
+node_modules/
+vendor/
+auth/cas/CAS/
+auth/fc/fcFPP.php
+enrol/lti/ims-blti/
+filter/algebra/AlgParser.pm
+filter/tex/mimetex.*
+lib/editor/atto/yui/src/rangy/js/*.*
+lib/editor/tinymce/plugins/pdw/tinymce/
+lib/editor/tinymce/plugins/spellchecker/rpc.php
+lib/editor/tinymce/tiny_mce/
+lib/adodb/
+lib/alfresco/
+lib/bennu/
+lib/evalmath/
+lib/lessphp/
+lib/phpexcel/
+lib/pear/Net/
+lib/google/
+lib/htmlpurifier/
+lib/jabber/
+lib/minify/
+lib/flowplayer/
+lib/password_compat/
+lib/pear/Auth/RADIUS.php
+lib/pear/Crypt/CHAP.php
+lib/pear/HTML/Common.php
+lib/pear/HTML/QuickForm.php
+lib/pear/HTML/QuickForm/
+lib/pear/PEAR.php
+lib/phpmailer/
+lib/simplepie/
+lib/tcpdf/
+lib/typo3/
+lib/yuilib/
+lib/yuilib/gallery/
+lib/jquery/
+lib/html2text/
+lib/markdown/
+lib/recaptchalib.php
+lib/xhprof/
+lib/xmlize.php
+lib/horde/
+lib/requirejs/
+lib/amd/src/loglevel.js
+lib/mustache/
+lib/amd/src/mustache.js
+lib/graphlib.php
+lib/spout/
+mod/assign/feedback/editpdf/fpdi/
+repository/s3/S3.php
+theme/bootstrapbase/less/bootstrap/
+theme/bootstrapbase/javascript/html5shiv.js
+theme/bootstrapbase/amd/src/bootstrap.js
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
new file mode 100644 (file)
index 0000000..03dc85a
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,164 @@
+{
+  'env': {
+    'browser': true,
+    'amd': true
+  },
+  'globals': {
+    'M': true,
+    'Y': true
+  },
+  '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.
+    // === Possible Errors ===
+    // DEFINE POLICY: 'comma-dangle': ['off', 'always'],
+    'no-cond-assign': 'error',
+    'no-console': 'error',
+    'no-constant-condition': 'error',
+    'no-control-regex': 'error',
+    'no-debugger': 'error',
+    '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-character-class': 'error',
+    'no-ex-assign': 'error',
+    'no-extra-boolean-cast': 'error',
+    'no-extra-parens': 'off',
+    'no-extra-semi': 'error',
+    'no-func-assign': 'error',
+    'no-inner-declarations': 'error',
+    'no-invalid-regexp': 'error',
+    'no-irregular-whitespace': 'error',
+    'no-negated-in-lhs': 'error',
+    'no-obj-calls': 'error',
+    'no-prototype-builtins': 'off',
+    'no-regex-spaces': 'error',
+    'no-sparse-arrays': 'error',
+    'no-unexpected-multiline': 'error',
+    'no-unreachable': 'warn',
+    'no-unsafe-finally': 'error',
+    'use-isnan': 'error',
+    'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
+    'valid-typeof': 'error',
+
+    // === Best Practices ===
+    // (these mostly match our jshint config)
+    'curly': 'error',
+    'dot-notation': 'warn',
+    'no-alert': 'warn',
+    'no-caller': 'error',
+    'no-case-declarations': 'error',
+    'no-empty-pattern': 'error',
+    'no-empty-function': 'warn',
+    //DEFINE POLICY: 'no-eq-null': 'warn',
+    'no-eval': 'error',
+    //DEFINE POLICY: 'no-extra-bind': 'warn',
+    'no-fallthrough': 'error',
+    //DEFINE POLICY: 'no-implicit-globals': 'warn',
+    'no-implied-eval': 'error',
+    'no-invalid-this': 'error',
+    'no-iterator': 'error',
+    'no-labels': 'error',
+    'no-loop-func': 'error',
+    'no-multi-spaces': 'warn',
+    'no-multi-str': '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-proto': 'error',
+    'no-redeclare': 'warn',
+    'no-return-assign': 'error',
+    'no-script-url': 'error',
+    'no-self-assign': 'error',
+    'no-self-compare': 'error',
+    'no-unmodified-loop-condition': 'error',
+    // Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-expressions': 'error',
+    'no-unused-labels': 'error',
+    //DEFINE POLICY: 'no-useless-call': 'error',
+    'no-useless-escape': 'warn',
+    //DEFINE POLICY: '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',
+
+    // === Stylistic Issues ===
+    'array-bracket-spacing': 'warn',
+    'block-spacing': 'warn',
+    'brace-style': ['warn', '1tbs'],
+    'camelcase': 'warn',
+    'comma-spacing': ['warn', { 'before': false, 'after': true }],
+    'comma-style': ['warn', 'last'],
+    'computed-property-spacing': 'error',
+    'consistent-this': 'off',
+    'eol-last': 'off',
+    'func-names': 'off',
+    'func-style': 'off',
+    // indent currently not doing well with our wrapping style, so disabled.
+    'indent': ['off', 4, { 'SwitchCase': 1 }],
+    'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
+    'keyword-spacing': 'warn',
+    'linebreak-style': ['error', 'unix'],
+    '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-params': 'off',
+    'max-statements': 'off',
+    'max-statements-per-line': 'off',
+    'new-cap': ['warn', { 'properties': false }],
+    'new-parens': 'warn',
+    'newline-after-var': 'off',
+    'newline-before-return': 'off',
+    // REVIST POLICY: 'newline-per-chained-call': 'warn',
+    'no-array-constructor': 'off',
+    'no-bitwise': 'error',
+    'no-continue': 'off',
+    'no-inline-comments': 'off',
+    'no-lonely-if': 'off',
+    'no-mixed-operators': 'off',
+    'no-mixed-spaces-and-tabs': 'error',
+    'no-multiple-empty-lines': 'warn',
+    'no-negated-condition': 'off',
+    'no-nested-ternary': 'warn',
+    'no-new-object': 'off',
+    'no-plusplus': 'off',
+    'no-spaced-func': 'warn',
+    'no-ternary': 'off',
+    'no-trailing-spaces': 'error',
+    'no-underscore-dangle': 'off',
+    // DEFINE POLICY: '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',
+    'one-var': 'off',
+    // DEFINE POLICY: 'one-var-declaration-per-line': 'off',
+    'operator-assignment': 'off',
+    'operator-linebreak': 'off',
+    'padded-blocks': 'off',
+    // DEFINE POLICY: 'quote-props': 'off',
+    'quotes': 'off',
+    'require-jsdoc': 'warn',
+    'semi': 'error',
+    'semi-spacing': ['warn', {'before': false, 'after': true}],
+    'sort-vars': 'off',
+    'space-before-blocks': 'warn',
+    'space-before-function-paren': ['warn', 'never'],
+    'space-in-parens': 'warn',
+    'space-infix-ops': 'warn',
+    'space-unary-ops': 'warn',
+    'spaced-comment': 'warn',
+    'unicode-bom': 'error',
+    'wrap-regex': 'off',
+  }
+}
index 7412970..b728341 100644 (file)
@@ -13,6 +13,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 /* jshint node: true, browser: false */
+/* eslint-env node */
 
 /**
  * @copyright  2014 Andrew Nicols
 module.exports = function(grunt) {
     var path = require('path'),
         tasks = {},
-        cwd = process.env.PWD || process.cwd();
+        cwd = process.env.PWD || process.cwd(),
+        async = require('async'),
+        DOMParser = require('xmldom').DOMParser,
+        xpath = require('xpath');
 
     // Windows users can't run grunt in a subdirectory, so allow them to set
     // the root by passing --root=path/to/dir.
@@ -34,9 +38,9 @@ module.exports = function(grunt) {
         var root = grunt.option('root');
         if (grunt.file.exists(__dirname, root)) {
             cwd = path.join(__dirname, root);
-            grunt.log.ok('Setting root to '+cwd);
+            grunt.log.ok('Setting root to ' + cwd);
         } else {
-            grunt.fail.fatal('Setting root to '+root+' failed - path does not exist');
+            grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
         }
     }
 
@@ -55,25 +59,75 @@ module.exports = function(grunt) {
      * @param {String} srcPath the  matched src path
      * @return {String} The rewritten destination path.
      */
-    var uglify_rename = function (destPath, srcPath) {
+    var uglifyRename = function(destPath, srcPath) {
         destPath = srcPath.replace('src', 'build');
         destPath = destPath.replace('.js', '.min.js');
         destPath = path.resolve(cwd, destPath);
         return destPath;
     };
 
+    /**
+     * Find thirdpartylibs.xml and generate an array of paths contained within
+     * them (used to generate ignore files and so on).
+     *
+     * @return {array} The list of thirdparty paths.
+     */
+    var getThirdPartyPathsFromXML = function() {
+        var thirdpartyfiles = grunt.file.expand('*/**/thirdpartylibs.xml');
+        var libs = ['node_modules/', 'vendor/'];
+
+        thirdpartyfiles.forEach(function(file) {
+          var dirname = path.dirname(file);
+
+          var doc = new DOMParser().parseFromString(grunt.file.read(file));
+          var nodes = xpath.select("/libraries/library/location/text()", doc);
+
+          nodes.forEach(function(node) {
+            var lib = path.join(dirname, node.toString());
+            if (grunt.file.isDir(lib)) {
+                // Ensure trailing slash on dirs.
+                lib = lib.replace(/\/?$/, '/');
+            }
+
+            // Look for duplicate paths before adding to array.
+            if (libs.indexOf(lib) === -1) {
+                libs.push(lib);
+            }
+          });
+        });
+        return libs;
+    };
+
+
     // 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.
+            amd: {
+              src: amdSrc,
+              options: {
+                  rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'}
+              }
+            },
+            // Check YUI module source files.
+            yui: {
+               src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
+            }
+        },
         uglify: {
             amd: {
                 files: [{
                     expand: true,
                     src: amdSrc,
-                    rename: uglify_rename
+                    rename: uglifyRename
                 }]
             }
         },
@@ -102,7 +156,7 @@ module.exports = function(grunt) {
             },
             yui: {
                 files: ['**/yui/src/**/*.js'],
-                tasks: ['shifter']
+                tasks: ['yui']
             },
         },
         shifter: {
@@ -113,6 +167,17 @@ module.exports = function(grunt) {
         }
     });
 
+    /**
+     * Generate ignore files (utilising thirdpartylibs.xml data)
+     */
+    tasks.ignorefiles = function() {
+      // An array of paths to third party directories.
+      var thirdPartyPaths = getThirdPartyPathsFromXML();
+      // Generate .eslintignore.
+      var eslintIgnores = ['# Generated by "grunt ignorefiles"', '*/**/yui/src/*/meta/', '*/**/build/'].concat(thirdPartyPaths);
+      grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
+    };
+
     /**
      * Shifter task. Is configured with a path to a specific file or a directory,
      * in the case of a specific file it will work out the right module to be built.
@@ -121,14 +186,13 @@ module.exports = function(grunt) {
      * so be careful to to call done().
      */
     tasks.shifter = function() {
-        var async = require('async'),
-            done = this.async(),
+        var done = this.async(),
             options = grunt.config('shifter.options');
 
         // Run the shifter processes one at a time to avoid confusing output.
-        async.eachSeries(options.paths, function (src, filedone) {
+        async.eachSeries(options.paths, function(src, filedone) {
             var args = [];
-            args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
+            args.push(path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
 
             // Always ignore the node_modules directory.
             args.push('--excludes', 'node_modules');
@@ -176,7 +240,7 @@ module.exports = function(grunt) {
                     cmd: "node",
                     args: args,
                     opts: {cwd: src, stdio: 'inherit', env: process.env}
-                }, function (error, result, code) {
+                }, function(error, result, code) {
                     if (code) {
                         grunt.fail.fatal('Shifter failed with code: ' + code);
                     } else {
@@ -205,7 +269,7 @@ module.exports = function(grunt) {
     tasks.startup = function() {
         // Are we in a YUI directory?
         if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
-            grunt.task.run('shifter');
+            grunt.task.run('yui');
         // Are we in an AMD directory?
         } else if (inAMD) {
             grunt.task.run('amd');
@@ -223,7 +287,7 @@ module.exports = function(grunt) {
     var onChange = grunt.util._.debounce(function() {
           var files = Object.keys(changedFiles);
           grunt.config('jshint.amd.src', files);
-          grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglify_rename }]);
+          grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglifyRename }]);
           grunt.config('shifter.options.paths', files);
           changedFiles = Object.create(null);
     }, 200);
@@ -238,11 +302,14 @@ module.exports = function(grunt) {
     grunt.loadNpmTasks('grunt-contrib-jshint');
     grunt.loadNpmTasks('grunt-contrib-less');
     grunt.loadNpmTasks('grunt-contrib-watch');
+    grunt.loadNpmTasks('grunt-eslint');
 
     // Register JS tasks.
     grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
-    grunt.registerTask('amd', ['jshint', 'uglify']);
-    grunt.registerTask('js', ['amd', '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('js', ['amd', 'yui']);
 
     // Register CSS taks.
     grunt.registerTask('css', ['less:bootstrapbase']);
index 3c3841e..0b03282 100644 (file)
@@ -28,7 +28,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 require_once($CFG->libdir.'/cronlib.php');
 
index 2770c03..b8be318 100644 (file)
@@ -25,7 +25,7 @@
 
 define('CLI_SCRIPT', 1);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');
 require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
 
index 527aa72..3ece44a 100644 (file)
@@ -30,7 +30,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 require_once($CFG->libdir.'/cronlib.php');
 
index 523f9e8..9f3c0df 100644 (file)
@@ -90,7 +90,7 @@ Example:
 
 
 // distro specific customisation
-$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
+$distrolibfile = __DIR__.'/../../install/distrolib.php';
 $distro = null;
 if (file_exists($distrolibfile)) {
     require_once($distrolibfile);
@@ -100,7 +100,7 @@ if (file_exists($distrolibfile)) {
 }
 
 // Nothing to do if config.php exists
-$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
+$configfile = __DIR__.'/../../config.php';
 if (file_exists($configfile)) {
     require($configfile);
     require_once($CFG->libdir.'/clilib.php');
@@ -159,7 +159,7 @@ if (version_compare(phpversion(), "5.4.4") < 0) {
 global $CFG;
 $CFG = new stdClass();
 $CFG->lang                 = 'en';
-$CFG->dirroot              = dirname(dirname(dirname(__FILE__)));
+$CFG->dirroot              = dirname(dirname(__DIR__));
 $CFG->libdir               = "$CFG->dirroot/lib";
 $CFG->wwwroot              = "http://localhost";
 $CFG->httpswwwroot         = $CFG->wwwroot;
@@ -172,7 +172,7 @@ $CFG->debug                = (E_ALL | E_STRICT);
 $CFG->debugdisplay         = true;
 $CFG->debugdeveloper       = true;
 
-$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
+$parts = explode('/', str_replace('\\', '/', dirname(__DIR__)));
 $CFG->admin                = array_pop($parts);
 
 //point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
@@ -244,7 +244,7 @@ list($options, $unrecognized) = cli_get_params(
         'chmod'             => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
         'lang'              => $CFG->lang,
         'wwwroot'           => '',
-        'dataroot'          => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
+        'dataroot'          => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(__DIR__))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
         'dbtype'            => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
         'dbhost'            => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
         'dbname'            => 'moodle',
index cb768c3..b66805e 100644 (file)
@@ -72,7 +72,7 @@ if (version_compare(phpversion(), "5.4.4") < 0) {
 }
 
 // Nothing to do if config.php does not exist
-$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
+$configfile = __DIR__.'/../../config.php';
 if (!file_exists($configfile)) {
     fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize
     fwrite(STDERR, "\n");
index 9938a3a..131b8f4 100644 (file)
@@ -24,7 +24,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 
 if ($DB->get_dbfamily() !== 'mysql') {
index df69376..e90060c 100644 (file)
@@ -25,7 +25,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(__FILE__).'/../../config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir . '/clilib.php');
 
 if ($DB->get_dbfamily() !== 'mysql') {
index 6bc3642..d392b0b 100644 (file)
@@ -26,7 +26,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 
 if ($DB->get_dbfamily() !== 'mysql') {
index f008da2..7c9d344 100644 (file)
@@ -23,7 +23,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');
 
 list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
index d7b4f74..27f4ca9 100644 (file)
@@ -26,7 +26,7 @@
 
 define('CLI_SCRIPT', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/clilib.php');      // cli only functions
 
 
index cefb990..6de2e13 100644 (file)
@@ -38,7 +38,7 @@ if (function_exists('opcache_reset') and !isset($_SERVER['REMOTE_ADDR'])) {
 define('CLI_SCRIPT', true);
 define('CACHE_DISABLE_ALL', true);
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');       // various admin-only functions
 require_once($CFG->libdir.'/upgradelib.php');     // general upgrade/install related functions
 require_once($CFG->libdir.'/clilib.php');         // cli only functions
index 6313d08..b112767 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 
 $action = optional_param('action', '', PARAM_ALPHA);
index fb5c4cf..eb6862d 100644 (file)
@@ -27,7 +27,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index d183fa4..ae9fc85 100644 (file)
@@ -29,7 +29,7 @@
    */
 
 // Security check.
-if (!file_exists(dirname(__FILE__).'/mailout-debugger.enable')) {
+if (!file_exists(__DIR__.'/mailout-debugger.enable')) {
     mdie("Disabled.");
 }
 $tmpdir=sys_get_temp_dir(); // default
index 270a230..52cb560 100644 (file)
@@ -21,7 +21,7 @@
  * @copyright  2011 Lancaster University Network Services Limited
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->dirroot . '/message/lib.php');
 require_once($CFG->libdir.'/adminlib.php');
 
index 375b3fa..6b1cebc 100644 (file)
@@ -2,7 +2,7 @@
 
 // Allows the admin to control user logins from remote moodles.
 
-require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
+require_once(__DIR__ . '/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 include_once($CFG->dirroot.'/mnet/lib.php');
 
index c078b27..03eac9b 100644 (file)
@@ -27,7 +27,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 
 $step   = optional_param('step', 'verify', PARAM_ALPHA);
index d6e544e..879caa8 100644 (file)
@@ -2,7 +2,7 @@
 
     // Allows the admin to configure mnet stuff
 
-    require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+    require(__DIR__.'/../../config.php');
     require_once($CFG->libdir.'/adminlib.php');
     include_once($CFG->dirroot.'/mnet/lib.php');
 
index 24ef9b6..df1f6e2 100644 (file)
@@ -27,7 +27,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot.'/mnet/lib.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
index 5f5fd6b..24ba79c 100644 (file)
@@ -24,7 +24,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot . '/admin/mnet/profilefields_form.php');
 $mnet = get_mnet_environment();
index cdc4fe3..ea588cd 100644 (file)
@@ -25,7 +25,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot . '/admin/mnet/services_form.php');
 $mnet = get_mnet_environment();
index f43225c..2560e84 100644 (file)
@@ -12,7 +12,7 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package mnet
  */
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
 require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
 require_once($CFG->libdir.'/adminlib.php');
 include_once($CFG->dirroot.'/mnet/lib.php');
index 290c0ae..cbbbfa3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
     // Allows the admin to configure services for remote hosts
 
-    require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+    require(__DIR__.'/../../config.php');
     require_once($CFG->libdir.'/adminlib.php');
     include_once($CFG->dirroot.'/mnet/lib.php');
 
index c032a9c..08bb01d 100644 (file)
@@ -28,7 +28,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(__FILE__)).'/config.php');
+require_once(__DIR__ . '/../config.php');
 
 // The authorization code generated by the authorization server.
 $code = required_param('code', PARAM_RAW);
index d004869..d0a3f5f 100644 (file)
@@ -26,7 +26,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index 39510cc..1176f3b 100644 (file)
@@ -24,7 +24,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->libdir . '/filelib.php');
 
index 48237bb..6a33fc0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir . '/portfoliolib.php');
 require_once($CFG->libdir . '/portfolio/forms.php');
 require_once($CFG->libdir . '/adminlib.php');
index 20ad4c1..6d7ed71 100644 (file)
@@ -3,7 +3,7 @@
 
 //error_reporting(0);
 //ini_set('display_errors',0);
-require_once(dirname(dirname(__FILE__)).'/config.php');
+require_once(__DIR__ . '/../config.php');
 $tmp = explode('@',$_ENV['RECIPIENT']);
 $address = $tmp[0];
 
index 7cd027e..057429c 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir . '/questionlib.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->libdir . '/tablelib.php');
index 80c6c6d..b13baf0 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir . '/questionlib.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->libdir . '/tablelib.php');
index e4db149..c3d648c 100644 (file)
@@ -27,7 +27,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index e01490e..bf10f51 100644 (file)
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->dirroot . '/repository/lib.php');
 require_once($CFG->libdir . '/adminlib.php');
 
index 0373857..960d0ff 100644 (file)
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->dirroot . '/repository/lib.php');
 require_once($CFG->libdir . '/adminlib.php');
 
index 09a44bb..5c65c55 100644 (file)
@@ -23,7 +23,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(dirname(__FILE__)) . '/config.php');
+require(__DIR__ . '/../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 admin_externalpage_setup('resetemoticons');
index 8ffd54d..383455e 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 
 $mode = required_param('mode', PARAM_ALPHANUMEXT);
index 79c697b..6649aaf 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
 
 $contextid = required_param('contextid', PARAM_INT);
 
index 8e98399..5a5e6a3 100644 (file)
@@ -28,7 +28,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 $action = required_param('action', PARAM_ALPHA);
index 6cd63ab..d5a9532 100644 (file)
@@ -31,7 +31,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
 
index 21ecab7..2d0dd1b 100644 (file)
@@ -72,13 +72,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
         $formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
     }
     $temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
-        'weeks',$formcourseformats));
+        'topics', $formcourseformats));
 
     $temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
         new lang_string('maxnumberweeks_desc'), 52));
 
     $temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
-        new lang_string('coursehelpnumberweeks'), 10));
+        new lang_string('coursehelpnumberweeks'), 4));
 
     $choices = array();
     $choices['0'] = new lang_string('hiddensectionscollapsed');
index 0d92dc0..7744063 100644 (file)
@@ -24,7 +24,7 @@
 
 define('NO_OUTPUT_BUFFERING', true);
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
index d9e554d..7720ac7 100644 (file)
@@ -33,7 +33,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
 
index 048ded5..0836076 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
index 5a5679a..8a1f78d 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
 
index 88be9a5..3c41fd9 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
 
index 45f9002..57f0716 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/capability/locallib.php');
 require_once($CFG->libdir.'/adminlib.php');
 
index d53af3e..cc9947c 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index 8ad4536..aabc31e 100644 (file)
@@ -21,7 +21,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/filter_form.php');
 require_once($CFG->libdir.'/adminlib.php');
index 4d120ff..9031329 100644 (file)
@@ -25,7 +25,7 @@
 
 define('NO_OUTPUT_BUFFERING', true); // progress bar is used here
 
-require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
 require_once($CFG->libdir.'/adminlib.php');
 
index cbd43e1..124e286 100644 (file)
@@ -25,7 +25,7 @@
 define('CLI_SCRIPT', true);
 define('NO_OUTPUT_BUFFERING', true);
 
-require(dirname(__FILE__) . '/../../../../config.php');
+require(__DIR__ . '/../../../../config.php');
 require_once($CFG->libdir. '/clilib.php');
 
 // CLI options.
index 78ab7e4..1dbb2ae 100644 (file)
@@ -25,7 +25,7 @@
 define('CLI_SCRIPT', true);
 define('NO_OUTPUT_BUFFERING', true);
 
-require(dirname(__FILE__) . '/../../../../config.php');
+require(__DIR__ . '/../../../../config.php');
 require_once($CFG->libdir. '/clilib.php');
 
 // CLI options.
index 3c26f50..84341b3 100644 (file)
@@ -21,7 +21,7 @@
  * @copyright  2009 Nicolas Connault
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
 
 // This index page was previously in use, for now we redirect to the make test
 // course page - but we might reinstate this page in the future.
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 cd6e7f4..453eed4 100644 (file)
@@ -23,7 +23,7 @@
  * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 admin_externalpage_setup('tool_installaddon_index');
index 8df27d0..db48884 100644 (file)
@@ -26,7 +26,7 @@
 
 define('AJAX_SCRIPT', true);
 
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 require_login();
index cf57df2..c14f771 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 4cc8611..899e3ce 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 d36f06f..8b32a48 100644 (file)
@@ -138,6 +138,7 @@ define(['jquery',
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery} The node
      * @method _find
      */
     ActionSelector.prototype._find = function(selector) {
@@ -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..8b5ae2e 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;
@@ -106,7 +107,7 @@ define(['jquery',
                 }
             ]);
         } else {
-            return null;
+            return;
         }
 
         requests[0].fail(notification.exception);
@@ -276,7 +277,7 @@ define(['jquery',
                 { key: message, component: 'tool_lp', param: competency.shortname },
                 { key: 'confirm', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Unlink the competency X from the course?
@@ -300,7 +301,7 @@ 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';
index 1ff679e..36b2a68 100644 (file)
@@ -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 470bb5d..db4bfe4 100644 (file)
@@ -126,6 +126,7 @@ define(['jquery',
             try {
                 config = JSON.parse(self._competency.ruleconfig);
             } catch (e) {
+                // eslint-disable-line no-empty
             }
         }
 
index 21e084e..c9c37bc 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
         };
 
@@ -86,7 +86,7 @@ define(['jquery',
                 { key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname },
                 { key: 'yes', component: 'core' },
                 { key: 'no', component: 'core' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0],
                     strings[1],
@@ -157,7 +157,7 @@ define(['jquery',
                 { key: confirmMessage, component: 'tool_lp' },
                 { key: 'yes', component: 'moodle' },
                 { key: 'no', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).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
@@ -257,7 +263,7 @@ define(['jquery',
                 { key: 'movecompetency', component: 'tool_lp', param: competency.shortname },
                 { key: 'move', component: 'tool_lp' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
 
                 var context = {
                     framework: framework,
@@ -288,8 +294,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 +306,7 @@ define(['jquery',
 
     /**
      * Re-render the page with the latest data.
+     * @param {Object} context
      * @method reloadPage
      */
     var reloadPage = function(context) {
@@ -313,6 +320,7 @@ define(['jquery',
 
     /**
      * Perform a search and render the page with the new search results.
+     * @param {Event} e
      * @method updateSearchHandler
      */
     var updateSearchHandler = function(e) {
@@ -381,7 +389,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.
@@ -413,7 +421,7 @@ define(['jquery',
                     });
                 });
 
-                calls.push( {
+                calls.push({
                     methodname: 'tool_lp_data_for_related_competencies_section',
                     args: { competencyid: relatedTarget.id }
                 });
@@ -486,7 +494,7 @@ define(['jquery',
                 str.get_strings([
                 { key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname },
                 { key: 'cancel', component: 'moodle' }
-                ]).done(function (strings) {
+                ]).done(function(strings) {
                     notification.alert(
                         null,
                         strings[0]
@@ -514,7 +522,7 @@ define(['jquery',
             { key: confirmMessage, component: 'tool_lp', param: competency.shortname },
             { key: 'delete', component: 'moodle' },
             { key: 'cancel', component: 'moodle' }
-        ]).done(function (strings) {
+        ]).done(function(strings) {
             notification.confirm(
                 strings[0], // Confirm.
                 strings[1], // Delete competency X?
@@ -528,6 +536,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 +545,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 +555,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 +565,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 +575,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();
@@ -614,7 +627,7 @@ define(['jquery',
     /**
      * Log the competency viewed event.
      *
-     * @param  {Object} The competency.
+     * @param  {Object} competency The competency.
      * @method triggerCompetencyViewedEvent
      */
     var triggerCompetencyViewedEvent = function(competency) {
@@ -729,6 +742,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 +795,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..9902eed 100644 (file)
@@ -43,12 +43,13 @@ 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) {
@@ -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,6 +136,7 @@ define(['jquery',
      * Get a promise on data competency.
      *
      * @param {Number} competencyid
+     * @param {Object} options
      * @return {Promise} return promise on data request
      * @method getCompetencyDataPromise
      */
@@ -160,8 +162,6 @@ define(['jquery',
          * Initialise the competency dialogue module.
          *
          * Only the first call matters.
-         *
-         * @return {Void}
          */
         init: function() {
             if (typeof instance !== 'undefined') {
index d6247fe..272d3e0 100644 (file)
@@ -231,7 +231,10 @@ define(['jquery',
                 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) {
@@ -265,6 +268,7 @@ define(['jquery',
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery}
      * @method _find
      */
     Picker.prototype._find = function(selector) {
@@ -275,6 +279,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) {
@@ -437,7 +442,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 +453,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..b417b67 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) {
@@ -88,7 +88,7 @@ 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;
index 4894d36..f207939 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
      */
@@ -181,6 +180,7 @@ define(['jquery',
      * Find a node in the dialogue.
      *
      * @param {String} selector
+     * @return {JQuery}
      * @method _find
      * @protected
      */
@@ -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..1cc3933 100644 (file)
@@ -57,7 +57,7 @@ define(['jquery',
         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,
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..a94eb30 100644 (file)
@@ -70,8 +70,8 @@ define(['core/str', 'core/yui'], function(str, Y) {
                 { key: 'emptydragdropregion', component: 'moodle' },
                 { key: 'movecontent', component: 'moodle' },
                 { key: 'tocontent', component: 'moodle' },
-            ]).done( function () {
-                Y.use('moodle-tool_lp-dragdrop-reorder', function () {
+            ]).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..44698d1 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') {
@@ -62,7 +61,7 @@ define(['jquery',
                 { key: 'areyousure', component: 'moodle' },
                 { key: 'delete', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 Notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Are you sure?
index a783033..b554495 100644 (file)
@@ -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 }
                 }]);
-                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) {
+                    ]).done(function(strings) {
                         notification.alert(
                             null,
                             strings[0]
@@ -136,7 +136,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
                 { key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname },
                 { key: 'delete', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).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..3558b9f 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, []);
index a91d770..6889936 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');
@@ -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..5a2648b 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) {
@@ -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..39efd98 100644 (file)
@@ -178,7 +178,7 @@ define(['jquery',
                 { key: 'deleteplan', component: 'tool_lp', param: plan.name },
                 { key: 'delete', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Delete plan X?
@@ -225,7 +225,7 @@ define(['jquery',
                 { key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name },
                 { key: 'reopenplan', component: 'tool_lp' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Reopen plan X?
@@ -272,7 +272,7 @@ define(['jquery',
                 { key: 'completeplanconfirm', component: 'tool_lp', param: plan.name },
                 { key: 'completeplan', component: 'tool_lp' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Complete plan X?
@@ -318,7 +318,7 @@ define(['jquery',
                 { key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name },
                 { key: 'unlinkplantemplate', component: 'tool_lp' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Unlink plan X?
@@ -507,7 +507,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.
index 11c8568..9ba1fd4 100644 (file)
@@ -198,7 +198,6 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
      *
      * @name   scaleChangeHandler
      * @param  {Event} e
-     * @return {Void}
      * @function
      */
     ScaleConfig.prototype.scaleChangeHandler = function(e) {
index d27abd3..46011f8 100644 (file)
@@ -32,7 +32,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
          * @param {Number} scaleid The scale id
          * @return [] {Promise}
          */
-
+        // eslint-disable-next-line camelcase
         get_values: function(scaleid) {
 
             var deferred = $.Deferred();
@@ -40,7 +40,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
             if (typeof localCache[scaleid] === 'undefined') {
                 ajax.call([{
                     methodname: 'core_competency_get_scale_values',
-                    args: {scaleid : scaleid},
+                    args: {scaleid: scaleid},
                     done: function(scaleinfo) {
                         localCache[scaleid] = scaleinfo;
                         deferred.resolve(scaleinfo);
index 0966cc2..e0ceecb 100644 (file)
@@ -21,7 +21,7 @@
  * @copyright  2015 Damyon Wiese <damyon@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str','tool_lp/actionselector'],
+define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str', 'tool_lp/actionselector'],
        function($, templates, ajax, notification, str, Actionselector) {
     // Private variables and functions.
 
@@ -135,9 +135,9 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
                         { key: 'unlinkplanstemplate', component: 'tool_lp' },
                         { key: 'confirm', component: 'moodle' },
                         { key: 'cancel', component: 'moodle' }
-                    ]).done(function (strings) {
-                        var actions = [{'text': strings[2], 'value' : 'delete'},
-                                       {'text': strings[3], 'value' : 'unlink'}];
+                    ]).done(function(strings) {
+                        var actions = [{'text': strings[2], 'value': 'delete'},
+                                       {'text': strings[3], 'value': 'unlink'}];
                         var actionselector = new Actionselector(
                                 strings[0], // Title.
                                 strings[1], // Message
@@ -152,14 +152,13 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
                             doDelete();
                         });
                     }).fail(notification.exception);
-                }
-                else {
+                } else {
                     str.get_strings([
                         { key: 'confirm', component: 'moodle' },
                         { key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
                         { key: 'delete', component: 'moodle' },
                         { key: 'cancel', component: 'moodle' }
-                    ]).done(function (strings) {
+                    ]).done(function(strings) {
                         notification.confirm(
                         strings[0], // Confirm.
                         strings[1], // Delete learning plan template X?
index f52934d..179dcf6 100644 (file)
@@ -186,12 +186,12 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
             var oneItem = null;
 
             while (lastIndex < currentIndex) {
-                oneItem  = $(this.visibleItems.get(lastIndex));
+                oneItem = $(this.visibleItems.get(lastIndex));
                 oneItem.attr('aria-selected', 'true');
                 lastIndex++;
             }
             while (lastIndex > currentIndex) {
-                oneItem  = $(this.visibleItems.get(lastIndex));
+                oneItem = $(this.visibleItems.get(lastIndex));
                 oneItem.attr('aria-selected', 'true');
                 lastIndex--;
             }
@@ -230,7 +230,8 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      */
     Tree.prototype.toggleItem = function(item) {
         if (!this.multiSelect) {
-            return this.selectItem(item);
+            this.selectItem(item);
+            return;
         }
 
         var current = item.attr('aria-selected');
@@ -271,6 +272,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleKeyDown
      * @param {Object} item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleKeyDown = function(item, e) {
         var currentIndex = this.visibleItems.index(item);
@@ -419,6 +421,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleKeyPress
      * @param {Object} item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleKeyPress = function(item, e) {
         if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
@@ -454,7 +457,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
 
                 // 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 (currentIndex != itemIndex)  {
+                while (currentIndex != itemIndex) {
 
                     var currentItem = this.visibleItems.eq(currentIndex);
                     var titleChr = currentItem.text().charAt(0);
@@ -468,7 +471,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
                         break;
                     }
 
-                    currentIndex = currentIndex+1;
+                    currentIndex = currentIndex + 1;
                     if (currentIndex == itemCount) {
                         // Reached the end of the list, start again at the beginning.
                         currentIndex = 0;
@@ -483,6 +486,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
             }
         }
 
+        // eslint-disable-next-line no-unreachable
         return true;
     };
 
@@ -507,6 +511,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleDblClick
      * @param {Object} item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleDblClick = function(item, e) {
 
@@ -531,6 +536,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleExpandCollapseClick
      * @param {Object} item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleExpandCollapseClick = function(item, e) {
 
@@ -547,6 +553,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleClick
      * @param {Object} item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleClick = function(item, e) {
 
@@ -568,6 +575,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleBlur
      * @param {Object} item item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleBlur = function() {
         return true;
@@ -579,6 +587,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
      * @method handleFocus
      * @param {Object} item item is the jquery id of the parent item of the group
      * @param {Event} e The event.
+     * @return {Boolean}
      */
     Tree.prototype.handleFocus = function(item) {
 
index bf61fe5..a560da7 100644 (file)
@@ -26,12 +26,12 @@ define(['jquery'], function($) {
     /**
      * UserCompetencyCourseNavigation
      *
-     * @param {String} The selector of the user element.
-     * @param {String} The selector of the competency element.
-     * @param {String} The base url for the page (no params).
-     * @param {Number} The course id
-     * @param {Number} The user id
-     * @param {Number} The competency id
+     * @param {String} userSelector The selector of the user element.
+     * @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} courseId The course id
      */
     var UserCompetencyCourseNavigation = function(userSelector, competencySelector, baseUrl, userId, competencyId, courseId) {
         this._baseUrl = baseUrl;
index 2234414..334e8ff 100644 (file)
@@ -26,12 +26,12 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function(
     /**
      * Info
      *
-     * @param {JQuery} Selector to replace when the information needs updating.
-     * @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 {Boolean} If we should display the user info.
+     * @param {JQuery} rootElement Selector to replace when the information needs updating.
+     * @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 {Boolean} displayuser If we should display the user info.
      */
     var Info = function(rootElement, competencyId, userId, planId, courseId, displayuser) {
         this._rootElement = rootElement;
index 87c977c..5001991 100644 (file)
@@ -27,9 +27,9 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
     /**
      * UserCompetencyPopup
      *
-     * @param {String} The regionSelector
-     * @param {String} The userCompetencySelector
-     * @param {Number} The plan ID
+     * @param {String} regionSelector The regionSelector
+     * @param {String} userCompetencySelector The userCompetencySelector
+     * @param {Number} planId The plan ID
      */
     var UserCompetencyPopup = function(regionSelector, userCompetencySelector, planId) {
         this._regionSelector = regionSelector;
@@ -53,14 +53,14 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
         var planId = this._planId;
 
         var requests = ajax.call([{
-            methodname : 'tool_lp_data_for_user_competency_summary_in_plan',
+            methodname: 'tool_lp_data_for_user_competency_summary_in_plan',
             args: { competencyid: competencyId, planid: planId },
             done: this._contextLoaded.bind(this),
             fail: notification.exception
         }]);
 
         // Log the user competency viewed in plan event.
-        requests[0].then(function (result) {
+        requests[0].then(function(result) {
             var eventMethodName = 'core_competency_user_competency_viewed_in_plan';
             // Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed.
             if (result.plan.iscompleted) {
@@ -98,7 +98,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
         var planId = this._planId;
 
         ajax.call([{
-            methodname : 'tool_lp_data_for_plan_page',
+            methodname: 'tool_lp_data_for_plan_page',
             args: { planid: planId},
             done: this._pageContextLoaded.bind(this),
             fail: notification.exception
index 6c4376a..f61c0f9 100644 (file)
@@ -47,7 +47,6 @@ define(['jquery',
      * Cancel a review request and refresh the view.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method _cancelReviewRequest
      */
     UserCompetencyWorkflow.prototype._cancelReviewRequest = function(data) {
@@ -71,7 +70,6 @@ define(['jquery',
      * Cancel a review request an refresh the view.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method cancelReviewRequest
      */
     UserCompetencyWorkflow.prototype.cancelReviewRequest = function(data) {
@@ -82,7 +80,6 @@ define(['jquery',
      * Cancel a review request handler.
      *
      * @param  {Event} e The event.
-     * @return {Void}
      * @method _cancelReviewRequestHandler
      */
     UserCompetencyWorkflow.prototype._cancelReviewRequestHandler = function(e) {
@@ -95,7 +92,6 @@ define(['jquery',
      * Request a review and refresh the view.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method _requestReview
      */
     UserCompetencyWorkflow.prototype._requestReview = function(data) {
@@ -119,7 +115,6 @@ define(['jquery',
      * Request a review.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method requestReview
      */
     UserCompetencyWorkflow.prototype.requestReview = function(data) {
@@ -130,7 +125,6 @@ define(['jquery',
      * Request a review handler.
      *
      * @param  {Event} e The event.
-     * @return {Void}
      * @method _requestReviewHandler
      */
     UserCompetencyWorkflow.prototype._requestReviewHandler = function(e) {
@@ -143,7 +137,6 @@ define(['jquery',
      * Start a review and refresh the view.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method _startReview
      */
     UserCompetencyWorkflow.prototype._startReview = function(data) {
@@ -167,7 +160,6 @@ define(['jquery',
      * Start a review.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method startReview
      */
     UserCompetencyWorkflow.prototype.startReview = function(data) {
@@ -178,7 +170,6 @@ define(['jquery',
      * Start a review handler.
      *
      * @param  {Event} e The event.
-     * @return {Void}
      * @method _startReviewHandler
      */
     UserCompetencyWorkflow.prototype._startReviewHandler = function(e) {
@@ -191,7 +182,6 @@ define(['jquery',
      * Stop a review and refresh the view.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method _stopReview
      */
     UserCompetencyWorkflow.prototype._stopReview = function(data) {
@@ -215,7 +205,6 @@ define(['jquery',
      * Stop a review.
      *
      * @param  {Object} data The user competency data.
-     * @return {Void}
      * @method stopReview
      */
     UserCompetencyWorkflow.prototype.stopReview = function(data) {
@@ -226,7 +215,6 @@ define(['jquery',
      * Stop a review handler.
      *
      * @param  {Event} e The event.
-     * @return {Void}
      * @method _stopReviewHandler
      */
     UserCompetencyWorkflow.prototype._stopReviewHandler = function(e) {
index 8c9e47e..f1f5cd3 100644 (file)
@@ -165,7 +165,7 @@ define(['jquery',
                 { key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name },
                 { key: 'delete', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Delete evidence X?
@@ -320,7 +320,7 @@ define(['jquery',
                 { key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name },
                 { key: 'confirm', component: 'moodle' },
                 { key: 'cancel', component: 'moodle' }
-            ]).done(function (strings) {
+            ]).done(function(strings) {
                 notification.confirm(
                     strings[0], // Confirm.
                     strings[1], // Send all competencies in review for X?
index dfd24fd..e776a1a 100644 (file)
@@ -40,14 +40,18 @@ class course_module_summary_exporter extends \core_competency\external\exporter
     }
 
     protected function get_other_values(renderer_base $output) {
-        $context = $this->related['cm']->context;
+        $cm = $this->related['cm'];
+        $context = $cm->context;
 
-        return array(
-            'id' => $this->related['cm']->id,
-            'name' => external_format_string($this->related['cm']->name, $context->id),
-            'url' => $this->related['cm']->url->out(),
-            'iconurl' => $this->related['cm']->get_icon_url()->out()
+        $values = array(
+            'id' => $cm->id,
+            'name' => external_format_string($cm->name, $context->id),
+            'iconurl' => $cm->get_icon_url()->out()
         );
+        if ($cm->url) {
+            $values['url'] = $cm->url->out();
+        }
+        return $values;
     }
 
 
@@ -60,7 +64,8 @@ class course_module_summary_exporter extends \core_competency\external\exporter
                 'type' => PARAM_TEXT
             ),
             'url' => array(
-                'type' => PARAM_URL
+                'type' => PARAM_URL,
+                'optional' => true,
             ),
             'iconurl' => array(
                 'type' => PARAM_URL
index b2e894d..870104e 100644 (file)
@@ -44,7 +44,7 @@ function tool_lp_extend_navigation_course($navigation, $course, $coursecontext)
                                             navigation_node::TYPE_SETTING,
                                             null,
                                             null,
-                                            new pix_icon('competency', '', 'tool_lp'));
+                                            new pix_icon('i/competencies', ''));
     if (isset($settingsnode)) {
         $navigation->add_node($settingsnode);
     }
@@ -129,7 +129,7 @@ function tool_lp_extend_navigation_category_settings($navigation, $coursecategor
                                                 navigation_node::TYPE_SETTING,
                                                 null,
                                                 null,
-                                                new pix_icon('competency', '', 'tool_lp'));
+                                                new pix_icon('i/competencies', ''));
         if (isset($settingsnode)) {
             $navigation->add_node($settingsnode);
         }
@@ -144,7 +144,7 @@ function tool_lp_extend_navigation_category_settings($navigation, $coursecategor
                                                 navigation_node::TYPE_SETTING,
                                                 null,
                                                 null,
-                                                new pix_icon('competency', '', 'tool_lp'));
+                                                new pix_icon('i/competencies', ''));
         if (isset($settingsnode)) {
             $navigation->add_node($settingsnode);
         }
diff --git a/admin/tool/lp/pix/competency.png b/admin/tool/lp/pix/competency.png
deleted file mode 100644 (file)
index 52fe956..0000000
Binary files a/admin/tool/lp/pix/competency.png and /dev/null differ
diff --git a/admin/tool/lp/pix/competency.svg b/admin/tool/lp/pix/competency.svg
deleted file mode 100644 (file)
index e5f670e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="32"
-   height="32"
-   id="svg2"
-   version="1.1"
-   inkscape:version="0.48.4 r9939"
-   sodipodi:docname="New document 1" preserveAspectRatio="xMinYMid meet">
-  <defs
-     id="defs4" />
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="5.6"
-     inkscape:cx="32.609372"
-     inkscape:cy="35.818362"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     showgrid="false"
-     width="33px"
-     inkscape:window-width="1916"
-     inkscape:window-height="981"
-     inkscape:window-x="0"
-     inkscape:window-y="72"
-     inkscape:window-maximized="0" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Layer 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(0,-1020.3622)">
-    <g
-       id="g3050"
-       transform="matrix(0.92121849,0,0,0.92121849,-35.507391,91.120599)">
-      <path
-         style="fill:#fafafa"
-         d="m 38.892857,1026.2908 0,-17 17,0 17,0 0,17 0,17 -17,0 -17,0 0,-17 z"
-         id="path3056"
-         inkscape:connector-curvature="0" />
-      <path
-         style="fill:#989898"
-         d="m 40.954049,1037.3439 c -3.465234,-3.0054 -1.687876,-4.0531 6.875853,-4.0531 6.919599,0 7.985143,0.2502 9.263277,2.1752 0.947236,1.4266 2.021632,1.9536 3.121972,1.5314 1.37559,-0.5279 1.677706,-2.0754 1.677706,-8.5934 0,-4.3723 0.273145,-8.6614 0.606989,-9.5314 0.509481,-1.3277 -0.303204,-1.5818 -5.059017,-1.5818 -3.522693,0 -5.432219,-0.3783 -5.047972,-1 1.028329,-1.6639 14.737848,-1.2221 17.277494,0.5567 3.593622,2.5171 2.823056,4.4433 -1.777494,4.4433 l -4,0 0,7.345 c 0,9.8743 -0.892111,10.655 -12.175731,10.655 -7.005509,0 -8.916904,-0.3458 -10.763077,-1.9469 z m 3.938808,-10.6589 c 0,-2.9538 0.324365,-3.3942 2.5,-3.3942 2.153991,0 2.499902,0.4498 2.499294,3.25 -6e-4,2.7611 -0.376693,3.2717 -2.5,3.3942 -2.203157,0.1271 -2.499294,-0.2579 -2.499294,-3.25 z m 7.428571,-1.3942 c 0,-1.6931 0.666667,-2 4.344732,-2 5.000845,0 4.927087,1.9191 -0.08232,2.1419 -3.011559,0.1339 -2.966069,0.1822 0.809017,0.8581 l 4,0.7162 -4.535714,0.1419 c -3.91635,0.1225 -4.535715,-0.1312 -4.535715,-1.8581 z m -6.761904,-3.6667 c -1.167788,-1.1678 -0.718106,-4.0457 0.833333,-5.3333 1.846181,-1.5322 4.5,0.2461 4.5,3.0155 0,2.2918 -3.735778,3.9154 -5.333333,2.3178 z m 6.833333,-0.3333 c 0.339919,-0.55 2.139919,-1 4,-1 1.860081,0 3.660081,0.45 4,1 0.377944,0.6115 -1.175955,1 -4,1 -2.824045,0 -4.377944,-0.3885 -4,-1 z"
-         id="path3054"
-         inkscape:connector-curvature="0" />
-      <path
-         style="fill:#5e5e5e"
-         d="m 40.892857,1036.2908 c -1.027328,-1.9196 -0.76049,-2 6.636076,-2 5.863885,0 8.157677,0.4084 9.593719,1.708 1.429812,1.2939 2.297278,1.4506 3.578741,0.6463 1.318167,-0.8273 1.801811,-3.0713 2.191464,-10.1678 l 0.5,-9.1062 -5.5,-0.351 c -4.40263,-0.2811 -3.893849,-0.3889 2.55,-0.5402 5.16365,-0.1213 8.480263,0.2412 9.25,1.0109 2.011735,2.0117 1.364232,2.8 -2.3,2.8 l -3.5,0 0,7.0657 c 0,10.7479 -0.204518,10.9343 -12,10.9343 -8.906177,0 -10.039956,-0.2061 -11,-2 z m 5.078947,-9.0357 c -0.06465,-2.8954 0.283272,-3.5357 1.921053,-3.5357 1.608782,0 2,0.6666 2,3.4081 0,2.8111 -0.245749,3.2042 -1.402754,2.244 -1.077175,-0.894 -1.523051,-0.8644 -1.921053,0.1276 -0.285064,0.7104 -0.553825,-0.2994 -0.597246,-2.244 z m 8.682712,-0.6716 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-3 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-2 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m -9.205886,-1.2025 c -0.810187,-1.3109 0.447721,-4.0902 1.851216,-4.0902 1.828446,0 3.499178,2.081 2.907877,3.6219 -0.592966,1.5452 -3.892838,1.87 -4.759093,0.4683 z"
-         id="path3052"
-         inkscape:connector-curvature="0" />
-    </g>
-  </g>
-</svg>
index 39d4e6e..9f13f6a 100644 (file)
 
 .tool-lp-menu li {
     float: left;
-    display: inline;
     position: relative;
     list-style-type: none;
     white-space: nowrap;
diff --git a/admin/tool/lp/upgrade.txt b/admin/tool/lp/upgrade.txt
new file mode 100644 (file)
index 0000000..4e41971
--- /dev/null
@@ -0,0 +1,10 @@
+This files describes changes in /admin/tool/lp/* - plugins,
+information provided here is intended especially for developers.
+
+=== 3.2 ===
+
+* The icon 'competency.png/svg' has been removed, please use i/competencies instead.
+
+=== 3.1.1 ===
+
+* The plugin icon 'competency.png/svg' will be removed in the future use i/competencies instead.
index 4d1c10c..8d04d45 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index 6b4ce5c..0cc6b41 100644 (file)
@@ -121,7 +121,7 @@ echo $OUTPUT->box_end();
 
 /// Rebuild course cache which might be incorrect now
 echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
-rebuild_course_cache();
+rebuild_course_cache(0, true);
 echo $OUTPUT->notification('...finished', 'notifysuccess');
 
 echo $OUTPUT->continue_button(new moodle_url('/admin/'));
index 774d4ee..d49d1dc 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 admin_externalpage_setup('toolphpunit');
index 482d39e..47a2b42 100644 (file)
@@ -24,7 +24,7 @@
 
 define('NO_OUTPUT_BUFFERING', true);
 
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 $testpath  = optional_param('testpath', '', PARAM_PATH);
index 32adc0d..63d4986 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
 
index 04c216e..9e81f97 100644 (file)
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
-require_once(dirname(__FILE__) . '/import_form.php');
+require_once(__DIR__ . '/import_form.php');
 
 admin_externalpage_setup('toolprofiling');
 
index e602e44..7a6c455 100644 (file)
@@ -26,7 +26,7 @@
 
 // TODO: it is wrong when core lib references ANY plugin lang strings, maybe more login could be moved here (skodak)
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
 
index c509b27..42a3f5a 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir . '/tablelib.php');
 
 $contextid = required_param('contextid', PARAM_INT);
index ed6e53c..9af5359 100644 (file)
@@ -22,7 +22,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index 55ae25d..503f280 100644 (file)
Binary files a/admin/tool/templatelibrary/amd/build/display.min.js and b/admin/tool/templatelibrary/amd/build/display.min.js differ
index 05507ee..66b3fbc 100644 (file)
@@ -120,14 +120,14 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
 
         var promises = ajax.call([{
             methodname: 'core_output_load_template',
-            args:{
+            args: {
                     component: component,
                     template: name,
                     themename: config.theme
             }
         }, {
             methodname: 'tool_templatelibrary_load_canonical_template',
-            args:{
+            args: {
                     component: component,
                     template: name
             }
@@ -136,13 +136,16 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
         // When returns a new promise that is resolved when all the passed in promises are resolved.
         // The arguments to the done become the values of each resolved promise.
         $.when.apply($, promises)
-            .done( function(source, originalSource) { templateLoaded(templateName, source, originalSource); })
+            .done(function(source, originalSource) {
+              templateLoaded(templateName, source, originalSource);
+            })
             .fail(notification.exception);
     };
 
     // Add the event listeners.
-    $('[data-region="list-templates"]').on('click', '[data-templatename]', function() {
+    $('[data-region="list-templates"]').on('click', '[data-templatename]', function(e) {
         var templatename = $(this).data('templatename');
+        e.preventDefault();
         loadTemplate(templatename);
     });
 
index 2c9d828..2fabeb2 100644 (file)
@@ -28,11 +28,11 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
      * The ajax call has returned with a new list of templates.
      *
      * @method reloadListTemplate
-     * @param String[] templates List of template ids.
+     * @param {String[]} templateList List of template ids.
      */
     var reloadListTemplate = function(templateList) {
         templates.render('tool_templatelibrary/search_results', { templates: templateList })
-            .done(function (result, js) {
+            .done(function(result, js) {
                 templates.replaceNode($('[data-region="searchresults"]'), result, js);
             }).fail(notification.exception);
     };
@@ -63,8 +63,8 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
      * the function will only be executed once.
      *
      * @method queueRefresh
-     * @param function callback
-     * @param int delay The time in milliseconds to delay.
+     * @param {function} callback
+     * @param {Number} delay The time in milliseconds to delay.
      */
     var queueRefresh = function(callback, delay) {
         if (throttle !== null) {
index f010f72..8248e27 100644 (file)
@@ -24,7 +24,7 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 $action = optional_param('action', '', PARAM_ALPHANUMEXT);
index 8fffd02..20f3ab7 100644 (file)
@@ -83,7 +83,7 @@ class generate_all_documentation extends XMLDBAction {
             $doc = new DOMDocument();
             $xsl = new XSLTProcessor();
 
-            $doc->load(dirname(__FILE__).'/../generate_documentation/xmldb.xsl');
+            $doc->load(__DIR__.'/../generate_documentation/xmldb.xsl');
             $xsl->importStyleSheet($doc);
 
             $dbdirs = get_db_directories();
index 3066799..9c72441 100644 (file)
@@ -87,7 +87,7 @@ class generate_documentation extends XMLDBAction {
             $doc = new DOMDocument();
             $xsl = new XSLTProcessor();
 
-            $doc->load(dirname(__FILE__).'/xmldb.xsl');
+            $doc->load(__DIR__.'/xmldb.xsl');
             $xsl->importStyleSheet($doc);
 
             $doc->load($path);
index d4223b6..e0559ee 100644 (file)
@@ -27,7 +27,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
index 62a4d29..751a75b 100644 (file)
@@ -24,7 +24,6 @@ if ($data = $action_form->get_data()) {
         case 3: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_delete.php');
         case 4: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_display.php');
         case 5: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_download.php');
-        //case 6: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_enrol.php'); //TODO: MDL-24064
         case 7: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_forcepasswordchange.php');
         case 8: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_cohortadd.php');
     }
diff --git a/admin/user/user_bulk_enrol.php b/admin/user/user_bulk_enrol.php
deleted file mode 100644 (file)
index 21ad105..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-/**
-* script for bulk user multi enrol operations
-*/
-
-die('this needs to be rewritten to use new enrol framework, sorry');  //TODO: MDL-24064
-
-require_once('../../config.php');
-require_once($CFG->libdir.'/adminlib.php');
-$processed = optional_param('processed', '', PARAM_BOOL);
-$sort = optional_param('sort', 'fullname', PARAM_ALPHA); //Sort by full name
-$dir  = optional_param('dir', 'asc', PARAM_ALPHA);       //Order to sort (ASC)
-
-require_login();
-admin_externalpage_setup('userbulk');
-require_capability('moodle/role:assign', context_system::instance()); //TODO: use some enrol cap
-$return = $CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk.php'