Merge branch 'wip-MDL-43626-master' of git://github.com/abgreeve/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 18 Apr 2014 02:52:45 +0000 (10:52 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 18 Apr 2014 02:52:45 +0000 (10:52 +0800)
527 files changed:
admin/settings/development.php
admin/tool/log/classes/helper/reader.php
admin/tool/log/db/install.php
admin/tool/log/db/upgrade.php [new file with mode: 0644]
admin/tool/log/store/legacy/classes/event/legacy_logged.php
admin/tool/log/store/legacy/lang/en/logstore_legacy.php
admin/tool/log/store/legacy/settings.php
admin/tool/log/store/legacy/version.php
admin/tool/log/store/standard/db/install.xml
admin/tool/log/store/standard/db/upgrade.php
admin/tool/log/store/standard/lang/en/logstore_standard.php
admin/tool/log/store/standard/version.php
admin/tool/log/version.php
availability/classes/frontend.php
availability/classes/info.php
availability/classes/info_section.php
availability/condition/group/classes/frontend.php
availability/condition/grouping/classes/frontend.php
availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js
availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js
availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js
availability/yui/src/form/js/form.js
backup/util/ui/tests/behat/behat_backup.php
blocks/comments/classes/event/comment_created.php
blocks/comments/classes/event/comment_deleted.php
blocks/mentees/block_mentees.php
blocks/navigation/block_navigation.php
blocks/recent_activity/block_recent_activity.php
filter/glossary/filter.php
filter/glossary/tests/filter_test.php
filter/glossary/version.php
filter/tex/filter.php
filter/tex/tests/filter_test.php [new file with mode: 0644]
lang/en/moodle.php
lang/en/question.php
lib/accesslib.php
lib/alfresco/README_MOODLE.txt
lib/alfresco/Service/WebService/AlfrescoWebService.php
lib/behat/behat_field_manager.php
lib/behat/classes/behat_context_helper.php [new file with mode: 0644]
lib/behat/classes/behat_selectors.php
lib/behat/form_field/behat_form_field.php
lib/behat/form_field/behat_form_filemanager.php [new file with mode: 0644]
lib/classes/event/assessable_submitted.php
lib/classes/event/assessable_uploaded.php
lib/classes/event/base.php
lib/classes/event/blog_association_created.php
lib/classes/event/blog_comment_created.php
lib/classes/event/blog_comment_deleted.php
lib/classes/event/blog_entries_viewed.php
lib/classes/event/blog_entry_created.php
lib/classes/event/blog_entry_deleted.php
lib/classes/event/blog_entry_updated.php
lib/classes/event/calendar_event_created.php
lib/classes/event/calendar_event_deleted.php
lib/classes/event/calendar_event_updated.php
lib/classes/event/cohort_created.php
lib/classes/event/cohort_deleted.php
lib/classes/event/cohort_member_added.php
lib/classes/event/cohort_member_removed.php
lib/classes/event/cohort_updated.php
lib/classes/event/comment_created.php
lib/classes/event/comment_deleted.php
lib/classes/event/comments_viewed.php
lib/classes/event/content_viewed.php
lib/classes/event/course_category_created.php
lib/classes/event/course_category_deleted.php
lib/classes/event/course_category_updated.php
lib/classes/event/course_completed.php
lib/classes/event/course_completion_updated.php
lib/classes/event/course_content_deleted.php
lib/classes/event/course_created.php
lib/classes/event/course_deleted.php
lib/classes/event/course_module_completion_updated.php
lib/classes/event/course_module_created.php
lib/classes/event/course_module_deleted.php
lib/classes/event/course_module_instance_list_viewed.php
lib/classes/event/course_module_instances_list_viewed.php
lib/classes/event/course_module_updated.php
lib/classes/event/course_module_viewed.php
lib/classes/event/course_reset_ended.php
lib/classes/event/course_reset_started.php
lib/classes/event/course_resources_list_viewed.php
lib/classes/event/course_restored.php
lib/classes/event/course_section_updated.php
lib/classes/event/course_updated.php
lib/classes/event/email_failed.php
lib/classes/event/group_created.php
lib/classes/event/group_deleted.php
lib/classes/event/group_member_added.php
lib/classes/event/group_member_removed.php
lib/classes/event/group_updated.php
lib/classes/event/grouping_created.php
lib/classes/event/grouping_deleted.php
lib/classes/event/grouping_updated.php
lib/classes/event/item_tagged.php
lib/classes/event/item_untagged.php
lib/classes/event/manager.php
lib/classes/event/message_contact_added.php
lib/classes/event/message_contact_blocked.php
lib/classes/event/message_contact_removed.php
lib/classes/event/message_contact_unblocked.php
lib/classes/event/message_read.php
lib/classes/event/message_sent.php
lib/classes/event/mnet_access_control_created.php
lib/classes/event/mnet_access_control_updated.php
lib/classes/event/note_created.php
lib/classes/event/note_deleted.php
lib/classes/event/note_updated.php
lib/classes/event/notes_viewed.php
lib/classes/event/question_category_created.php [new file with mode: 0644]
lib/classes/event/role_allow_assign_updated.php
lib/classes/event/role_allow_override_updated.php
lib/classes/event/role_allow_switch_updated.php
lib/classes/event/role_assigned.php
lib/classes/event/role_capabilities_updated.php
lib/classes/event/role_deleted.php
lib/classes/event/role_unassigned.php
lib/classes/event/tag_created.php
lib/classes/event/tag_deleted.php
lib/classes/event/tag_flagged.php
lib/classes/event/tag_unflagged.php
lib/classes/event/tag_updated.php
lib/classes/event/unknown_logged.php [moved from admin/tool/log/store/standard/db/access.php with 61% similarity]
lib/classes/event/user_created.php
lib/classes/event/user_deleted.php
lib/classes/event/user_enrolment_created.php
lib/classes/event/user_enrolment_deleted.php
lib/classes/event/user_enrolment_updated.php
lib/classes/event/user_graded.php
lib/classes/event/user_list_viewed.php
lib/classes/event/user_loggedin.php
lib/classes/event/user_loggedinas.php
lib/classes/event/user_loggedout.php
lib/classes/event/user_login_failed.php
lib/classes/event/user_profile_viewed.php
lib/classes/event/user_updated.php
lib/classes/event/webservice_function_called.php
lib/classes/event/webservice_login_failed.php
lib/classes/event/webservice_service_created.php
lib/classes/event/webservice_service_deleted.php
lib/classes/event/webservice_service_updated.php
lib/classes/event/webservice_service_user_added.php
lib/classes/event/webservice_service_user_removed.php
lib/classes/event/webservice_token_created.php
lib/classes/event/webservice_token_sent.php
lib/classes/grades_external.php
lib/classes/log/reader.php
lib/csslib.php
lib/db/install.xml
lib/db/upgrade.php
lib/deprecatedlib.php
lib/dml/mariadb_native_moodle_database.php
lib/editor/atto/plugins/image/lang/en/atto_image.php
lib/editor/atto/plugins/image/lib.php
lib/editor/atto/plugins/image/styles.css
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/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js
lib/editor/atto/plugins/table/yui/src/button/js/button.js
lib/editor/atto/readme_moodle.txt [new file with mode: 0644]
lib/editor/atto/styles.css
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-min.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy-min.js
lib/editor/atto/yui/build/moodle-editor_atto-rangy/moodle-editor_atto-rangy.js
lib/editor/atto/yui/src/editor/js/editor-plugin-buttons.js
lib/editor/atto/yui/src/rangy/js/rangy-core.js
lib/filestorage/stored_file.php
lib/modinfolib.php
lib/moodlelib.php
lib/outputrenderers.php
lib/pagelib.php
lib/setuplib.php
lib/tests/behat/behat_forms.php
lib/tests/behat/behat_hooks.php
lib/tests/csslib_test.php
lib/tests/event_unknown_logged_test.php [new file with mode: 0644]
lib/tests/eventslib_test.php
lib/tests/filelib_test.php
lib/tests/grades_externallib_test.php
lib/tests/moodlelib_test.php
lib/upgradelib.php
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-debug.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-min.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception.js
lib/yui/src/notification/js/exception.js
message/output/airnotifier/settings.php
mod/assign/assignmentplugin.php
mod/assign/classes/event/all_submissions_downloaded.php
mod/assign/classes/event/assessable_submitted.php
mod/assign/classes/event/base.php [new file with mode: 0644]
mod/assign/classes/event/batch_set_marker_allocation_viewed.php [new file with mode: 0644]
mod/assign/classes/event/batch_set_workflow_state_viewed.php [new file with mode: 0644]
mod/assign/classes/event/course_module_instance_list_viewed.php [new file with mode: 0644]
mod/assign/classes/event/extension_granted.php
mod/assign/classes/event/feedback_updated.php [new file with mode: 0644]
mod/assign/classes/event/feedback_viewed.php [new file with mode: 0644]
mod/assign/classes/event/grading_form_viewed.php [new file with mode: 0644]
mod/assign/classes/event/grading_table_viewed.php [new file with mode: 0644]
mod/assign/classes/event/identities_revealed.php
mod/assign/classes/event/marker_updated.php
mod/assign/classes/event/reveal_identities_confirmation_page_viewed.php [new file with mode: 0644]
mod/assign/classes/event/statement_accepted.php
mod/assign/classes/event/submission_confirmation_form_viewed.php [new file with mode: 0644]
mod/assign/classes/event/submission_created.php
mod/assign/classes/event/submission_duplicated.php
mod/assign/classes/event/submission_form_viewed.php [new file with mode: 0644]
mod/assign/classes/event/submission_graded.php
mod/assign/classes/event/submission_locked.php
mod/assign/classes/event/submission_status_updated.php
mod/assign/classes/event/submission_status_viewed.php [new file with mode: 0644]
mod/assign/classes/event/submission_unlocked.php
mod/assign/classes/event/submission_updated.php
mod/assign/classes/event/submission_viewed.php [new file with mode: 0644]
mod/assign/classes/event/workflow_state_updated.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/offline/locallib.php
mod/assign/index.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/submission/comments/classes/event/comment_created.php
mod/assign/submission/comments/classes/event/comment_deleted.php
mod/assign/submission/file/classes/event/assessable_uploaded.php
mod/assign/submission/file/classes/event/submission_created.php
mod/assign/submission/file/classes/event/submission_updated.php
mod/assign/submission/file/locallib.php
mod/assign/submission/onlinetext/classes/event/assessable_uploaded.php
mod/assign/submission/onlinetext/classes/event/submission_created.php
mod/assign/submission/onlinetext/classes/event/submission_updated.php
mod/assign/submission/onlinetext/lang/en/assignsubmission_onlinetext.php
mod/assign/submission/onlinetext/locallib.php
mod/assign/tests/base_test.php
mod/assign/tests/behat/file_submission.feature
mod/assign/tests/behat/online_submissions.feature
mod/assign/tests/behat/submission_comments.feature [new file with mode: 0644]
mod/assign/tests/event_test.php [deleted file]
mod/assign/tests/events_test.php [new file with mode: 0644]
mod/assign/tests/fixtures/event_mod_assign_fixtures.php
mod/assign/tests/locallib_test.php
mod/book/classes/event/chapter_created.php
mod/book/classes/event/chapter_deleted.php
mod/book/classes/event/chapter_updated.php
mod/book/classes/event/chapter_viewed.php
mod/book/classes/event/course_module_instance_list_viewed.php
mod/book/classes/event/course_module_viewed.php
mod/book/delete.php
mod/book/edit.php
mod/book/index.php
mod/book/lib.php
mod/book/move.php
mod/book/show.php
mod/book/tests/events_test.php
mod/book/tool/exportimscp/classes/event/book_exported.php
mod/book/tool/exportimscp/index.php
mod/book/tool/exportimscp/tests/events_test.php
mod/book/tool/importhtml/locallib.php
mod/book/tool/print/classes/event/book_printed.php
mod/book/tool/print/classes/event/chapter_printed.php
mod/book/tool/print/index.php
mod/book/tool/print/lib.php
mod/book/tool/print/tests/events_test.php
mod/book/upgrade.txt [new file with mode: 0644]
mod/book/view.php
mod/chat/classes/event/course_module_instance_list_viewed.php
mod/chat/classes/event/message_sent.php
mod/chat/classes/event/sessions_viewed.php
mod/chat/gui_basic/index.php
mod/chat/lib.php
mod/choice/classes/event/answer_submitted.php
mod/choice/classes/event/answer_updated.php
mod/choice/classes/event/course_module_instance_list_viewed.php
mod/choice/classes/event/course_module_viewed.php
mod/choice/classes/event/report_viewed.php
mod/choice/lib.php
mod/data/classes/event/comment_created.php
mod/data/classes/event/comment_deleted.php
mod/data/classes/event/course_module_instance_list_viewed.php
mod/data/classes/event/course_module_viewed.php
mod/data/classes/event/field_created.php
mod/data/classes/event/field_deleted.php
mod/data/classes/event/field_updated.php
mod/data/classes/event/record_created.php
mod/data/classes/event/record_deleted.php
mod/data/classes/event/record_updated.php
mod/data/classes/event/template_updated.php
mod/data/classes/event/template_viewed.php
mod/data/lib.php
mod/data/tests/behat/add_entries.feature [new file with mode: 0644]
mod/data/tests/behat/behat_mod_data.php [new file with mode: 0644]
mod/data/tests/behat/view_entries.feature [new file with mode: 0644]
mod/feedback/classes/event/course_module_instance_list_viewed.php
mod/feedback/classes/event/course_module_viewed.php
mod/feedback/classes/event/response_deleted.php
mod/feedback/classes/event/response_submitted.php
mod/feedback/lib.php
mod/folder/classes/event/course_module_instance_list_viewed.php
mod/folder/classes/event/course_module_viewed.php
mod/folder/classes/event/folder_updated.php
mod/folder/lang/en/folder.php
mod/folder/lib.php
mod/forum/classes/event/assessable_uploaded.php
mod/forum/classes/event/course_module_instance_list_viewed.php
mod/forum/classes/event/course_module_viewed.php
mod/forum/classes/event/course_searched.php
mod/forum/classes/event/discussion_created.php
mod/forum/classes/event/discussion_deleted.php
mod/forum/classes/event/discussion_moved.php
mod/forum/classes/event/discussion_updated.php
mod/forum/classes/event/discussion_viewed.php
mod/forum/classes/event/post_created.php
mod/forum/classes/event/post_deleted.php
mod/forum/classes/event/post_updated.php
mod/forum/classes/event/readtracking_disabled.php
mod/forum/classes/event/readtracking_enabled.php
mod/forum/classes/event/subscribers_viewed.php
mod/forum/classes/event/subscription_created.php
mod/forum/classes/event/subscription_deleted.php
mod/forum/classes/event/userreport_viewed.php
mod/forum/lib.php
mod/forum/tests/behat/add_forum.feature
mod/glossary/approve.php
mod/glossary/classes/event/category_created.php
mod/glossary/classes/event/category_deleted.php
mod/glossary/classes/event/category_updated.php
mod/glossary/classes/event/comment_created.php
mod/glossary/classes/event/comment_deleted.php
mod/glossary/classes/event/course_module_instance_list_viewed.php
mod/glossary/classes/event/course_module_viewed.php
mod/glossary/classes/event/entry_approved.php
mod/glossary/classes/event/entry_created.php
mod/glossary/classes/event/entry_deleted.php
mod/glossary/classes/event/entry_disapproved.php
mod/glossary/classes/event/entry_updated.php
mod/glossary/classes/event/entry_viewed.php
mod/glossary/classes/local/concept_cache.php [new file with mode: 0644]
mod/glossary/db/caches.php [new file with mode: 0644]
mod/glossary/db/events.php [moved from admin/tool/log/store/legacy/db/access.php with 62% similarity]
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/editcategories.php
mod/glossary/import.php
mod/glossary/lang/en/glossary.php
mod/glossary/lib.php
mod/glossary/tests/concept_cache_test.php [new file with mode: 0644]
mod/glossary/tests/generator/lib.php
mod/glossary/tests/generator_test.php
mod/glossary/version.php
mod/imscp/classes/event/course_module_instance_list_viewed.php
mod/imscp/classes/event/course_module_viewed.php
mod/imscp/lib.php
mod/label/lib.php
mod/lesson/classes/event/course_module_instance_list_viewed.php
mod/lesson/classes/event/course_module_viewed.php
mod/lesson/classes/event/essay_assessed.php
mod/lesson/classes/event/essay_attempt_viewed.php
mod/lesson/classes/event/highscore_added.php
mod/lesson/classes/event/highscores_viewed.php
mod/lesson/classes/event/lesson_ended.php
mod/lesson/classes/event/lesson_started.php
mod/lesson/lib.php
mod/lti/classes/event/course_module_instance_list_viewed.php
mod/lti/classes/event/course_module_viewed.php
mod/lti/classes/event/unknown_service_api_called.php
mod/page/classes/event/course_module_instance_list_viewed.php
mod/page/classes/event/course_module_viewed.php
mod/page/lang/en/page.php
mod/page/lib.php
mod/quiz/addrandom.php
mod/quiz/attempt.php
mod/quiz/classes/event/attempt_abandoned.php
mod/quiz/classes/event/attempt_becameoverdue.php
mod/quiz/classes/event/attempt_deleted.php [new file with mode: 0644]
mod/quiz/classes/event/attempt_preview_started.php [new file with mode: 0644]
mod/quiz/classes/event/attempt_reviewed.php [new file with mode: 0644]
mod/quiz/classes/event/attempt_started.php
mod/quiz/classes/event/attempt_submitted.php
mod/quiz/classes/event/attempt_summary_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/attempt_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/course_module_instance_list_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/course_module_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/edit_page_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/group_override_created.php [new file with mode: 0644]
mod/quiz/classes/event/group_override_deleted.php [new file with mode: 0644]
mod/quiz/classes/event/group_override_updated.php [new file with mode: 0644]
mod/quiz/classes/event/question_manually_graded.php [new file with mode: 0644]
mod/quiz/classes/event/report_viewed.php [new file with mode: 0644]
mod/quiz/classes/event/user_override_created.php [new file with mode: 0644]
mod/quiz/classes/event/user_override_deleted.php [new file with mode: 0644]
mod/quiz/classes/event/user_override_updated.php [new file with mode: 0644]
mod/quiz/comment.php
mod/quiz/edit.php
mod/quiz/index.php
mod/quiz/lang/en/quiz.php
mod/quiz/lib.php
mod/quiz/locallib.php
mod/quiz/overridedelete.php
mod/quiz/overrideedit.php
mod/quiz/processattempt.php
mod/quiz/report.php
mod/quiz/report/attemptsreport.php
mod/quiz/report/statistics/tests/fixtures/questions03.csv [new file with mode: 0644]
mod/quiz/report/statistics/tests/fixtures/quizzes.csv
mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv
mod/quiz/report/statistics/tests/fixtures/responsecounts03.csv [new file with mode: 0644]
mod/quiz/report/statistics/tests/fixtures/steps03.csv [new file with mode: 0644]
mod/quiz/review.php
mod/quiz/summary.php
mod/quiz/tests/events_test.php
mod/quiz/view.php
mod/resource/classes/event/course_module_instance_list_viewed.php
mod/resource/classes/event/course_module_viewed.php
mod/resource/lang/en/resource.php
mod/resource/lib.php
mod/scorm/classes/event/attempt_deleted.php
mod/scorm/classes/event/course_module_instance_list_viewed.php
mod/scorm/classes/event/course_module_viewed.php
mod/scorm/classes/event/interactions_viewed.php
mod/scorm/classes/event/report_viewed.php
mod/scorm/classes/event/sco_launched.php
mod/scorm/classes/event/tracks_viewed.php
mod/scorm/classes/event/user_report_viewed.php
mod/scorm/lib.php
mod/survey/classes/event/course_module_instance_list_viewed.php
mod/survey/classes/event/course_module_viewed.php
mod/survey/classes/event/report_downloaded.php
mod/survey/classes/event/report_viewed.php
mod/survey/classes/event/response_submitted.php
mod/survey/lib.php
mod/upgrade.txt
mod/url/classes/event/course_module_instance_list_viewed.php
mod/url/classes/event/course_module_viewed.php
mod/url/lang/en/url.php
mod/url/lib.php
mod/wiki/classes/event/comment_created.php
mod/wiki/classes/event/comment_deleted.php
mod/wiki/classes/event/comments_viewed.php
mod/wiki/classes/event/course_module_instance_list_viewed.php
mod/wiki/classes/event/course_module_viewed.php
mod/wiki/classes/event/page_created.php
mod/wiki/classes/event/page_deleted.php
mod/wiki/classes/event/page_diff_viewed.php
mod/wiki/classes/event/page_history_viewed.php
mod/wiki/classes/event/page_locks_deleted.php
mod/wiki/classes/event/page_map_viewed.php
mod/wiki/classes/event/page_updated.php
mod/wiki/classes/event/page_version_deleted.php
mod/wiki/classes/event/page_version_restored.php
mod/wiki/classes/event/page_version_viewed.php
mod/wiki/classes/event/page_viewed.php
mod/wiki/lib.php
mod/workshop/classes/event/assessable_uploaded.php
mod/workshop/classes/event/assessment_evaluated.php
mod/workshop/classes/event/assessment_evaluations_reset.php
mod/workshop/classes/event/assessment_reevaluated.php
mod/workshop/classes/event/assessments_reset.php
mod/workshop/classes/event/course_module_instance_list_viewed.php
mod/workshop/classes/event/course_module_viewed.php
mod/workshop/classes/event/phase_switched.php
mod/workshop/classes/event/submission_assessed.php
mod/workshop/classes/event/submission_created.php
mod/workshop/classes/event/submission_reassessed.php
mod/workshop/classes/event/submission_updated.php
mod/workshop/classes/event/submission_viewed.php
mod/workshop/renderer.php
question/category_class.php
question/classes/statistics/questions/all_calculated_for_qubaid_condition.php
question/classes/statistics/questions/calculated.php
question/classes/statistics/questions/calculator.php
question/classes/statistics/responses/analysis_for_class.php
question/tests/events_test.php [new file with mode: 0644]
question/type/numerical/question.php
question/type/numerical/tests/question_test.php
report/completion/classes/event/report_viewed.php
report/completion/classes/event/user_report_viewed.php
report/log/classes/event/report_viewed.php
report/log/classes/event/user_report_viewed.php
report/log/classes/table_log.php
report/log/graph.php
report/log/locallib.php
report/log/tests/behat/filter_log.feature
report/log/tests/behat/user_log.feature
report/log/user.php
report/loglive/classes/event/report_viewed.php
report/loglive/classes/table_log.php
report/loglive/tests/behat/loglive_report.feature
report/outline/classes/event/activity_viewed.php
report/outline/classes/event/outline_viewed.php
report/outline/index.php
report/outline/lang/en/report_outline.php
report/outline/locallib.php
report/outline/tests/behat/outline.feature [new file with mode: 0644]
report/outline/tests/behat/user.feature [new file with mode: 0644]
report/outline/user.php
report/participation/classes/event/report_viewed.php
report/participation/index.php
report/participation/lang/en/report_participation.php
report/participation/locallib.php [new file with mode: 0644]
report/participation/tests/behat/filter_participation.feature [new file with mode: 0644]
report/stats/classes/event/report_viewed.php
report/stats/classes/event/user_report_viewed.php
repository/alfresco/lang/en/repository_alfresco.php
repository/tests/behat/behat_filepicker.php
repository/upload/tests/behat/behat_repository_upload.php
repository/wikimedia/lib.php
tag/manage.php
theme/bootstrapbase/less/moodle/core.less
theme/bootstrapbase/less/moodle/modules.less
theme/bootstrapbase/less/moodle/responsive.less
theme/bootstrapbase/less/moodle/user.less
theme/bootstrapbase/style/moodle.css
theme/styles.php
user/profile/definelib.php
user/profile/index.php
version.php

index b99d519..99209ae 100644 (file)
@@ -41,48 +41,46 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
     $ADMIN->add('development', $temp);
 
-    // "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
-    if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
-        $temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
-        // Main profiling switch
-        $temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
-        // List of URLs that will be automatically profiled
-        $temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
-        // List of URLs that won't be profiled ever
-        $temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
-        // Allow random profiling each XX requests
-        $temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
-        // Allow PROFILEME/DONTPROFILEME GPC
-        $temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
-        // Allow PROFILEALL/PROFILEALLSTOP GPC
-        $temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
-        // TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
-        // TODO: Allow to skip call_user functions (ignored_functions array)
-        // Specify the life time (in minutes) of profiling runs
-        $temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
-             0 => new lang_string('neverdeleteruns', 'admin'),
-      30*24*60 => new lang_string('numdays', '', 30),
-      15*24*60 => new lang_string('numdays', '', 15),
-       7*24*60 => new lang_string('numdays', '', 7),
-       4*24*60 => new lang_string('numdays', '', 4),
-       2*24*60 => new lang_string('numdays', '', 2),
-         24*60 => new lang_string('numhours', '', 24),
-         16*80 => new lang_string('numhours', '', 16),
-          8*60 => new lang_string('numhours', '', 8),
-          4*60 => new lang_string('numhours', '', 4),
-          2*60 => new lang_string('numhours', '', 2),
-            60 => new lang_string('numminutes', '', 60),
-            30 => new lang_string('numminutes', '', 30),
-            15 => new lang_string('numminutes', '', 15))));
-        // Define the prefix to be added to imported profiling runs.
-        $temp->add(new admin_setting_configtext('profilingimportprefix',
-                new lang_string('profilingimportprefix', 'admin'),
-                new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
-
-        // Add the 'profiling' page to admin block
-        $ADMIN->add('development', $temp);
-    }
-
+    // "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
+    $xhprofenabled = extension_loaded('xhprof') && function_exists('xhprof_enable');
+    $temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
+    // Main profiling switch.
+    $temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
+    // List of URLs that will be automatically profiled.
+    $temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
+    // List of URLs that won't be profiled ever.
+    $temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
+    // Allow random profiling each XX requests.
+    $temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
+    // Allow PROFILEME/DONTPROFILEME GPC.
+    $temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
+    // Allow PROFILEALL/PROFILEALLSTOP GPC.
+    $temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
+    // TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
+    // TODO: Allow to skip call_user functions (ignored_functions array)
+    // Specify the life time (in minutes) of profiling runs.
+    $temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
+               0 => new lang_string('neverdeleteruns', 'admin'),
+        30*24*60 => new lang_string('numdays', '', 30),
+        15*24*60 => new lang_string('numdays', '', 15),
+         7*24*60 => new lang_string('numdays', '', 7),
+         4*24*60 => new lang_string('numdays', '', 4),
+         2*24*60 => new lang_string('numdays', '', 2),
+           24*60 => new lang_string('numhours', '', 24),
+           16*80 => new lang_string('numhours', '', 16),
+            8*60 => new lang_string('numhours', '', 8),
+            4*60 => new lang_string('numhours', '', 4),
+            2*60 => new lang_string('numhours', '', 2),
+              60 => new lang_string('numminutes', '', 60),
+              30 => new lang_string('numminutes', '', 30),
+              15 => new lang_string('numminutes', '', 15))));
+    // Define the prefix to be added to imported profiling runs.
+    $temp->add(new admin_setting_configtext('profilingimportprefix',
+            new lang_string('profilingimportprefix', 'admin'),
+            new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
+
+    // Add the 'profiling' page to admin block.
+    $ADMIN->add('development', $temp);
 
      // Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
     $ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
index 036f874..4d8b4bf 100644 (file)
@@ -61,15 +61,4 @@ trait reader {
         }
         return $this->store;
     }
-
-    /**
-     * If the current user can access current store or not.
-     *
-     * @param \context $context
-     *
-     * @return bool
-     */
-    public function can_access(\context $context) {
-        return has_capability('logstore/' . $this->store . ':read', $context);
-    }
 }
index 6fccec4..52d2d9d 100644 (file)
 
 defined('MOODLE_INTERNAL') || die();
 
+/**
+ * Install the plugin.
+ */
 function xmldb_tool_log_install() {
-    global $CFG;
+    global $CFG, $DB;
 
     $enabled = array();
 
-    // For now enable only the legacy logging, this keeps 100% BC.
+    // Add data to new log only from now on.
+    if (file_exists("$CFG->dirroot/$CFG->admin/tool/log/store/standard")) {
+        $enabled[] = 'logstore_standard';
+    }
+
+    // Enable legacy log reading, but only if there are existing data.
     if (file_exists("$CFG->dirroot/$CFG->admin/tool/log/store/legacy")) {
-        $enabled[] = 'logstore_legacy';
+        unset_config('loglegacy', 'logstore_legacy');
+        // Do not enabled legacy logging if somebody installed a new
+        // site and in less than one day upgraded to 2.7.
+        $params = array('yesterday' => time() - 60*60*24);
+        if ($DB->record_exists_select('log', "time < :yesterday", $params)) {
+            $enabled[] = 'logstore_legacy';
+        }
     }
 
     set_config('enabled_stores', implode(',', $enabled), 'tool_log');
diff --git a/admin/tool/log/db/upgrade.php b/admin/tool/log/db/upgrade.php
new file mode 100644 (file)
index 0000000..0dc0597
--- /dev/null
@@ -0,0 +1,47 @@
+<?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/>.
+
+/**
+ * Logging support.
+ *
+ * @package    tool_log
+ * @copyright  2014 Petr Skoda {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Upgrade the plugin.
+ *
+ * @param int $oldversion
+ * @return bool always true
+ */
+function xmldb_tool_log_upgrade($oldversion) {
+    global $CFG, $DB, $OUTPUT;
+
+    $dbman = $DB->get_manager();
+
+    if ($oldversion < 2014040600) {
+        // Reset logging defaults in dev branches,
+        // in production upgrade the install.php is executed instead.
+        require_once(__DIR__ . '/install.php');
+        xmldb_tool_log_install();
+        upgrade_plugin_savepoint(true, 2014040600, 'tool', 'log');
+    }
+
+    return true;
+}
index 198e27a..f485cca 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * Legacy log emulation event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Petr Skoda {@link http://skodak.org}
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 58a54d4..9e39406 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 $string['event_legacy_logged'] = 'Legacy event logged';
-$string['legacy:read'] = 'Read logs';
 $string['loglegacy'] = 'Log legacy data';
 $string['loglegacy_help'] = 'This plugin records log data to the legacy log table (mdl_log). This functionality has been replaced by newer, richer and more efficient logging plugins, so you should only run this plugin if you have old custom reports that directly query the old log table. Writing to the legacy logs will increase load, so it is recommended that you disable this plugin for performance reasons when it is not needed.';
 $string['pluginname'] = 'Legacy log';
index d9ed97b..0a7149e 100644 (file)
@@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die();
 if ($hassiteconfig) {
     $settings->add(new admin_setting_configcheckbox('logstore_legacy/loglegacy',
         new lang_string('loglegacy', 'logstore_legacy'),
-        new lang_string('loglegacy_help', 'logstore_legacy'), 1));
+        new lang_string('loglegacy_help', 'logstore_legacy'), 0));
 
     $settings->add(new admin_setting_configcheckbox('logguests',
         new lang_string('logguests', 'admin'),
index 95f1d42..f9b48d3 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014031300; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->version = 2014041700; // The current plugin version (Date: YYYYMMDDXX).
 $plugin->requires = 2014031200; // Requires this Moodle version.
 $plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
index 053f8cd..9586c03 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20140320" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
+<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20140415" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../../../../lib/xmldb/xmldb.xsd"
 >
       </KEYS>
       <INDEXES>
         <INDEX NAME="timecreated" UNIQUE="false" FIELDS="timecreated"/>
-        <INDEX NAME="contextid-component" UNIQUE="false" FIELDS="contextid, component"/>
-        <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
-        <INDEX NAME="eventname" UNIQUE="false" FIELDS="eventname"/>
-        <INDEX NAME="crud" UNIQUE="false" FIELDS="crud"/>
-        <INDEX NAME="edulevel" UNIQUE="false" FIELDS="edulevel"/>
+        <INDEX NAME="course-time" UNIQUE="false" FIELDS="courseid, anonymous, timecreated"/>
+        <INDEX NAME="user-module" UNIQUE="false" FIELDS="userid, contextlevel, contextinstanceid, crud, edulevel, timecreated"/>
       </INDEXES>
     </TABLE>
   </TABLES>
index db7a122..d394d46 100644 (file)
@@ -42,5 +42,74 @@ function xmldb_logstore_standard_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2014032000, 'logstore', 'standard');
     }
 
+    if ($oldversion < 2014041500) {
+
+        // Define index contextid-component (not unique) to be dropped form logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('contextid-component', XMLDB_INDEX_NOTUNIQUE, array('contextid', 'component'));
+
+        // Conditionally launch drop index contextid-component.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Define index courseid (not unique) to be dropped form logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('courseid', XMLDB_INDEX_NOTUNIQUE, array('courseid'));
+
+        // Conditionally launch drop index courseid.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Define index eventname (not unique) to be dropped form logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('eventname', XMLDB_INDEX_NOTUNIQUE, array('eventname'));
+
+        // Conditionally launch drop index eventname.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Define index crud (not unique) to be dropped form logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('crud', XMLDB_INDEX_NOTUNIQUE, array('crud'));
+
+        // Conditionally launch drop index crud.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Define index edulevel (not unique) to be dropped form logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('edulevel', XMLDB_INDEX_NOTUNIQUE, array('edulevel'));
+
+        // Conditionally launch drop index edulevel.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Define index course-time (not unique) to be added to logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('course-time', XMLDB_INDEX_NOTUNIQUE, array('courseid', 'anonymous', 'timecreated'));
+
+        // Conditionally launch add index course-time.
+        if (!$dbman->index_exists($table, $index)) {
+            $dbman->add_index($table, $index);
+        }
+
+        // Define index user-module (not unique) to be added to logstore_standard_log.
+        $table = new xmldb_table('logstore_standard_log');
+        $index = new xmldb_index('user-module', XMLDB_INDEX_NOTUNIQUE, array('userid', 'contextlevel', 'contextinstanceid', 'crud', 'edulevel', 'timecreated'));
+
+        // Conditionally launch add index user-module.
+        if (!$dbman->index_exists($table, $index)) {
+            $dbman->add_index($table, $index);
+        }
+
+        // Standard savepoint reached.
+        upgrade_plugin_savepoint(true, 2014041500, 'logstore', 'standard');
+    }
+
     return true;
 }
index c81fac5..2e2c2a7 100644 (file)
@@ -25,5 +25,4 @@
 $string['buffersize'] = 'Write buffer size';
 $string['pluginname'] = 'Standard log';
 $string['pluginname_desc'] = 'A log plugin stores log entries in a Moodle database table.';
-$string['standard:read'] = 'Read logs';
 $string['taskcleanup'] = 'Log table cleanup';
index 94f88e2..9fb2180 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014032000; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->version = 2014041700; // The current plugin version (Date: YYYYMMDDXX).
 $plugin->requires = 2014031200; // Requires this Moodle version.
 $plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
index 0838cd2..a70afc3 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2014011300; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2014011000; // Requires this Moodle version.
+$plugin->version = 2014040600; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2014040300; // Requires this Moodle version.
 $plugin->component = 'tool_log'; // Full name of the plugin (used for diagnostics).
index f2a7276..ea7b012 100644 (file)
@@ -172,7 +172,7 @@ abstract class frontend {
         $decoded = json_decode($data['availabilityconditionsjson']);
         if (!$decoded) {
             // This shouldn't be possible.
-            throw new coding_exception('Invalid JSON from availabilityconditionsjson field');
+            throw new \coding_exception('Invalid JSON from availabilityconditionsjson field');
         }
         if (!empty($decoded->errors)) {
             $error = '';
index 965e552..a335d38 100644 (file)
@@ -193,12 +193,7 @@ abstract class info {
             $tree = $this->get_availability_tree();
             $result = $tree->check_available(false, $this, $grabthelot, $userid);
         } catch (\coding_exception $e) {
-            // We catch the message because it causes fatal problems in most of
-            // the GUI if this exception gets thrown (you can't edit the
-            // activity to fix it). Obviously it should never happen anyway, but
-            // just in case.
-            debugging('Error processing availability data for &lsquo;' .
-                    $this->get_thing_name() . '&rsquo;: ' . s($e->a), DEBUG_DEVELOPER);
+            $this->warn_about_invalid_availability($e);
             $this->modinfo = null;
             return false;
         }
@@ -237,7 +232,12 @@ abstract class info {
         if (is_null($this->availability)) {
             return true;
         } else {
-            return $this->get_availability_tree()->is_available_for_all();
+            try {
+                return $this->get_availability_tree()->is_available_for_all();
+            } catch (\coding_exception $e) {
+                $this->warn_about_invalid_availability($e);
+                return false;
+            }
         }
     }
 
@@ -273,13 +273,32 @@ abstract class info {
             $this->modinfo = null;
             return $result;
         } catch (\coding_exception $e) {
-            // Again we catch the message to avoid problems in GUI.
-            debugging('Error processing availability data for &lsquo;' .
-                    $this->get_thing_name() . '&rsquo;: ' . s($e->a), DEBUG_DEVELOPER);
+            $this->warn_about_invalid_availability($e);
             return false;
         }
     }
 
+    /**
+     * In some places we catch coding_exception because if a bug happens, it
+     * would be fatal for the course page GUI; instead we just show a developer
+     * debug message.
+     *
+     * @param \coding_exception $e Exception that occurred
+     */
+    protected function warn_about_invalid_availability(\coding_exception $e) {
+        $name = $this->get_thing_name();
+        // If it occurs while building modinfo based on somebody calling $cm->name,
+        // we can't get $cm->name, and this line will cause a warning.
+        $htmlname = @$this->format_info($name, $this->course);
+        if ($htmlname === '') {
+            // So instead use the numbers (cmid) from the tag.
+            $htmlname = preg_replace('~[^0-9]~', '', $name);
+        }
+        $info = 'Error processing availability data for &lsquo;' . $htmlname
+                 . '&rsquo;: ' . s($e->a);
+        debugging($info, DEBUG_DEVELOPER);
+    }
+
     /**
      * Called during restore (near end of restore). Updates any necessary ids
      * and writes the updated tree to the database. May output warnings if
index 67f02d6..777c46a 100644 (file)
@@ -43,7 +43,7 @@ class info_section extends info {
      * @param \section_info $section Section object
      */
     public function __construct(\section_info $section) {
-        parent::__construct(\get_course($section->course), $section->visible,
+        parent::__construct($section->modinfo->get_course(), $section->visible,
                 $section->availability);
         $this->section = $section;
     }
index 31f1167..499d1a4 100644 (file)
@@ -79,9 +79,11 @@ class frontend extends \core_availability\frontend {
             \section_info $section = null) {
         global $CFG;
 
-        // Group option can be used on sections, and on modules but only
-        // if groupmembersonly is turned off. (To avoid confusion.)
-        if (!is_null($cm) && $CFG->enablegroupmembersonly) {
+        // If groupmembersonly is turned on, then you can only add group
+        // restrictions on sections (which don't use groupmembersonly) and
+        // not on modules. This is to avoid confusion - otherwise
+        // there would be two ways to add restrictions based on groups.
+        if (is_null($section) && $CFG->enablegroupmembersonly) {
             return false;
         }
 
index 9dfb5e5..456fb26 100644 (file)
@@ -74,9 +74,11 @@ class frontend extends \core_availability\frontend {
             \section_info $section = null) {
         global $CFG, $DB;
 
-        // Grouping option can be used on sections, and on modules but only
-        // if groupmembersonly is turned off. (To avoid confusion.)
-        if (!is_null($cm) && $CFG->enablegroupmembersonly) {
+        // If groupmembersonly is turned on, then you can only add group
+        // restrictions on sections (which don't use groupmembersonly) and
+        // not on modules. This is to avoid confusion - otherwise
+        // there would be two ways to add restrictions based on groups.
+        if (is_null($section) && $CFG->enablegroupmembersonly) {
             return false;
         }
 
index 185b4db..229f79a 100644 (file)
Binary files a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js and b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js differ
index 37fd6e2..60ede80 100644 (file)
Binary files a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js and b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js differ
index 185b4db..229f79a 100644 (file)
Binary files a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js and b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js differ
index fceaada..85fc922 100644 (file)
@@ -94,12 +94,16 @@ M.core_availability.form = {
 
         // Get top-level tree as JSON.
         var value = this.field.get('value');
-        if (value === '') {
-            this.rootList = new M.core_availability.List(null, true);
-        } else {
-            var data = Y.JSON.parse(value);
-            this.rootList = new M.core_availability.List(data, true);
+        var data = null;
+        if (value !== '') {
+            try {
+                data = Y.JSON.parse(value);
+            } catch(x) {
+                // If the JSON data is not valid, treat it as empty.
+                this.field.set('value', '');
+            }
         }
+        this.rootList = new M.core_availability.List(data, true);
         this.mainDiv.appendChild(this.rootList.node);
 
         // Update JSON value after loading (to reflect any changes that need
@@ -956,7 +960,7 @@ M.core_availability.EyeIcon = function(individual, shown) {
         M.core_availability.form.update();
     };
     hideButton.on('click', click, this);
-    hideButton.on('keyup', click, this);
+    hideButton.on('key', click, 'up:enter', this);
 };
 
 /**
index 463f278..21f82f8 100644 (file)
@@ -349,9 +349,7 @@ class behat_backup extends behat_base {
         foreach ($datahash as $locator => $value) {
 
             try {
-                // Using $this->find* to enforce stability over speed.
-                $fieldnode = $this->find_field($locator);
-                $field = behat_field_manager::get_form_field($fieldnode, $this->getSession());
+                $field = behat_field_manager::get_form_field_from_label($locator, $this);
                 $field->set_value($value);
 
             } catch (ElementNotFoundException $e) {
index db96870..5864f83 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * block_comments comment created event.
  *
  * @package    block_comments
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index a347c0b..6e1214d 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * block_comments comment deleted event.
  *
  * @package    block_comments
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index bbb76a1..0c2ff91 100644 (file)
@@ -50,7 +50,8 @@ class block_mentees extends block_base {
         $this->content = new stdClass();
 
         // get all the mentees, i.e. users you have a direct assignment to
-        if ($usercontexts = $DB->get_records_sql("SELECT c.instanceid, c.instanceid, u.firstname, u.lastname
+        $allusernames = get_all_user_name_fields(true, 'u');
+        if ($usercontexts = $DB->get_records_sql("SELECT c.instanceid, c.instanceid, $allusernames
                                                     FROM {role_assignments} ra, {context} c, {user} u
                                                    WHERE ra.userid = ?
                                                          AND ra.contextid = c.id
index 9b2613b..f152729 100644 (file)
@@ -163,7 +163,7 @@ class block_navigation extends block_base {
             redirect($url);
         }
 
-        $trimmode = self::TRIM_LEFT;
+        $trimmode = self::TRIM_RIGHT;
         $trimlength = 50;
 
         if (!empty($this->config->trimmode)) {
index ed3ffcb..ce97602 100644 (file)
@@ -172,7 +172,7 @@ class block_recent_activity extends block_base {
                     $changelist[$log->cmid] = array('action' => 'delete mod',
                         'module' => (object)array(
                             'modname' => $log->modname,
-                            'modfullname' => $modnames[$log->modname]
+                            'modfullname' => isset($modnames[$log->modname]) ? $modnames[$log->modname] : $log->modname
                          ));
 
                 } else if (!$wasdeleted && isset($modinfo->cms[$log->cmid]) && $canviewupdated) {
index a1ddebb..016efd6 100644 (file)
@@ -17,7 +17,7 @@
 /**
  * This filter provides automatic linking to
  * glossary entries, aliases and categories when
- * found inside every Moodle text
+ * found inside every Moodle text.
  *
  * @package    filter
  * @subpackage glossary
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * Glossary filtering
+ * Glossary linking filter class.
  *
- * TODO: erase the $GLOSSARY_EXCLUDECONCEPTS global => require format_text()
- *       to be able to pass arbitrary $options['filteroptions']['glossary'] to filter_text()
+ * NOTE: multilang glossary entries are not compatible with this filter.
  */
 class filter_glossary extends moodle_text_filter {
+    /** @var int $cachecourseid cache invalidation flag in case content from multiple courses displayed. */
+    protected $cachecourseid = null;
+    /** @var int $cacheuserid cache invalidation flag in case user is switched. */
+    protected $cacheuserid = null;
+    /** @var array $cacheconceptlist page level filter cache, this should be always faster than MUC */
+    protected $cacheconceptlist = null;
 
     public function setup($page, $context) {
         // This only requires execution once per request.
@@ -49,185 +54,100 @@ class filter_glossary extends moodle_text_filter {
     }
 
     public function filter($text, array $options = array()) {
-        global $CFG, $DB, $GLOSSARY_EXCLUDECONCEPTS;
-
-        // Trivial-cache - keyed on $cachedcontextid
-        static $cachedcontextid;
-        static $conceptlist;
-
-        static $nothingtodo;         // To avoid processing if no glossaries / concepts are found
+        global $CFG, $USER, $GLOSSARY_EXCLUDEENTRY;
 
         // Try to get current course.
         $coursectx = $this->context->get_course_context(false);
         if (!$coursectx) {
+            // Only global glossaries will be linked.
             $courseid = 0;
         } else {
             $courseid = $coursectx->instanceid;
         }
 
-        // Initialise/invalidate our trivial cache if dealing with a different context
-        if (!isset($cachedcontextid) || $cachedcontextid !== $this->context->id) {
-            $cachedcontextid = $this->context->id;
-            $conceptlist = array();
-            $nothingtodo = false;
-        }
-
-        if (($nothingtodo === true) || (!has_capability('mod/glossary:view', $this->context))) {
-            return $text;
+        if ($this->cachecourseid != $courseid or $this->cacheuserid != $USER->id) {
+            // Invalidate the page cache.
+            $this->cacheconceptlist = null;
         }
 
-        // Create a list of all the concepts to search for.  It may be cached already.
-        if (empty($conceptlist)) {
-
-            // Find all the glossaries we need to examine
-            if (!$glossaries = $DB->get_records_sql_menu('
-                    SELECT g.id, g.name
-                      FROM {glossary} g, {course_modules} cm, {modules} m
-                     WHERE m.name = \'glossary\'
-                       AND cm.module = m.id
-                       AND cm.visible = 1
-                       AND g.id = cm.instance
-                       AND g.usedynalink != 0
-                       AND (g.course = ? OR g.globalglossary = 1)
-                  ORDER BY g.globalglossary, g.id', array($courseid))) {
-                $nothingtodo = true;
+        if (is_array($this->cacheconceptlist) and empty($GLOSSARY_EXCLUDEENTRY)) {
+            if (empty($this->cacheconceptlist)) {
                 return $text;
             }
+            return filter_phrases($text, $this->cacheconceptlist);
+        }
 
-            // Make a list of glossary IDs for searching
-            $glossarylist = implode(',', array_keys($glossaries));
-
-            // Pull out all the raw data from the database for entries, categories and aliases
-            $entries = $DB->get_records_select('glossary_entries',
-                    'glossaryid IN ('.$glossarylist.') AND usedynalink != 0 AND approved != 0 ', null, '',
-                    'id,glossaryid, concept, casesensitive, 0 AS category, fullmatch');
-
-            $categories = $DB->get_records_select('glossary_categories',
-                    'glossaryid IN ('.$glossarylist.') AND usedynalink != 0', null, '',
-                    'id,glossaryid,name AS concept, 1 AS casesensitive, 1 AS category, 1 AS fullmatch');
-
-            $aliases = $DB->get_records_sql('
-                    SELECT ga.id, ge.id AS entryid, ge.glossaryid,
-                           ga.alias AS concept, ge.concept AS originalconcept,
-                           casesensitive, 0 AS category, fullmatch
-                      FROM {glossary_alias} ga,
-                           {glossary_entries} ge
-                      WHERE ga.entryid = ge.id
-                        AND ge.glossaryid IN ('.$glossarylist.')
-                        AND ge.usedynalink != 0
-                        AND ge.approved != 0', null);
-
-            // Combine them into one big list
-            $concepts = array();
-            if ($entries and $categories) {
-                $concepts = array_merge($entries, $categories);
-            } else if ($categories) {
-                $concepts = $categories;
-            } else if ($entries) {
-                $concepts = $entries;
-            }
-
-            if ($aliases) {
-                $concepts = array_merge($concepts, $aliases);
-            }
-
-            if (!empty($concepts)) {
-                foreach ($concepts as $key => $concept) {
-                    // Trim empty or unlinkable concepts
-                    $currentconcept = trim(strip_tags($concept->concept));
-
-                    // Concept must be HTML-escaped, so do the same as format_string
-                    // to turn ampersands into &amp;.
-                    $currentconcept = replace_ampersands_not_followed_by_entity($currentconcept);
-
-                    if (empty($currentconcept)) {
-                        unset($concepts[$key]);
-                        continue;
-                    } else {
-                        $concepts[$key]->concept = $currentconcept;
-                    }
-
-                    // Rule out any small integers.  See bug 1446
-                    $currentint = intval($currentconcept);
-                    if ($currentint && (strval($currentint) == $currentconcept) && $currentint < 1000) {
-                        unset($concepts[$key]);
-                    }
-                }
-            }
-
-            if (empty($concepts)) {
-                $nothingtodo = true;
-                return $text;
-            }
+        list($glossaries, $allconcepts) = \mod_glossary\local\concept_cache::get_concepts($courseid);
 
-            usort($concepts, 'filter_glossary::sort_entries_by_length');
+        if (!$allconcepts) {
+            $this->cacheuserid = $USER->id;
+            $this->cachecourseid = $courseid;
+            $this->cacheconcepts = array();
+            return $text;
+        }
 
-            $strcategory = get_string('category', 'glossary');
+        $strcategory = get_string('category', 'glossary');
 
-            // Loop through all the concepts, setting up our data structure for the filter
-            $conceptlist = array();    // We will store all the concepts here
+        $conceptlist = array();
+        $excluded = false;
 
+        foreach ($allconcepts as $concepts) {
             foreach ($concepts as $concept) {
-                $glossaryname = str_replace(':', '-', $glossaries[$concept->glossaryid]);
-                if ($concept->category) {       // Link to a category
-                    // TODO: Fix this string usage
-                    $title = strip_tags($glossaryname.': '.$strcategory.' '.$concept->concept);
-                    $href_tag_begin = '<a class="glossary autolink category glossaryid'.$concept->glossaryid.'" title="'.$title.'" '.
-                                      'href="'.$CFG->wwwroot.'/mod/glossary/view.php?g='.$concept->glossaryid.
-                                      '&amp;mode=cat&amp;hook='.$concept->id.'">';
+                if (!empty($GLOSSARY_EXCLUDEENTRY) and $concept->id == $GLOSSARY_EXCLUDEENTRY) {
+                    $excluded = true;
+                    continue;
+                }
+                if ($concept->category) { // Link to a category.
+                    // TODO: Fix this string usage.
+                    $title = $glossaries[$concept->glossaryid] . ': ' . $strcategory . ' ' . $concept->concept;
+                    $link = new moodle_url('/mod/glossary/view.php', array('g' => $concept->glossaryid, 'mode' => 'cat', 'hook' => $concept->id));
+                    $attributes = array(
+                        'href'  => $link,
+                        'title' => $title,
+                        'class' => 'glossary autolink category glossaryid' . $concept->glossaryid);
+
                 } else { // Link to entry or alias
-                    if (!empty($concept->originalconcept)) {  // We are dealing with an alias (so show and point to original)
-                        $title = str_replace('"', "'", html_entity_decode(
-                                strip_tags($glossaryname.': '.$concept->originalconcept)));
-                        $concept->id = $concept->entryid;
-                    } else { // This is an entry
-                        // We need to remove entities from the content here because it
-                        // will be escaped by html_writer below.
-                        $title = str_replace('"', "'", html_entity_decode(
-                                strip_tags($glossaryname.': '.$concept->concept)));
-                    }
-                    // hardcoding dictionary format in the URL rather than defaulting
+                    $title = $glossaries[$concept->glossaryid] . ': ' . $concept->concept;
+                    // Hardcoding dictionary format in the URL rather than defaulting
                     // to the current glossary format which may not work in a popup.
                     // for example "entry list" means the popup would only contain
                     // a link that opens another popup.
-                    $link = new moodle_url('/mod/glossary/showentry.php', array('courseid'=>$courseid, 'eid'=>$concept->id, 'displayformat'=>'dictionary'));
+                    $link = new moodle_url('/mod/glossary/showentry.php', array('eid' => $concept->id, 'displayformat' => 'dictionary'));
                     $attributes = array(
-                        'href' => $link,
-                        'title'=> $title,
-                        'class'=> 'glossary autolink concept glossaryid'.$concept->glossaryid);
-
-                    // this flag is optionally set by resource_pluginfile()
-                    // if processing an embedded file use target to prevent getting nested Moodles
-                    if (isset($CFG->embeddedsoforcelinktarget) && $CFG->embeddedsoforcelinktarget) {
-                        $attributes['target'] = '_top';
-                    }
-
-                    $href_tag_begin = html_writer::start_tag('a', $attributes);
+                        'href'  => $link,
+                        'title' => str_replace('&amp;', '&', $title), // Undo the s() mangling.
+                        'class' => 'glossary autolink concept glossaryid' . $concept->glossaryid);
                 }
+                // This flag is optionally set by resource_pluginfile()
+                // if processing an embedded file use target to prevent getting nested Moodles.
+                if (!empty($CFG->embeddedsoforcelinktarget)) {
+                    $attributes['target'] = '_top';
+                }
+                $href_tag_begin = html_writer::start_tag('a', $attributes);
+
                 $conceptlist[] = new filterobject($concept->concept, $href_tag_begin, '</a>',
                     $concept->casesensitive, $concept->fullmatch);
             }
-
-            $conceptlist = filter_remove_duplicates($conceptlist);
         }
 
-        if (!empty($GLOSSARY_EXCLUDECONCEPTS)) {
-            $reducedconceptlist=array();
-            foreach($conceptlist as $concept) {
-                if(!in_array($concept->phrase,$GLOSSARY_EXCLUDECONCEPTS)) {
-                    $reducedconceptlist[]=$concept;
-                }
-            }
-            return filter_phrases($text, $reducedconceptlist);
+        usort($conceptlist, 'filter_glossary::sort_entries_by_length');
+
+        if (!$excluded) {
+            // Do not cache the excluded list here, it is used once per page only.
+            $this->cacheuserid = $USER->id;
+            $this->cachecourseid = $courseid;
+            $this->cacheconceptlist = $conceptlist;
         }
 
+        if (empty($conceptlist)) {
+            return $text;
+        }
         return filter_phrases($text, $conceptlist);   // Actually search for concepts!
     }
 
-
     private static function sort_entries_by_length($entry0, $entry1) {
-        $len0 = strlen($entry0->concept);
-        $len1 = strlen($entry1->concept);
+        $len0 = strlen($entry0->phrase);
+        $len1 = strlen($entry1->phrase);
 
         if ($len0 < $len1) {
             return 1;
index c8f3966..ccf54ed 100644 (file)
@@ -53,18 +53,22 @@ class filter_glossary_filter_testcase extends advanced_testcase {
                 array('course' => $course->id, 'mainglossary' => 1));
 
         // Create two entries with ampersands and one normal entry.
+        /** @var mod_glossary_generator $generator */
         $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary');
         $normal = $generator->create_content($glossary, array('concept' => 'normal'));
         $amp1 = $generator->create_content($glossary, array('concept' => 'A&B'));
         $amp2 = $generator->create_content($glossary, array('concept' => 'C&amp;D'));
 
+        filter_manager::reset_caches();
+        \mod_glossary\local\concept_cache::reset_caches();
+
         // Format text with all three entries in HTML.
         $html = '<p>A&amp;B C&amp;D normal</p>';
         $filtered = format_text($html, FORMAT_HTML, array('context' => $context));
 
         // Find all the glossary links in the result.
         $matches = array();
-        preg_match_all('~courseid=' . $course->id . '&amp;eid=([0-9]+).*?title="(.*?)"~', $filtered, $matches);
+        preg_match_all('~eid=([0-9]+).*?title="(.*?)"~', $filtered, $matches);
 
         // There should be 3 glossary links.
         $this->assertEquals(3, count($matches[1]));
index 9d099fb..d20d57f 100644 (file)
@@ -25,8 +25,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version  = 2013110500;
-$plugin->requires = 2013110500;  // Requires this Moodle version
+$plugin->version  = 2014040600;
+$plugin->requires = 2014040300;  // Requires this Moodle version
 $plugin->component= 'filter_glossary';
 
-$plugin->dependencies = array('mod_glossary' => 2013110500);
+$plugin->dependencies = array('mod_glossary' => 2014040600);
index 6e593f3..05eae5d 100644 (file)
@@ -114,7 +114,11 @@ class filter_tex extends moodle_text_filter {
         global $CFG, $DB;
 
         /// Do a quick check using stripos to avoid unnecessary work
-        if (!preg_match('/<tex/i',$text) and !strstr($text,'$$') and !strstr($text,'\\[') and !preg_match('/\[tex/i',$text)) { //added one more tag (dlnsk)
+        if ((!preg_match('/<tex/i', $text)) &&
+                (strpos($text,'$$') === false) &&
+                (strpos($text,'\\[') === false) &&
+                (strpos($text, '\\(') === false) &&
+                (!preg_match('/\[tex/i',$text))) {
             return $text;
         }
 
@@ -146,9 +150,20 @@ class filter_tex extends moodle_text_filter {
         // or $$ TeX expression $$
         // or \[ TeX expression \]          // original tag of MathType and TeXaide (dlnsk)
         // or [tex] TeX expression [/tex]   // somtime it's more comfortable than <tex> (dlnsk)
-        preg_match_all('/<tex(?:\s+alt=["\'](.*?)["\'])?>(.+?)<\/tex>|\$\$(.+?)\$\$|\\\\\[(.+?)\\\\\]|\\[tex\\](.+?)\\[\/tex\\]/is', $text, $matches);
+        $rules = array(
+            '<tex(?:\s+alt=["\'](.*?)["\'])?>(.+?)<\/tex>',
+            '\$\$(.+?)\$\$',
+            '\\\\\[(.+?)\\\\\]',
+            '\\\\\((.+?)\\\\\)',
+            '\\[tex\\](.+?)\\[\/tex\\]'
+        );
+        $megarule = '/' . implode($rules, '|') . '/is';
+        preg_match_all($megarule, $text, $matches);
         for ($i=0; $i<count($matches[0]); $i++) {
-            $texexp = $matches[2][$i] . $matches[3][$i] . $matches[4][$i] . $matches[5][$i];
+            $texexp = '';
+            for ($j = 0; $j < count($rules); $j++) {
+                $texexp .= $matches[$j + 2][$i];
+            }
             $alt = $matches[1][$i];
             $texexp = str_replace('<nolink>','',$texexp);
             $texexp = str_replace('</nolink>','',$texexp);
diff --git a/filter/tex/tests/filter_test.php b/filter/tex/tests/filter_test.php
new file mode 100644 (file)
index 0000000..1b03725
--- /dev/null
@@ -0,0 +1,81 @@
+<?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/>.
+
+/**
+ * Unit test for the filter_tex
+ *
+ * @package    filter_tex
+ * @copyright  2014 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+global $CFG;
+require_once($CFG->dirroot . '/filter/tex/filter.php');
+
+
+/**
+ * Unit tests for filter_tex.
+ *
+ * Test the delimiter parsing used by the tex filter.
+ *
+ * @copyright  2014 Damyon Wiese
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class filter_tex_testcase extends advanced_testcase {
+
+    protected $filter;
+
+    protected function setUp() {
+        parent::setUp();
+        $this->resetAfterTest(true);
+        $this->filter = new filter_tex(context_system::instance(), array());
+    }
+
+    function run_with_delimiters($start, $end, $filtershouldrun) {
+        $pre = 'Some pre text';
+        $post = 'Some post text';
+        $equation = ' \sum{a^b} ';
+
+        $before = $pre . $start . $equation . $end . $post;
+
+        $after = trim($this->filter->filter($before));
+
+        if ($filtershouldrun) {
+            $this->assertNotEquals($after, $before);
+        } else {
+            $this->assertEquals($after, $before);
+        }
+    }
+
+    function test_delimiters() {
+        // First test the list of supported delimiters.
+        $this->run_with_delimiters('$$', '$$', true);
+        $this->run_with_delimiters('\\(', '\\)', true);
+        $this->run_with_delimiters('\\[', '\\]', true);
+        $this->run_with_delimiters('[tex]', '[/tex]', true);
+        $this->run_with_delimiters('<tex>', '</tex>', true);
+        $this->run_with_delimiters('<tex alt="nonsense">', '</tex>', true);
+        // Now test some cases that shouldn't be executed.
+        $this->run_with_delimiters('<textarea>', '</textarea>', false);
+        $this->run_with_delimiters('$', '$', false);
+        $this->run_with_delimiters('(', ')', false);
+        $this->run_with_delimiters('[', ']', false);
+        $this->run_with_delimiters('$$', '\\]', false);
+    }
+
+}
index 916abb7..d09245d 100644 (file)
@@ -739,6 +739,7 @@ $string['eventcoursesectionupdated'] = ' Course section updated';
 $string['eventcoursemoduleinstancelistviewed'] = 'Course module instance list viewed';
 $string['eventemailfailed'] = 'Email failed to send';
 $string['eventname'] = 'Event name';
+$string['eventunknownlogged'] = 'Unknown event';
 $string['eventusercreated'] = 'User created';
 $string['eventuserdeleted'] = 'User deleted';
 $string['eventuserlistviewed'] = 'User list viewed';
index b1f6385..63ef294 100644 (file)
@@ -137,6 +137,7 @@ $string['errorprocess'] = 'Error occurred during processing!';
 $string['errorprocessingresponses'] = 'An error occurred while processing your responses ({$a}). Click continue to return to the page you were on and try again.';
 $string['errorsavingcomment'] = 'Error saving the comment for question {$a->name} in the database.';
 $string['errorupdatingattempt'] = 'Error updating attempt {$a->id} in the database.';
+$string['eventquestioncategorycreated'] = 'Question category created';
 $string['exportcategory'] = 'Export category';
 $string['exportcategory_help'] = 'This setting determines the category from which the exported questions will be taken.
 
index e9c6633..d869d74 100644 (file)
@@ -5652,7 +5652,7 @@ abstract class context extends stdClass implements IteratorAggregate {
      * Is this context part of any course? If yes return course context.
      *
      * @param bool $strict true means throw exception if not found, false means return false if not found
-     * @return course_context context of the enclosing course, null if not found or exception
+     * @return context_course context of the enclosing course, null if not found or exception
      */
     public function get_course_context($strict = true) {
         if ($strict) {
@@ -6791,7 +6791,7 @@ class context_course extends context {
      * Is this context part of any course? If yes return course context.
      *
      * @param bool $strict true means throw exception if not found, false means return false if not found
-     * @return course_context context of the enclosing course, null if not found or exception
+     * @return context_course context of the enclosing course, null if not found or exception
      */
     public function get_course_context($strict = true) {
         return $this;
@@ -7257,7 +7257,7 @@ class context_block extends context {
      * Is this context part of any course? If yes return course context.
      *
      * @param bool $strict true means throw exception if not found, false means return false if not found
-     * @return course_context context of the enclosing course, null if not found or exception
+     * @return context_course context of the enclosing course, null if not found or exception
      */
     public function get_course_context($strict = true) {
         $parentcontext = $this->get_parent_context();
index 83179f0..aaf6400 100644 (file)
@@ -34,6 +34,8 @@
     - AlfrescoWebService::__soapCall() arguments do not match SoapClient::__soapCall()
     - AlfrescoWebService::__doRequest() arguments do not match SoapClient::__soapCall()
 
+6. Apply the changes from MDL-41975 in regard with the timestamp
+
 == Alfresco PHP Library ==
 
 Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki.
index b549755..898dcdf 100644 (file)
@@ -79,8 +79,8 @@ class AlfrescoWebService extends SoapClient
 \r
          // Construct Timestamp Header\r
          $timeStamp = $dom->createElementNS($this->wsUtilityNS, "Timestamp");\r
-         $createdDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+24, date("i"), date("s"), date("m"), date("d"), date("Y")));\r
-         $expiresDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+25, date("i"), date("s"), date("m"), date("d"), date("Y")));\r
+         $createdDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H"), gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));\r
+         $expiresDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H")+1, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));\r
          $created = new DOMElement("Created", $createdDate, $this->wsUtilityNS);\r
          $expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS);\r
          $timeStamp->appendChild($created);\r
index 6bbc39e..d2e8c7f 100644 (file)
@@ -26,7 +26,9 @@
 // NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
 
 use Behat\Mink\Session as Session,
-    Behat\Mink\Element\NodeElement as NodeElement;
+    Behat\Mink\Element\NodeElement as NodeElement,
+    Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException,
+    Behat\MinkExtension\Context\RawMinkContext as RawMinkContext;
 
 /**
  * Helper to interact with form fields.
@@ -38,6 +40,30 @@ use Behat\Mink\Session as Session,
  */
 class behat_field_manager {
 
+    /**
+     * Gets an instance of the form field from it's label
+     *
+     * @param string $label
+     * @param RawMinkContext $context
+     * @return behat_form_field
+     */
+    public static function get_form_field_from_label($label, RawMinkContext $context) {
+
+        // There are moodle form elements that are not directly related with
+        // a basic HTML form field, we should also take care of them.
+        try {
+            // The DOM node.
+            $fieldnode = $context->find_field($label);
+        } catch (ElementNotFoundException $e) {
+
+            // Looking for labels that points to filemanagers.
+            $fieldnode = $context->find_filemanager($label);
+        }
+
+        // The behat field manager.
+        return self::get_form_field($fieldnode, $context->getSession());
+    }
+
     /**
      * Gets an instance of the form field.
      *
@@ -217,6 +243,7 @@ class behat_field_manager {
      * @todo MDL-XXXXX This will be deleted in Moodle 2.8
      * @see behat_field_manager::get_form_field()
      * @param NodeElement $fieldnode
+     * @param string $locator
      * @param Session $session The behat browser session
      * @return behat_form_field
      */
@@ -237,6 +264,7 @@ class behat_field_manager {
      * @todo MDL-XXXXX This will be deleted in Moodle 2.8
      * @see behat_field_manager::get_field_node_type()
      * @param NodeElement $fieldnode The current node.
+     * @param string $locator
      * @param Session $session The behat browser session
      * @return mixed A NodeElement if we continue looking for the element type and String or false when we are done.
      */
diff --git a/lib/behat/classes/behat_context_helper.php b/lib/behat/classes/behat_context_helper.php
new file mode 100644 (file)
index 0000000..cdeea57
--- /dev/null
@@ -0,0 +1,111 @@
+<?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/>.
+
+/**
+ * Helper to initialise behat contexts from moodle code.
+ *
+ * @package    core
+ * @category   test
+ * @copyright  2014 David Monllaó
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
+
+use Behat\Mink\Session as Session,
+    Behat\Mink\Mink as Mink;
+
+/**
+ * Helper to get behat contexts.
+ *
+ * @package    core
+ * @category   test
+ * @copyright  2014 David Monllaó
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class behat_context_helper {
+
+    /**
+     * List of already initialized contexts.
+     *
+     * @var array
+     */
+    protected static $contexts = array();
+
+    /**
+     * @var Mink.
+     */
+    protected static $mink = false;
+
+    /**
+     * Sets the browser session.
+     *
+     * @param Session $session
+     * @return void
+     */
+    public static function set_session(Session $session) {
+
+        // Set mink to be able to init a context.
+        self::$mink = new Mink(array('mink' => $session));
+        self::$mink->setDefaultSessionName('mink');
+    }
+
+    /**
+     * Gets the required context.
+     *
+     * Getting a context you get access to all the steps
+     * that uses direct API calls; steps returning step chains
+     * can not be executed like this.
+     *
+     * @throws coding_exception
+     * @param string $classname Context identifier (the class name).
+     * @return behat_base
+     */
+    public static function get($classname) {
+
+        if (!self::init_context($classname)) {
+            throw coding_exception('The required "' . $classname . '" class does not exist');
+        }
+
+        return self::$contexts[$classname];
+    }
+
+    /**
+     * Initializes the required context.
+     *
+     * @throws coding_exception
+     * @param string $classname
+     * @return bool
+     */
+    protected static function init_context($classname) {
+
+        if (!empty(self::$contexts[$classname])) {
+            return true;
+        }
+
+        if (!class_exists($classname)) {
+            return false;
+        }
+
+        $instance = new $classname();
+        $instance->setMink(self::$mink);
+
+        self::$contexts[$classname] = $instance;
+
+        return true;
+    }
+
+}
index cedf70e..ddacab4 100644 (file)
@@ -64,11 +64,13 @@ class behat_selectors {
         'checkbox' => 'checkbox',
         'radio' => 'radio',
         'file' => 'file',
+        'filemanager' => 'filemanager',
         'optgroup' => 'optgroup',
         'option' => 'option',
         'table' => 'table',
         'field' => 'field',
         'fieldset' => 'fieldset',
+        'text' => 'text',
         'css_element' => 'css_element',
         'xpath_element' => 'xpath_element'
     );
@@ -82,7 +84,10 @@ class behat_selectors {
      * @var XPaths for moodle elements.
      */
     protected static $moodleselectors = array(
-        'dialogue' => <<<XPATH
+        'text' => <<<XPATH
+//*[contains(., %locator%)][count(./descendant::*[contains(., %locator%)]) = 0]
+XPATH
+        , 'dialogue' => <<<XPATH
 //div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
     normalize-space(descendant::div[
         contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-hd ')
@@ -98,6 +103,9 @@ XPATH
 XPATH
         , 'table_row' => <<<XPATH
 .//tr[contains(normalize-space(.), %locator%)]
+XPATH
+        , 'filemanager' => <<<XPATH
+//div[contains(concat(' ', normalize-space(@class), ' '), ' ffilemanager ')]/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
 XPATH
     );
 
index 4d3f1b4..c1abb1a 100644 (file)
@@ -50,6 +50,12 @@ class behat_form_field {
      */
     protected $field;
 
+    /**
+     * @var string The field's locator.
+     */
+    protected $fieldlocator = false;
+
+
     /**
      * General constructor with the node and the session to interact with.
      *
@@ -171,4 +177,63 @@ class behat_form_field {
         }
         return true;
     }
+
+    /**
+     * Gets the field locator.
+     *
+     * Defaults to the field label but you can
+     * specify other locators if you are interested.
+     *
+     * Public visibility as in most cases will be hard to
+     * use this method in a generic way, as fields can
+     * be selected using multiple ways (label, id, name...).
+     *
+     * @throws coding_exception
+     * @param string $locatortype
+     * @return string
+     */
+    protected function get_field_locator($locatortype = false) {
+
+        if (!empty($this->fieldlocator)) {
+            return $this->fieldlocator;
+        }
+
+        $fieldid = $this->field->getAttribute('id');
+
+        // Defaults to label.
+        if ($locatortype == 'label' || $locatortype == false) {
+
+            $labelnode = $this->session->getPage()->find('xpath', '//label[@for="' . $fieldid . '"]');
+
+            // Exception only if $locatortype was specified.
+            if (!$labelnode && $locatortype == 'label') {
+                throw new coding_exception('Field with "' . $fieldid . '" id does not have a label.');
+            }
+
+            $this->fieldlocator = $labelnode->getText();
+        }
+
+        // Let's look for the name as a second option (more popular than
+        // id's when pointing to fields).
+        if (($locatortype == 'name' || $locatortype == false) &&
+                empty($this->fieldlocator)) {
+
+            $name = $this->field->getAttribute('name');
+
+            // Exception only if $locatortype was specified.
+            if (!$name && $locatortype == 'name') {
+                throw new coding_exception('Field with "' . $fieldid . '" id does not have a name attribute.');
+            }
+
+            $this->fieldlocator = $name;
+        }
+
+        // Otherwise returns the id if no specific locator type was provided.
+        if (empty($this->fieldlocator)) {
+            $this->fieldlocator = $fieldid;
+        }
+
+        return $this->fieldlocator;
+    }
+
 }
diff --git a/lib/behat/form_field/behat_form_filemanager.php b/lib/behat/form_field/behat_form_filemanager.php
new file mode 100644 (file)
index 0000000..055efbf
--- /dev/null
@@ -0,0 +1,122 @@
+<?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 manager form element.
+ *
+ * @package    core_form
+ * @category   test
+ * @copyright  2014 David Monllaó
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
+
+require_once(__DIR__  . '/behat_form_field.php');
+
+/**
+ * File manager form field.
+ *
+ * Simple filemanager field manager to allow
+ * forms to be filled using TableNodes. It only
+ * adds files and checks the field contents in the
+ * root directory. If you want to run complex actions
+ * that involves subdirectories or other repositories
+ * than 'Upload a file' you should use steps related with
+ * behat_filepicker::i_add_file_from_repository_to_filemanager
+ * this is intended to be used with multi-field
+ *
+ * This field manager allows you to:
+ * - Get: A comma-separated list of the root directory
+ *   file names, including folders.
+ * - Set: Add a file, in case you want to add more than
+ *     one file you can always set two table rows using
+ *     the same locator.
+ * - Match: A comma-separated list of file names.
+ *
+ * @package    core_form
+ * @category   test
+ * @copyright  2014 David Monllaó
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class behat_form_filemanager extends behat_form_field {
+
+    /**
+     * Gets the value.
+     *
+     * @return string A comma-separated list of the root directory file names.
+     */
+    public function get_value() {
+
+        // Wait until DOM and JS is ready.
+        $this->session->wait(behat_base::TIMEOUT, behat_base::PAGE_READY_JS);
+
+        // Get the label to restrict the files to this single form field.
+        $fieldlabel = $this->get_field_locator();
+
+        // Get the name of the current directory elements.
+        $xpath = "//label[contains(., '" . $fieldlabel . "')]" .
+            "/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' fitemtitle ')]" .
+            "/following-sibling::div[contains(concat(' ', normalize-space(@class), ' '), ' ffilemanager ')]" .
+            "/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename ')]";
+
+        // We don't need to wait here, also we don't have access to protected
+        // contexts find* methods.
+        $files = $this->session->getPage()->findAll('xpath', $xpath);
+
+        if (!$files) {
+            return '';
+        }
+
+        $filenames = array();
+        foreach ($files as $filenode) {
+            $filenames[] = $filenode->getText();
+        }
+
+        return implode(',', $filenames);
+    }
+
+    /**
+     * Sets the field value.
+     *
+     * @param string $value
+     * @return void
+     */
+    public function set_value($value) {
+
+        // Getting the filemanager label from the DOM.
+        $fieldlabel = $this->get_field_locator();
+
+        // Getting the filepicker context and using the step definition
+        // to upload the requested file.
+        $uploadcontext = behat_context_helper::get('behat_repository_upload');
+        $uploadcontext->i_upload_file_to_filemanager($value, $fieldlabel);
+    }
+
+    /**
+     * Matches the provided filename/s against the current field value.
+     *
+     * If the filemanager contains more than one file the $expectedvalue
+     * value should include all the file names separating them by comma.
+     *
+     * @param string $expectedvalue
+     * @return bool The provided value matches the field value?
+     */
+    public function matches($expectedvalue) {
+        return $this->text_matches($expectedvalue);
+    }
+
+}
index 6b4bf6e..62752af 100644 (file)
@@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die();
  * Both events could be triggered in a row, first the uploaded, then the submitted.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 972195c..64fdabe 100644 (file)
@@ -44,6 +44,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 33870ce..e0034bd 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * All other event classes must extend this class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Petr Skoda {@link http://skodak.org}
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  *
@@ -338,7 +339,7 @@ abstract class base implements \IteratorAggregate {
         }
 
         if (!class_exists($classname)) {
-            return false;
+            return self::restore_unknown($data, $logextra);
         }
         $event = new $classname();
         if (!($event instanceof \core\event\base)) {
@@ -370,6 +371,27 @@ abstract class base implements \IteratorAggregate {
         return $event;
     }
 
+    /**
+     * Restore unknown event.
+     *
+     * @param array $data
+     * @param array $logextra
+     * @return unknown_logged
+     */
+    protected static final function restore_unknown(array $data, array $logextra) {
+        $classname = '\core\event\unknown_logged';
+
+        /** @var unknown_logged $event */
+        $event = new $classname();
+        $event->restored = true;
+        $event->triggered = true;
+        $event->dispatched = true;
+        $event->data = $data;
+        $event->logextra = $logextra;
+
+        return $event;
+    }
+
     /**
      * Create fake event from legacy log data.
      *
index 28c03c1..495a643 100644 (file)
@@ -39,6 +39,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 onwards Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 1ac2850..3bd1005 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * blog comment created event.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index cf8e7da..4e07272 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * blog comment deleted event.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 6da91bb..a22092d 100644 (file)
@@ -36,6 +36,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 onwards Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 1b3f6b1..c476189 100644 (file)
@@ -21,7 +21,7 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Event for when a new blog entry is added..
  *
- * @package    core_blog
+ * @package    core
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -31,7 +31,8 @@ defined('MOODLE_INTERNAL') || die();
  *
  * Class for event to be triggered when a blog entry is created.
  *
- * @package    core_blog
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 467d811..e2acde8 100644 (file)
@@ -16,7 +16,7 @@
 /**
  * Event for when a new blog entry is deleted.
  *
- * @package    core_blog
+ * @package    core
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -29,7 +29,8 @@ defined('MOODLE_INTERNAL') || die();
  *
  * Event for when a new blog entry is deleted.
  *
- * @package    core_blog
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ff9686b..dcfec20 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event to be triggered when a blog entry is updated.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index b9b83a6..9dceaca 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  *     -int repeatid: Id of the parent event if present, else 0.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 329aed5..296ad68 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  *     -int repeatid: Id of the parent event if present, else 0.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ffab5b9..6226502 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  *     -int repeatid: Id of the parent event if present, else 0.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index cfe435d..ee748e4 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Cohort created event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Dan Poltawski <dan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ccc2ccd..4b9c520 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Cohort deleted event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Dan Poltawski <dan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 8dc153d..a32c341 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * User added to a cohort event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Dan Poltawski <dan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index e42868a..6145fa2 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * User removed from a cohort event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Dan Poltawski <dan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7ee1226..e023643 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Cohort updated event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Dan Poltawski <dan@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 2e18f69..539bfc4 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index be04218..de7829f 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index fbea09d..4964ee4 100644 (file)
@@ -32,6 +32,7 @@ defined('MOODLE_INTERNAL') || die();
  * This class has to be extended by any event which is triggred while viewing comment.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 797ad37..9f7ab5f 100644 (file)
@@ -37,6 +37,7 @@ debugging('core\event\content_viewed has been deprecated. Please extend base eve
  * This class has been deprecated, please extend base event or other relevent abstract class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @deprecated since Moodle 2.7
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
index c131f27..4e60ffc 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * Course category created event.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 63333b4..e14dc68 100644 (file)
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 2cb7739..d12bbaa 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * Course category updated event.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 300bcdc..05a43ee 100644 (file)
@@ -21,7 +21,8 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Event when course completed.
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 9ffa4f6..d687080 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event when course module completion is updated.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 05a59d1..fe64a58 100644 (file)
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 93e6bab..16fee48 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 357b9cd..fc999d5 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 6233bfb..88d8067 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event when course module completion is updated.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index c73f711..fd0aebb 100644 (file)
@@ -39,6 +39,7 @@ defined('MOODLE_INTERNAL') || die();
  * Class for event to be triggered when a new course module is created.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
  */
index 82d01d1..fa539d6 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
  */
index 87c222a..f4a5782 100644 (file)
@@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die();
  *     \mod_chat\event\course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 onwards Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index a7c2df1..6534c5c 100644 (file)
@@ -32,6 +32,7 @@ defined('MOODLE_INTERNAL') || die();
  *
  * @deprecated Since Moodle 2.7
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index e1069d6..976987b 100644 (file)
@@ -39,6 +39,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
  */
index 9f9b654..4c88c4b 100644 (file)
@@ -31,6 +31,7 @@ defined('MOODLE_INTERNAL') || die();
  * Class for event to be triggered when a course module is viewed.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 onwards Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 02aa67c..f3191d2 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 91531ef..59c6abe 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 24e046a..cae5e3a 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event for viewing the list of course resources.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Marina Glancy
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 02a9dd2..8858f4b 100644 (file)
@@ -32,6 +32,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index bec63f3..dd92950 100644 (file)
@@ -36,6 +36,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index a7d8bc3..9d3be66 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index d0220da..90830ab 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * Email failed event.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ff92010..a9faa24 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group created event.
+ * Group created event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group created event class.
+ * Group created event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index e1cfca4..f1879fb 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group deleted event.
+ * Group deleted event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group deleted event class.
+ * Group deleted event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index a248f91..674fd7e 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group member added event.
+ * Group member added event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,7 +26,7 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group member added event class.
+ * Group member added event class.
  *
  * @property-read array $other {
  *      Extra information about event.
@@ -35,7 +35,8 @@ defined('MOODLE_INTERNAL') || die();
  *      @type int itemid id of item.
  * }
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 8557359..3842a41 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group member removed event.
+ * Group member removed event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group member removed event class.
+ * Group member removed event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4b03799..e5d61f9 100644 (file)
@@ -15,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group updated event.
+ * Group updated event.
  *
  * @package    core_group
  * @copyright  2013 Frédéric Massart
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group updated event class.
+ * Group updated event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index b4ecb1a..e5a00e3 100644 (file)
@@ -15,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group grouping created event.
+ * Grouping created event.
  *
  * @package    core_group
  * @copyright  2013 Frédéric Massart
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group grouping created event class.
+ * Grouping created event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 3603be9..a3d0efc 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group grouping deleted event.
+ * Grouping deleted event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group grouping deleted event class.
+ * Grouping deleted event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4e351dd..2dfca36 100644 (file)
@@ -15,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * core_group grouping updated event.
+ * Grouping updated event.
  *
- * @package    core_group
+ * @package    core
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -26,9 +26,10 @@ namespace core\event;
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * core_group grouping updated event class.
+ * Grouping updated event class.
  *
- * @package    core_group
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7ad49fb..1eb4996 100644 (file)
@@ -28,6 +28,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4967536..da60d86 100644 (file)
@@ -28,6 +28,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 738bb7d..879b4a6 100644 (file)
@@ -22,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
  * New event manager class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Petr Skoda {@link http://skodak.org}
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 6ea7dd8..5d2c94e 100644 (file)
@@ -18,6 +18,7 @@
  * Message contact added event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 3d79fbd..6b1cdf6 100644 (file)
@@ -18,6 +18,7 @@
  * Message contact blocked event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 78c0d04..2ca36ea 100644 (file)
@@ -18,6 +18,7 @@
  * Message contact removed event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 2475511..c931462 100644 (file)
@@ -18,6 +18,7 @@
  * Message contact unblocked event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 664f2f2..3ed0a5f 100644 (file)
@@ -24,6 +24,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 3aad156..2240fcf 100644 (file)
@@ -24,6 +24,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index cf9cb13..56b70c4 100644 (file)
@@ -18,6 +18,7 @@
  * Mnet access control created event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 79ac0ec..b2badfa 100644 (file)
@@ -18,6 +18,7 @@
  * Mnet access control updated event class.
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index e4a804b..fe2f208 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index bf15884..53403b7 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 54c8fb3..79cc5aa 100644 (file)
@@ -38,6 +38,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 5765111..58a688e 100644 (file)
@@ -32,6 +32,7 @@ defined('MOODLE_INTERNAL') || die();
  * Class for event to be triggered when a note is viewed.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Ankit Agarwal
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
diff --git a/lib/classes/event/question_category_created.php b/lib/classes/event/question_category_created.php
new file mode 100644 (file)
index 0000000..a620065
--- /dev/null
@@ -0,0 +1,80 @@
+<?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/>.
+
+/**
+ * Question category created event class.
+ *
+ * @package    core
+ * @since      Moodle 2.7
+ * @copyright  2014 Mark Nelson <markn@moodle.com>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+namespace core\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+class question_category_created extends base {
+
+    /**
+     * Init method.
+     */
+    protected function init() {
+        $this->data['objecttable'] = 'question_categories';
+        $this->data['crud'] = 'c';
+        $this->data['edulevel'] = self::LEVEL_TEACHING;
+    }
+
+    /**
+     * Returns localised general event name.
+     *
+     * @return string
+     */
+    public static function get_name() {
+        return get_string('eventquestioncategorycreated', 'question');
+    }
+
+    /**
+     * Returns description of what happened.
+     *
+     * @return string
+     */
+    public function get_description() {
+        return 'A question category with the id of ' . $this->objectid . ' was created by a user with the id ' . $this->userid;
+    }
+
+    /**
+     * Returns relevant URL.
+     *
+     * @return \moodle_url
+     */
+    public function get_url() {
+        if ($this->contextlevel == CONTEXT_MODULE) {
+            return new \moodle_url('/question/category.php', array('cmid' => $this->contextinstanceid));
+        } else {
+            return new \moodle_url('/question/category.php', array('courseid' => $this->courseid));
+        }
+    }
+
+    /**
+     * Return the legacy event log data.
+     *
+     * @return array
+     */
+    protected function get_legacy_logdata() {
+        return array($this->courseid, 'quiz', 'addcategory', 'view.php?id=' . $this->contextinstanceid,
+            $this->objectid, $this->contextinstanceid);
+    }
+}
index b5f2dd1..50b9475 100644 (file)
@@ -21,7 +21,8 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Event when role allow assignments is updated.
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 9451cfa..3e3c6ac 100644 (file)
@@ -21,7 +21,8 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Event when role allow override is updated.
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7b96dde..0d03614 100644 (file)
@@ -21,7 +21,8 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Event when role allow switch is updated.
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index cad0a1b..79b5639 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Petr Skoda {@link http://skodak.org}
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 9347479..5c65f95 100644 (file)
@@ -21,7 +21,8 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Role updated event.
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index de3e963..9a52582 100644 (file)
@@ -29,7 +29,8 @@ defined('MOODLE_INTERNAL') || die();
  *      @type string archetype role type.
  * }
  *
- * @package    core_event
+ * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4521ab3..4a0908f 100644 (file)
@@ -30,6 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Petr Skoda {@link http://skodak.org}
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 9b6e9ac..a94c78b 100644 (file)
@@ -25,6 +25,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 55c1356..6077b8a 100644 (file)
@@ -25,6 +25,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 18adc67..5c4b8fc 100644 (file)
@@ -25,6 +25,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 6acc93c..70e2518 100644 (file)
@@ -25,6 +25,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 8381097..a2059a5 100644 (file)
@@ -25,6 +25,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
similarity index 61%
rename from admin/tool/log/store/standard/db/access.php
rename to lib/classes/event/unknown_logged.php
index 774489b..a0e7544 100644 (file)
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
+namespace core\event;
+
+defined('MOODLE_INTERNAL') || die();
+
 /**
- * Defines the capabilities used by standard log store.
+ * Unknown event class.
  *
- * @package    logstore_standard
- * @copyright  2013 Petr Skoda {@link http://skodak.org}
+ * @package    core
+ * @since      Moodle 2.7
+ * @copyright  2014 Petr Skoda
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
+class unknown_logged extends base {
+    public function init() {
+        throw new \coding_exception('unknown events cannot be triggered');
+    }
 
-defined('MOODLE_INTERNAL') || die();
+    public static function get_name() {
+        return get_string('eventunknownlogged', 'core');
+    }
 
-$capabilities = array(
-    'logstore/standard:read' => array(
-        'riskbitmask'  => RISK_PERSONAL,
-        'captype'      => 'read',
-        'contextlevel' => CONTEXT_MODULE,
-        'archetypes'   => array(
-            'manager'        => CAP_ALLOW,
-            'editingteacher' => CAP_ALLOW,
-            'teacher'        => CAP_ALLOW,
-        ),
-    ),
-);
+    public function get_description() {
+        return 'Unknown event (' . $this->eventname . ')';
+    }
+}
index ec91dc3..88ce8ca 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event when new user profile is created.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 37d9edb..dcfdddb 100644 (file)
@@ -39,6 +39,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 825eb53..5338cd6 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4c7a905..7339566 100644 (file)
@@ -36,6 +36,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event when user is unenrolled from a course.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 5bfad22..02c5c7c 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ae77611..ba3f374 100644 (file)
@@ -17,7 +17,7 @@
 /**
  * Grade edited event.
  *
- * @package    core_grades
+ * @package    core
  * @copyright  2014 Petr Skoda
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -37,7 +37,8 @@ defined('MOODLE_INTERNAL') || die();
  *     -bool overridden: Is this grade override?
  *     -float finalgrade: the final grade value.
  *
- * @package    core_grades
+ * @package    core
+ * @since      Moodle 2.7
  * @copyright  2013 Petr Skoda
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 315b376..6cb6210 100644 (file)
@@ -26,6 +26,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index ec94f35..6966893 100644 (file)
@@ -18,6 +18,7 @@
  * User login event.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index bf88da9..b292c58 100644 (file)
@@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index f332ae1..310e5e6 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7ea66cf..c671792 100644 (file)
@@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.7
  * @copyright  2014 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 919ecc7..7bc8ba8 100644 (file)
@@ -26,6 +26,7 @@
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Mark Nelson <markn@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index af7c04f..69e36c5 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * Event when user profile is updated.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Rajesh Taneja <rajesh@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index a2f3e8c..b40cec2 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7d82a95..181dbb7 100644 (file)
@@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 9aa7e24..46f5199 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7832e0a..517bea8 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * core webservice service deleted event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 121f7a3..dacc33b 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * core webservice service updated event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 4bf7c94..d27fdb1 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * core webservice service user added event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index 7114b47..95b71c5 100644 (file)
@@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die();
  * core webservice service user removed event class.
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index db241df..1eda6b0 100644 (file)
@@ -35,6 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * }
  *
  * @package    core
+ * @since      Moodle 2.6
  * @copyright  2013 Frédéric Massart
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */