Merge branch 'MDL-52708' of https://github.com/ramdesh/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 9 May 2016 07:49:48 +0000 (15:49 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 9 May 2016 07:49:48 +0000 (15:49 +0800)
1082 files changed:
admin/dataformats.php [new file with mode: 0644]
admin/environment.xml
admin/settings/competency.php [new file with mode: 0644]
admin/settings/plugins.php
admin/settings/server.php
admin/settings/top.php
admin/tool/cohortroles/classes/api.php [new file with mode: 0644]
admin/tool/cohortroles/classes/cohort_role_assignment.php [new file with mode: 0644]
admin/tool/cohortroles/classes/form/assign_role_cohort.php [new file with mode: 0644]
admin/tool/cohortroles/classes/output/cohort_role_assignments_table.php [new file with mode: 0644]
admin/tool/cohortroles/classes/output/renderer.php [new file with mode: 0644]
admin/tool/cohortroles/classes/task/cohort_role_sync.php [new file with mode: 0644]
admin/tool/cohortroles/db/install.xml [new file with mode: 0644]
admin/tool/cohortroles/db/tasks.php [new file with mode: 0644]
admin/tool/cohortroles/index.php [new file with mode: 0644]
admin/tool/cohortroles/lang/en/tool_cohortroles.php [new file with mode: 0644]
admin/tool/cohortroles/settings.php [new file with mode: 0644]
admin/tool/cohortroles/templates/cohort-in-list.mustache [new file with mode: 0644]
admin/tool/cohortroles/tests/api_test.php [new file with mode: 0644]
admin/tool/cohortroles/version.php [new file with mode: 0644]
admin/tool/log/store/standard/db/install.xml
admin/tool/log/store/standard/db/upgrade.php
admin/tool/log/store/standard/version.php
admin/tool/lp/amd/build/actionselector.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencies.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competency_outcomes.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competency_plan_navigation.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule_all.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competency_rule_points.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencyactions.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencydialogue.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencypicker.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencypicker_user_plans.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencyruleconfig.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/competencytree.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/course_competency_settings.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/dialogue.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/dragdrop-reorder.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/event_base.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/evidence_delete.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/form-cohort-selector.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/form-user-selector.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/frameworkactions.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/frameworks_datasource.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/grade_dialogue.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/grade_user_competency_inline.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/menubar.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/parentcompetency_form.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/planactions.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/scaleconfig.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/scalevalues.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/templateactions.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/tree.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_course_navigation.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_info.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_plan_popup.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/user_competency_workflow.min.js [new file with mode: 0644]
admin/tool/lp/amd/build/user_evidence_actions.min.js [new file with mode: 0644]
admin/tool/lp/amd/src/actionselector.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencies.js [new file with mode: 0644]
admin/tool/lp/amd/src/competency_outcomes.js [new file with mode: 0644]
admin/tool/lp/amd/src/competency_plan_navigation.js [new file with mode: 0644]
admin/tool/lp/amd/src/competency_rule.js [new file with mode: 0644]
admin/tool/lp/amd/src/competency_rule_all.js [new file with mode: 0644]
admin/tool/lp/amd/src/competency_rule_points.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencyactions.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencydialogue.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencypicker.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencypicker_user_plans.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencyruleconfig.js [new file with mode: 0644]
admin/tool/lp/amd/src/competencytree.js [new file with mode: 0644]
admin/tool/lp/amd/src/course_competency_settings.js [new file with mode: 0644]
admin/tool/lp/amd/src/dialogue.js [new file with mode: 0644]
admin/tool/lp/amd/src/dragdrop-reorder.js [new file with mode: 0644]
admin/tool/lp/amd/src/event_base.js [new file with mode: 0644]
admin/tool/lp/amd/src/evidence_delete.js [new file with mode: 0644]
admin/tool/lp/amd/src/form-cohort-selector.js [new file with mode: 0644]
admin/tool/lp/amd/src/form-user-selector.js [new file with mode: 0644]
admin/tool/lp/amd/src/frameworkactions.js [new file with mode: 0644]
admin/tool/lp/amd/src/frameworks_datasource.js [new file with mode: 0644]
admin/tool/lp/amd/src/grade_dialogue.js [new file with mode: 0644]
admin/tool/lp/amd/src/grade_user_competency_inline.js [new file with mode: 0644]
admin/tool/lp/amd/src/menubar.js [new file with mode: 0644]
admin/tool/lp/amd/src/parentcompetency_form.js [new file with mode: 0644]
admin/tool/lp/amd/src/planactions.js [new file with mode: 0644]
admin/tool/lp/amd/src/scaleconfig.js [new file with mode: 0644]
admin/tool/lp/amd/src/scalevalues.js [new file with mode: 0644]
admin/tool/lp/amd/src/templateactions.js [new file with mode: 0644]
admin/tool/lp/amd/src/tree.js [new file with mode: 0644]
admin/tool/lp/amd/src/user_competency_course_navigation.js [new file with mode: 0644]
admin/tool/lp/amd/src/user_competency_info.js [new file with mode: 0644]
admin/tool/lp/amd/src/user_competency_plan_popup.js [new file with mode: 0644]
admin/tool/lp/amd/src/user_competency_workflow.js [new file with mode: 0644]
admin/tool/lp/amd/src/user_evidence_actions.js [new file with mode: 0644]
admin/tool/lp/classes/course_competencies_form_element.php [new file with mode: 0644]
admin/tool/lp/classes/course_competency_rule_form_element.php [new file with mode: 0644]
admin/tool/lp/classes/course_competency_statistics.php [new file with mode: 0644]
admin/tool/lp/classes/external.php [new file with mode: 0644]
admin/tool/lp/classes/external/cohort_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/competency_path_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/competency_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/course_competency_statistics_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/course_module_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/course_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/path_node_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/template_statistics_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/user_competency_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/user_competency_summary_in_course_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/user_competency_summary_in_plan_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/user_evidence_competency_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/external/user_evidence_summary_exporter.php [new file with mode: 0644]
admin/tool/lp/classes/form/competency.php [new file with mode: 0644]
admin/tool/lp/classes/form/competency_framework.php [new file with mode: 0644]
admin/tool/lp/classes/form/framework_autocomplete.php [new file with mode: 0644]
admin/tool/lp/classes/form/persistent.php [new file with mode: 0644]
admin/tool/lp/classes/form/plan.php [new file with mode: 0644]
admin/tool/lp/classes/form/template.php [new file with mode: 0644]
admin/tool/lp/classes/form/template_cohorts.php [new file with mode: 0644]
admin/tool/lp/classes/form/template_plans.php [new file with mode: 0644]
admin/tool/lp/classes/form/user_evidence.php [new file with mode: 0644]
admin/tool/lp/classes/output/competency_plan_navigation.php [new file with mode: 0644]
admin/tool/lp/classes/output/competency_summary.php [new file with mode: 0644]
admin/tool/lp/classes/output/course_competencies_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/manage_competencies_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/manage_competency_frameworks_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/manage_templates_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/plan_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/plans_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/related_competencies.php [new file with mode: 0644]
admin/tool/lp/classes/output/renderer.php [new file with mode: 0644]
admin/tool/lp/classes/output/template_cohorts_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/template_cohorts_table.php [new file with mode: 0644]
admin/tool/lp/classes/output/template_competencies_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/template_plans_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/template_plans_table.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_competency_course_navigation.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_competency_summary.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_competency_summary_in_course.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_competency_summary_in_plan.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_evidence_list_page.php [new file with mode: 0644]
admin/tool/lp/classes/output/user_evidence_page.php [new file with mode: 0644]
admin/tool/lp/classes/page_helper.php [new file with mode: 0644]
admin/tool/lp/classes/template_statistics.php [new file with mode: 0644]
admin/tool/lp/classes/url_resolver.php [new file with mode: 0644]
admin/tool/lp/competencies.php [new file with mode: 0644]
admin/tool/lp/competencyframeworks.php [new file with mode: 0644]
admin/tool/lp/coursecompetencies.php [new file with mode: 0644]
admin/tool/lp/db/services.php [new file with mode: 0644]
admin/tool/lp/editcompetency.php [new file with mode: 0644]
admin/tool/lp/editcompetencyframework.php [new file with mode: 0644]
admin/tool/lp/editplan.php [new file with mode: 0644]
admin/tool/lp/edittemplate.php [new file with mode: 0644]
admin/tool/lp/lang/en/tool_lp.php [new file with mode: 0644]
admin/tool/lp/learningplans.php [new file with mode: 0644]
admin/tool/lp/lib.php [new file with mode: 0644]
admin/tool/lp/pix/competency.png [new file with mode: 0644]
admin/tool/lp/pix/competency.svg [new file with mode: 0644]
admin/tool/lp/pix/url.png [new file with mode: 0644]
admin/tool/lp/pix/url.svg [new file with mode: 0644]
admin/tool/lp/plan.php [new file with mode: 0644]
admin/tool/lp/plans.php [new file with mode: 0644]
admin/tool/lp/settings.php [new file with mode: 0644]
admin/tool/lp/styles.css [new file with mode: 0644]
admin/tool/lp/template_cohorts.php [new file with mode: 0644]
admin/tool/lp/template_plans.php [new file with mode: 0644]
admin/tool/lp/templatecompetencies.php [new file with mode: 0644]
admin/tool/lp/templates/action_selector.mustache [new file with mode: 0644]
admin/tool/lp/templates/comment_area.mustache [new file with mode: 0644]
admin/tool/lp/templates/competencies_move_tree.mustache [new file with mode: 0644]
admin/tool/lp/templates/competencies_tree.mustache [new file with mode: 0644]
admin/tool/lp/templates/competencies_tree_root.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_grader.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_path.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_picker.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_picker_competencyform.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_picker_user_plans.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_plan_navigation.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_rule_config.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_rule_points.mustache [new file with mode: 0644]
admin/tool/lp/templates/competency_summary.mustache [new file with mode: 0644]
admin/tool/lp/templates/course_competencies_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/course_competency_settings.mustache [new file with mode: 0644]
admin/tool/lp/templates/course_competency_statistics.mustache [new file with mode: 0644]
admin/tool/lp/templates/evidence_summary.mustache [new file with mode: 0644]
admin/tool/lp/templates/form-cohort-selector-suggestion.mustache [new file with mode: 0644]
admin/tool/lp/templates/form-user-selector-suggestion.mustache [new file with mode: 0644]
admin/tool/lp/templates/linked_courses_summary.mustache [new file with mode: 0644]
admin/tool/lp/templates/loading.mustache [new file with mode: 0644]
admin/tool/lp/templates/manage_competencies_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/manage_competency_frameworks_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/manage_templates_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/no_frameworks_warning.mustache [new file with mode: 0644]
admin/tool/lp/templates/plan_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/plans_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/related_competencies.mustache [new file with mode: 0644]
admin/tool/lp/templates/scale_configuration_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/template_competencies_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/template_statistics.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_competency_course_navigation.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_competency_summary.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_competency_summary_in_course.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_competency_summary_in_plan.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_evidence_list_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_evidence_page.mustache [new file with mode: 0644]
admin/tool/lp/templates/user_summary.mustache [new file with mode: 0644]
admin/tool/lp/tests/behat/behat_tool_lp.php [new file with mode: 0644]
admin/tool/lp/tests/behat/behat_tool_lp_data_generators.php [new file with mode: 0644]
admin/tool/lp/tests/behat/framework_crud.feature [new file with mode: 0644]
admin/tool/lp/tests/behat/plan_crud.feature [new file with mode: 0644]
admin/tool/lp/tests/behat/plan_workflow.feature [new file with mode: 0644]
admin/tool/lp/tests/behat/template_crud.feature [new file with mode: 0644]
admin/tool/lp/tests/behat/user_evidence_comp_link.feature [new file with mode: 0644]
admin/tool/lp/tests/behat/user_evidence_crud.feature [new file with mode: 0644]
admin/tool/lp/tests/externallib_test.php [new file with mode: 0644]
admin/tool/lp/user_competency.php [new file with mode: 0644]
admin/tool/lp/user_competency_in_course.php [new file with mode: 0644]
admin/tool/lp/user_competency_in_plan.php [new file with mode: 0644]
admin/tool/lp/user_evidence.php [new file with mode: 0644]
admin/tool/lp/user_evidence_edit.php [new file with mode: 0644]
admin/tool/lp/user_evidence_list.php [new file with mode: 0644]
admin/tool/lp/version.php [new file with mode: 0644]
admin/tool/lp/yui/build/moodle-tool_lp-dragdrop-reorder/moodle-tool_lp-dragdrop-reorder-debug.js [new file with mode: 0644]
admin/tool/lp/yui/build/moodle-tool_lp-dragdrop-reorder/moodle-tool_lp-dragdrop-reorder-min.js [new file with mode: 0644]
admin/tool/lp/yui/build/moodle-tool_lp-dragdrop-reorder/moodle-tool_lp-dragdrop-reorder.js [new file with mode: 0644]
admin/tool/lp/yui/src/dragdrop-reorder/build.json [new file with mode: 0644]
admin/tool/lp/yui/src/dragdrop-reorder/js/dragdropreorder.js [new file with mode: 0644]
admin/tool/lp/yui/src/dragdrop-reorder/meta/dragdrop-reorder.json [new file with mode: 0644]
admin/tool/lpmigrate/classes/form/migrate_framework.php [new file with mode: 0644]
admin/tool/lpmigrate/classes/framework_mapper.php [new file with mode: 0644]
admin/tool/lpmigrate/classes/framework_processor.php [new file with mode: 0644]
admin/tool/lpmigrate/classes/output/migrate_framework_results.php [new file with mode: 0644]
admin/tool/lpmigrate/classes/output/renderer.php [new file with mode: 0644]
admin/tool/lpmigrate/db/access.php [new file with mode: 0644]
admin/tool/lpmigrate/frameworks.php [new file with mode: 0644]
admin/tool/lpmigrate/lang/en/tool_lpmigrate.php [new file with mode: 0644]
admin/tool/lpmigrate/settings.php [new file with mode: 0644]
admin/tool/lpmigrate/templates/migrate_frameworks_results.mustache [new file with mode: 0644]
admin/tool/lpmigrate/tests/processor_test.php [new file with mode: 0644]
admin/tool/lpmigrate/version.php [new file with mode: 0644]
admin/tool/mobile/classes/api.php [new file with mode: 0644]
admin/tool/mobile/classes/external.php [new file with mode: 0644]
admin/tool/mobile/db/services.php [new file with mode: 0644]
admin/tool/mobile/lang/en/tool_mobile.php [new file with mode: 0644]
admin/tool/mobile/tests/externallib_test.php [new file with mode: 0644]
admin/tool/mobile/version.php [new file with mode: 0644]
admin/tool/monitor/classes/notification_task.php
admin/tool/monitor/tests/eventobservers_test.php
admin/tool/recyclebin/tests/course_bin_test.php
admin/tool/uploaduser/index.php
admin/tool/uploaduser/lang/en/tool_uploaduser.php
admin/tool/uploaduser/user_form.php
admin/user/user_bulk_download.php
admin/webservice/documentation.php
admin/webservice/forms.php
admin/webservice/testclient.php
admin/webservice/testclient_forms.php
auth/db/auth.php
auth/db/lang/en/auth_db.php
auth/db/tests/db_test.php
auth/db/upgrade.txt
auth/ldap/lang/en/auth_ldap.php
auth/ldap/tests/plugin_test.php
auth/lti/auth.php [new file with mode: 0644]
auth/lti/lang/en/auth_lti.php [new file with mode: 0644]
auth/lti/version.php [new file with mode: 0644]
auth/shibboleth/logout.php
availability/condition/grade/tests/behat/availability_grade.feature
backup/moodle2/backup_activity_task.class.php
backup/moodle2/backup_course_task.class.php
backup/moodle2/backup_root_task.class.php
backup/moodle2/backup_settingslib.php
backup/moodle2/backup_stepslib.php
backup/moodle2/backup_tool_plugin.class.php [new file with mode: 0644]
backup/moodle2/restore_activity_task.class.php
backup/moodle2/restore_course_task.class.php
backup/moodle2/restore_root_task.class.php
backup/moodle2/restore_settingslib.php
backup/moodle2/restore_stepslib.php
backup/moodle2/restore_tool_plugin.class.php [new file with mode: 0644]
badges/lib.php
blocks/activity_modules/tests/behat/block_activity_modules.feature
blocks/badges/tests/behat/block_badges.feature [new file with mode: 0644]
blocks/badges/tests/behat/block_badges_course.feature [new file with mode: 0644]
blocks/badges/tests/behat/block_badges_dashboard.feature [new file with mode: 0644]
blocks/badges/tests/behat/block_badges_frontpage.feature [new file with mode: 0644]
blocks/badges/tests/fixtures/badge.png [new file with mode: 0644]
blocks/blog_menu/tests/behat/block_blog_menu_activity.feature [new file with mode: 0644]
blocks/course_overview/renderer.php
blocks/feedback/block_feedback.php
blocks/feedback/db/install.php
blocks/feedback/lang/en/block_feedback.php
blocks/lp/block_lp.php [new file with mode: 0644]
blocks/lp/classes/output/competencies_to_review_page.php [new file with mode: 0644]
blocks/lp/classes/output/plans_to_review_page.php [new file with mode: 0644]
blocks/lp/classes/output/renderer.php [new file with mode: 0644]
blocks/lp/classes/output/summary.php [new file with mode: 0644]
blocks/lp/competencies_to_review.php [new file with mode: 0644]
blocks/lp/db/access.php [new file with mode: 0644]
blocks/lp/lang/en/block_lp.php [new file with mode: 0644]
blocks/lp/plans_to_review.php [new file with mode: 0644]
blocks/lp/styles.css [new file with mode: 0644]
blocks/lp/templates/competencies_to_review_page.mustache [new file with mode: 0644]
blocks/lp/templates/plans_to_review_page.mustache [new file with mode: 0644]
blocks/lp/templates/summary.mustache [new file with mode: 0644]
blocks/lp/version.php [new file with mode: 0644]
blocks/navigation/styles.css
blog/edit.php
blog/index.php
cache/stores/memcached/addinstanceform.php
cache/stores/memcached/lang/en/cachestore_memcached.php
cache/stores/memcached/lib.php
cache/stores/memcached/tests/memcached_test.php
calendar/view.php
cohort/classes/output/cohortidnumber.php
cohort/classes/output/cohortname.php
cohort/lib.php
comment/lib.php
competency/classes/api.php [new file with mode: 0644]
competency/classes/competency.php [new file with mode: 0644]
competency/classes/competency_framework.php [new file with mode: 0644]
competency/classes/competency_rule.php [new file with mode: 0644]
competency/classes/competency_rule_all.php [new file with mode: 0644]
competency/classes/competency_rule_points.php [new file with mode: 0644]
competency/classes/course_competency.php [new file with mode: 0644]
competency/classes/course_competency_settings.php [new file with mode: 0644]
competency/classes/course_module_competency.php [new file with mode: 0644]
competency/classes/evidence.php [new file with mode: 0644]
competency/classes/external.php [new file with mode: 0644]
competency/classes/external/comment_area_exporter.php [new file with mode: 0644]
competency/classes/external/competency_exporter.php [new file with mode: 0644]
competency/classes/external/competency_framework_exporter.php [new file with mode: 0644]
competency/classes/external/course_competency_exporter.php [new file with mode: 0644]
competency/classes/external/course_competency_settings_exporter.php [new file with mode: 0644]
competency/classes/external/course_module_competency_exporter.php [new file with mode: 0644]
competency/classes/external/evidence_exporter.php [new file with mode: 0644]
competency/classes/external/exporter.php [new file with mode: 0644]
competency/classes/external/persistent_exporter.php [new file with mode: 0644]
competency/classes/external/plan_competency_exporter.php [new file with mode: 0644]
competency/classes/external/plan_exporter.php [new file with mode: 0644]
competency/classes/external/related_competency_exporter.php [new file with mode: 0644]
competency/classes/external/stored_file_exporter.php [new file with mode: 0644]
competency/classes/external/template_competency_exporter.php [new file with mode: 0644]
competency/classes/external/template_exporter.php [new file with mode: 0644]
competency/classes/external/user_competency_course_exporter.php [new file with mode: 0644]
competency/classes/external/user_competency_exporter.php [new file with mode: 0644]
competency/classes/external/user_competency_plan_exporter.php [new file with mode: 0644]
competency/classes/external/user_evidence_competency_exporter.php [new file with mode: 0644]
competency/classes/external/user_evidence_exporter.php [new file with mode: 0644]
competency/classes/external/user_summary_exporter.php [new file with mode: 0644]
competency/classes/invalid_persistent_exception.php [new file with mode: 0644]
competency/classes/persistent.php [new file with mode: 0644]
competency/classes/plan.php [new file with mode: 0644]
competency/classes/plan_competency.php [new file with mode: 0644]
competency/classes/related_competency.php [new file with mode: 0644]
competency/classes/template.php [new file with mode: 0644]
competency/classes/template_cohort.php [new file with mode: 0644]
competency/classes/template_competency.php [new file with mode: 0644]
competency/classes/url.php [new file with mode: 0644]
competency/classes/user_competency.php [new file with mode: 0644]
competency/classes/user_competency_course.php [new file with mode: 0644]
competency/classes/user_competency_plan.php [new file with mode: 0644]
competency/classes/user_evidence.php [new file with mode: 0644]
competency/classes/user_evidence_competency.php [new file with mode: 0644]
competency/lib.php [new file with mode: 0644]
competency/tests/api_test.php [new file with mode: 0644]
competency/tests/competency_rule_test.php [new file with mode: 0644]
competency/tests/competency_test.php [new file with mode: 0644]
competency/tests/course_competency_settings_test.php [new file with mode: 0644]
competency/tests/course_competency_test.php [new file with mode: 0644]
competency/tests/event_test.php [new file with mode: 0644]
competency/tests/exporter_test.php [new file with mode: 0644]
competency/tests/external_test.php [new file with mode: 0644]
competency/tests/generator/lib.php [new file with mode: 0644]
competency/tests/generator_test.php [new file with mode: 0644]
competency/tests/hooks_test.php [new file with mode: 0644]
competency/tests/lib_test.php [new file with mode: 0644]
competency/tests/persistent_test.php [new file with mode: 0644]
competency/tests/plan_test.php [new file with mode: 0644]
competency/tests/task_test.php [new file with mode: 0644]
competency/tests/template_test.php [new file with mode: 0644]
competency/tests/user_evidence_competency_test.php [new file with mode: 0644]
completion/tests/behat/restrict_activity_by_grade.feature
completion/tests/behat/restrict_section_availability.feature
composer.json
composer.lock
config-dist.php
course/classes/output/course_module_name.php
course/edit.php
course/externallib.php
course/format/lib.php
course/format/singleactivity/lib.php
course/lib.php
course/modlib.php
course/moodleform_mod.php
course/pending.php
course/renderer.php
course/reset_form.php
course/tests/courselib_test.php
course/tests/externallib_test.php
course/tests/restore_test.php [new file with mode: 0644]
dataformat/csv/classes/writer.php [new file with mode: 0644]
dataformat/csv/lang/en/dataformat_csv.php [new file with mode: 0644]
dataformat/csv/version.php [new file with mode: 0644]
dataformat/excel/classes/writer.php [new file with mode: 0644]
dataformat/excel/lang/en/dataformat_excel.php [new file with mode: 0644]
dataformat/excel/version.php [new file with mode: 0644]
dataformat/html/classes/writer.php [new file with mode: 0644]
dataformat/html/lang/en/dataformat_html.php [new file with mode: 0644]
dataformat/html/version.php [new file with mode: 0644]
dataformat/json/classes/writer.php [new file with mode: 0644]
dataformat/json/lang/en/dataformat_json.php [new file with mode: 0644]
dataformat/json/version.php [new file with mode: 0644]
dataformat/ods/classes/writer.php [new file with mode: 0644]
dataformat/ods/lang/en/dataformat_ods.php [new file with mode: 0644]
dataformat/ods/version.php [new file with mode: 0644]
dataformat/upgrade.txt [new file with mode: 0644]
enrol/editinstance.php
enrol/editinstance_form.php
enrol/externallib.php
enrol/guest/db/services.php
enrol/guest/version.php
enrol/lti/backup/moodle2/backup_enrol_lti_plugin.class.php [new file with mode: 0644]
enrol/lti/backup/moodle2/restore_enrol_lti_plugin.class.php [new file with mode: 0644]
enrol/lti/classes/helper.php [new file with mode: 0644]
enrol/lti/classes/manage_table.php [new file with mode: 0644]
enrol/lti/classes/task/sync_grades.php [new file with mode: 0644]
enrol/lti/classes/task/sync_members.php [new file with mode: 0644]
enrol/lti/db/access.php [new file with mode: 0644]
enrol/lti/db/install.xml [new file with mode: 0644]
enrol/lti/db/tasks.php [new file with mode: 0644]
enrol/lti/ims-blti/LICENSE.txt [new file with mode: 0644]
enrol/lti/ims-blti/OAuth.php [new file with mode: 0644]
enrol/lti/ims-blti/OAuthBody.php [new file with mode: 0644]
enrol/lti/ims-blti/TrivialOAuthDataStore.php [new file with mode: 0644]
enrol/lti/ims-blti/blti.php [new file with mode: 0644]
enrol/lti/ims-blti/blti_util.php [new file with mode: 0644]
enrol/lti/ims-blti/moodle_readme.txt [new file with mode: 0644]
enrol/lti/index.php [new file with mode: 0644]
enrol/lti/lang/en/enrol_lti.php [new file with mode: 0644]
enrol/lti/lib.php [new file with mode: 0644]
enrol/lti/settings.php [new file with mode: 0644]
enrol/lti/tests/behat/basic_settings.feature [new file with mode: 0644]
enrol/lti/tests/behat/index_page.feature [new file with mode: 0644]
enrol/lti/tests/helper_test.php [new file with mode: 0644]
enrol/lti/thirdpartylibs.xml [new file with mode: 0644]
enrol/lti/tool.php [new file with mode: 0644]
enrol/lti/version.php [new file with mode: 0644]
enrol/manual/db/services.php
enrol/manual/externallib.php
enrol/manual/yui/quickenrolment/assets/skins/sam/quickenrolment.css
enrol/manual/yui/quickenrolment/quickenrolment.js
enrol/self/db/services.php
enrol/self/version.php
enrol/tests/enrollib_test.php
files/externallib.php
files/tests/externallib_test.php
grade/externallib.php [deleted file]
grade/grading/form/guide/amd/build/comment_chooser.min.js
grade/grading/form/guide/amd/src/comment_chooser.js
grade/grading/form/guide/renderer.php
grade/grading/form/guide/tests/behat/edit_guide.feature
grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php
grade/grading/form/rubric/tests/behat/edit_rubric.feature
grade/grading/tests/behat/behat_grading.php
grade/report/singleview/tests/behat/bulk_insert_grades.feature
grade/report/user/db/services.php
grade/report/user/version.php
grade/tests/behat/grade_scales.feature
grade/tests/behat/grade_single_item_scales.feature
group/externallib.php
install/lang/br/langconfig.php [new file with mode: 0644]
install/lang/ca/install.php
install/lang/cs/install.php
install/lang/es_mx/install.php
install/lang/fr/admin.php
lang/en/admin.php
lang/en/auth.php
lang/en/backup.php
lang/en/cache.php
lang/en/cohort.php
lang/en/competency.php [new file with mode: 0644]
lang/en/deprecated.txt
lang/en/error.php
lang/en/grades.php
lang/en/group.php
lang/en/moodle.php
lang/en/plugin.php
lang/en/role.php
lang/en/search.php
lang/en/table.php
lang/en/tag.php
lib/adminlib.php
lib/ajax/service.php
lib/amd/build/form-autocomplete.min.js
lib/amd/build/form-course-selector.min.js
lib/amd/build/tag.min.js
lib/amd/build/templates.min.js
lib/amd/build/tooltip.min.js [new file with mode: 0644]
lib/amd/build/tree.min.js
lib/amd/src/form-autocomplete.js
lib/amd/src/form-course-selector.js
lib/amd/src/tag.js
lib/amd/src/templates.js
lib/amd/src/tooltip.js [new file with mode: 0644]
lib/amd/src/tree.js
lib/behat/behat_base.php
lib/behat/classes/util.php
lib/behat/lib.php
lib/blocklib.php
lib/classes/component.php
lib/classes/dataformat/base.php [new file with mode: 0644]
lib/classes/dataformat/spout_base.php [new file with mode: 0644]
lib/classes/date.php
lib/classes/event/competency_comment_created.php [new file with mode: 0644]
lib/classes/event/competency_comment_deleted.php [new file with mode: 0644]
lib/classes/event/competency_created.php [new file with mode: 0644]
lib/classes/event/competency_deleted.php [new file with mode: 0644]
lib/classes/event/competency_evidence_created.php [new file with mode: 0644]
lib/classes/event/competency_framework_created.php [new file with mode: 0644]
lib/classes/event/competency_framework_deleted.php [new file with mode: 0644]
lib/classes/event/competency_framework_updated.php [new file with mode: 0644]
lib/classes/event/competency_framework_viewed.php [new file with mode: 0644]
lib/classes/event/competency_plan_approved.php [new file with mode: 0644]
lib/classes/event/competency_plan_completed.php [new file with mode: 0644]
lib/classes/event/competency_plan_created.php [new file with mode: 0644]
lib/classes/event/competency_plan_deleted.php [new file with mode: 0644]
lib/classes/event/competency_plan_reopened.php [new file with mode: 0644]
lib/classes/event/competency_plan_review_request_cancelled.php [new file with mode: 0644]
lib/classes/event/competency_plan_review_requested.php [new file with mode: 0644]
lib/classes/event/competency_plan_review_started.php [new file with mode: 0644]
lib/classes/event/competency_plan_review_stopped.php [new file with mode: 0644]
lib/classes/event/competency_plan_unapproved.php [new file with mode: 0644]
lib/classes/event/competency_plan_unlinked.php [new file with mode: 0644]
lib/classes/event/competency_plan_updated.php [new file with mode: 0644]
lib/classes/event/competency_plan_viewed.php [new file with mode: 0644]
lib/classes/event/competency_template_created.php [new file with mode: 0644]
lib/classes/event/competency_template_deleted.php [new file with mode: 0644]
lib/classes/event/competency_template_updated.php [new file with mode: 0644]
lib/classes/event/competency_template_viewed.php [new file with mode: 0644]
lib/classes/event/competency_updated.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_plan_viewed.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_rated.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_rated_in_course.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_rated_in_plan.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_review_request_cancelled.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_review_requested.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_review_started.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_review_stopped.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_viewed.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_viewed_in_course.php [new file with mode: 0644]
lib/classes/event/competency_user_competency_viewed_in_plan.php [new file with mode: 0644]
lib/classes/event/competency_user_evidence_created.php [new file with mode: 0644]
lib/classes/event/competency_user_evidence_deleted.php [new file with mode: 0644]
lib/classes/event/competency_user_evidence_updated.php [new file with mode: 0644]
lib/classes/event/competency_viewed.php [new file with mode: 0644]
lib/classes/plugin_manager.php
lib/classes/plugininfo/dataformat.php [new file with mode: 0644]
lib/classes/session/manager.php
lib/classes/session/memcached.php
lib/classes/task/complete_plans_task.php [new file with mode: 0644]
lib/classes/task/manager.php
lib/classes/task/sync_plans_from_template_cohorts_task.php [new file with mode: 0644]
lib/classes/update/code_manager.php
lib/classes/user.php
lib/dataformatlib.php [new file with mode: 0644]
lib/db/access.php
lib/db/caches.php
lib/db/events.php
lib/db/install.xml
lib/db/messages.php
lib/db/services.php
lib/db/tag.php
lib/db/tasks.php
lib/db/upgrade.php
lib/deprecatedlib.php
lib/dml/mysqli_native_moodle_database.php
lib/dml/tests/dml_test.php
lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-debug.js
lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js
lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js
lib/editor/atto/plugins/image/yui/src/button/js/button.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/autosave.js
lib/enrollib.php
lib/external/externallib.php
lib/external/tests/external_test.php
lib/externallib.php
lib/filelib.php
lib/filestorage/file_storage.php
lib/form/autocomplete.php
lib/form/course.php
lib/form/tests/behat/modgrade_validation.feature
lib/form/url.js
lib/formslib.php
lib/grade/grade_category.php
lib/grade/grade_scale.php
lib/grade/tests/grade_category_test.php
lib/moodlelib.php
lib/navigationlib.php
lib/outputrenderers.php
lib/outputrequirementslib.php
lib/pagelib.php
lib/phpunit/bootstrap.php
lib/questionlib.php
lib/spout/LICENSE [new file with mode: 0644]
lib/spout/README.md [new file with mode: 0644]
lib/spout/readme_moodle.txt [new file with mode: 0644]
lib/spout/src/Spout/Autoloader/Psr4Autoloader.php [new file with mode: 0644]
lib/spout/src/Spout/Autoloader/autoload.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Escaper/CSV.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Escaper/EscaperInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Escaper/ODS.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Escaper/XLSX.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Exception/EncodingConversionException.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Exception/IOException.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Exception/InvalidArgumentException.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Exception/SpoutException.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Exception/UnsupportedTypeException.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Helper/EncodingHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Helper/FileSystemHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Helper/GlobalFunctionsHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Helper/StringHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Common/Type.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/AbstractReader.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/CSV/Reader.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/CSV/RowIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/CSV/Sheet.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/CSV/SheetIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/IteratorNotRewindableException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/NoSheetsFoundException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/ReaderException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/ReaderNotOpenedException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/SharedStringNotFoundException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Exception/XMLProcessingException.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/IteratorInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ODS/Helper/CellValueFormatter.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ODS/Reader.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ODS/RowIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ODS/Sheet.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ODS/SheetIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ReaderFactory.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/ReaderInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/SheetInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Wrapper/SimpleXMLElement.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Wrapper/XMLInternalErrorsHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/Wrapper/XMLReader.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/CellHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/CellValueFormatter.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SharedStringsCaching/CachingStrategyFactory.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SharedStringsCaching/CachingStrategyInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SharedStringsCaching/FileBasedStrategy.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SharedStringsCaching/InMemoryStrategy.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SharedStringsHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/SheetHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Helper/StyleHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Reader.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/RowIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/Sheet.php [new file with mode: 0644]
lib/spout/src/Spout/Reader/XLSX/SheetIterator.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/AbstractMultiSheetsWriter.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/AbstractWriter.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/CSV/Writer.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Helper/AbstractStyleHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Helper/CellHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Helper/ZipHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Internal/AbstractWorkbook.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Internal/WorkbookInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Internal/WorksheetInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Common/Sheet.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/InvalidColorException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/InvalidSheetNameException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/SheetNotFoundException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/WriterAlreadyOpenedException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/WriterException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Exception/WriterNotOpenedException.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/ODS/Helper/FileSystemHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/ODS/Helper/StyleHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/ODS/Internal/Workbook.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/ODS/Internal/Worksheet.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/ODS/Writer.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Style/Color.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Style/Style.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/Style/StyleBuilder.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/WriterFactory.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/WriterInterface.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Helper/FileSystemHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Helper/SharedStringsHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Helper/StyleHelper.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Internal/Workbook.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Internal/Worksheet.php [new file with mode: 0644]
lib/spout/src/Spout/Writer/XLSX/Writer.php [new file with mode: 0644]
lib/tablelib.php
lib/templates/dataformat_selector.mustache [new file with mode: 0644]
lib/templates/form_autocomplete_selection.mustache
lib/testing/tests/generator_test.php
lib/tests/adhoc_task_test.php
lib/tests/behat/behat_forms.php
lib/tests/behat/behat_general.php
lib/tests/behat/behat_hooks.php
lib/tests/component_test.php
lib/tests/datalib_test.php
lib/tests/date_legacy_test.php
lib/tests/date_test.php
lib/tests/externallib_test.php
lib/tests/fixtures/timezonewindows.xml
lib/tests/fixtures/unoconv-source.docx [new file with mode: 0644]
lib/tests/fixtures/unoconv-source.html [new file with mode: 0644]
lib/tests/scheduled_task_test.php
lib/tests/unoconv_test.php [new file with mode: 0644]
lib/tests/user_test.php
lib/thirdpartylibs.xml
lib/upgrade.txt
lib/upgradelib.php
login/index.php
login/signup_form.php
message/externallib.php
message/output/airnotifier/db/services.php
message/output/airnotifier/message_output_airnotifier.php
message/output/airnotifier/version.php
mod/assign/amd/build/grading_actions.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_form_change_checker.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_navigation.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_navigation_user_info.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_panel.min.js [new file with mode: 0644]
mod/assign/amd/build/grading_review_panel.min.js [new file with mode: 0644]
mod/assign/amd/build/participant_selector.min.js [new file with mode: 0644]
mod/assign/amd/src/grading_actions.js [new file with mode: 0644]
mod/assign/amd/src/grading_form_change_checker.js [new file with mode: 0644]
mod/assign/amd/src/grading_navigation.js [new file with mode: 0644]
mod/assign/amd/src/grading_navigation_user_info.js [new file with mode: 0644]
mod/assign/amd/src/grading_panel.js [new file with mode: 0644]
mod/assign/amd/src/grading_review_panel.js [new file with mode: 0644]
mod/assign/amd/src/participant_selector.js [new file with mode: 0644]
mod/assign/classes/output/grading_app.php [new file with mode: 0644]
mod/assign/db/services.php
mod/assign/externallib.php
mod/assign/feedback/editpdf/classes/document_services.php
mod/assign/feedback/editpdf/classes/event/observer.php [new file with mode: 0644]
mod/assign/feedback/editpdf/classes/renderer.php
mod/assign/feedback/editpdf/classes/task/convert_submissions.php [new file with mode: 0644]
mod/assign/feedback/editpdf/db/events.php [new file with mode: 0644]
mod/assign/feedback/editpdf/db/install.xml
mod/assign/feedback/editpdf/db/tasks.php [new file with mode: 0644]
mod/assign/feedback/editpdf/db/upgrade.php
mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php
mod/assign/feedback/editpdf/locallib.php
mod/assign/feedback/editpdf/styles.css
mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php
mod/assign/feedback/editpdf/tests/behat/group_annotations.feature
mod/assign/feedback/editpdf/version.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/editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/globals.js
mod/assign/feedback/editpdf/yui/src/editor/meta/editor.json
mod/assign/feedback/file/locallib.php
mod/assign/feedback/file/tests/behat/feedback_file.feature [new file with mode: 0644]
mod/assign/feedback/file/tests/fixtures/feedback.txt [new file with mode: 0644]
mod/assign/feedback/file/tests/fixtures/submission.txt [new file with mode: 0644]
mod/assign/feedback/offline/locallib.php
mod/assign/feedbackplugin.php
mod/assign/gradingbatchoperationsform.php
mod/assign/gradingoptionsform.php
mod/assign/gradingtable.php
mod/assign/lang/en/assign.php
mod/assign/lib.php
mod/assign/locallib.php
mod/assign/renderable.php
mod/assign/renderer.php
mod/assign/settings.php
mod/assign/styles.css
mod/assign/templates/attempt_history_chooser.mustache [new file with mode: 0644]
mod/assign/templates/grading_actions.mustache [new file with mode: 0644]
mod/assign/templates/grading_app.mustache [new file with mode: 0644]
mod/assign/templates/grading_navigation.mustache [new file with mode: 0644]
mod/assign/templates/grading_navigation_no_users.mustache [new file with mode: 0644]
mod/assign/templates/grading_navigation_user_info.mustache [new file with mode: 0644]
mod/assign/templates/grading_navigation_user_selector.mustache [new file with mode: 0644]
mod/assign/templates/grading_navigation_user_summary.mustache [new file with mode: 0644]
mod/assign/templates/grading_panel.mustache [new file with mode: 0644]
mod/assign/templates/grading_save_in_progress.mustache [new file with mode: 0644]
mod/assign/templates/list_participant_user_summary.mustache [new file with mode: 0644]
mod/assign/templates/loading.mustache [new file with mode: 0644]
mod/assign/templates/popout_button.mustache [new file with mode: 0644]
mod/assign/templates/review_panel.mustache [new file with mode: 0644]
mod/assign/tests/base_test.php
mod/assign/tests/behat/allow_another_attempt.feature
mod/assign/tests/behat/comment_inline.feature
mod/assign/tests/behat/display_error_message_onbadformat.feature
mod/assign/tests/behat/display_grade.feature
mod/assign/tests/behat/edit_previous_feedback.feature
mod/assign/tests/behat/filter_by_marker.feature
mod/assign/tests/behat/grading_status.feature
mod/assign/tests/behat/grant_extension.feature
mod/assign/tests/behat/group_submission.feature
mod/assign/tests/behat/outcome_grading.feature
mod/assign/tests/behat/prevent_submission_changes.feature
mod/assign/tests/behat/quickgrading.feature
mod/assign/tests/behat/reopen_locked_submission.feature
mod/assign/tests/behat/rescale_grades.feature
mod/assign/tests/behat/steps_blind_marking.feature
mod/assign/tests/behat/submission_comments.feature
mod/assign/tests/behat/submit_without_group.feature
mod/assign/tests/externallib_test.php
mod/assign/tests/locallib_test.php
mod/assign/version.php
mod/data/field/checkbox/field.class.php
mod/data/field/menu/field.class.php
mod/data/field/multimenu/field.class.php
mod/data/field/number/field.class.php
mod/data/field/radiobutton/field.class.php
mod/data/field/text/field.class.php
mod/data/field/textarea/field.class.php
mod/data/tests/behat/required_entries.feature
mod/feedback/README.txt [deleted file]
mod/feedback/TODO.txt [deleted file]
mod/feedback/amd/build/edit.min.js [new file with mode: 0644]
mod/feedback/amd/src/edit.js [new file with mode: 0644]
mod/feedback/analysis.php
mod/feedback/analysis_course.php
mod/feedback/analysis_to_excel.php [deleted file]
mod/feedback/backup/moodle2/backup_feedback_stepslib.php
mod/feedback/backup/moodle2/restore_feedback_stepslib.php
mod/feedback/classes/complete_form.php [new file with mode: 0644]
mod/feedback/classes/completion.php [new file with mode: 0644]
mod/feedback/classes/course_map_form.php
mod/feedback/classes/course_select_form.php [new file with mode: 0644]
mod/feedback/classes/event/course_module_viewed.php
mod/feedback/classes/event/response_deleted.php
mod/feedback/classes/event/response_submitted.php
mod/feedback/classes/output/summary.php [new file with mode: 0644]
mod/feedback/classes/responses_anon_table.php
mod/feedback/classes/responses_table.php
mod/feedback/classes/structure.php [new file with mode: 0644]
mod/feedback/classes/templates_table.php [new file with mode: 0644]
mod/feedback/complete.php
mod/feedback/db/install.php
mod/feedback/db/install.xml
mod/feedback/db/upgrade.php
mod/feedback/db/upgradelib.php [new file with mode: 0644]
mod/feedback/delete_item.php [deleted file]
mod/feedback/delete_item_form.php [deleted file]
mod/feedback/delete_template.php
mod/feedback/delete_template_form.php [deleted file]
mod/feedback/edit.php
mod/feedback/edit_form.php
mod/feedback/edit_item.php
mod/feedback/import.php
mod/feedback/item/captcha/lib.php
mod/feedback/item/feedback_item_class.php
mod/feedback/item/feedback_item_form_class.php
mod/feedback/item/info/info_form.php
mod/feedback/item/info/lib.php
mod/feedback/item/label/lib.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoice/multichoice_form.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/item/multichoicerated/multichoicerated_form.php
mod/feedback/item/numeric/lib.php
mod/feedback/item/textarea/lib.php
mod/feedback/item/textfield/lib.php
mod/feedback/lang/en/deprecated.txt
mod/feedback/lang/en/feedback.php
mod/feedback/lib.php
mod/feedback/print.php
mod/feedback/show_entries.php
mod/feedback/styles.css
mod/feedback/tabs.php
mod/feedback/templates/summary.mustache [new file with mode: 0644]
mod/feedback/tests/behat/anonymous.feature
mod/feedback/tests/behat/behat_mod_feedback.php
mod/feedback/tests/behat/coursemapping.feature
mod/feedback/tests/behat/export_import.feature [new file with mode: 0644]
mod/feedback/tests/behat/groups.feature
mod/feedback/tests/behat/multichoice.feature
mod/feedback/tests/behat/non_anonymous.feature
mod/feedback/tests/behat/question_types.feature
mod/feedback/tests/behat/question_types_non_anon.feature [new file with mode: 0644]
mod/feedback/tests/behat/show_nonrespondents.feature
mod/feedback/tests/behat/templates.feature [new file with mode: 0644]
mod/feedback/tests/events_test.php
mod/feedback/tests/fixtures/testexport.xml [new file with mode: 0644]
mod/feedback/tests/upgradelib_test.php [new file with mode: 0644]
mod/feedback/upgrade.txt
mod/feedback/use_templ.php
mod/feedback/use_templ_form.php
mod/feedback/version.php
mod/feedback/view.php
mod/feedback/yui/dragdrop/dragdrop.js
mod/forum/backup/moodle2/restore_forum_stepslib.php
mod/forum/classes/observer.php
mod/forum/db/services.php
mod/forum/externallib.php
mod/forum/index.php
mod/forum/lang/en/forum.php
mod/forum/lib.php
mod/forum/markposts.php
mod/forum/subscribe.php
mod/forum/subscribe_ajax.php
mod/forum/tests/externallib_test.php
mod/forum/tests/lib_test.php
mod/glossary/view.php
mod/lti/ajax.php
mod/lti/amd/build/cartridge_registration_form.min.js [new file with mode: 0644]
mod/lti/amd/build/events.min.js [new file with mode: 0644]
mod/lti/amd/build/external_registration.min.js [new file with mode: 0644]
mod/lti/amd/build/external_registration_return.min.js [new file with mode: 0644]
mod/lti/amd/build/keys.min.js [new file with mode: 0644]
mod/lti/amd/build/tool_card_controller.min.js [new file with mode: 0644]
mod/lti/amd/build/tool_configure_controller.min.js [new file with mode: 0644]
mod/lti/amd/build/tool_proxy.min.js [new file with mode: 0644]
mod/lti/amd/build/tool_type.min.js [new file with mode: 0644]
mod/lti/amd/src/cartridge_registration_form.js [new file with mode: 0644]
mod/lti/amd/src/events.js [new file with mode: 0644]
mod/lti/amd/src/external_registration.js [new file with mode: 0644]
mod/lti/amd/src/external_registration_return.js [new file with mode: 0644]
mod/lti/amd/src/keys.js [new file with mode: 0644]
mod/lti/amd/src/tool_card_controller.js [new file with mode: 0644]
mod/lti/amd/src/tool_configure_controller.js [new file with mode: 0644]
mod/lti/amd/src/tool_proxy.js [new file with mode: 0644]
mod/lti/amd/src/tool_type.js [new file with mode: 0644]
mod/lti/classes/external.php
mod/lti/classes/output/external_registration_return_page.php [new file with mode: 0644]
mod/lti/classes/output/renderer.php [new file with mode: 0644]
mod/lti/classes/output/tool_configure_page.php [new file with mode: 0644]
mod/lti/classes/plugininfo/ltisource.php
mod/lti/db/install.xml
mod/lti/db/services.php
mod/lti/db/upgrade.php
mod/lti/edit_form.php
mod/lti/externalregistrationreturn.php [new file with mode: 0644]
mod/lti/instructor_edit_tool_type.php
mod/lti/lang/en/lti.php
mod/lti/lib.php
mod/lti/locallib.php
mod/lti/mod_form.js
mod/lti/mod_form.php
mod/lti/service/toolsettings/classes/local/resource/contextsettings.php
mod/lti/service/toolsettings/classes/local/resource/linksettings.php
mod/lti/service/toolsettings/classes/local/resource/systemsettings.php
mod/lti/service/toolsettings/classes/local/service/toolsettings.php
mod/lti/service/toolsettings/version.php
mod/lti/settings.php
mod/lti/source/upgrade.txt [new file with mode: 0644]
mod/lti/styles.css
mod/lti/templates/cartridge_registration_form.mustache [new file with mode: 0644]
mod/lti/templates/external_registration.mustache [new file with mode: 0644]
mod/lti/templates/loader.mustache [new file with mode: 0644]
mod/lti/templates/registration_feedback.mustache [new file with mode: 0644]
mod/lti/templates/tool_card.mustache [new file with mode: 0644]
mod/lti/templates/tool_configure.mustache [new file with mode: 0644]
mod/lti/templates/tool_list.mustache [new file with mode: 0644]
mod/lti/templates/tool_proxy_registration_form.mustache [new file with mode: 0644]
mod/lti/templates/tool_type_capabilities_agree.mustache [new file with mode: 0644]
mod/lti/tests/behat/addtool.feature [new file with mode: 0644]
mod/lti/tests/behat/addtype.feature [new file with mode: 0644]
mod/lti/tests/behat/toolconfigure.feature [new file with mode: 0644]
mod/lti/tests/externallib_test.php
mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml [new file with mode: 0644]
mod/lti/tests/fixtures/tool_provider.html [new file with mode: 0644]
mod/lti/tests/locallib_test.php
mod/lti/toolconfigure.php [new file with mode: 0644]
mod/lti/toolssettings.php
mod/lti/typessettings.php
mod/lti/version.php
mod/quiz/attemptlib.php
mod/quiz/report/statistics/lang/en/quiz_statistics.php
mod/quiz/report/statistics/report.php
mod/quiz/styles.css
mod/resource/mod_form.php
mod/scorm/player.js
mod/scorm/view.js
mod/upgrade.txt
mod/url/mod_form.php
mod/wiki/classes/external.php
mod/wiki/classes/search/collaborative_page.php [new file with mode: 0644]
mod/wiki/db/services.php
mod/wiki/db/tag.php
mod/wiki/lang/en/wiki.php
mod/wiki/locallib.php
mod/wiki/tests/behat/edit_tags.feature
mod/wiki/tests/externallib_test.php
mod/wiki/tests/generator/lib.php
mod/wiki/tests/generator_test.php
mod/wiki/tests/lib_test.php
mod/wiki/tests/search_test.php [new file with mode: 0644]
mod/wiki/version.php
mod/workshop/lang/en/workshop.php
notes/externallib.php
phpunit.xml.dist
pix/t/editinline.png [new file with mode: 0644]
pix/t/editinline.svg [new file with mode: 0644]
question/export_form.php
question/import_form.php
report/competency/amd/build/grading_popup.min.js [new file with mode: 0644]
report/competency/amd/build/user_course_navigation.min.js [new file with mode: 0644]
report/competency/amd/src/grading_popup.js [new file with mode: 0644]
report/competency/amd/src/user_course_navigation.js [new file with mode: 0644]
report/competency/classes/external.php [new file with mode: 0644]
report/competency/classes/output/renderer.php [new file with mode: 0644]
report/competency/classes/output/report.php [new file with mode: 0644]
report/competency/classes/output/user_course_navigation.php [new file with mode: 0644]
report/competency/db/services.php [new file with mode: 0644]
report/competency/index.php [new file with mode: 0644]
report/competency/lang/en/report_competency.php [new file with mode: 0644]
report/competency/lib.php [new file with mode: 0644]
report/competency/styles.css [new file with mode: 0644]
report/competency/templates/report.mustache [new file with mode: 0644]
report/competency/templates/user_competency_summary.mustache [new file with mode: 0644]
report/competency/templates/user_course_navigation.mustache [new file with mode: 0644]
report/competency/version.php [new file with mode: 0644]
report/log/classes/renderer.php
repository/merlot/lib.php
search/classes/document.php
search/classes/engine.php
search/classes/manager.php
search/classes/output/form/search.php
search/classes/output/renderer.php
search/engine/solr/classes/engine.php
search/engine/solr/classes/schema.php
search/engine/solr/lang/en/search_solr.php
search/engine/solr/setup_schema.php
search/engine/solr/tests/engine_test.php
search/engine/solr/tests/fixtures/testable_engine.php [new file with mode: 0644]
search/index.php
search/tests/fixtures/mock_search_area.php
search/tests/fixtures/mock_search_engine.php
search/tests/fixtures/testable_core_search.php
search/tests/generator/lib.php [new file with mode: 0644]
search/tests/manager_test.php
tag/classes/external.php
tag/classes/index_builder.php [new file with mode: 0644]
tag/classes/manage_table.php
tag/classes/tag.php
tag/lib.php
tag/manage.php
tag/tests/behat/edit_tag.feature
tag/tests/behat/standard_tags.feature
tag/tests/external_test.php
tag/tests/taglib_test.php
theme/bootstrapbase/less/moodle/core.less
theme/bootstrapbase/less/moodle/forms.less
theme/bootstrapbase/less/moodle/modules.less
theme/bootstrapbase/less/moodle/undo.less
theme/bootstrapbase/less/moodle/yui_fixes.less [deleted file]
theme/bootstrapbase/pix/mod/quiz/checkmark.png [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/checkmark.svg [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/flag-on.png [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/flag-on.svg [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/warningtriangle.png [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/warningtriangle.svg [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/whitecircle.png [new file with mode: 0644]
theme/bootstrapbase/pix/mod/quiz/whitecircle.svg [new file with mode: 0644]
theme/bootstrapbase/renderers/core_renderer.php
theme/bootstrapbase/style/moodle.css
user/edit_form.php
user/editadvanced_form.php
user/editlib.php
user/externallib.php
user/forum_form.php
user/index.php
user/language.php
user/language_form.php
user/lib.php
user/profile/lib.php
user/tests/behat/name_fields.feature
user/tests/externallib_test.php
user/tests/profilelib_test.php
user/tests/userlib_test.php
version.php
webservice/externallib.php
webservice/lib.php
webservice/renderer.php
webservice/tests/lib_test.php
webservice/upgrade.txt
webservice/upload.php
webservice/wsdoc.php

diff --git a/admin/dataformats.php b/admin/dataformats.php
new file mode 100644 (file)
index 0000000..f531e9b
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Lets users manage data formats
+ *
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU Public License
+ * @copyright  2016 Brendan Heywood (brendan@catalyst-au.net)
+ * @package    core
+ * @subpackage dataformat
+ */
+
+require_once('../config.php');
+require_once($CFG->libdir.'/adminlib.php');
+
+$action = required_param('action', PARAM_ALPHANUMEXT);
+$name   = required_param('name', PARAM_PLUGIN);
+
+$syscontext = context_system::instance();
+$PAGE->set_url('/admin/dataformats.php');
+$PAGE->set_context($syscontext);
+
+require_login();
+require_capability('moodle/site:config', $syscontext);
+require_sesskey();
+
+$return = new moodle_url('/admin/settings.php', array('section' => 'managedataformats'));
+
+$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
+$sortorder = array_flip(array_keys($plugins));
+
+if (!isset($plugins[$name])) {
+    print_error('courseformatnotfound', 'error', $return, $name);
+}
+
+switch ($action) {
+    case 'disable':
+        if ($plugins[$name]->is_enabled()) {
+            set_config('disabled', 1, 'dataformat_'. $name);
+            core_plugin_manager::reset_caches();
+        }
+        break;
+    case 'enable':
+        if (!$plugins[$name]->is_enabled()) {
+            unset_config('disabled', 'dataformat_'. $name);
+            core_plugin_manager::reset_caches();
+        }
+        break;
+    case 'up':
+        if ($sortorder[$name]) {
+            $currentindex = $sortorder[$name];
+            $seq = array_keys($plugins);
+            $seq[$currentindex] = $seq[$currentindex - 1];
+            $seq[$currentindex - 1] = $name;
+            set_config('dataformat_plugins_sortorder', implode(',', $seq));
+        }
+        break;
+    case 'down':
+        if ($sortorder[$name] < count($sortorder) - 1) {
+            $currentindex = $sortorder[$name];
+            $seq = array_keys($plugins);
+            $seq[$currentindex] = $seq[$currentindex + 1];
+            $seq[$currentindex + 1] = $name;
+            set_config('dataformat_plugins_sortorder', implode(',', $seq));
+        }
+        break;
+}
+redirect($return);
+
index 43bc5e4..1fc8ce1 100644 (file)
       </PHP_EXTENSION>
       <PHP_EXTENSION name="xml" level="required">
       </PHP_EXTENSION>
+      <PHP_EXTENSION name="xmlreader" level="required">
+      </PHP_EXTENSION>
       <PHP_EXTENSION name="intl" level="optional">
         <FEEDBACK>
           <ON_CHECK message="intlrecommended" />
diff --git a/admin/settings/competency.php b/admin/settings/competency.php
new file mode 100644 (file)
index 0000000..1fffa73
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * File.
+ *
+ * @package    core_competency
+ * @copyright  2016 Frédéric Massart - FMCorz.net
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+// Save processing when the user will not be able to access anything.
+if (has_capability('moodle/site:config', $systemcontext)) {
+
+    $parentname = 'competencies';
+
+    // Settings page.
+    $settings = new admin_settingpage('competencysettings', new lang_string('competenciessettings', 'core_competency'),
+        'moodle/site:config', false);
+    $ADMIN->add($parentname, $settings);
+
+    // Load the full tree of settings.
+    if ($ADMIN->fulltree) {
+        $setting = new admin_setting_configcheckbox('core_competency/enabled',
+            new lang_string('enablecompetencies', 'core_competency'),
+            new lang_string('enablecompetencies_desc', 'core_competency'), 1);
+        $settings->add($setting);
+
+        $setting = new admin_setting_configcheckbox('core_competency/pushcourseratingstouserplans',
+            new lang_string('pushcourseratingstouserplans', 'core_competency'),
+            new lang_string('pushcourseratingstouserplans_desc', 'core_competency'), 1);
+        $settings->add($setting);
+    }
+
+}
index 1bea1b2..1beaca5 100644 (file)
@@ -187,6 +187,11 @@ if ($hassiteconfig) {
         $plugin->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
     }
 
+    // Data format settings.
+    $ADMIN->add('modules', new admin_category('dataformatsettings', new lang_string('dataformats')));
+    $temp = new admin_settingpage('managedataformats', new lang_string('managedataformats'));
+    $temp->add(new admin_setting_managedataformats());
+    $ADMIN->add('dataformatsettings', $temp);
 
     //== Portfolio settings ==
     require_once($CFG->libdir. '/portfoliolib.php');
index 573ed4b..548031b 100644 (file)
@@ -12,6 +12,7 @@ $temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('patht
 $temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
 $temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
 $temp->add(new admin_setting_configexecutable('pathtogs', new lang_string('pathtogs', 'admin'), new lang_string('pathtogs_help', 'admin'), '/usr/bin/gs'));
+$temp->add(new admin_setting_configexecutable('pathtounoconv', new lang_string('pathtounoconv', 'admin'), new lang_string('pathtounoconv_help', 'admin'), '/usr/bin/unoconv'));
 $ADMIN->add('server', $temp);
 
 
index 4736f06..223af0c 100644 (file)
@@ -30,6 +30,7 @@ if ($hassiteconfig) {
 $ADMIN->add('root', new admin_category('users', new lang_string('users','admin')));
 $ADMIN->add('root', new admin_category('courses', new lang_string('courses','admin')));
 $ADMIN->add('root', new admin_category('grades', new lang_string('grades')));
+$ADMIN->add('root', new admin_category('competencies', new lang_string('competencies', 'core_competency')));
 $ADMIN->add('root', new admin_category('badges', new lang_string('badges'), empty($CFG->enablebadges)));
 $ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
 $ADMIN->add('root', new admin_category('language', new lang_string('language')));
diff --git a/admin/tool/cohortroles/classes/api.php b/admin/tool/cohortroles/classes/api.php
new file mode 100644 (file)
index 0000000..e610e35
--- /dev/null
@@ -0,0 +1,228 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Class exposing the api for the cohortroles tool.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+namespace tool_cohortroles;
+
+use stdClass;
+use context_system;
+use core_competency\invalid_persistent_exception;
+
+/**
+ * Class for doing things with cohort roles.
+ *
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class api {
+
+    /**
+     * Create a cohort role assignment from a record containing all the data for the class.
+     *
+     * Requires moodle/role:manage capability at the system context.
+     *
+     * @param stdClass $record Record containing all the data for an instance of the class.
+     * @return competency
+     */
+    public static function create_cohort_role_assignment(stdClass $record) {
+        $cohortroleassignment = new cohort_role_assignment(0, $record);
+        $context = context_system::instance();
+
+        // First we do a permissions check.
+        require_capability('moodle/role:manage', $context);
+
+        // Validate before we check for existing records.
+        if (!$cohortroleassignment->is_valid()) {
+            throw new invalid_persistent_exception($cohortroleassignment->get_errors());
+        }
+
+        $existing = cohort_role_assignment::get_record((array) $record);
+        if (!empty($existing)) {
+            return false;
+        } else {
+            // OK - all set.
+            $cohortroleassignment->create();
+        }
+        return $cohortroleassignment;
+    }
+
+    /**
+     * Delete a cohort role assignment by id.
+     *
+     * Requires moodle/role:manage capability at the system context.
+     *
+     * @param int $id The record to delete. This will also remove this role from the user for all users in the system.
+     * @return boolean
+     */
+    public static function delete_cohort_role_assignment($id) {
+        $cohortroleassignment = new cohort_role_assignment($id);
+        $context = context_system::instance();
+
+        // First we do a permissions check.
+        require_capability('moodle/role:manage', $context);
+
+        // OK - all set.
+        return $cohortroleassignment->delete();
+    }
+
+    /**
+     * Perform a search based on the provided filters and return a paginated list of records.
+     *
+     * Requires moodle/role:manage capability at the system context.
+     *
+     * @param string $sort The column to sort on
+     * @param string $order ('ASC' or 'DESC')
+     * @param int $skip Number of records to skip (pagination)
+     * @param int $limit Max of records to return (pagination)
+     * @return array of cohort_role_assignment
+     */
+    public static function list_cohort_role_assignments($sort = '', $order = 'ASC', $skip = 0, $limit = 0) {
+        $context = context_system::instance();
+
+        // First we do a permissions check.
+        require_capability('moodle/role:manage', $context);
+
+        // OK - all set.
+        return cohort_role_assignment::get_records(array(), $sort, $order, $skip, $limit);
+    }
+
+    /**
+     * Perform a search based on the provided filters and return a paginated list of records.
+     *
+     * Requires moodle/role:manage capability at system context.
+     *
+     * @return int
+     */
+    public static function count_cohort_role_assignments() {
+        $context = context_system::instance();
+
+        // First we do a permissions check.
+        require_capability('moodle/role:manage', $context);
+
+        // OK - all set.
+        return cohort_role_assignment::count_records();
+    }
+
+    /**
+     * Sync all roles - adding and deleting role assignments as required.
+     *
+     * Slow. Should only be called from a background task.
+     *
+     * Requires moodle/role:manage capability at the system context.
+     *
+     * @return array('rolesadded' => array of (useridassignedto, useridassignedover, roleid),
+     *               'rolesremoved' => array of (useridassignedto, useridassignedover, roleid))
+     */
+    public static function sync_all_cohort_roles() {
+        global $DB;
+
+        $context = context_system::instance();
+
+        // First we do a permissions check.
+        require_capability('moodle/role:manage', $context);
+
+        // Ok ready to go.
+        $rolesadded = array();
+        $rolesremoved = array();
+
+        // Get all cohort role assignments and group them by user and role.
+        $all = cohort_role_assignment::get_records(array(), 'userid, roleid');
+        // We build an better structure to loop on.
+        $info = array();
+        foreach ($all as $cra) {
+            if (!isset($info[$cra->get_userid()])) {
+                $info[$cra->get_userid()] = array();
+            }
+            if (!isset($info[$cra->get_userid()][$cra->get_roleid()])) {
+                $info[$cra->get_userid()][$cra->get_roleid()] = array();
+            }
+            array_push($info[$cra->get_userid()][$cra->get_roleid()], $cra->get_cohortid());
+        }
+        // Then for each user+role combo - find user context in the cohort without a role assigned.
+
+        foreach ($info as $userid => $roles) {
+            foreach ($roles as $roleid => $cohorts) {
+                list($cohortsql, $params) = $DB->get_in_or_equal($cohorts, SQL_PARAMS_NAMED);
+
+                $params['usercontext'] = CONTEXT_USER;
+                $params['roleid'] = $roleid;
+                $params['userid'] = $userid;
+
+                $sql = 'SELECT u.id AS userid, ra.id, ctx.id AS contextid
+                          FROM {user} u
+                          JOIN {cohort_members} cm ON u.id = cm.userid
+                          JOIN {context} ctx ON u.id = ctx.instanceid AND ctx.contextlevel = :usercontext
+                          LEFT JOIN {role_assignments} ra ON ra.contextid = ctx.id
+                           AND ra.roleid = :roleid
+                           AND ra.userid = :userid
+                         WHERE cm.cohortid ' . $cohortsql . '
+                           AND ra.id IS NULL';
+
+                $toadd = $DB->get_records_sql($sql, $params);
+
+                foreach ($toadd as $add) {
+                    role_assign($roleid, $userid, $add->contextid, 'tool_cohortroles');
+                    $rolesadded[] = array(
+                        'useridassignedto' => $userid,
+                        'useridassignedover' => $add->userid,
+                        'roleid' => $roleid
+                    );
+                }
+            }
+        }
+
+        // And for each user+role combo - find user context not in the cohort with a role assigned.
+        // If the role was assigned by this component, unassign the role.
+        foreach ($info as $userid => $roles) {
+            foreach ($roles as $roleid => $cohorts) {
+                // Now we are looking for entries NOT in the cohort.
+                list($cohortsql, $params) = $DB->get_in_or_equal($cohorts, SQL_PARAMS_NAMED);
+
+                $params['usercontext'] = CONTEXT_USER;
+                $params['roleid'] = $roleid;
+                $params['userid'] = $userid;
+                $params['component'] = 'tool_cohortroles';
+
+                $sql = 'SELECT u.id as userid, ra.id, ctx.id AS contextid
+                          FROM {user} u
+                          JOIN {context} ctx ON u.id = ctx.instanceid AND ctx.contextlevel = :usercontext
+                          JOIN {role_assignments} ra ON ra.contextid = ctx.id AND ra.roleid = :roleid AND ra.userid = :userid
+                     LEFT JOIN {cohort_members} cm ON u.id = cm.userid
+                           AND cm.cohortid ' . $cohortsql . '
+                         WHERE ra.component = :component AND cm.cohortid IS NULL';
+
+                $toremove = $DB->get_records_sql($sql, $params);
+                foreach ($toremove as $remove) {
+                    role_unassign($roleid, $userid, $remove->contextid, 'tool_cohortroles');
+                    $rolesremoved[] = array(
+                        'useridassignedto' => $userid,
+                        'useridassignedover' => $remove->userid,
+                        'roleid' => $roleid
+                    );
+                }
+            }
+        }
+
+        return array('rolesadded' => $rolesadded, 'rolesremoved' => $rolesremoved);
+    }
+
+}
diff --git a/admin/tool/cohortroles/classes/cohort_role_assignment.php b/admin/tool/cohortroles/classes/cohort_role_assignment.php
new file mode 100644 (file)
index 0000000..08ac464
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Class for cohort_role_assignment persistence.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+namespace tool_cohortroles;
+
+use lang_string;
+use core_competency\persistent;
+
+/**
+ * Class for loading/storing cohort_role_assignments from the DB.
+ *
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class cohort_role_assignment extends persistent {
+
+    /** Table name for user_competency persistency */
+    const TABLE = 'tool_cohortroles';
+
+    /**
+     * Return the definition of the properties of this model.
+     *
+     * @return array
+     */
+    protected static function define_properties() {
+        return array(
+            'userid' => array(
+                'type' => PARAM_INT,
+            ),
+            'roleid' => array(
+                'type' => PARAM_INT,
+            ),
+            'cohortid' => array(
+                'type' => PARAM_INT,
+            )
+        );
+    }
+
+    /**
+     * Validate the user ID.
+     *
+     * @param int $value The value.
+     * @return true|lang_string
+     */
+    protected function validate_userid($value) {
+        global $DB;
+
+        if (!$DB->record_exists('user', array('id' => $value))) {
+            return new lang_string('invaliduserid', 'error');
+        }
+
+        return true;
+    }
+
+    /**
+     * Validate the role ID.
+     *
+     * @param int $value The value.
+     * @return true|lang_string
+     */
+    protected function validate_roleid($value) {
+        global $DB;
+
+        if (!$DB->record_exists('role', array('id' => $value))) {
+            return new lang_string('invalidroleid', 'error');
+        }
+
+        return true;
+    }
+
+    /**
+     * Validate the cohort ID.
+     *
+     * @param int $value The value.
+     * @return true|lang_string
+     */
+    protected function validate_cohortid($value) {
+        global $DB;
+
+        if (!$DB->record_exists('cohort', array('id' => $value))) {
+            return new lang_string('invalidcohortid', 'error');
+        }
+
+        return true;
+    }
+
+}
diff --git a/admin/tool/cohortroles/classes/form/assign_role_cohort.php b/admin/tool/cohortroles/classes/form/assign_role_cohort.php
new file mode 100644 (file)
index 0000000..7cc59ae
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Assign role to cohort form.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+namespace tool_cohortroles\form;
+defined('MOODLE_INTERNAL') || die();
+
+use moodleform;
+use context_system;
+
+require_once($CFG->libdir . '/formslib.php');
+
+/**
+ * Assign role to cohort form.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class assign_role_cohort extends moodleform {
+
+    /**
+     * Form definition.
+     */
+    public function definition() {
+        global $PAGE;
+
+        $mform = $this->_form;
+        $roles = get_roles_for_contextlevels(CONTEXT_USER);
+
+        if (empty($roles)) {
+            $output = $PAGE->get_renderer('tool_cohortroles');
+            $warning = $output->notify_problem(get_string('noassignableroles', 'tool_cohortroles'));
+            $mform->addElement('html', $warning);
+            return;
+        }
+
+        $options = array(
+            'ajax' => 'tool_lp/form-user-selector',
+            'multiple' => true
+        );
+        $mform->addElement('autocomplete', 'userids', get_string('selectusers', 'tool_cohortroles'), array(), $options);
+        $mform->addRule('userids', null, 'required');
+
+        $names = role_get_names();
+        $options = array();
+        foreach ($roles as $idx => $roleid) {
+            $options[$roleid] = $names[$roleid]->localname;
+        }
+
+        $mform->addElement('select', 'roleid', get_string('selectrole', 'tool_cohortroles'), $options);
+        $mform->addRule('roleid', null, 'required');
+
+        $context = context_system::instance();
+        $options = array(
+            'ajax' => 'tool_lp/form-cohort-selector',
+            'multiple' => true,
+            'data-contextid' => $context->id,
+            'data-includes' => 'all'
+        );
+        $mform->addElement('autocomplete', 'cohortids', get_string('selectcohorts', 'tool_cohortroles'), array(), $options);
+        $mform->addRule('cohortids', null, 'required');
+        $mform->addElement('submit', 'submit', get_string('assign', 'tool_cohortroles'));
+    }
+
+}
diff --git a/admin/tool/cohortroles/classes/output/cohort_role_assignments_table.php b/admin/tool/cohortroles/classes/output/cohort_role_assignments_table.php
new file mode 100644 (file)
index 0000000..08c8c3f
--- /dev/null
@@ -0,0 +1,231 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Cohort role assignments table
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+namespace tool_cohortroles\output;
+defined('MOODLE_INTERNAL') || die();
+
+require_once($CFG->libdir . '/tablelib.php');
+
+use context_helper;
+use context_system;
+use html_writer;
+use moodle_url;
+use table_sql;
+
+/**
+ * Cohort role assignments table.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class cohort_role_assignments_table extends table_sql {
+
+    /**
+     * Sets up the table.
+     *
+     * @param string $uniqueid Unique id of table.
+     * @param moodle_url $url The base URL.
+     */
+    public function __construct($uniqueid, $url) {
+        global $CFG;
+        parent::__construct($uniqueid);
+        $context = context_system::instance();
+
+        $this->context = $context;
+
+        $this->rolenames = role_get_names();
+
+        // This object should not be used without the right permissions.
+        require_capability('moodle/role:manage', $context);
+
+        $this->useridfield = 'userid';
+
+        // Define columns in the table.
+        $this->define_table_columns();
+
+        $this->define_baseurl($url);
+        // Define configs.
+        $this->define_table_configs();
+    }
+
+    /**
+     * Role name column.
+     *
+     * @param array $data Row data.
+     * @return string
+     */
+    protected function col_rolename($data) {
+        return $this->rolenames[$data->roleid]->localname;
+    }
+
+    /**
+     * Cohort name column.
+     *
+     * @param array $data Row data.
+     * @return string
+     */
+    protected function col_cohortname($data) {
+        global $OUTPUT;
+
+        $record = (object) array(
+            'id' => $data->cohortid,
+            'idnumber' => $data->cohortidnumber,
+            'description' => $data->cohortdescription,
+            'visible' => $data->cohortvisible,
+            'name' => $data->cohortname
+        );
+        $context = context_helper::instance_by_id($data->cohortcontextid);
+
+        $exporter = new \tool_lp\external\cohort_summary_exporter($record, array('context' => $context));
+        $cohort = $exporter->export($OUTPUT);
+
+        $html = $OUTPUT->render_from_template('tool_cohortroles/cohort-in-list', $cohort);
+        return $html;
+    }
+
+    /**
+     * Actions column.
+     *
+     * @param array $data Row data.
+     * @return string
+     */
+    protected function col_actions($data) {
+        global $OUTPUT;
+
+        $action = new \confirm_action(get_string('removecohortroleassignmentconfirm', 'tool_cohortroles'));
+        $url = new moodle_url($this->baseurl);
+        $url->params(array('removecohortroleassignment' => $data->id, 'sesskey' => sesskey()));
+        $pix = new \pix_icon('t/delete', get_string('removecohortroleassignment', 'tool_cohortroles'));
+        return $OUTPUT->action_link($url, '', $action, null, $pix);
+    }
+
+    /**
+     * Setup the headers for the table.
+     */
+    protected function define_table_columns() {
+        $extrafields = get_extra_user_fields($this->context);
+
+        // Define headers and columns.
+        $cols = array(
+            'cohortname' => get_string('cohort', 'cohort'),
+            'rolename' => get_string('role'),
+            'fullname' => get_string('name'),
+        );
+
+        // Add headers for extra user fields.
+        foreach ($extrafields as $field) {
+            if (get_string_manager()->string_exists($field, 'moodle')) {
+                $cols[$field] = get_string($field);
+            } else {
+                $cols[$field] = $field;
+            }
+        }
+
+        // Add remaining headers.
+        $cols = array_merge($cols, array('actions' => get_string('actions')));
+
+        $this->define_columns(array_keys($cols));
+        $this->define_headers(array_values($cols));
+    }
+
+    /**
+     * Define table configs.
+     */
+    protected function define_table_configs() {
+        $this->collapsible(false);
+        $this->sortable(true, 'lastname', SORT_ASC);
+        $this->pageable(true);
+        $this->no_sorting('actions');
+    }
+
+    /**
+     * Builds the SQL query.
+     *
+     * @param bool $count When true, return the count SQL.
+     * @return array containing sql to use and an array of params.
+     */
+    protected function get_sql_and_params($count = false) {
+        $fields = 'uca.id, uca.cohortid, uca.userid, uca.roleid, ';
+        $fields .= 'c.name as cohortname, c.idnumber as cohortidnumber, c.contextid as cohortcontextid, ';
+        $fields .= 'c.visible as cohortvisible, c.description as cohortdescription, ';
+
+        // Add extra user fields that we need for the graded user.
+        $extrafields = get_extra_user_fields($this->context);
+        foreach ($extrafields as $field) {
+            $fields .= 'u.' . $field . ', ';
+        }
+        $fields .= get_all_user_name_fields(true, 'u');
+
+        if ($count) {
+            $select = "COUNT(1)";
+        } else {
+            $select = "$fields";
+        }
+
+        $sql = "SELECT $select
+                   FROM {tool_cohortroles} uca
+                   JOIN {user} u ON u.id = uca.userid
+                   JOIN {cohort} c ON c.id = uca.cohortid";
+        $params = array();
+
+        // Add order by if needed.
+        if (!$count && $sqlsort = $this->get_sql_sort()) {
+            $sql .= " ORDER BY " . $sqlsort;
+        }
+
+        return array($sql, $params);
+    }
+
+    /**
+     * Override the default implementation to set a decent heading level.
+     */
+    public function print_nothing_to_display() {
+        global $OUTPUT;
+        echo $this->render_reset_button();
+        $this->print_initials_bar();
+        echo $OUTPUT->heading(get_string('nothingtodisplay'), 4);
+    }
+
+    /**
+     * Query the DB.
+     *
+     * @param int $pagesize size of page for paginated displayed table.
+     * @param bool $useinitialsbar do you want to use the initials bar.
+     */
+    public function query_db($pagesize, $useinitialsbar = true) {
+        global $DB;
+
+        list($countsql, $countparams) = $this->get_sql_and_params(true);
+        list($sql, $params) = $this->get_sql_and_params();
+        $total = $DB->count_records_sql($countsql, $countparams);
+        $this->pagesize($pagesize, $total);
+        $this->rawdata = $DB->get_records_sql($sql, $params, $this->get_page_start(), $this->get_page_size());
+
+        // Set initial bars.
+        if ($useinitialsbar) {
+            $this->initialbars($total > $pagesize);
+        }
+    }
+}
diff --git a/admin/tool/cohortroles/classes/output/renderer.php b/admin/tool/cohortroles/classes/output/renderer.php
new file mode 100644 (file)
index 0000000..561052f
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Renderer class for cohort roles
+ *
+ * @package    tool_cohortroles
+ * @copyright  2016 Issam Taboubi <issam.taboubi@umontreal.ca>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+namespace tool_cohortroles\output;
+
+defined('MOODLE_INTERNAL') || die();
+
+use plugin_renderer_base;
+use renderable;
+
+/**
+ * Renderer class for cohort roles
+ *
+ * @package    tool_cohortroles
+ * @copyright  2016 Issam Taboubi <issam.taboubi@umontreal.ca>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class renderer extends plugin_renderer_base {
+
+    /**
+     * Output a nofication.
+     *
+     * @param string $message the message to print out
+     * @return string HTML fragment.
+     * @see \core\output\notification
+     */
+    public function notify_message($message) {
+        $n = new \core\output\notification($message, \core\output\notification::NOTIFY_INFO);
+        return $this->render($n);
+    }
+
+    /**
+     * Output an error notification.
+     *
+     * @param string $message the message to print out
+     * @return string HTML fragment.
+     * @see \core\output\notification
+     */
+    public function notify_problem($message) {
+        $n = new \core\output\notification($message, \core\output\notification::NOTIFY_ERROR);
+        return $this->render($n);
+    }
+
+    /**
+     * Output a success notification.
+     *
+     * @param string $message the message to print out
+     * @return string HTML fragment.
+     * @see \core\output\notification
+     */
+    public function notify_success($message) {
+        $n = new \core\output\notification($message, \core\output\notification::NOTIFY_SUCCESS);
+        return $this->render($n);
+    }
+}
diff --git a/admin/tool/cohortroles/classes/task/cohort_role_sync.php b/admin/tool/cohortroles/classes/task/cohort_role_sync.php
new file mode 100644 (file)
index 0000000..a3d628c
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Scheduled task for syncing cohort roles.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+namespace tool_cohortroles\task;
+
+use core\task\scheduled_task;
+use tool_cohortroles\api;
+
+/**
+ * Scheduled task for syncing cohort roles.
+ *
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class cohort_role_sync extends scheduled_task {
+
+    /**
+     * Get name.
+     * @return string
+     */
+    public function get_name() {
+        // Shown in admin screens.
+        return get_string('taskname', 'tool_cohortroles');
+    }
+
+    /**
+     * Execute.
+     */
+    public function execute() {
+        mtrace('Sync cohort roles...');
+        $result = api::sync_all_cohort_roles();
+
+        mtrace('Added ' . count($result['rolesadded']));
+        mtrace('Removed ' . count($result['rolesremoved']));
+    }
+}
diff --git a/admin/tool/cohortroles/db/install.xml b/admin/tool/cohortroles/db/install.xml
new file mode 100644 (file)
index 0000000..538ec1f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<XMLDB PATH="admin/tool/cohortroles/db" VERSION="20151201" COMMENT="XMLDB file for Moodle admin/tool/cohortroles"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
+>
+  <TABLES>
+    <TABLE NAME="tool_cohortroles" COMMENT="Mapping of users to cohort role assignments.">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
+        <FIELD NAME="cohortid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The cohort to sync"/>
+        <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The role to assign"/>
+        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The user to sync"/>
+        <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The time this record was created"/>
+        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The time this record was modified."/>
+        <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="Who last modified this record?"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+      </KEYS>
+      <INDEXES>
+        <INDEX NAME="cohortuserrole" UNIQUE="true" FIELDS="cohortid, roleid, userid"/>
+      </INDEXES>
+    </TABLE>
+  </TABLES>
+</XMLDB>
diff --git a/admin/tool/cohortroles/db/tasks.php b/admin/tool/cohortroles/db/tasks.php
new file mode 100644 (file)
index 0000000..e5f5a62
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Tasks definitions.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$tasks = array(
+    array(
+        'classname' => 'tool_cohortroles\task\cohort_role_sync',
+        'blocking' => 0,
+        'minute' => 'R',
+        'hour' => '*',
+        'day' => '*',
+        'dayofweek' => '*',
+        'month' => '*'
+    ),
+);
diff --git a/admin/tool/cohortroles/index.php b/admin/tool/cohortroles/index.php
new file mode 100644 (file)
index 0000000..d53af3e
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Assign roles for a user.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(dirname(__FILE__) . '/../../../config.php');
+require_once($CFG->libdir.'/adminlib.php');
+require_once($CFG->libdir.'/tablelib.php');
+
+$removeid = optional_param('removecohortroleassignment', 0, PARAM_INT);
+
+admin_externalpage_setup('toolcohortroles');
+$context = context_system::instance();
+
+$pageurl = new moodle_url('/admin/tool/cohortroles/index.php');
+
+$output = $PAGE->get_renderer('tool_cohortroles');
+
+echo $output->header();
+$title = get_string('assignroletocohort', 'tool_cohortroles');
+echo $output->heading($title);
+
+$form = new tool_cohortroles\form\assign_role_cohort();
+
+if ($removeid) {
+    require_sesskey();
+
+    $result = \tool_cohortroles\api::delete_cohort_role_assignment($removeid);
+    if ($result) {
+        $notification = get_string('cohortroleassignmentremoved', 'tool_cohortroles');
+        echo $output->notify_success($notification);
+    } else {
+        $notification = get_string('cohortroleassignmentnotremoved', 'tool_cohortroles');
+        echo $output->notify_problem($notification);
+    }
+    echo $output->continue_button(new moodle_url($pageurl));
+} else if ($data = $form->get_data()) {
+    require_sesskey();
+    // We must create them all or none.
+    $saved = 0;
+    // Loop through userids and cohortids only if both of them are not empty.
+    if (!empty($data->userids) && !empty($data->cohortids)) {
+        foreach ($data->userids as $userid) {
+            foreach ($data->cohortids as $cohortid) {
+                $params = (object) array('userid' => $userid, 'cohortid' => $cohortid, 'roleid' => $data->roleid);
+                $result = \tool_cohortroles\api::create_cohort_role_assignment($params);
+                if ($result) {
+                    $saved++;
+                }
+            }
+        }
+    }
+    if ($saved == 0) {
+        $notification = get_string('nocohortroleassignmentssaved', 'tool_cohortroles');
+        echo $output->notify_problem($notification);
+    } else if ($saved == 1) {
+        $notification = get_string('onecohortroleassignmentsaved', 'tool_cohortroles');
+        echo $output->notify_success($notification);
+    } else {
+        $notification = get_string('acohortroleassignmentssaved', 'tool_cohortroles', $saved);
+        echo $output->notify_success($notification);
+    }
+
+    echo $output->continue_button(new moodle_url($pageurl));
+} else {
+    $form->display();
+
+    $title = get_string('existingcohortroles', 'tool_cohortroles');
+    echo $output->heading($title);
+    $url = new moodle_url('/admin/tool/cohortroles/index.php');
+    $table = new tool_cohortroles\output\cohort_role_assignments_table(uniqid(), $url);
+    echo $table->out(50, true);
+
+    echo $output->spacer();
+    echo $output->notify_message(get_string('backgroundsync', 'tool_cohortroles'));
+}
+
+echo $output->footer();
+
diff --git a/admin/tool/cohortroles/lang/en/tool_cohortroles.php b/admin/tool/cohortroles/lang/en/tool_cohortroles.php
new file mode 100644 (file)
index 0000000..e735f7e
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Strings for component 'tool_userroles', language 'en'
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$string['acohortroleassignmentssaved'] = '{$a} cohort role assignments were saved.';
+$string['assign'] = 'Assign';
+$string['assignroletocohort'] = 'Assign role to users in the context of all members of these cohorts';
+$string['backgroundsync'] = 'Note: Roles assigned on this page will not take affect immediately, the changes to role assignments will be made by a background task.';
+$string['cohortroleassignmentremoved'] = 'The cohort role assignment was removed.';
+$string['cohortroleassignmentnotremoved'] = 'The cohort role assignment was not removed.';
+$string['cohortroles'] = 'Cohort roles';
+$string['existingcohortroles'] = 'Existing cohort role assignments';
+$string['managecohortroles'] = 'Assign user roles for entire cohort';
+$string['noassignableroles'] = 'No roles can be assigned at a user context level. <a href="../../roles/manage.php">Manage roles</a>';
+$string['nocohortroleassignmentssaved'] = 'No cohort role assignments were saved.';
+$string['onecohortroleassignmentsaved'] = 'One cohort role assignment was saved.';
+$string['pluginname'] = 'Cohort roles management';
+$string['removecohortroleassignment'] = 'Remove cohort role assignment';
+$string['removecohortroleassignmentconfirm'] = 'Are you sure you want to remove this cohort role assignment? This role will be removed for this user in all other user contexts.';
+$string['selectcohorts'] = 'Select cohorts';
+$string['selectrole'] = 'Select role';
+$string['selectusers'] = 'Select users to assign role';
+$string['taskname'] = 'Sync cohort role assignments';
+$string['thisuserroles'] = 'Roles assigned relative to this user';
diff --git a/admin/tool/cohortroles/settings.php b/admin/tool/cohortroles/settings.php
new file mode 100644 (file)
index 0000000..139a425
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Link to user roles management.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+// This tool's required capabilities.
+$capabilities = [
+    'moodle/cohort:view',
+    'moodle/role:manage'
+];
+
+// Check if the user has all of the required capabilities.
+$context = context_system::instance();
+$hasaccess = has_all_capabilities($capabilities, $context);
+
+// Add this admin page only if the user has all of the required capabilities.
+if ($hasaccess) {
+    $str = get_string('managecohortroles', 'tool_cohortroles');
+    $url = new moodle_url('/admin/tool/cohortroles/index.php');
+    $ADMIN->add('roles', new admin_externalpage('toolcohortroles', $str, $url, $capabilities));
+}
diff --git a/admin/tool/cohortroles/templates/cohort-in-list.mustache b/admin/tool/cohortroles/templates/cohort-in-list.mustache
new file mode 100644 (file)
index 0000000..971065a
--- /dev/null
@@ -0,0 +1,43 @@
+{{!
+    This file is part of Moodle - http://moodle.org/
+
+    Moodle is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Moodle is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @template tool_cohortroles/cohort-in-list
+
+    Moodle template for displaying a cohort in a list.
+
+    Classes required for JS:
+    * none
+
+    Data attributes required for JS:
+    * none
+
+    Context variables required for this template:
+    * id cohort id field
+    * name cohort name field
+    * idnumber cohort idnumber field
+    * description cohort description field
+    * visible cohort visible field
+
+    Example context (json):
+    { "id": "1",
+      "name": "Cohort 1",
+      "visible": true,
+      "idnumber": "014",
+      "description": "Some users"
+    }
+}}
+{{> tool_lp/form-cohort-selector-suggestion }}
diff --git a/admin/tool/cohortroles/tests/api_test.php b/admin/tool/cohortroles/tests/api_test.php
new file mode 100644 (file)
index 0000000..27c4cd8
--- /dev/null
@@ -0,0 +1,243 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * API tests.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+use tool_cohortroles\api;
+
+/**
+ * API tests.
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class tool_cohortroles_api_testcase extends advanced_testcase {
+    /** @var stdClass $cohort */
+    protected $cohort = null;
+
+    /** @var stdClass $userassignto */
+    protected $userassignto = null;
+
+    /** @var stdClass $userassignover */
+    protected $userassignover = null;
+
+    /** @var stdClass $role */
+    protected $role = null;
+
+    /**
+     * Setup function- we will create a course and add an assign instance to it.
+     */
+    protected function setUp() {
+        global $DB;
+
+        $this->resetAfterTest(true);
+
+        // Create some users.
+        $this->cohort = $this->getDataGenerator()->create_cohort();
+        $this->userassignto = $this->getDataGenerator()->create_user();
+        $this->userassignover = $this->getDataGenerator()->create_user();
+        $this->roleid = create_role('Sausage Roll', 'sausageroll', 'mmmm');
+        cohort_add_member($this->cohort->id, $this->userassignover->id);
+    }
+
+
+    public function test_create_cohort_role_assignment_without_permission() {
+        $this->setExpectedException('required_capability_exception');
+        $this->setUser($this->userassignto);
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        api::create_cohort_role_assignment($params);
+    }
+
+    public function test_create_cohort_role_assignment_with_invalid_data() {
+        $this->setExpectedException('core_competency\invalid_persistent_exception');
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => -8,
+            'cohortid' => $this->cohort->id
+        );
+        api::create_cohort_role_assignment($params);
+    }
+
+    public function test_create_cohort_role_assignment() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+        $this->assertNotEmpty($result->get_id());
+        $this->assertEquals($result->get_userid(), $this->userassignto->id);
+        $this->assertEquals($result->get_roleid(), $this->roleid);
+        $this->assertEquals($result->get_cohortid(), $this->cohort->id);
+    }
+
+    public function test_delete_cohort_role_assignment_without_permission() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+        $this->setExpectedException('required_capability_exception');
+        $this->setUser($this->userassignto);
+        api::delete_cohort_role_assignment($result->get_id());
+    }
+
+    public function test_delete_cohort_role_assignment_with_invalid_data() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+        $this->setExpectedException('dml_missing_record_exception');
+        api::delete_cohort_role_assignment($result->get_id() + 1);
+    }
+
+    public function test_delete_cohort_role_assignment() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+        $worked = api::delete_cohort_role_assignment($result->get_id());
+        $this->assertTrue($worked);
+    }
+
+    public function test_list_cohort_role_assignments() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+
+        $list = api::list_cohort_role_assignments();
+        $list[0]->is_valid();
+        $this->assertEquals($list[0], $result);
+    }
+
+    public function test_count_cohort_role_assignments() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+
+        $count = api::count_cohort_role_assignments();
+        $this->assertEquals($count, 1);
+    }
+
+    public function test_sync_all_cohort_roles() {
+        $this->setAdminUser();
+        $params = (object) array(
+            'userid' => $this->userassignto->id,
+            'roleid' => $this->roleid,
+            'cohortid' => $this->cohort->id
+        );
+        $result = api::create_cohort_role_assignment($params);
+
+        // Verify roles are assigned when users enter the cohort.
+        $sync = api::sync_all_cohort_roles();
+
+        $rolesadded = array(array(
+            'useridassignedto' => $this->userassignto->id,
+            'useridassignedover' => $this->userassignover->id,
+            'roleid' => $this->roleid
+        ));
+        $rolesremoved = array();
+        $expected = array('rolesadded' => $rolesadded,
+                          'rolesremoved' => $rolesremoved);
+        $this->assertEquals($sync, $expected);
+
+        // Verify roles are removed when users leave the cohort.
+        cohort_remove_member($this->cohort->id, $this->userassignover->id);
+        $sync = api::sync_all_cohort_roles();
+
+        $rolesadded = array();
+        $rolesremoved = array(array(
+            'useridassignedto' => $this->userassignto->id,
+            'useridassignedover' => $this->userassignover->id,
+            'roleid' => $this->roleid
+        ));
+        $expected = array('rolesadded' => $rolesadded,
+                          'rolesremoved' => $rolesremoved);
+        $this->assertEquals($sync, $expected);
+
+        // Verify roles assigned by any other component are not removed.
+        $usercontext = context_user::instance($this->userassignover->id);
+        role_assign($this->roleid, $this->userassignto->id, $usercontext->id);
+        $sync = api::sync_all_cohort_roles();
+
+        $rolesadded = array();
+        $rolesremoved = array();
+        $expected = array('rolesadded' => $rolesadded,
+                          'rolesremoved' => $rolesremoved);
+        $this->assertEquals($sync, $expected);
+
+        // Remove manual role assignment.
+        role_unassign($this->roleid, $this->userassignto->id, $usercontext->id);
+        // Add someone to the cohort again...
+        cohort_add_member($this->cohort->id, $this->userassignover->id);
+        $sync = api::sync_all_cohort_roles();
+        $rolesadded = array(array(
+            'useridassignedto' => $this->userassignto->id,
+            'useridassignedover' => $this->userassignover->id,
+            'roleid' => $this->roleid
+        ));
+        $rolesremoved = array();
+        $expected = array('rolesadded' => $rolesadded,
+                          'rolesremoved' => $rolesremoved);
+        $this->assertEquals($sync, $expected);
+
+        // Verify no fatal errors when a cohort is deleted.
+        cohort_delete_cohort($this->cohort);
+        $sync = api::sync_all_cohort_roles();
+
+        $rolesadded = array();
+        $rolesremoved = array(array(
+            'useridassignedto' => $this->userassignto->id,
+            'useridassignedover' => $this->userassignover->id,
+            'roleid' => $this->roleid
+        ));
+        $expected = array('rolesadded' => $rolesadded,
+                          'rolesremoved' => $rolesremoved);
+        $this->assertEquals($sync, $expected);
+    }
+
+}
diff --git a/admin/tool/cohortroles/version.php b/admin/tool/cohortroles/version.php
new file mode 100644 (file)
index 0000000..bf9fb21
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Plugin version info
+ *
+ * @package    tool_cohortroles
+ * @copyright  2015 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+
+$plugin->version   = 2015111018; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2014110400; // Requires this Moodle version.
+$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
+
+$plugin->dependencies = array(
+    'tool_lp' => ANY_VERSION
+);
index 9586c03..22d80d4 100644 (file)
@@ -30,6 +30,7 @@
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+        <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
       </KEYS>
       <INDEXES>
         <INDEX NAME="timecreated" UNIQUE="false" FIELDS="timecreated"/>
index b844b62..4e23361 100644 (file)
@@ -25,7 +25,9 @@
 defined('MOODLE_INTERNAL') || die();
 
 function xmldb_logstore_standard_upgrade($oldversion) {
-    global $CFG;
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
 
     // Moodle v2.8.0 release upgrade line.
     // Put any upgrade step following this.
@@ -36,5 +38,20 @@ function xmldb_logstore_standard_upgrade($oldversion) {
     // Moodle v3.0.0 release upgrade line.
     // Put any upgrade step following this.
 
+    if ($oldversion < 2016041200) {
+        // This could take a long time. Unfortunately, no way to know how long, and no way to do progress, so setting for 1 hour.
+        upgrade_set_timeout(3600);
+
+        // Define key contextid (foreign) to be added to logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));
+
+        // Launch add key contextid.
+        $dbman->add_key($table, $key);
+
+        // Standard savepoint reached.
+        upgrade_plugin_savepoint(true, 2016041200, 'logstore', 'standard');
+    }
+
     return true;
 }
index 73c131e..2e482f4 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2015111600; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->version = 2016041200; // The current plugin version (Date: YYYYMMDDXX).
 $plugin->requires = 2015111000; // Requires this Moodle version.
 $plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
diff --git a/admin/tool/lp/amd/build/actionselector.min.js b/admin/tool/lp/amd/build/actionselector.min.js
new file mode 100644 (file)
index 0000000..90062ca
Binary files /dev/null and b/admin/tool/lp/amd/build/actionselector.min.js differ
diff --git a/admin/tool/lp/amd/build/competencies.min.js b/admin/tool/lp/amd/build/competencies.min.js
new file mode 100644 (file)
index 0000000..cf57df2
Binary files /dev/null and b/admin/tool/lp/amd/build/competencies.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_outcomes.min.js b/admin/tool/lp/amd/build/competency_outcomes.min.js
new file mode 100644 (file)
index 0000000..2da1745
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_outcomes.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_plan_navigation.min.js b/admin/tool/lp/amd/build/competency_plan_navigation.min.js
new file mode 100644 (file)
index 0000000..1862243
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_plan_navigation.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule.min.js b/admin/tool/lp/amd/build/competency_rule.min.js
new file mode 100644 (file)
index 0000000..8939576
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule_all.min.js b/admin/tool/lp/amd/build/competency_rule_all.min.js
new file mode 100644 (file)
index 0000000..d95f6a0
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule_all.min.js differ
diff --git a/admin/tool/lp/amd/build/competency_rule_points.min.js b/admin/tool/lp/amd/build/competency_rule_points.min.js
new file mode 100644 (file)
index 0000000..39eaef7
Binary files /dev/null and b/admin/tool/lp/amd/build/competency_rule_points.min.js differ
diff --git a/admin/tool/lp/amd/build/competencyactions.min.js b/admin/tool/lp/amd/build/competencyactions.min.js
new file mode 100644 (file)
index 0000000..2ca219d
Binary files /dev/null and b/admin/tool/lp/amd/build/competencyactions.min.js differ
diff --git a/admin/tool/lp/amd/build/competencydialogue.min.js b/admin/tool/lp/amd/build/competencydialogue.min.js
new file mode 100644 (file)
index 0000000..2ef99e4
Binary files /dev/null and b/admin/tool/lp/amd/build/competencydialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/competencypicker.min.js b/admin/tool/lp/amd/build/competencypicker.min.js
new file mode 100644 (file)
index 0000000..61eec30
Binary files /dev/null and b/admin/tool/lp/amd/build/competencypicker.min.js differ
diff --git a/admin/tool/lp/amd/build/competencypicker_user_plans.min.js b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js
new file mode 100644 (file)
index 0000000..faf4bd4
Binary files /dev/null and b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js differ
diff --git a/admin/tool/lp/amd/build/competencyruleconfig.min.js b/admin/tool/lp/amd/build/competencyruleconfig.min.js
new file mode 100644 (file)
index 0000000..8a0f0a2
Binary files /dev/null and b/admin/tool/lp/amd/build/competencyruleconfig.min.js differ
diff --git a/admin/tool/lp/amd/build/competencytree.min.js b/admin/tool/lp/amd/build/competencytree.min.js
new file mode 100644 (file)
index 0000000..4955f99
Binary files /dev/null and b/admin/tool/lp/amd/build/competencytree.min.js differ
diff --git a/admin/tool/lp/amd/build/course_competency_settings.min.js b/admin/tool/lp/amd/build/course_competency_settings.min.js
new file mode 100644 (file)
index 0000000..5fe246e
Binary files /dev/null and b/admin/tool/lp/amd/build/course_competency_settings.min.js differ
diff --git a/admin/tool/lp/amd/build/dialogue.min.js b/admin/tool/lp/amd/build/dialogue.min.js
new file mode 100644 (file)
index 0000000..7538d6a
Binary files /dev/null and b/admin/tool/lp/amd/build/dialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/dragdrop-reorder.min.js b/admin/tool/lp/amd/build/dragdrop-reorder.min.js
new file mode 100644 (file)
index 0000000..77c33ba
Binary files /dev/null and b/admin/tool/lp/amd/build/dragdrop-reorder.min.js differ
diff --git a/admin/tool/lp/amd/build/event_base.min.js b/admin/tool/lp/amd/build/event_base.min.js
new file mode 100644 (file)
index 0000000..c9e4818
Binary files /dev/null and b/admin/tool/lp/amd/build/event_base.min.js differ
diff --git a/admin/tool/lp/amd/build/evidence_delete.min.js b/admin/tool/lp/amd/build/evidence_delete.min.js
new file mode 100644 (file)
index 0000000..aebb3f1
Binary files /dev/null and b/admin/tool/lp/amd/build/evidence_delete.min.js differ
diff --git a/admin/tool/lp/amd/build/form-cohort-selector.min.js b/admin/tool/lp/amd/build/form-cohort-selector.min.js
new file mode 100644 (file)
index 0000000..b582a15
Binary files /dev/null and b/admin/tool/lp/amd/build/form-cohort-selector.min.js differ
diff --git a/admin/tool/lp/amd/build/form-user-selector.min.js b/admin/tool/lp/amd/build/form-user-selector.min.js
new file mode 100644 (file)
index 0000000..d228806
Binary files /dev/null and b/admin/tool/lp/amd/build/form-user-selector.min.js differ
diff --git a/admin/tool/lp/amd/build/frameworkactions.min.js b/admin/tool/lp/amd/build/frameworkactions.min.js
new file mode 100644 (file)
index 0000000..32c694d
Binary files /dev/null and b/admin/tool/lp/amd/build/frameworkactions.min.js differ
diff --git a/admin/tool/lp/amd/build/frameworks_datasource.min.js b/admin/tool/lp/amd/build/frameworks_datasource.min.js
new file mode 100644 (file)
index 0000000..cfc5c70
Binary files /dev/null and b/admin/tool/lp/amd/build/frameworks_datasource.min.js differ
diff --git a/admin/tool/lp/amd/build/grade_dialogue.min.js b/admin/tool/lp/amd/build/grade_dialogue.min.js
new file mode 100644 (file)
index 0000000..6bfa3df
Binary files /dev/null and b/admin/tool/lp/amd/build/grade_dialogue.min.js differ
diff --git a/admin/tool/lp/amd/build/grade_user_competency_inline.min.js b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js
new file mode 100644 (file)
index 0000000..ac0c28f
Binary files /dev/null and b/admin/tool/lp/amd/build/grade_user_competency_inline.min.js differ
diff --git a/admin/tool/lp/amd/build/menubar.min.js b/admin/tool/lp/amd/build/menubar.min.js
new file mode 100644 (file)
index 0000000..7ab1169
Binary files /dev/null and b/admin/tool/lp/amd/build/menubar.min.js differ
diff --git a/admin/tool/lp/amd/build/parentcompetency_form.min.js b/admin/tool/lp/amd/build/parentcompetency_form.min.js
new file mode 100644 (file)
index 0000000..d7732ee
Binary files /dev/null and b/admin/tool/lp/amd/build/parentcompetency_form.min.js differ
diff --git a/admin/tool/lp/amd/build/planactions.min.js b/admin/tool/lp/amd/build/planactions.min.js
new file mode 100644 (file)
index 0000000..d590b7e
Binary files /dev/null and b/admin/tool/lp/amd/build/planactions.min.js differ
diff --git a/admin/tool/lp/amd/build/scaleconfig.min.js b/admin/tool/lp/amd/build/scaleconfig.min.js
new file mode 100644 (file)
index 0000000..db0ffd8
Binary files /dev/null and b/admin/tool/lp/amd/build/scaleconfig.min.js differ
diff --git a/admin/tool/lp/amd/build/scalevalues.min.js b/admin/tool/lp/amd/build/scalevalues.min.js
new file mode 100644 (file)
index 0000000..53c3286
Binary files /dev/null and b/admin/tool/lp/amd/build/scalevalues.min.js differ
diff --git a/admin/tool/lp/amd/build/templateactions.min.js b/admin/tool/lp/amd/build/templateactions.min.js
new file mode 100644 (file)
index 0000000..02fd09b
Binary files /dev/null and b/admin/tool/lp/amd/build/templateactions.min.js differ
diff --git a/admin/tool/lp/amd/build/tree.min.js b/admin/tool/lp/amd/build/tree.min.js
new file mode 100644 (file)
index 0000000..4cc8611
Binary files /dev/null and b/admin/tool/lp/amd/build/tree.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_course_navigation.min.js b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js
new file mode 100644 (file)
index 0000000..e11b466
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_info.min.js b/admin/tool/lp/amd/build/user_competency_info.min.js
new file mode 100644 (file)
index 0000000..8d95549
Binary files /dev/null and b/admin/tool/lp/amd/build/user_competency_info.min.js differ
diff --git a/admin/tool/lp/amd/build/user_competency_plan_popup.min.js b/admin/tool/lp/amd/build/user_competency_plan_popup.min.js
new file mode 100644 (file)
index 0000000..