Merge branch 'wip-MDL-44139-master' of git://github.com/ds125v/moodle
authorDamyon Wiese <damyon@moodle.com>
Mon, 24 Feb 2014 07:28:51 +0000 (15:28 +0800)
committerDamyon Wiese <damyon@moodle.com>
Mon, 24 Feb 2014 07:28:51 +0000 (15:28 +0800)
Conflicts:
theme/bootstrapbase/style/moodle.css

953 files changed:
admin/environment.xml
admin/settings/appearance.php
admin/settings/users.php
admin/tool/qeupgradehelper/README.txt [deleted file]
admin/tool/qeupgradehelper/afterupgradelib.php [deleted file]
admin/tool/qeupgradehelper/cli/convert.php [deleted file]
admin/tool/qeupgradehelper/convertquiz.php [deleted file]
admin/tool/qeupgradehelper/cronsetup.php [deleted file]
admin/tool/qeupgradehelper/cronsetup_form.php [deleted file]
admin/tool/qeupgradehelper/extracttestcase.php [deleted file]
admin/tool/qeupgradehelper/extracttestcase_form.php [deleted file]
admin/tool/qeupgradehelper/index.php [deleted file]
admin/tool/qeupgradehelper/lang/en/tool_qeupgradehelper.php [deleted file]
admin/tool/qeupgradehelper/lib.php [deleted file]
admin/tool/qeupgradehelper/listpreupgrade.php [deleted file]
admin/tool/qeupgradehelper/listtodo.php [deleted file]
admin/tool/qeupgradehelper/listupgraded.php [deleted file]
admin/tool/qeupgradehelper/locallib.php [deleted file]
admin/tool/qeupgradehelper/partialupgrade-example.php [deleted file]
admin/tool/qeupgradehelper/renderer.php [deleted file]
admin/tool/qeupgradehelper/resetquiz.php [deleted file]
admin/tool/qeupgradehelper/styles.css [deleted file]
admin/tool/xmldb/actions/XMLDBAction.class.php
auth/cas/auth.php
auth/ldap/auth.php
auth/tests/behat/behat_auth.php
auth/tests/behat/login.feature
backup/import.php
backup/moodle2/backup_stepslib.php
backup/moodle2/restore_stepslib.php
backup/util/ui/renderer.php
badges/mybadges.php
badges/view.php
blocks/activity_modules/block_activity_modules.php
blocks/activity_modules/lang/en/block_activity_modules.php
blocks/activity_modules/version.php
blocks/admin_bookmarks/block_admin_bookmarks.php
blocks/admin_bookmarks/create.php
blocks/admin_bookmarks/delete.php
blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php
blocks/admin_bookmarks/version.php
blocks/badges/db/access.php
blocks/blog_menu/block_blog_menu.php
blocks/blog_menu/version.php
blocks/blog_recent/block_blog_recent.php
blocks/blog_recent/edit_form.php
blocks/blog_recent/version.php
blocks/blog_tags/block_blog_tags.php
blocks/blog_tags/edit_form.php
blocks/blog_tags/lang/en/block_blog_tags.php
blocks/blog_tags/version.php
blocks/calendar_month/lang/en/block_calendar_month.php
blocks/calendar_month/version.php
blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php
blocks/calendar_upcoming/version.php
blocks/comments/block_comments.php
blocks/comments/lib.php
blocks/comments/version.php
blocks/community/block_community.php
blocks/community/communitycourse.php
blocks/community/db/upgrade.php
blocks/community/forms.php
blocks/community/lang/en/block_community.php
blocks/community/locallib.php
blocks/community/renderer.php
blocks/community/version.php
blocks/completionstatus/block_completionstatus.php
blocks/completionstatus/db/upgrade.php
blocks/completionstatus/details.php
blocks/completionstatus/version.php
blocks/course_list/block_course_list.php
blocks/course_list/lang/en/block_course_list.php
blocks/course_list/settings.php
blocks/course_list/version.php
blocks/course_overview/renderer.php
blocks/course_summary/block_course_summary.php
blocks/course_summary/db/upgrade.php
blocks/course_summary/version.php
blocks/edit_form.php
blocks/feedback/block_feedback.php
blocks/feedback/db/install.php
blocks/feedback/lang/en/block_feedback.php
blocks/feedback/version.php
blocks/glossary_random/backup/moodle2/restore_glossary_random_block_task.class.php
blocks/glossary_random/block_glossary_random.php
blocks/glossary_random/edit_form.php
blocks/glossary_random/lang/en/block_glossary_random.php
blocks/glossary_random/version.php
blocks/html/backup/moodle1/lib.php
blocks/html/backup/moodle2/backup_html_block_task.class.php
blocks/html/backup/moodle2/restore_html_block_task.class.php
blocks/html/block_html.php
blocks/html/db/upgrade.php
blocks/html/edit_form.php
blocks/html/lang/en/block_html.php
blocks/html/lib.php
blocks/html/settings.php
blocks/html/version.php
blocks/login/block_login.php
blocks/login/lang/en/block_login.php
blocks/login/version.php
blocks/mentees/block_mentees.php
blocks/mentees/edit_form.php
blocks/mentees/version.php
blocks/messages/block_messages.php
blocks/messages/lang/en/block_messages.php
blocks/messages/version.php
blocks/mnet_hosts/block_mnet_hosts.php
blocks/mnet_hosts/lang/en/block_mnet_hosts.php
blocks/mnet_hosts/version.php
blocks/moodleblock.class.php
blocks/myprofile/block_myprofile.php
blocks/myprofile/edit_form.php
blocks/myprofile/lang/en/block_myprofile.php
blocks/myprofile/version.php
blocks/navigation/db/upgrade.php
blocks/navigation/lang/en/block_navigation.php
blocks/news_items/block_news_items.php
blocks/news_items/lang/en/block_news_items.php
blocks/news_items/version.php
blocks/online_users/block_online_users.php
blocks/online_users/settings.php
blocks/online_users/version.php
blocks/participants/block_participants.php
blocks/participants/lang/en/block_participants.php
blocks/participants/version.php
blocks/private_files/block_private_files.php
blocks/private_files/edit.php
blocks/private_files/lang/en/block_private_files.php
blocks/private_files/renderer.php
blocks/private_files/version.php
blocks/quiz_results/backup/moodle2/restore_quiz_results_block_task.class.php
blocks/quiz_results/block_quiz_results.php
blocks/quiz_results/edit_form.php
blocks/quiz_results/lang/en/block_quiz_results.php
blocks/quiz_results/version.php
blocks/rss_client/backup/moodle1/lib.php
blocks/rss_client/backup/moodle2/backup_rss_client_block_task.class.php
blocks/rss_client/backup/moodle2/backup_rss_client_stepslib.php
blocks/rss_client/backup/moodle2/restore_rss_client_block_task.class.php
blocks/rss_client/backup/moodle2/restore_rss_client_stepslib.php
blocks/rss_client/block_rss_client.php
blocks/rss_client/edit_form.php
blocks/rss_client/editfeed.php
blocks/rss_client/lang/en/block_rss_client.php
blocks/rss_client/managefeeds.php
blocks/rss_client/settings.php
blocks/rss_client/version.php
blocks/rss_client/viewfeed.php
blocks/search_forums/block_search_forums.php
blocks/search_forums/lang/en/block_search_forums.php
blocks/search_forums/version.php
blocks/selfcompletion/block_selfcompletion.php
blocks/selfcompletion/db/upgrade.php
blocks/selfcompletion/lang/en/block_selfcompletion.php
blocks/selfcompletion/version.php
blocks/settings/block_settings.php
blocks/settings/db/upgrade.php
blocks/settings/edit_form.php
blocks/settings/lang/en/block_settings.php
blocks/settings/renderer.php
blocks/settings/version.php
blocks/site_main_menu/block_site_main_menu.php
blocks/site_main_menu/version.php
blocks/social_activities/block_social_activities.php
blocks/social_activities/lang/en/block_social_activities.php
blocks/social_activities/version.php
blocks/tag_flickr/block_tag_flickr.php
blocks/tag_flickr/edit_form.php
blocks/tag_flickr/lang/en/block_tag_flickr.php
blocks/tag_flickr/version.php
blocks/tag_youtube/block_tag_youtube.php
blocks/tag_youtube/edit_form.php
blocks/tag_youtube/lang/en/block_tag_youtube.php
blocks/tag_youtube/version.php
blocks/tags/block_tags.php
blocks/tags/edit_form.php
blocks/tags/settings.php
blocks/tags/version.php
cache/stores/memcache/lib.php
cache/stores/memcached/lib.php
cache/stores/mongodb/lib.php
calendar/externallib.php
calendar/renderer.php
cohort/locallib.php
composer.json
course/format/formatlegacy.php
course/format/lib.php
course/format/topics/lib.php
course/format/upgrade.txt
course/format/weeks/lib.php
course/lib.php
course/renderer.php
course/rest.php
course/tests/behat/activities_visibility_icons.feature
course/tests/behat/behat_course.php
course/tests/behat/course_controls.feature
course/tests/behat/section_visibility.feature
course/view.php
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-debug.js
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop-min.js
course/yui/build/moodle-course-dragdrop/moodle-course-dragdrop.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-min.js
course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js
course/yui/src/dragdrop/js/resource.js
course/yui/src/toolboxes/js/resource.js
enrol/externallib.php
enrol/manual/externallib.php
enrol/manual/tests/externallib_test.php
enrol/tests/externallib_test.php
grade/edit/outcome/export.php
grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php [new file with mode: 0644]
grade/grading/form/rubric/tests/behat/edit_rubric.feature [new file with mode: 0644]
grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature [new file with mode: 0644]
grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature [new file with mode: 0644]
grade/grading/tests/behat/behat_grading.php [new file with mode: 0644]
grade/import/csv/index.php
group/index.php
install/lang/dz/error.php
install/lang/it/error.php
install/lang/nl/error.php
lang/en/admin.php
lang/en/badges.php
lang/en/moodle.php
lib/adminlib.php
lib/ajax/ajaxlib.php
lib/behat/classes/behat_selectors.php
lib/cronlib.php
lib/customcheckslib.php
lib/db/access.php
lib/db/events.php
lib/db/install.xml
lib/db/services.php
lib/db/upgrade.php
lib/deprecatedlib.php
lib/environmentlib.php
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms-debug.js
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms-min.js
lib/form/yui/build/moodle-form-shortforms/moodle-form-shortforms.js
lib/form/yui/src/shortforms/js/shortforms.js
lib/formslib.php
lib/grade/grade_item.php
lib/moodlelib.php
lib/outputcomponents.php
lib/outputlib.php
lib/outputrequirementslib.php
lib/portfolio/exporter.php
lib/portfoliolib.php
lib/setuplib.php
lib/tablelib.php
lib/tests/tablelib_test.php
lib/tests/upgradelib_test.php
lib/upgrade.txt
lib/upgradelib.php
lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js
lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js
lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop.js
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-min.js
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception.js
lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-debug.js
lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-min.js
lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert.js
lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js
lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js
lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-debug.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception-min.js
lib/yui/build/moodle-core-notification-exception/moodle-core-notification-exception.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-debug.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js
lib/yui/build/moodle-core-tooltip/moodle-core-tooltip.js
lib/yui/src/dragdrop/js/dragdrop.js
lib/yui/src/notification/build.json
lib/yui/src/notification/js/ajaxexception.js
lib/yui/src/notification/js/alert.js
lib/yui/src/notification/js/confirm.js
lib/yui/src/notification/js/dialogue.js
lib/yui/src/notification/js/exception.js
lib/yui/src/notification/js/info.js [new file with mode: 0644]
lib/yui/src/tooltip/js/tooltip.js
lib/yuilib/3.13.0/widget-modality/widget-modality-coverage.js
lib/yuilib/3.13.0/widget-modality/widget-modality-debug.js
lib/yuilib/3.13.0/widget-modality/widget-modality-min.js
lib/yuilib/3.13.0/widget-modality/widget-modality.js
mod/assign/classes/event/submission_created.php [new file with mode: 0644]
mod/assign/classes/event/submission_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/lang/en/assign.php
mod/assign/locallib.php
mod/assign/submission/file/classes/event/submission_created.php [new file with mode: 0644]
mod/assign/submission/file/classes/event/submission_updated.php [new file with mode: 0644]
mod/assign/submission/file/locallib.php
mod/assign/submission/file/tests/events_test.php
mod/assign/submission/onlinetext/classes/event/submission_created.php [new file with mode: 0644]
mod/assign/submission/onlinetext/classes/event/submission_updated.php [new file with mode: 0644]
mod/assign/submission/onlinetext/locallib.php
mod/assign/submission/onlinetext/tests/events_test.php
mod/assign/tests/event_test.php [new file with mode: 0644]
mod/assign/tests/fixtures/event_mod_assign_fixtures.php [new file with mode: 0644]
mod/assign/upgrade.txt
mod/assignment/backup/moodle1/lib.php
mod/assignment/backup/moodle2/backup_assignment_stepslib.php
mod/assignment/backup/moodle2/restore_assignment_activity_task.class.php
mod/assignment/backup/moodle2/restore_assignment_stepslib.php
mod/assignment/db/messages.php
mod/assignment/lang/en/assignment.php
mod/assignment/lib.php
mod/assignment/type/offline/backup/moodle1/lib.php
mod/assignment/type/offline/backup/moodle2/backup_assignment_offline_subplugin.class.php
mod/assignment/type/offline/backup/moodle2/restore_assignment_offline_subplugin.class.php
mod/assignment/type/offline/lang/en/assignment_offline.php
mod/assignment/type/offline/version.php
mod/assignment/type/online/backup/moodle1/lib.php
mod/assignment/type/online/lang/en/assignment_online.php
mod/assignment/type/online/version.php
mod/assignment/type/upload/backup/moodle1/lib.php
mod/assignment/type/upload/lang/en/assignment_upload.php
mod/assignment/type/upload/version.php
mod/assignment/type/uploadsingle/backup/moodle1/lib.php
mod/assignment/type/uploadsingle/lang/en/assignment_uploadsingle.php
mod/assignment/type/uploadsingle/version.php
mod/assignment/version.php
mod/chat/backup/moodle1/lib.php
mod/chat/backup/moodle2/backup_chat_stepslib.php
mod/chat/backup/moodle2/restore_chat_activity_task.class.php
mod/chat/backup/moodle2/restore_chat_stepslib.php
mod/chat/lang/en/chat.php
mod/chat/lib.php
mod/chat/locallib.php
mod/chat/version.php
mod/choice/backup/moodle1/lib.php
mod/choice/backup/moodle2/backup_choice_settingslib.php
mod/choice/backup/moodle2/backup_choice_stepslib.php
mod/choice/backup/moodle2/restore_choice_activity_task.class.php
mod/choice/backup/moodle2/restore_choice_stepslib.php
mod/choice/lang/en/choice.php
mod/choice/lib.php
mod/choice/renderer.php
mod/choice/version.php
mod/data/backup/moodle1/lib.php
mod/data/backup/moodle2/backup_data_stepslib.php
mod/data/backup/moodle2/restore_data_activity_task.class.php
mod/data/backup/moodle2/restore_data_stepslib.php
mod/data/classes/event/course_module_instance_list_viewed.php [moved from admin/tool/qeupgradehelper/version.php with 71% similarity]
mod/data/classes/event/course_module_viewed.php [moved from admin/tool/qeupgradehelper/db/install.php with 61% similarity]
mod/data/classes/event/field_created.php [new file with mode: 0644]
mod/data/classes/event/field_deleted.php [new file with mode: 0644]
mod/data/classes/event/field_updated.php [new file with mode: 0644]
mod/data/classes/event/record_created.php [new file with mode: 0644]
mod/data/classes/event/record_deleted.php [new file with mode: 0644]
mod/data/classes/event/record_updated.php [new file with mode: 0644]
mod/data/classes/event/template_updated.php [new file with mode: 0644]
mod/data/classes/event/template_viewed.php [new file with mode: 0644]
mod/data/css.php
mod/data/edit.php
mod/data/export.php
mod/data/field.php
mod/data/import.php
mod/data/index.php
mod/data/js.php
mod/data/lang/en/data.php
mod/data/lib.php
mod/data/locallib.php
mod/data/preset.php
mod/data/templates.php
mod/data/tests/events_test.php [new file with mode: 0644]
mod/data/version.php
mod/data/view.php
mod/feedback/ajax.php
mod/feedback/analysis.php
mod/feedback/analysis_course.php
mod/feedback/analysis_to_excel.php
mod/feedback/backup/moodle1/lib.php
mod/feedback/backup/moodle2/backup_feedback_settingslib.php
mod/feedback/backup/moodle2/backup_feedback_stepslib.php
mod/feedback/backup/moodle2/restore_feedback_activity_task.class.php
mod/feedback/backup/moodle2/restore_feedback_stepslib.php
mod/feedback/choose_group_form.php
mod/feedback/complete.php
mod/feedback/complete_guest.php
mod/feedback/db/messages.php
mod/feedback/delete_completed.php
mod/feedback/delete_completed_form.php
mod/feedback/delete_item.php
mod/feedback/delete_item_form.php
mod/feedback/delete_template.php
mod/feedback/delete_template_form.php
mod/feedback/edit.php
mod/feedback/edit_form.php
mod/feedback/edit_item.php
mod/feedback/export.php
mod/feedback/import.php
mod/feedback/import_form.php
mod/feedback/index.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/lang/en/feedback.php
mod/feedback/lib.php
mod/feedback/mapcourse.php
mod/feedback/mod_form.php
mod/feedback/print.php
mod/feedback/show_entries.php
mod/feedback/show_entries_anonym.php
mod/feedback/show_nonrespondents.php
mod/feedback/styles.css
mod/feedback/tabs.php
mod/feedback/unmapcourse.php
mod/feedback/use_templ.php
mod/feedback/use_templ_form.php
mod/feedback/version.php
mod/feedback/view.php
mod/folder/backup/moodle1/lib.php
mod/folder/backup/moodle2/backup_folder_activity_task.class.php
mod/folder/backup/moodle2/backup_folder_stepslib.php
mod/folder/backup/moodle2/restore_folder_activity_task.class.php
mod/folder/backup/moodle2/restore_folder_stepslib.php
mod/folder/db/install.php
mod/folder/db/upgrade.php
mod/folder/edit.php
mod/folder/edit_form.php
mod/folder/index.php
mod/folder/lang/en/folder.php
mod/folder/lib.php
mod/folder/locallib.php
mod/folder/mod_form.php
mod/folder/renderer.php
mod/folder/settings.php
mod/folder/version.php
mod/folder/view.php
mod/forum/backup/moodle1/lib.php
mod/forum/backup/moodle2/backup_forum_activity_task.class.php
mod/forum/backup/moodle2/backup_forum_settingslib.php
mod/forum/backup/moodle2/backup_forum_stepslib.php
mod/forum/backup/moodle2/restore_forum_activity_task.class.php
mod/forum/backup/moodle2/restore_forum_stepslib.php
mod/forum/classes/event/course_module_instance_list_viewed.php [moved from admin/tool/qeupgradehelper/settings.php with 57% similarity]
mod/forum/classes/event/course_searched.php [new file with mode: 0644]
mod/forum/classes/event/discussion_created.php [new file with mode: 0644]
mod/forum/classes/event/discussion_deleted.php [new file with mode: 0644]
mod/forum/classes/event/discussion_moved.php [new file with mode: 0644]
mod/forum/classes/event/discussion_updated.php [new file with mode: 0644]
mod/forum/classes/event/discussion_viewed.php [new file with mode: 0644]
mod/forum/classes/event/forum_viewed.php [new file with mode: 0644]
mod/forum/classes/event/post_created.php [new file with mode: 0644]
mod/forum/classes/event/post_deleted.php [new file with mode: 0644]
mod/forum/classes/event/post_updated.php [new file with mode: 0644]
mod/forum/classes/event/readtracking_disabled.php [new file with mode: 0644]
mod/forum/classes/event/readtracking_enabled.php [new file with mode: 0644]
mod/forum/classes/event/subscribers_viewed.php [new file with mode: 0644]
mod/forum/classes/event/subscription_created.php [new file with mode: 0644]
mod/forum/classes/event/subscription_deleted.php [new file with mode: 0644]
mod/forum/classes/event/userreport_viewed.php [new file with mode: 0644]
mod/forum/db/messages.php
mod/forum/db/upgrade.php
mod/forum/discuss.php
mod/forum/index.php
mod/forum/lang/en/forum.php
mod/forum/lib.php
mod/forum/locallib.php
mod/forum/markposts.php
mod/forum/mod_form.php
mod/forum/post.php
mod/forum/renderer.php
mod/forum/rsslib.php
mod/forum/search.php
mod/forum/settings.php
mod/forum/settracking.php
mod/forum/subscribe.php
mod/forum/subscribers.php
mod/forum/tests/events_test.php [new file with mode: 0644]
mod/forum/unsubscribeall.php
mod/forum/user.php
mod/forum/version.php
mod/forum/view.php
mod/glossary/backup/moodle1/lib.php
mod/glossary/backup/moodle2/backup_glossary_stepslib.php
mod/glossary/backup/moodle2/restore_glossary_activity_task.class.php
mod/glossary/backup/moodle2/restore_glossary_stepslib.php
mod/glossary/lang/en/glossary.php
mod/glossary/lib.php
mod/glossary/locallib.php
mod/glossary/version.php
mod/imscp/backup/moodle1/lib.php
mod/imscp/backup/moodle2/backup_imscp_stepslib.php
mod/imscp/backup/moodle2/restore_imscp_activity_task.class.php
mod/imscp/backup/moodle2/restore_imscp_stepslib.php
mod/imscp/db/install.php
mod/imscp/db/upgrade.php
mod/imscp/index.php
mod/imscp/lang/en/imscp.php
mod/imscp/lib.php
mod/imscp/locallib.php
mod/imscp/mod_form.php
mod/imscp/settings.php
mod/imscp/version.php
mod/imscp/view.php
mod/label/backup/moodle1/lib.php
mod/label/backup/moodle2/backup_label_stepslib.php
mod/label/backup/moodle2/restore_label_activity_task.class.php
mod/label/backup/moodle2/restore_label_stepslib.php
mod/label/db/upgrade.php
mod/label/index.php
mod/label/lang/en/label.php
mod/label/lib.php
mod/label/mod_form.php
mod/label/version.php
mod/label/view.php
mod/lesson/backup/moodle1/lib.php
mod/lesson/backup/moodle2/backup_lesson_stepslib.php
mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
mod/lesson/backup/moodle2/restore_lesson_stepslib.php
mod/lesson/continue.php
mod/lesson/db/messages.php
mod/lesson/db/upgrade.php
mod/lesson/edit.php
mod/lesson/editpage.php
mod/lesson/editpage_form.php
mod/lesson/essay.php
mod/lesson/essay_form.php
mod/lesson/format.php
mod/lesson/highscores.php
mod/lesson/import.php
mod/lesson/import_form.php
mod/lesson/index.php
mod/lesson/lang/en/lesson.php
mod/lesson/lesson.php
mod/lesson/lib.php
mod/lesson/locallib.php
mod/lesson/mediafile.php
mod/lesson/mod_form.php
mod/lesson/pagetypes/branchtable.php
mod/lesson/pagetypes/cluster.php
mod/lesson/pagetypes/endofbranch.php
mod/lesson/pagetypes/endofcluster.php
mod/lesson/pagetypes/essay.php
mod/lesson/pagetypes/matching.php
mod/lesson/pagetypes/multichoice.php
mod/lesson/pagetypes/numerical.php
mod/lesson/pagetypes/shortanswer.php
mod/lesson/pagetypes/truefalse.php
mod/lesson/reformat.php
mod/lesson/renderer.php
mod/lesson/report.php
mod/lesson/settings.php
mod/lesson/tabs.php
mod/lesson/version.php
mod/lesson/view.php
mod/lesson/view_form.php
mod/lti/TrivialStore.php
mod/lti/backup/moodle1/lib.php
mod/lti/backup/moodle2/backup_lti_stepslib.php
mod/lti/backup/moodle2/restore_lti_activity_task.class.php
mod/lti/backup/moodle2/restore_lti_stepslib.php
mod/lti/db/upgrade.php
mod/lti/edit_form.php
mod/lti/grade.php
mod/lti/index.php
mod/lti/instructor_edit_tool_type.php
mod/lti/lang/en/lti.php
mod/lti/launch.php
mod/lti/lib.php
mod/lti/localadminlib.php
mod/lti/locallib.php
mod/lti/mod_form.php
mod/lti/request_tool.php
mod/lti/return.php
mod/lti/service.php
mod/lti/servicelib.php
mod/lti/settings.php
mod/lti/typessettings.php
mod/lti/version.php
mod/lti/view.php
mod/page/backup/moodle1/lib.php
mod/page/backup/moodle2/backup_page_stepslib.php
mod/page/backup/moodle2/restore_page_activity_task.class.php
mod/page/backup/moodle2/restore_page_stepslib.php
mod/page/db/install.php
mod/page/db/upgrade.php
mod/page/index.php
mod/page/lang/en/page.php
mod/page/lib.php
mod/page/locallib.php
mod/page/mod_form.php
mod/page/settings.php
mod/page/version.php
mod/page/view.php
mod/quiz/db/install.xml
mod/quiz/db/upgrade.php
mod/quiz/lib.php
mod/quiz/locallib.php
mod/quiz/report/statistics/lang/en/quiz_statistics.php
mod/quiz/report/statistics/report.php
mod/quiz/report/statistics/statistics_table.php
mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv [new file with mode: 0644]
mod/quiz/report/statistics/tests/statistics_test.php
mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php
mod/quiz/styles.css
mod/quiz/version.php
mod/resource/backup/moodle1/lib.php
mod/resource/backup/moodle2/backup_resource_stepslib.php
mod/resource/backup/moodle2/restore_resource_activity_task.class.php
mod/resource/backup/moodle2/restore_resource_stepslib.php
mod/resource/db/upgrade.php
mod/resource/index.php
mod/resource/lang/en/resource.php
mod/resource/lib.php
mod/resource/locallib.php
mod/resource/mod_form.php
mod/resource/settings.php
mod/resource/tests/generator/lib.php
mod/resource/tests/generator_test.php
mod/resource/version.php
mod/resource/view.php
mod/scorm/backup/moodle1/lib.php
mod/scorm/backup/moodle2/backup_scorm_stepslib.php
mod/scorm/backup/moodle2/restore_scorm_activity_task.class.php
mod/scorm/backup/moodle2/restore_scorm_stepslib.php
mod/scorm/datamodels/aicclib.php
mod/scorm/datamodels/scormlib.php
mod/scorm/db/upgrade.php
mod/scorm/lang/en/scorm.php
mod/scorm/lib.php
mod/scorm/locallib.php
mod/scorm/mod_form.php
mod/scorm/report/userreportinteractions.php
mod/scorm/tabs.php
mod/scorm/version.php
mod/survey/backup/moodle1/lib.php
mod/survey/backup/moodle2/backup_survey_stepslib.php
mod/survey/backup/moodle2/restore_survey_activity_task.class.php
mod/survey/backup/moodle2/restore_survey_stepslib.php
mod/survey/download.php
mod/survey/lang/en/survey.php
mod/survey/lib.php
mod/survey/report.php
mod/survey/save.php
mod/survey/version.php
mod/survey/view.php
mod/url/backup/moodle1/lib.php
mod/url/backup/moodle2/backup_url_stepslib.php
mod/url/backup/moodle2/restore_url_activity_task.class.php
mod/url/backup/moodle2/restore_url_stepslib.php
mod/url/db/install.php
mod/url/db/upgrade.php
mod/url/index.php
mod/url/lang/en/url.php
mod/url/lib.php
mod/url/locallib.php
mod/url/mod_form.php
mod/url/settings.php
mod/url/version.php
mod/url/view.php
mod/wiki/admin.php
mod/wiki/backup/moodle1/lib.php
mod/wiki/backup/moodle2/backup_wiki_settingslib.php
mod/wiki/backup/moodle2/backup_wiki_stepslib.php
mod/wiki/backup/moodle2/restore_wiki_activity_task.class.php
mod/wiki/backup/moodle2/restore_wiki_stepslib.php
mod/wiki/comments.php
mod/wiki/create_form.php
mod/wiki/db/upgrade.php
mod/wiki/diff.php
mod/wiki/edit.php
mod/wiki/edit_form.php
mod/wiki/editcomments.php
mod/wiki/editors/html.php
mod/wiki/editors/wiki_editor.php
mod/wiki/editors/wikieditor.php
mod/wiki/editors/wikifiletable.php
mod/wiki/files.php
mod/wiki/filesedit.php
mod/wiki/filesedit_form.php
mod/wiki/history.php
mod/wiki/index.php
mod/wiki/instancecomments.php
mod/wiki/lang/en/wiki.php
mod/wiki/lib.php
mod/wiki/locallib.php
mod/wiki/lock.php
mod/wiki/map.php
mod/wiki/mod_form.php
mod/wiki/overridelocks.php
mod/wiki/pagelib.php
mod/wiki/parser/markups/creole.php
mod/wiki/parser/markups/html.php
mod/wiki/parser/markups/nwiki.php
mod/wiki/parser/markups/wikimarkup.php
mod/wiki/parser/parser.php
mod/wiki/parser/utils.php
mod/wiki/prettyview.php
mod/wiki/renderer.php
mod/wiki/restoreversion.php
mod/wiki/search.php
mod/wiki/styles.css
mod/wiki/tests/wikiparser_test.php
mod/wiki/version.php
mod/wiki/view.php
mod/wiki/viewversion.php
mod/workshop/aggregate.php
mod/workshop/allocation.php
mod/workshop/allocation/lib.php
mod/workshop/assessment.php
mod/workshop/backup/moodle1/lib.php
mod/workshop/backup/moodle2/restore_workshop_activity_task.class.php
mod/workshop/backup/moodle2/restore_workshop_stepslib.php
mod/workshop/classes/event/assessable_uploaded.php
mod/workshop/classes/event/assessment_evaluated.php [new file with mode: 0644]
mod/workshop/classes/event/assessment_evaluations_reset.php [new file with mode: 0644]
mod/workshop/classes/event/assessment_reevaluated.php [new file with mode: 0644]
mod/workshop/classes/event/assessments_reset.php [new file with mode: 0644]
mod/workshop/classes/event/course_module_viewed.php
mod/workshop/classes/event/instances_list_viewed.php [new file with mode: 0644]
mod/workshop/classes/event/phase_switched.php [new file with mode: 0644]
mod/workshop/classes/event/submission_assessed.php [new file with mode: 0644]
mod/workshop/classes/event/submission_created.php [new file with mode: 0644]
mod/workshop/classes/event/submission_reassessed.php [new file with mode: 0644]
mod/workshop/classes/event/submission_updated.php [new file with mode: 0644]
mod/workshop/classes/event/submission_viewed.php [new file with mode: 0644]
mod/workshop/db/subplugins.php
mod/workshop/db/uninstall.php
mod/workshop/editform.php
mod/workshop/editformpreview.php
mod/workshop/eval/lib.php
mod/workshop/exassessment.php
mod/workshop/excompare.php
mod/workshop/exsubmission.php
mod/workshop/feedbackauthor_form.php
mod/workshop/feedbackreviewer_form.php
mod/workshop/form/assessment_form.php
mod/workshop/form/edit_form.php
mod/workshop/form/lib.php
mod/workshop/index.php
mod/workshop/lang/en/workshop.php
mod/workshop/lib.php
mod/workshop/locallib.php
mod/workshop/mod_form.php
mod/workshop/renderer.php
mod/workshop/settings.php
mod/workshop/submission.php
mod/workshop/submission_form.php
mod/workshop/switchphase.php
mod/workshop/tests/events_test.php [new file with mode: 0644]
mod/workshop/tests/fixtures/testable.php [new file with mode: 0644]
mod/workshop/tests/locallib_test.php
mod/workshop/toolbox.php
mod/workshop/view.php
question/behaviour/behaviourbase.php
question/behaviour/rendererbase.php
question/classes/statistics/questions/all_calculated_for_qubaid_condition.php [new file with mode: 0644]
question/classes/statistics/questions/calculated.php
question/classes/statistics/questions/calculated_for_subquestion.php
question/classes/statistics/questions/calculator.php
question/classes/statistics/responses/analyser.php
question/classes/statistics/responses/analysis_for_actual_response.php
question/classes/statistics/responses/analysis_for_class.php
question/classes/statistics/responses/analysis_for_question.php
question/classes/statistics/responses/analysis_for_subpart.php
question/engine/questionattempt.php
question/engine/upgrade/upgradelib.php
question/format.php
question/format/blackboard_six/format.php
question/format/blackboard_six/formatbase.php
question/format/blackboard_six/formatpool.php
question/format/blackboard_six/formatqti.php
question/format/blackboard_six/tests/blackboardformatpool_test.php
question/format/blackboard_six/tests/blackboardsixformatqti_test.php
question/format/xml/format.php
question/format/xml/tests/xmlformat_test.php
question/type/calculated/tests/upgradelibnewqe_test.php
question/type/calculatedmulti/tests/upgradelibnewqe_test.php
question/type/calculatedsimple/edit_calculatedsimple_form.php
question/type/calculatedsimple/tests/upgradelibnewqe_test.php
question/type/description/tests/upgradelibnewqe_test.php
question/type/edit_question_form.php
question/type/essay/db/upgradelib.php
question/type/essay/tests/upgradelibnewqe_test.php
question/type/match/renderer.php
question/type/match/tests/upgradelibnewqe_test.php
question/type/multianswer/tests/upgradelibnewqe_test.php
question/type/multichoice/tests/upgradelibnewqe_test.php
question/type/numerical/tests/upgradelibnewqe_test.php
question/type/questiontypebase.php
question/type/random/tests/upgradelibnewqe_test.php
question/type/randomsamatch/backup/moodle1/lib.php [new file with mode: 0644]
question/type/randomsamatch/backup/moodle2/backup_qtype_randomsamatch_plugin.class.php
question/type/randomsamatch/backup/moodle2/restore_qtype_randomsamatch_plugin.class.php
question/type/randomsamatch/db/install.xml
question/type/randomsamatch/db/upgrade.php [new file with mode: 0644]
question/type/randomsamatch/db/upgradelib.php [new file with mode: 0644]
question/type/randomsamatch/edit_randomsamatch_form.php
question/type/randomsamatch/lang/en/qtype_randomsamatch.php
question/type/randomsamatch/lib.php [new file with mode: 0644]
question/type/randomsamatch/question.php [new file with mode: 0644]
question/type/randomsamatch/questiontype.php
question/type/randomsamatch/renderer.php [new file with mode: 0644]
question/type/randomsamatch/tests/helper.php [new file with mode: 0644]
question/type/randomsamatch/tests/question_test.php [new file with mode: 0644]
question/type/randomsamatch/tests/upgradelibnewqe_test.php [new file with mode: 0644]
question/type/randomsamatch/tests/walkthrough_test.php [new file with mode: 0644]
question/type/randomsamatch/version.php
question/type/shortanswer/tests/upgradelibnewqe_test.php
question/type/truefalse/tests/upgradelibnewqe_test.php
question/type/upgrade.txt
rating/lib.php
theme/afterburner/config.php
theme/afterburner/db/upgrade.php
theme/afterburner/lang/en/theme_afterburner.php
theme/afterburner/layout/default.php
theme/afterburner/layout/embedded.php
theme/afterburner/lib.php
theme/afterburner/renderers.php
theme/afterburner/settings.php
theme/afterburner/style/afterburner_dock.css
theme/afterburner/version.php
theme/anomaly/config.php
theme/anomaly/lang/en/theme_anomaly.php
theme/anomaly/layout/frontpage.php
theme/anomaly/layout/general.php
theme/anomaly/layout/report.php
theme/anomaly/lib.php
theme/anomaly/renderers.php
theme/anomaly/settings.php
theme/anomaly/style/general.css
theme/anomaly/version.php
theme/arialist/layout/frontpage.php
theme/arialist/layout/general.php
theme/arialist/layout/report.php
theme/arialist/lib.php
theme/arialist/settings.php
theme/base/cli/svgtool.php
theme/base/config.php
theme/base/lang/en/theme_base.php
theme/base/layout/embedded.php
theme/base/layout/frontpage.php
theme/base/layout/general.php
theme/base/layout/report.php
theme/base/style/blocks.css
theme/base/style/core.css
theme/base/style/dock.css
theme/base/version.php
theme/binarius/config.php
theme/binarius/layout/frontpage.php
theme/binarius/layout/general.php
theme/binarius/layout/report.php
theme/binarius/version.php
theme/bootstrapbase/config.php
theme/bootstrapbase/lang/en/theme_bootstrapbase.php
theme/bootstrapbase/layout/columns1.php
theme/bootstrapbase/layout/columns2.php
theme/bootstrapbase/layout/columns3.php
theme/bootstrapbase/layout/embedded.php
theme/bootstrapbase/layout/maintenance.php
theme/bootstrapbase/layout/popup.php
theme/bootstrapbase/layout/secure.php
theme/bootstrapbase/less/README
theme/bootstrapbase/less/moodle.less
theme/bootstrapbase/less/moodle/admin.less
theme/bootstrapbase/less/moodle/blocks.less
theme/bootstrapbase/less/moodle/dock.less
theme/bootstrapbase/less/moodle/modules.less
theme/bootstrapbase/less/moodle/undo.less
theme/bootstrapbase/renderers/core_renderer.php
theme/bootstrapbase/style/moodle.css
theme/boxxie/layout/embedded.php
theme/boxxie/layout/frontpage.php
theme/boxxie/layout/general.php
theme/boxxie/style/core.css
theme/brick/layout/frontpage.php
theme/brick/layout/general.php
theme/brick/lib.php
theme/brick/settings.php
theme/canvas/lang/en/theme_canvas.php
theme/canvas/layout/embedded.php
theme/canvas/layout/frontpage.php
theme/canvas/layout/general.php
theme/canvas/layout/report.php
theme/canvas/style/core.css
theme/clean/layout/columns1.php
theme/clean/layout/columns2.php
theme/clean/layout/columns3.php
theme/clean/layout/embedded.php
theme/clean/layout/maintenance.php
theme/clean/layout/secure.php
theme/formal_white/style/formal_white.css
theme/formfactor/layout/embedded.php
theme/formfactor/layout/frontpage.php
theme/formfactor/layout/general.php
theme/formfactor/style/mods.css
theme/formfactor/version.php
theme/fusion/layout/frontpage.php
theme/fusion/layout/general.php
theme/fusion/lib.php
theme/fusion/settings.php
theme/leatherbound/layout/frontpage.php
theme/leatherbound/layout/general.php
theme/leatherbound/layout/report.php
theme/magazine/config.php
theme/magazine/lang/en/theme_magazine.php
theme/magazine/layout/embedded.php
theme/magazine/layout/frontpage.php
theme/magazine/layout/general.php
theme/magazine/lib.php
theme/magazine/settings.php
theme/magazine/style/core.css
theme/magazine/version.php
theme/nimble/layout/frontpage.php
theme/nimble/layout/general.php
theme/nimble/lib.php
theme/nimble/settings.php
theme/nonzero/layout/frontpage.php
theme/nonzero/layout/general.php
theme/nonzero/lib.php
theme/nonzero/settings.php
theme/overlay/layout/frontpage.php
theme/overlay/layout/general.php
theme/overlay/lib.php
theme/overlay/settings.php
theme/overlay/version.php
theme/serenity/config.php
theme/serenity/lang/en/theme_serenity.php
theme/sky_high/config.php
theme/sky_high/lang/en/theme_sky_high.php
theme/sky_high/layout/frontpage.php
theme/sky_high/layout/general.php
theme/sky_high/layout/report.php
theme/sky_high/lib.php
theme/sky_high/settings.php
theme/sky_high/version.php
theme/splash/layout/embedded.php
theme/splash/layout/report.php
theme/standard/style/admin.css
theme/standard/style/core.css
theme/standard/style/grade.css
theme/standard/style/modules.css
theme/standard/style/question.css
theme/standardold/layout/embedded.php
theme/standardold/layout/frontpage.php
theme/standardold/layout/general.php
theme/upgrade.txt
theme/yui_combo.php
user/lib.php
user/profile.php
user/tests/externallib_test.php
user/view.php
version.php

index 4edfcd1..b1cfc26 100644 (file)
         </FEEDBACK>
       </PHP_SETTING>
     </PHP_SETTINGS>
+    <CUSTOM_CHECKS>
+      <CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
+        <FEEDBACK>
+          <ON_ERROR message="quizattemptsupgradedmessage" />
+        </FEEDBACK>
+      </CUSTOM_CHECK>
+    </CUSTOM_CHECKS>
   </MOODLE>
 </COMPATIBILITY_MATRIX>
index 2cf6f0f..1df0a09 100644 (file)
@@ -191,6 +191,9 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
     // "documentation" settingpage
     $temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
     $temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
+    $ltemp = array('' => get_string('forceno'));
+    $ltemp += get_string_manager()->get_list_of_translations(true);
+    $temp->add(new admin_setting_configselect('doclang', get_string('doclang', 'admin'), get_string('configdoclang', 'admin'), '', $ltemp));
     $temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
     $ADMIN->add('appearance', $temp);
 
@@ -217,7 +220,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
     $ADMIN->add('appearance', $temp);
 
     $temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
-    $temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1));
     $temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
     $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
     $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
index 5a50bce..2231bab 100644 (file)
@@ -127,6 +127,7 @@ if ($hassiteconfig
                              'msnid' => new lang_string('msnid'),
                              'firstaccess' => new lang_string('firstaccess'),
                              'lastaccess' => new lang_string('lastaccess'),
+                             'lastip' => new lang_string('lastip'),
                              'mycourses' => new lang_string('mycourses'),
                              'groups' => new lang_string('groups'),
                              'suspended' => new lang_string('suspended', 'auth'),
diff --git a/admin/tool/qeupgradehelper/README.txt b/admin/tool/qeupgradehelper/README.txt
deleted file mode 100644 (file)
index b9ce983..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-This plugin can help upgrade site with a large number of question attempts from
-Moodle 2.0 to 2.1.
-
-With a lot of question attempts, doing the whole conversion on upgrade is very
-slow. The plugin can help with that in various ways.
-
-
-1. It provides a report of how much data there is to upgrade.
-
-2. It can extract test-cases from the database. This can help you report bugs
-in the upgrade process to the developers.
-
-3. You can set up cron to complete the conversion of quiz attempts, if you have
-configured a partial upgrade.
-
-
-If this plugin is present during upgrade:
-
-4. then only a subset of attempts are upgraded. Read the instructions in the
-partialupgrade-example.php script.
-
-
-If this plugin is present in a Moodle 2.1 site after upgrade:
-
-5. If not all attempts have been upgraded in a 2.1 site, then this plugin
-displays a list of how many quizzes still need to be upgraded
-
-6. ... and can be used to complete the upgrade manually ...
-
-7. or this plugin has a cron script that can be used to finish the upgrade
-automatically after the main upgrade has finished.
-
-8. It can also reset any attempts that were upgraded (provided they have not
-subsequently been modified) so you can re-upgrade them. This may allow you to
-recover from a buggy upgrade.
-
-9. Finally, you can still use the extract test-cases script to help report bugs.
-
-
-Manual upgrades can be processed via the web interface or the command line tool
-cliupgrade.php. To run cliupgrade.php, use a command similar to:
-sudo -u www-data /usr/bin/php admin/tool/qeupgradehelper/cli/convert.php -h
-The -h flag will show the options for running the tool.
\ No newline at end of file
diff --git a/admin/tool/qeupgradehelper/afterupgradelib.php b/admin/tool/qeupgradehelper/afterupgradelib.php
deleted file mode 100644 (file)
index 5aeb316..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?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 engine upgrade helper library code that relies on other parts of the
- * new question engine code.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-defined('MOODLE_INTERNAL') || die;
-
-require_once($CFG->dirroot . '/question/engine/upgrade/upgradelib.php');
-
-
-class tool_qeupgradehelper_attempt_upgrader extends question_engine_attempt_upgrader {
-    public $quizid;
-    public $attemptsdone = 0;
-    public $attemptstodo;
-
-    public function __construct($quizid, $attemptstodo) {
-        $this->quizid = $quizid;
-        $this->attemptstodo = $attemptstodo;
-    }
-
-    protected function get_quiz_ids() {
-        return array($this->quizid);
-    }
-
-    protected function print_progress($done, $outof, $quizid) {
-    }
-
-    protected function convert_quiz_attempt($quiz, $attempt, $questionsessionsrs, $questionsstatesrs) {
-        $this->attemptsdone += 1;
-        return parent::convert_quiz_attempt($quiz, $attempt, $questionsessionsrs, $questionsstatesrs);
-    }
-
-    protected function reset_progress($done, $outof) {
-        if (is_null($this->progressbar)) {
-            $this->progressbar = new progress_bar('qe2reset');
-            $this->progressbar->create();
-        }
-
-        gc_collect_cycles(); // This was really helpful in PHP 5.2. Perhaps remove.
-        $a = new stdClass();
-        $a->done = $done;
-        $a->outof = $outof;
-        $this->progressbar->update($done, $outof,
-                get_string('resettingquizattemptsprogress', 'tool_qeupgradehelper', $a));
-    }
-
-    protected function get_resettable_attempts($quiz) {
-        global $DB;
-        return $DB->get_records_sql("
-                SELECT
-                    quiza.*
-
-                FROM {quiz_attempts} quiza
-                LEFT JOIN (
-                    SELECT attempt, MAX(timestamp) AS time
-                    FROM {question_states}
-                    GROUP BY attempt
-                ) AS oldtimemodified ON oldtimemodified.attempt = quiza.uniqueid
-                LEFT JOIN (
-                    SELECT qa.questionusageid, MAX(qas.timecreated) AS time
-                    FROM {question_attempts} qa
-                    JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
-                    GROUP BY qa.questionusageid
-                ) AS newtimemodified ON newtimemodified.questionusageid = quiza.uniqueid
-
-                WHERE quiza.preview = 0
-                  AND quiza.needsupgradetonewqe = 0
-                  AND (newtimemodified.time IS NULL OR oldtimemodified.time >= newtimemodified.time)
-                  AND quiza.quiz = :quizid", array('quizid' => $quiz->id));
-    }
-
-    public function reset_all_resettable_attempts() {
-        global $DB;
-
-        $transaction = $DB->start_delegated_transaction();
-
-        $quiz = $DB->get_record('quiz', array('id' => $this->quizid));
-        $attempts = $this->get_resettable_attempts($quiz);
-        foreach ($attempts as $attempt) {
-            $this->reset_attempt($quiz, $attempt);
-        }
-
-        $transaction->allow_commit();
-    }
-
-    protected function reset_attempt($quiz, $attempt) {
-        global $DB;
-
-        $this->attemptsdone += 1;
-        $this->reset_progress($this->attemptsdone, $this->attemptstodo);
-
-        $questionids = explode(',', $quiz->questions);
-        $slottoquestionid = array(0 => 0);
-        foreach ($questionids as $questionid) {
-            if ($questionid) {
-                $slottoquestionid[] = $questionid;
-            }
-        }
-
-        $slotlayout = explode(',', $attempt->layout);
-        $oldlayout = array();
-        $ok = true;
-        foreach ($slotlayout as $slot) {
-            if (array_key_exists($slot, $slottoquestionid)) {
-                $oldlayout[] = $slottoquestionid[$slot];
-            } else if (in_array($slot, $questionids)) {
-                // OK there was probably a problem during the original upgrade.
-                $oldlayout[] = $slot;
-            } else {
-                $ok = false;
-                break;
-            }
-        }
-
-        if ($ok) {
-            $layout = implode(',', $oldlayout);
-        } else {
-            $layout = $attempt->layout;
-        }
-
-        $DB->delete_records_select('question_attempt_step_data', "attemptstepid IN (
-                SELECT qas.id
-                FROM {question_attempts} qa
-                JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
-                WHERE questionusageid = :uniqueid)",
-                array('uniqueid' => $attempt->uniqueid));
-        $DB->delete_records_select('question_attempt_steps', "questionattemptid IN (
-                SELECT qa.id
-                FROM {question_attempts} qa
-                WHERE questionusageid = :uniqueid)",
-                array('uniqueid' => $attempt->uniqueid));
-        $DB->delete_records('question_attempts',
-                array('questionusageid' => $attempt->uniqueid));
-
-        $DB->set_field('question_usages', 'preferredbehaviour', 'to_be_set_later',
-                array('id' => $attempt->uniqueid));
-        $DB->set_field('quiz_attempts', 'layout', $layout,
-                array('uniqueid' => $attempt->uniqueid));
-        $DB->set_field('quiz_attempts', 'needsupgradetonewqe', 1,
-                array('uniqueid' => $attempt->uniqueid));
-    }
-}
diff --git a/admin/tool/qeupgradehelper/cli/convert.php b/admin/tool/qeupgradehelper/cli/convert.php
deleted file mode 100644 (file)
index 779442e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-<?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/>.
-
-/**
- * Script to allow upgrading of quizzes with attempts that were previously
- * skipped.
- *
- * @package    tool_qeupgradehelper
- * @copyright  2012 Eric Merrill, Oakland Unversity
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-define('CLI_SCRIPT', true);
-
-require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/config.php');
-require_once(dirname(dirname(__FILE__)) . '/locallib.php');
-require_once(dirname(dirname(__FILE__)) . '/lib.php');
-require_once($CFG->libdir.'/clilib.php');      // CLI only functions.
-
-
-// Now get cli options.
-list($options, $unrecognized) = cli_get_params(array('quiz'=>false, 'timelimit'=>false, 'countlimit'=>false, 'help'=>false),
-                                               array('c'=>'countlimit', 't'=>'timelimit', 'h'=>'help'));
-
-if ($unrecognized) {
-    $unrecognized = implode("\n  ", $unrecognized);
-    cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
-}
-
-
-if ($options['help']) {
-    $help =
-"Question engine upgrade helper CLI tool.
-Will upgrade all remaining question attempts if no options are specified.
-
-Options:
--c, --countlimit=<n>    Process n number of quizzes then exit
--t, --timelimit=<n>     Process quizzes for n number of seconds, then exit. A quiz
-                        currently in progress will not be interrupted.
---quiz=<quizid>         Process quiz quizid only
--h, --help              Print out this help
-
-countlimit and timelimit can be used together. First one to trigger will stop execution.
-
-Example:
-\$sudo -u www-data /usr/bin/php admin/tool/qeupgradehelper/cliupgrade.php
-";
-
-    echo $help;
-    die;
-}
-
-
-
-
-if (!tool_qeupgradehelper_is_upgraded()) {
-    mtrace('qeupgradehelper: site not yet upgraded. Doing nothing.');
-    return;
-}
-
-require_once(dirname(dirname(__FILE__)) . '/afterupgradelib.php');
-
-
-$starttime = time();
-
-// Setup the stop time.
-if ($options['timelimit']) {
-    $stoptime = time() + $options['timelimit'];
-} else {
-    $stoptime = false;
-}
-
-// If we are doing a quiz id, limit to one.
-if ($options['quiz']) {
-    $options['countlimit'] = 1;
-}
-
-$count = 0;
-
-
-mtrace('qeupgradehelper: processing ...');
-
-/* This while statement does a few things
- * Basically if an option is set to false, then that subsection will return
- * true, and will short circuit the test condition for that option, and always
- * being true. Both options are anded together, so either one can trigger to stop.
- */
-while ((!$stoptime || (time() < $stoptime)) && (!$options['countlimit'] || ($count < $options['countlimit']))) {
-    if ($options['quiz']) {
-        $quizid = $options['quiz'];
-    } else {
-        $quiz = tool_qeupgradehelper_get_quiz_for_upgrade();
-        if (!$quiz) {
-            mtrace('qeupgradehelper: No more quizzes to process.');
-            break; // No more to do.
-        }
-
-        $quizid = $quiz->id;
-    }
-    $quizsummary = tool_qeupgradehelper_get_quiz($quizid);
-    if ($quizsummary) {
-        mtrace('  starting upgrade of attempts at quiz ' . $quizid);
-        $upgrader = new tool_qeupgradehelper_attempt_upgrader(
-                $quizsummary->id, $quizsummary->numtoconvert);
-        $upgrader->convert_all_quiz_attempts();
-        mtrace('  upgrade of quiz ' . $quizid . ' complete.');
-    } else {
-        mtrace('quiz ' . $quizid . ' not found or already upgraded.');
-    }
-
-    $count++;
-}
-
-
-mtrace('qeupgradehelper: Done. Processed '.$count.' quizes in '.(time()-$starttime).' seconds');
-return;
diff --git a/admin/tool/qeupgradehelper/convertquiz.php b/admin/tool/qeupgradehelper/convertquiz.php
deleted file mode 100644 (file)
index d12fc99..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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/>.
-
-/**
- * Script to upgrade the attempts at a particular quiz, after confirmation.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once(dirname(__FILE__) . '/afterupgradelib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-$quizid = required_param('quizid', PARAM_INT);
-$confirmed = optional_param('confirmed', false, PARAM_BOOL);
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-tool_qeupgradehelper_require_upgraded();
-
-admin_externalpage_setup('qeupgradehelper', '', array(),
-        tool_qeupgradehelper_url('convertquiz', array('quizid' => $quizid)));
-$PAGE->navbar->add(get_string('listtodo', 'tool_qeupgradehelper'),
-        tool_qeupgradehelper_url('listtodo'));
-$PAGE->navbar->add(get_string('convertattempts', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$quizsummary = tool_qeupgradehelper_get_quiz($quizid);
-if (!$quizsummary) {
-    print_error('invalidquizid', 'tool_qeupgradehelper',
-            tool_qeupgradehelper_url('listtodo'));
-}
-
-$quizsummary->name = format_string($quizsummary->name);
-
-if ($confirmed && data_submitted() && confirm_sesskey()) {
-    // Actually do the conversion.
-    echo $renderer->header();
-    echo $renderer->heading(get_string(
-            'upgradingquizattempts', 'tool_qeupgradehelper', $quizsummary));
-
-    $upgrader = new tool_qeupgradehelper_attempt_upgrader(
-            $quizsummary->id, $quizsummary->numtoconvert);
-    $upgrader->convert_all_quiz_attempts();
-
-    echo $renderer->heading(get_string('conversioncomplete', 'tool_qeupgradehelper'));
-    echo $renderer->end_of_page_link(
-            new moodle_url('/mod/quiz/report.php', array('q' => $quizsummary->id)),
-            get_string('gotoquizreport', 'tool_qeupgradehelper'));
-    echo $renderer->end_of_page_link(tool_qeupgradehelper_url('listtodo'),
-            get_string('listtodo', 'tool_qeupgradehelper'));
-
-    echo $renderer->footer();
-    exit;
-}
-
-echo $renderer->convert_quiz_are_you_sure($quizsummary);
diff --git a/admin/tool/qeupgradehelper/cronsetup.php b/admin/tool/qeupgradehelper/cronsetup.php
deleted file mode 100644 (file)
index 2523ee5..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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/>.
-
-/**
- * Script to set up cron to complete the upgrade automatically.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once(dirname(__FILE__) . '/cronsetup_form.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-
-admin_externalpage_setup('qeupgradehelper', '', array(),
-        tool_qeupgradehelper_url('cronsetup'));
-$PAGE->navbar->add(get_string('cronsetup', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$form = new tool_qeupgradehelper_cron_setup_form(
-        new moodle_url('/admin/tool/qeupgradehelper/cronsetup.php'));
-$form->set_data(get_config('tool_qeupgradehelper'));
-
-if ($form->is_cancelled()) {
-    redirect(tool_qeupgradehelper_url('index'));
-
-} else if ($fromform = $form->get_data()) {
-    if ($fromform->cronenabled) {
-        set_config('cronenabled', $fromform->cronenabled, 'tool_qeupgradehelper');
-        set_config('starthour', $fromform->starthour, 'tool_qeupgradehelper');
-        set_config('stophour', $fromform->stophour, 'tool_qeupgradehelper');
-        set_config('procesingtime', $fromform->procesingtime, 'tool_qeupgradehelper');
-
-    } else {
-        unset_config('cronenabled', 'tool_qeupgradehelper');
-        unset_config('starthour', 'tool_qeupgradehelper');
-        unset_config('stophour', 'tool_qeupgradehelper');
-        unset_config('procesingtime', 'tool_qeupgradehelper');
-    }
-    redirect(tool_qeupgradehelper_url('index'));
-
-}
-
-echo $renderer->header();
-echo $renderer->heading(get_string('cronsetup', 'tool_qeupgradehelper'));
-echo $renderer->box(get_string('croninstructions', 'tool_qeupgradehelper'));
-$form->display();
-echo $renderer->footer();
diff --git a/admin/tool/qeupgradehelper/cronsetup_form.php b/admin/tool/qeupgradehelper/cronsetup_form.php
deleted file mode 100644 (file)
index 60473f5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?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/>.
-
-/**
- * Settings form for cronsetup.php.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2011 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-defined('MOODLE_INTERNAL') || die();
-
-require_once($CFG->libdir . '/formslib.php');
-
-
-/**
- * Cron setup form.
- * @copyright  2011 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_cron_setup_form extends moodleform {
-    public function definition() {
-        $mform = $this->_form;
-
-        $mform->addElement('selectyesno', 'cronenabled',
-                get_string('cronenabled', 'tool_qeupgradehelper'));
-        $mform->setType('cronenabled', PARAM_BOOL);
-
-        $mform->addElement('select', 'starthour',
-                get_string('cronstarthour', 'tool_qeupgradehelper'), range(0, 23));
-        $mform->setType('starthour', PARAM_INT);
-
-        $mform->addElement('select', 'stophour',
-                get_string('cronstophour', 'tool_qeupgradehelper'),
-                array_combine(range(1, 24), range(1, 24)));
-        $mform->setType('stophour', PARAM_INT);
-        $mform->setDefault('stophour', 24);
-
-        $mform->addElement('duration', 'procesingtime',
-                get_string('cronprocesingtime', 'tool_qeupgradehelper'));
-        $mform->setType('procesingtime', PARAM_INT);
-        $mform->setDefault('procesingtime', 60);
-
-        $mform->disabledIf('starthour', 'cronenabled', 'eq', 0);
-        $mform->disabledIf('stophour', 'cronenabled', 'eq', 0);
-        $mform->disabledIf('procesingtime', 'cronenabled', 'eq', 0);
-
-        $this->add_action_buttons();
-    }
-}
diff --git a/admin/tool/qeupgradehelper/extracttestcase.php b/admin/tool/qeupgradehelper/extracttestcase.php
deleted file mode 100644 (file)
index 902418f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?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/>.
-
-/**
- * Script to help create unit tests for the upgrade using example data from the
- * database.
- *
- * (The theory is that if the upgrade dies with an error, you can restore the
- * database from backup, and then use this script to extract the problem case
- * as a unit test. Then you can fix that unit tests. Then you can repeat the upgrade.)
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2009 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once(dirname(__FILE__) . '/extracttestcase_form.php');
-require_once($CFG->libdir . '/questionlib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-
-admin_externalpage_setup('qeupgradehelper', '', array(),
-        tool_qeupgradehelper_url('extracttestcase'));
-$PAGE->navbar->add(get_string('extracttestcase', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$mform = new tool_qeupgradehelper_extract_options_form(
-        new moodle_url('/admin/tool/qeupgradehelper/extracttestcase.php'), null, 'get');
-
-echo $OUTPUT->header();
-if ($fromform = $mform->get_data()) {
-    $qsid = null;
-    if (!empty($fromform->attemptid) && !empty($fromform->questionid)) {
-        $qsid = tool_qeupgradehelper_get_session_id($fromform->attemptid, $fromform->questionid);
-        $name = 'qsession' . $qsid;
-
-    } else if (!empty($fromform->statehistory)) {
-        notify('Searching ...', 'notifysuccess');
-        flush();
-        $qsid = tool_qeupgradehelper_find_test_case($fromform->behaviour, $fromform->statehistory,
-                $fromform->qtype, $fromform->extratests);
-        $name = 'history' . $fromform->statehistory;
-    }
-
-    if ($qsid) {
-        tool_qeupgradehelper_generate_unit_test($qsid, $name);
-    } else {
-        notify('No suitable attempts found.');
-    }
-}
-
-$mform->display();
-echo $OUTPUT->footer();
diff --git a/admin/tool/qeupgradehelper/extracttestcase_form.php b/admin/tool/qeupgradehelper/extracttestcase_form.php
deleted file mode 100644 (file)
index ca8619e..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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/>.
-
-/**
- * Settings form for extracttestcase.php.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2009 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-defined('MOODLE_INTERNAL') || die();
-
-require_once($CFG->libdir . '/formslib.php');
-
-
-/**
- * Options form.
- * @copyright  2009 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_extract_options_form extends moodleform {
-    public function definition() {
-        $mform = $this->_form;
-
-        $behaviour = array(
-            'deferredfeedback' => 'Deferred feedback',
-            'adaptive' => 'Adaptive',
-            'adaptivenopenalty' => 'Adaptive (no penalties)',
-        );
-
-        $qtypes = core_component::get_plugin_list('qtype');
-        foreach ($qtypes as $qtype => $notused) {
-            $qtypes[$qtype] = get_string('pluginname', 'qtype_' . $qtype);
-        }
-
-        $mform->addElement('header', 'h1', 'Either extract a specific question_session');
-        $mform->addElement('text', 'attemptid', 'Quiz attempt id', array('size' => '10'));
-        $mform->setType('attemptid', PARAM_INT);
-
-        $mform->addElement('text', 'questionid', 'Question id', array('size' => '10'));
-        $mform->setType('questionid', PARAM_INT);
-
-        $mform->addElement('header', 'h2', 'Or find and extract an example by type');
-        $mform->addElement('select', 'behaviour', 'Behaviour', $behaviour);
-        $mform->setType('behaviour', PARAM_ALPHA);
-
-        $mform->addElement('text', 'statehistory', 'State history', array('size' => '10'));
-        $mform->setType('statehistory', PARAM_RAW);
-
-        $mform->addElement('select', 'qtype', 'Question type', $qtypes);
-        $mform->setType('qtype', PARAM_PLUGIN);
-
-        $mform->addElement('text', 'extratests', 'Extra conditions', array('size' => '50'));
-        $mform->setType('extratests', PARAM_RAW);
-        $this->add_action_buttons(false, 'Create test case');
-    }
-}
diff --git a/admin/tool/qeupgradehelper/index.php b/admin/tool/qeupgradehelper/index.php
deleted file mode 100644 (file)
index 776645a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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/>.
-
-/**
- * This plugin can help upgrade site with a large number of question attempts
- * from Moodle 2.0 to 2.1.
- *
- * This screen is the main entry-point to the plugin, it gives the admin a list
- * of options available to them.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-admin_externalpage_setup('qeupgradehelper');
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$actions = array();
-if (tool_qeupgradehelper_is_upgraded()) {
-    $detected = get_string('upgradedsitedetected', 'tool_qeupgradehelper');
-    $actions[] = tool_qeupgradehelper_action::make('listtodo');
-    $actions[] = tool_qeupgradehelper_action::make('listupgraded');
-    $actions[] = tool_qeupgradehelper_action::make('extracttestcase');
-    $actions[] = tool_qeupgradehelper_action::make('cronsetup');
-
-} else {
-    $detected = get_string('oldsitedetected', 'tool_qeupgradehelper');
-    $actions[] = tool_qeupgradehelper_action::make('listpreupgrade');
-    $actions[] = tool_qeupgradehelper_action::make('extracttestcase');
-    $actions[] = tool_qeupgradehelper_action::make('cronsetup');
-}
-
-echo $renderer->index_page($detected, $actions);
diff --git a/admin/tool/qeupgradehelper/lang/en/tool_qeupgradehelper.php b/admin/tool/qeupgradehelper/lang/en/tool_qeupgradehelper.php
deleted file mode 100644 (file)
index 7bd7c13..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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 engine upgrade helper langauge strings.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-$string['action'] = 'Action';
-$string['alreadydone'] = 'Everything has already been converted';
-$string['areyousure'] = 'Are you sure?';
-$string['areyousuremessage'] = 'Do you wish to proceed with upgrading all {$a->numtoconvert} attempts at quiz \'{$a->name}\' in course {$a->shortname}?';
-$string['areyousureresetmessage'] = 'Quiz \'{$a->name}\' in course {$a->shortname} has {$a->totalattempts} attempts, of which {$a->convertedattempts} were upgraded from the old system. Of those, {$a->resettableattempts} can be reset, for later re-conversion. Do you want to proceed with this?';
-$string['attemptstoconvert'] = 'Attempts needing conversion';
-$string['backtoindex'] = 'Back to the main page';
-$string['conversioncomplete'] = 'Conversion complete';
-$string['convertattempts'] = 'Convert attempts';
-$string['convertquiz'] = 'Convert attempts...';
-$string['convertedattempts'] = 'Converted attempts';
-$string['cronenabled'] = 'Cron enabled';
-$string['croninstructions'] = 'You can enable cron to automatically complete the upgrade following a partial upgrade. Cron will run between set hours on the day (according to server local time). Each time cron runs, it will process a number of attempts until Time limit amount of time has been used, then it will stop and wait for the next cron run. Even if you have set up cron, it will not do anything unless it detects that the main upgrade to 2.1 has been completed.';
-$string['cronprocesingtime'] = 'Processing time each cron run';
-$string['cronsetup'] = 'Configure cron';
-$string['cronsetup_desc'] = 'You can configure cron to complete the upgrade of quiz attempt data automatically.';
-$string['cronstarthour'] = 'Start hour';
-$string['cronstophour'] = 'Stop hour';
-$string['extracttestcase'] = 'Extract test case';
-$string['extracttestcase_desc'] = 'Use example data from the database to help create unit tests that can be used to test the upgrade.';
-$string['gotoindex'] = 'Back to the list of quizzes that can be upgraded';
-$string['gotoquizreport'] = 'Go to the reports for this quiz, to check the upgrade';
-$string['gotoresetlink'] = 'Go to the list of quizzes that can be reset';
-$string['includedintheupgrade'] = 'Included in the upgrade?';
-$string['invalidquizid'] = 'Invalid quiz id. Either the quiz does not exist, or it has no attempts to convert.';
-$string['listpreupgrade'] = 'List quizzes and attempts';
-$string['listpreupgrade_desc'] = 'This will show a report of all the quizzes on the system and how many attempts they have. This will give you an idea of the scope of the upgrade you have to do.';
-$string['listpreupgradeintro'] = 'These are the number of quiz attempts that will need to be processed when you upgrade your site. A few tens of thousands is no worry. Much beyond that and you need to think about how long the upgrade will take.';
-$string['listtodo'] = 'List quizzes still to upgrade';
-$string['listtodo_desc'] = 'This will show a report of all the quizzes on the system (if any) that have attempts that still need to be upgraded to the new question engine.';
-$string['listtodointro'] = 'These are all the quizzes with attempt data that still needs to be converted. You can convert the attempts by clicking the link.';
-$string['listupgraded'] = 'List already upgraded quizzes that can be reset';
-$string['listupgraded_desc'] = 'This will show a report of all the quizzes on the system whose attempts have been upgraded, and where the old data is still present so the upgrade could be reset and redone.';
-$string['listupgradedintro'] = 'These are all the quizzes that have attempts that were upgraded, and where the old attempt data is still there, so they could be reset, and the upgrade re-done.';
-$string['noquizattempts'] = 'Your site does not have any quiz attempts at all!';
-$string['nothingupgradedyet'] = 'No upgraded attempts that can be reset';
-$string['notupgradedsiterequired'] = 'This script can only work before the site has been upgraded.';
-$string['numberofattempts'] = 'Number of quiz attempts';
-$string['oldsitedetected'] = 'This appears to be a site that has not yet been upgraded to include the new question engine.';
-$string['outof'] = '{$a->some} out of {$a->total}';
-$string['pluginname'] = 'Question engine upgrade helper';
-$string['pretendupgrade'] = 'Do a dry-run of the attempts upgrade';
-$string['pretendupgrade_desc'] = 'The upgrade does three things: Load the existing data from the database; transform it; then write the transformed data to the DB. This script will test the first two parts of the process.';
-$string['questionsessions'] = 'Question sessions';
-$string['quizid'] = 'Quiz id';
-$string['quizupgrade'] = 'Quiz upgrade status';
-$string['quizzesthatcanbereset'] = 'The following quizzes have converted attempts that you may be able to reset';
-$string['quizzestobeupgraded'] = 'All quizzes with attempts';
-$string['quizzeswithunconverted'] = 'The following quizzes have attempts that need to be converted';
-$string['resetquiz'] = 'Reset attempts...';
-$string['resetcomplete'] = 'Reset complete';
-$string['resettingquizattempts'] = 'Resetting quiz attempts';
-$string['resettingquizattemptsprogress'] = 'Resetting attempt {$a->done} / {$a->outof}';
-$string['upgradingquizattempts'] = 'Upgrading the attempts for quiz \'{$a->name}\' in course {$a->shortname}';
-$string['upgradedsitedetected'] = 'This appears to be a site that has been upgraded to include the new question engine.';
-$string['upgradedsiterequired'] = 'This script can only work after the site has been upgraded.';
-$string['veryoldattemtps'] = 'Your site has {$a} quiz attempts that were never completely updated during the upgrade from Moodle 1.4 to Moodle 1.5. These attempts will be dealt with before the main upgrade. You need to to consider the extra time required for this.';
diff --git a/admin/tool/qeupgradehelper/lib.php b/admin/tool/qeupgradehelper/lib.php
deleted file mode 100644 (file)
index a6fc034..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?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/>.
-
-/**
- * Lib functions (cron) to automatically complete the question engine upgrade
- * if it was not done all at once during the main upgrade.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2011 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-defined('MOODLE_INTERNAL') || die;
-
-/**
- * Standard cron function
- */
-function tool_qeupgradehelper_cron() {
-    $settings = get_config('tool_qeupgradehelper');
-    if (empty($settings->cronenabled)) {
-        return;
-    }
-
-    mtrace('qeupgradehelper: tool_qeupgradehelper_cron() started at '. date('H:i:s'));
-    try {
-        tool_qeupgradehelper_process($settings);
-    } catch (Exception $e) {
-        mtrace('qeupgradehelper: tool_qeupgradehelper_cron() failed with an exception:');
-        mtrace($e->getMessage());
-    }
-    mtrace('qeupgradehelper: tool_qeupgradehelper_cron() finished at ' . date('H:i:s'));
-}
-
-/**
- * This function does the cron process within the time range according to settings.
- */
-function tool_qeupgradehelper_process($settings) {
-    global $CFG;
-    require_once(dirname(__FILE__) . '/locallib.php');
-
-    if (!tool_qeupgradehelper_is_upgraded()) {
-        mtrace('qeupgradehelper: site not yet upgraded. Doing nothing.');
-        return;
-    }
-
-    require_once(dirname(__FILE__) . '/afterupgradelib.php');
-
-    $hour = (int) date('H');
-    if ($hour < $settings->starthour || $hour >= $settings->stophour) {
-        mtrace('qeupgradehelper: not between starthour and stophour, so doing nothing (hour = ' .
-                $hour . ').');
-        return;
-    }
-
-    $stoptime = time() + $settings->procesingtime;
-
-    mtrace('qeupgradehelper: processing ...');
-    while (time() < $stoptime) {
-
-        $quiz = tool_qeupgradehelper_get_quiz_for_upgrade();
-        if (!$quiz) {
-            mtrace('qeupgradehelper: No more quizzes to process. You should probably disable the qeupgradehelper cron settings now.');
-            break; // No more to do;
-        }
-
-        $quizid = $quiz->id;
-        $quizsummary = tool_qeupgradehelper_get_quiz($quizid);
-        if ($quizsummary) {
-            mtrace('  starting upgrade of attempts at quiz ' . $quizid);
-            $upgrader = new tool_qeupgradehelper_attempt_upgrader(
-                    $quizsummary->id, $quizsummary->numtoconvert);
-            $upgrader->convert_all_quiz_attempts();
-            mtrace('  upgrade of quiz ' . $quizid . ' complete.');
-        }
-    }
-
-    mtrace('qeupgradehelper: Done.');
-    return;
-}
diff --git a/admin/tool/qeupgradehelper/listpreupgrade.php b/admin/tool/qeupgradehelper/listpreupgrade.php
deleted file mode 100644 (file)
index ee15a09..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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/>.
-
-/**
- * Script to show all the quizzes in the site with how many attempts they have
- * that will need to be upgraded.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-tool_qeupgradehelper_require_not_upgraded();
-
-admin_externalpage_setup('qeupgradehelper', '', array(), tool_qeupgradehelper_url(''));
-$PAGE->navbar->add(get_string('listpreupgrade', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$quizzes = new tool_qeupgradehelper_pre_upgrade_quiz_list();
-
-// Look to see if the admin has set things up to only upgrade certain attempts.
-$partialupgradefile = $CFG->dirroot . '/' . $CFG->admin . '/tool/qeupgradehelper/partialupgrade.php';
-$partialupgradefunction = 'tool_qeupgradehelper_get_quizzes_to_upgrade';
-if (is_readable($partialupgradefile)) {
-    include_once($partialupgradefile);
-    if (function_exists($partialupgradefunction)) {
-        $quizzes = new tool_qeupgradehelper_pre_upgrade_quiz_list_restricted(
-                $partialupgradefunction());
-    }
-}
-
-$numveryoldattemtps = tool_qeupgradehelper_get_num_very_old_attempts();
-
-if ($quizzes->is_empty()) {
-    echo $renderer->simple_message_page(get_string('noquizattempts', 'tool_qeupgradehelper'));
-
-} else {
-    echo $renderer->quiz_list_page($quizzes, $numveryoldattemtps);
-}
diff --git a/admin/tool/qeupgradehelper/listtodo.php b/admin/tool/qeupgradehelper/listtodo.php
deleted file mode 100644 (file)
index 83062ea..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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/>.
-
-/**
- * Script to show all the quizzes with attempts that still need to be upgraded
- * after the main upgrade.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-tool_qeupgradehelper_require_upgraded();
-
-admin_externalpage_setup('qeupgradehelper', '', array(),
-        tool_qeupgradehelper_url('listtodo'));
-$PAGE->navbar->add(get_string('listtodo', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$quizzes = new tool_qeupgradehelper_upgradable_quiz_list();
-
-if ($quizzes->is_empty()) {
-    echo $renderer->simple_message_page(get_string('alreadydone', 'tool_qeupgradehelper'));
-
-} else {
-    echo $renderer->quiz_list_page($quizzes);
-}
diff --git a/admin/tool/qeupgradehelper/listupgraded.php b/admin/tool/qeupgradehelper/listupgraded.php
deleted file mode 100644 (file)
index 187f75e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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/>.
-
-/**
- * Script to show all the quizzes with attempts that have been upgraded
- * after the main upgrade. With an option to reset the conversion, so it can be
- * re-done if necessary.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once($CFG->libdir . '/adminlib.php');
-
-require_login();
-require_capability('moodle/site:config', context_system::instance());
-tool_qeupgradehelper_require_upgraded();
-
-admin_externalpage_setup('qeupgradehelper', '', array(),
-        tool_qeupgradehelper_url('listupgraded'));
-$PAGE->navbar->add(get_string('listupgraded', 'tool_qeupgradehelper'));
-
-$renderer = $PAGE->get_renderer('tool_qeupgradehelper');
-
-$quizzes = new tool_qeupgradehelper_resettable_quiz_list();
-
-if ($quizzes->is_empty()) {
-    echo $renderer->simple_message_page(get_string('nothingupgradedyet', 'tool_qeupgradehelper'));
-
-} else {
-    echo $renderer->quiz_list_page($quizzes);
-}
diff --git a/admin/tool/qeupgradehelper/locallib.php b/admin/tool/qeupgradehelper/locallib.php
deleted file mode 100644 (file)
index 2c1d933..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-<?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 engine upgrade helper library code.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-defined('MOODLE_INTERNAL') || die();
-
-
-/**
- * Detect whether this site has been upgraded to the new question engine yet.
- * @return bool whether the site has been upgraded.
- */
-function tool_qeupgradehelper_is_upgraded() {
-    global $CFG, $DB;
-    $dbman = $DB->get_manager();
-    return is_readable($CFG->dirroot . '/question/engine/upgrade/upgradelib.php') &&
-            $dbman->table_exists('question_usages');
-}
-
-/**
- * If the site has not yet been upgraded, display an error.
- */
-function tool_qeupgradehelper_require_upgraded() {
-    if (!tool_qeupgradehelper_is_upgraded()) {
-        throw new moodle_exception('upgradedsiterequired', 'tool_qeupgradehelper',
-                tool_qeupgradehelper_url('index'));
-    }
-}
-
-/**
- * If the site has been upgraded, display an error.
- */
-function tool_qeupgradehelper_require_not_upgraded() {
-    if (tool_qeupgradehelper_is_upgraded()) {
-        throw new moodle_exception('notupgradedsiterequired', 'tool_qeupgradehelper',
-                tool_qeupgradehelper_url('index'));
-    }
-}
-
-/**
- * Get the URL of a script within this plugin.
- * @param string $script the script name, without .php. E.g. 'index'.
- * @param array $params URL parameters (optional).
- */
-function tool_qeupgradehelper_url($script, $params = array()) {
-    return new moodle_url('/admin/tool/qeupgradehelper/' . $script . '.php', $params);
-}
-
-
-/**
- * Class to encapsulate one of the functionalities that this plugin offers.
- *
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_action {
-    /** @var string the name of this action. */
-    public $name;
-    /** @var moodle_url the URL to launch this action. */
-    public $url;
-    /** @var string a description of this aciton. */
-    public $description;
-
-    /**
-     * Constructor to set the fields.
-     */
-    protected function __construct($name, moodle_url $url, $description) {
-        $this->name = $name;
-        $this->url = $url;
-        $this->description = $description;
-    }
-
-    /**
-     * Make an action with standard values.
-     * @param string $shortname internal name of the action. Used to get strings
-     * and build a URL.
-     * @param array $params any URL params required.
-     */
-    public static function make($shortname, $params = array()) {
-        return new self(
-                get_string($shortname, 'tool_qeupgradehelper'),
-                tool_qeupgradehelper_url($shortname, $params),
-                get_string($shortname . '_desc', 'tool_qeupgradehelper'));
-    }
-}
-
-
-/**
- * A class to represent a list of quizzes with various information about
- * attempts that can be displayed as a table.
- *
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-abstract class tool_qeupgradehelper_quiz_list {
-    public $title;
-    public $intro;
-    public $quizacolheader;
-    public $sql;
-    public $quizlist = null;
-    public $totalquizas = 0;
-    public $totalqas = 0;
-
-    protected function __construct($title, $intro, $quizacolheader) {
-        global $DB;
-        $this->title = get_string($title, 'tool_qeupgradehelper');
-        $this->intro = get_string($intro, 'tool_qeupgradehelper');
-        $this->quizacolheader = get_string($quizacolheader, 'tool_qeupgradehelper');
-        $this->build_sql();
-        $this->quizlist = $DB->get_records_sql($this->sql);
-    }
-
-    protected function build_sql() {
-        $this->sql = '
-            SELECT
-                quiz.id,
-                quiz.name,
-                c.shortname,
-                c.id AS courseid,
-                COUNT(1) AS attemptcount,
-                SUM(qsesscounts.num) AS questionattempts
-
-            FROM {quiz_attempts} quiza
-            JOIN {quiz} quiz ON quiz.id = quiza.quiz
-            JOIN {course} c ON c.id = quiz.course
-            LEFT JOIN (
-                SELECT attemptid, COUNT(1) AS num
-                FROM {question_sessions}
-                GROUP BY attemptid
-            ) qsesscounts ON qsesscounts.attemptid = quiza.uniqueid
-
-            WHERE quiza.preview = 0
-                ' . $this->extra_where_clause() . '
-
-            GROUP BY quiz.id, quiz.name, c.shortname, c.id
-
-            ORDER BY c.shortname, quiz.name, quiz.id';
-    }
-
-    abstract protected function extra_where_clause();
-
-    public function get_col_headings() {
-        return array(
-            get_string('quizid', 'tool_qeupgradehelper'),
-            get_string('course'),
-            get_string('pluginname', 'quiz'),
-            $this->quizacolheader,
-            get_string('questionsessions', 'tool_qeupgradehelper'),
-        );
-    }
-
-    public function get_row($quizinfo) {
-        $this->totalquizas += $quizinfo->attemptcount;
-        $this->totalqas += $quizinfo->questionattempts;
-        return array(
-            $quizinfo->id,
-            html_writer::link(new moodle_url('/course/view.php',
-                    array('id' => $quizinfo->courseid)), format_string($quizinfo->shortname)),
-            html_writer::link(new moodle_url('/mod/quiz/view.php',
-                    array('q' => $quizinfo->id)), format_string($quizinfo->name)),
-            $quizinfo->attemptcount,
-            $quizinfo->questionattempts ? $quizinfo->questionattempts : 0,
-        );
-    }
-
-    public function get_row_class($quizinfo) {
-        return null;
-    }
-
-    public function get_total_row() {
-        return array(
-            '',
-            html_writer::tag('b', get_string('total')),
-            '',
-            html_writer::tag('b', $this->totalquizas),
-            html_writer::tag('b', $this->totalqas),
-        );
-    }
-
-    public function is_empty() {
-        return empty($this->quizlist);
-    }
-}
-
-
-/**
- * A list of quizzes that still need to be upgraded after the main upgrade.
- *
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_upgradable_quiz_list extends tool_qeupgradehelper_quiz_list {
-    public function __construct() {
-        parent::__construct('quizzeswithunconverted', 'listtodointro', 'attemptstoconvert');
-    }
-
-    protected function extra_where_clause() {
-        return 'AND quiza.needsupgradetonewqe = 1';
-    }
-
-    public function get_col_headings() {
-        $headings = parent::get_col_headings();
-        $headings[] = get_string('action', 'tool_qeupgradehelper');
-        return $headings;
-    }
-
-    public function get_row($quizinfo) {
-        $row = parent::get_row($quizinfo);
-        $row[] = html_writer::link(tool_qeupgradehelper_url('convertquiz', array('quizid' => $quizinfo->id)),
-                        get_string('convertquiz', 'tool_qeupgradehelper'));
-        return $row;
-    }
-}
-
-
-/**
- * A list of quizzes that still need to be upgraded after the main upgrade.
- *
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_resettable_quiz_list extends tool_qeupgradehelper_quiz_list {
-    public function __construct() {
-        parent::__construct('quizzesthatcanbereset', 'listupgradedintro', 'convertedattempts');
-    }
-
-    protected function extra_where_clause() {
-        return 'AND quiza.needsupgradetonewqe = 0
-              AND EXISTS(SELECT 1 FROM {question_states}
-                    WHERE attempt = quiza.uniqueid)';
-    }
-
-    public function get_col_headings() {
-        $headings = parent::get_col_headings();
-        $headings[] = get_string('action', 'tool_qeupgradehelper');
-        return $headings;
-    }
-
-    public function get_row($quizinfo) {
-        $row = parent::get_row($quizinfo);
-        $row[] = html_writer::link(tool_qeupgradehelper_url('resetquiz', array('quizid' => $quizinfo->id)),
-                        get_string('resetquiz', 'tool_qeupgradehelper'));
-        return $row;
-    }
-}
-
-
-/**
- * A list of quizzes that will be upgraded during the main upgrade.
- *
- * @copyright  2010 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_pre_upgrade_quiz_list extends tool_qeupgradehelper_quiz_list {
-    public function __construct() {
-        parent::__construct('quizzestobeupgraded', 'listpreupgradeintro', 'numberofattempts');
-    }
-
-    protected function extra_where_clause() {
-        return '';
-    }
-}
-
-
-/**
- * A list of quizzes that will be upgraded during the main upgrade, when the
- * partialupgrade.php script is being used.
- *
- * @copyright  2011 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class tool_qeupgradehelper_pre_upgrade_quiz_list_restricted extends tool_qeupgradehelper_pre_upgrade_quiz_list {
-    protected $quizids;
-    protected $restrictedtotalquizas = 0;
-    protected $restrictedtotalqas = 0;
-
-    public function __construct($quizids) {
-        parent::__construct();
-        $this->quizids = $quizids;
-    }
-
-    public function get_row_class($quizinfo) {
-        if (!in_array($quizinfo->id, $this->quizids)) {
-            return 'dimmed';
-        } else {
-            return parent::get_row_class($quizinfo);
-        }
-    }
-
-    public function get_col_headings() {
-        $headings = parent::get_col_headings();
-        $headings[] = get_string('includedintheupgrade', 'tool_qeupgradehelper');
-        return $headings;
-    }
-
-    public function get_row($quizinfo) {
-        $row = parent::get_row($quizinfo);
-        if (in_array($quizinfo->id, $this->quizids)) {
-            $this->restrictedtotalquizas += $quizinfo->attemptcount;
-            $this->restrictedtotalqas += $quizinfo->questionattempts;
-            $row[] = get_string('yes');
-        } else {
-            $row[] = get_string('no');
-        }
-        return $row;
-    }
-
-    protected function out_of($restrictedtotal, $fulltotal) {
-        $a = new stdClass();
-        $a->some = $a->some = html_writer::tag('b', $restrictedtotal);
-        $a->total = $fulltotal;
-        return get_string('outof', 'tool_qeupgradehelper', $a);
-    }
-
-    public function get_total_row() {
-        return array(
-            '',
-            html_writer::tag('b', get_string('total')),
-            '',
-            $this->out_of($this->restrictedtotalquizas, $this->totalquizas),
-            $this->out_of($this->restrictedtotalqas, $this->totalqas),
-        );
-    }
-}
-
-
-/**
- * List the number of quiz attempts that were never upgraded from 1.4 -> 1.5.
- * @return int the number of such attempts.
- */
-function tool_qeupgradehelper_get_num_very_old_attempts() {
-    global $DB;
-    return $DB->count_records_sql('
-            SELECT COUNT(1)
-              FROM {quiz_attempts} quiza
-             WHERE uniqueid IN (
-                SELECT DISTINCT qst.attempt
-                  FROM {question_states} qst
-                  LEFT JOIN {question_sessions} qsess ON
-                        qst.question = qsess.questionid AND qst.attempt = qsess.attemptid
-                 WHERE qsess.id IS NULL)');
-}
-
-/**
- * Get the information about a quiz to be upgraded.
- * @param integer $quizid the quiz id.
- * @return object the information about that quiz, as for
- *      {@link tool_qeupgradehelper_get_upgradable_quizzes()}.
- */
-function tool_qeupgradehelper_get_quiz($quizid) {
-    global $DB;
-    return $DB->get_record_sql("
-            SELECT
-                quiz.id,
-                quiz.name,
-                c.shortname,
-                c.id AS courseid,
-                COUNT(1) AS numtoconvert
-
-            FROM {quiz_attempts} quiza
-            JOIN {quiz} quiz ON quiz.id = quiza.quiz
-            JOIN {course} c ON c.id = quiz.course
-
-            WHERE quiza.preview = 0
-              AND quiza.needsupgradetonewqe = 1
-              AND quiz.id = ?
-
-            GROUP BY quiz.id, quiz.name, c.shortname, c.id
-
-            ORDER BY c.shortname, quiz.name, quiz.id", array($quizid));
-}
-
-/**
- * Get the information about a quiz to be upgraded.
- * @param integer $quizid the quiz id.
- * @return object the information about that quiz, as for
- *      {@link tool_qeupgradehelper_get_resettable_quizzes()}, but with extra fields
- *      totalattempts and resettableattempts.
- */
-function tool_qeupgradehelper_get_resettable_quiz($quizid) {
-    global $DB;
-    return $DB->get_record_sql("
-            SELECT
-                quiz.id,
-                quiz.name,
-                c.shortname,
-                c.id AS courseid,
-                COUNT(1) AS totalattempts,
-                SUM(CASE WHEN quiza.needsupgradetonewqe = 0 AND
-                    oldtimemodified.time IS NOT NULL THEN 1 ELSE 0 END) AS convertedattempts,
-                SUM(CASE WHEN quiza.needsupgradetonewqe = 0 AND
-                    newtimemodified.time IS NULL OR oldtimemodified.time >= newtimemodified.time
-                            THEN 1 ELSE 0 END) AS resettableattempts
-
-            FROM {quiz_attempts} quiza
-            JOIN {quiz} quiz ON quiz.id = quiza.quiz
-            JOIN {course} c ON c.id = quiz.course
-            LEFT JOIN (
-                SELECT attempt, MAX(timestamp) AS time
-                FROM {question_states}
-                GROUP BY attempt
-            ) AS oldtimemodified ON oldtimemodified.attempt = quiza.uniqueid
-            LEFT JOIN (
-                SELECT qa.questionusageid, MAX(qas.timecreated) AS time
-                FROM {question_attempts} qa
-                JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id
-                GROUP BY qa.questionusageid
-            ) AS newtimemodified ON newtimemodified.questionusageid = quiza.uniqueid
-
-            WHERE quiza.preview = 0
-              AND quiz.id = ?
-
-            GROUP BY quiz.id, quiz.name, c.shortname, c.id", array($quizid));
-}
-
-/**
- * Get a question session id form a quiz attempt id and a question id.
- * @param int $attemptid a quiz attempt id.
- * @param int $questionid a question id.
- * @return int the question session id.
- */
-function tool_qeupgradehelper_get_session_id($attemptid, $questionid) {
-    global $DB;
-    $attempt = $DB->get_record('quiz_attempts', array('id' => $attemptid));
-    if (!$attempt) {
-        return null;
-    }
-    return $DB->get_field('question_sessions', 'id',
-            array('attemptid' => $attempt->uniqueid, 'questionid' => $questionid));
-}
-
-/**
- * Identify the question session id of a question attempt matching certain
- * requirements.
- * @param integer $behaviour 0 = deferred feedback, 1 = interactive.
- * @param string $statehistory of states, last first. E.g. 620.
- * @param string $qtype question type.
- * @return integer question_session.id.
- */
-function tool_qeupgradehelper_find_test_case($behaviour, $statehistory, $qtype, $extratests) {
-    global $DB;
-
-    $params = array(
-        'qtype' => $qtype,
-        'statehistory' => $statehistory
-    );
-
-    if ($behaviour == 'deferredfeedback') {
-        $extrawhere = '';
-        $params['optionflags'] = 0;
-
-    } else if ($behaviour == 'adaptive') {
-        $extrawhere = 'AND penaltyscheme = :penaltyscheme';
-        $params['optionflags'] = 0;
-        $params['penaltyscheme'] = 0;
-
-    } else {
-        $extrawhere = 'AND penaltyscheme = :penaltyscheme';
-        $params['optionflags'] = 0;
-        $params['penaltyscheme'] = 1;
-    }
-
-    $possibleids = $DB->get_records_sql_menu('
-            SELECT
-                qsess.id,
-                1
-
-            FROM {question_sessions} qsess
-            JOIN {question_states} qst ON qst.attempt = qsess.attemptid
-                    AND qst.question = qsess.questionid
-            JOIN {quiz_attempts} quiza ON quiza.uniqueid = qsess.attemptid
-            JOIN {quiz} quiz ON quiz.id = quiza.quiz
-            JOIN {question} q ON q.id = qsess.questionid
-
-            WHERE q.qtype = :qtype
-            AND quiz.optionflags = :optionflags
-            ' . $extrawhere . '
-
-            GROUP BY
-                qsess.id
-
-            HAVING SUM(
-                (CASE WHEN qst.event = 10 THEN 1 ELSE qst.event END) *
-                POWER(10, CAST(qst.seq_number AS NUMERIC(110,0)))
-            ) = :statehistory' . $extratests, $params, 0, 100);
-
-    if (!$possibleids) {
-        return null;
-    }
-
-    return array_rand($possibleids);
-}
-
-/**
- * Grab all the data that upgrade will need for upgrading one
- * attempt at one question from the old DB.
- */
-function tool_qeupgradehelper_generate_unit_test($questionsessionid, $namesuffix) {
-    global $DB;
-
-    $qsession = $DB->get_record('question_sessions', array('id' => $questionsessionid));
-    $attempt = $DB->get_record('quiz_attempts', array('uniqueid' => $qsession->attemptid));
-    $quiz = $DB->get_record('quiz', array('id' => $attempt->quiz));
-    $qstates = $DB->get_records('question_states',
-            array('attempt' => $qsession->attemptid, 'question' => $qsession->questionid),
-            'seq_number, id');
-
-    $question = tool_qeupgradehelper_load_question($qsession->questionid, $quiz->id);
-
-    if (!tool_qeupgradehelper_is_upgraded()) {
-        if (!$quiz->optionflags) {
-            $quiz->preferredbehaviour = 'deferredfeedback';
-        } else if ($quiz->penaltyscheme) {
-            $quiz->preferredbehaviour = 'adaptive';
-        } else {
-            $quiz->preferredbehaviour = 'adaptivenopenalty';
-        }
-        unset($quiz->optionflags);
-        unset($quiz->penaltyscheme);
-
-        $question->defaultmark = $question->defaultgrade;
-        unset($question->defaultgrade);
-    }
-
-    $attempt->needsupgradetonewqe = 1;
-
-    echo '<textarea readonly="readonly" rows="80" cols="120" >' . "
-    public function test_{$question->qtype}_{$quiz->preferredbehaviour}_{$namesuffix}() {
-";
-    tool_qeupgradehelper_display_convert_attempt_input($quiz, $attempt,
-            $question, $qsession, $qstates);
-
-    if ($question->qtype == 'random') {
-        list($randombit, $realanswer) = explode('-', reset($qstates)->answer, 2);
-        $newquestionid = substr($randombit, 6);
-        $newquestion = tool_qeupgradehelper_load_question($newquestionid);
-        $newquestion->maxmark = $question->maxmark;
-
-        echo tool_qeupgradehelper_format_var('$realquestion', $newquestion);
-        echo '        $this->loader->put_question_in_cache($realquestion);
-';
-    }
-
-    echo '
-        $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates);
-
-        $expectedqa = (object) array(';
-    echo "
-            'behaviour' => '{$quiz->preferredbehaviour}',
-            'questionid' => {$question->id},
-            'variant' => 1,
-            'maxmark' => {$question->maxmark},
-            'minfraction' => 0,
-            'maxfraction' => 1,
-            'flagged' => 0,
-            'questionsummary' => '',
-            'rightanswer' => '',
-            'responsesummary' => '',
-            'timemodified' => 0,
-            'steps' => array(";
-    foreach ($qstates as $state) {
-        echo "
-                {$state->seq_number} => (object) array(
-                    'sequencenumber' => {$state->seq_number},
-                    'state' => '',
-                    'fraction' => null,
-                    'timecreated' => {$state->timestamp},
-                    'userid' => {$attempt->userid},
-                    'data' => array(),
-                ),";
-    }
-    echo '
-            ),
-        );
-
-        $this->compare_qas($expectedqa, $qa);
-    }
-</textarea>';
-}
-
-function tool_qeupgradehelper_format_var($name, $var) {
-    $out = var_export($var, true);
-    $out = str_replace('<', '&lt;', $out);
-    $out = str_replace('ADOFetchObj::__set_state(array(', '(object) array(', $out);
-    $out = str_replace('stdClass::__set_state(array(', '(object) array(', $out);
-    $out = str_replace('array (', 'array(', $out);
-    $out = preg_replace('/=> \n\s*/', '=> ', $out);
-    $out = str_replace(')),', '),', $out);
-    $out = str_replace('))', ')', $out);
-    $out = preg_replace('/\n               (?! )/', "\n                                    ", $out);
-    $out = preg_replace('/\n            (?! )/',    "\n                                ", $out);
-    $out = preg_replace('/\n           (?! )/',     "\n                            ", $out);
-    $out = preg_replace('/\n          (?! )/',      "\n                            ", $out);
-    $out = preg_replace('/\n         (?! )/',       "\n                        ", $out);
-    $out = preg_replace('/\n        (?! )/',        "\n                        ", $out);
-    $out = preg_replace('/\n       (?! )/',         "\n                        ", $out);
-    $out = preg_replace('/\n      (?! )/',          "\n                    ", $out);
-    $out = preg_replace('/\n     (?! )/',           "\n                ", $out);
-    $out = preg_replace('/\n    (?! )/',            "\n                ", $out);
-    $out = preg_replace('/\n   (?! )/',             "\n            ", $out);
-    $out = preg_replace('/\n  (?! )/',              "\n            ", $out);
-    $out = preg_replace('/\n(?! )/',                "\n        ", $out);
-    $out = preg_replace('/\bNULL\b/', 'null', $out);
-    return "        $name = $out;\n";
-}
-
-function tool_qeupgradehelper_display_convert_attempt_input($quiz, $attempt,
-        $question, $qsession, $qstates) {
-    echo tool_qeupgradehelper_format_var('$quiz', $quiz);
-    echo tool_qeupgradehelper_format_var('$attempt', $attempt);
-    echo tool_qeupgradehelper_format_var('$question', $question);
-    echo tool_qeupgradehelper_format_var('$qsession', $qsession);
-    echo tool_qeupgradehelper_format_var('$qstates', $qstates);
-}
-
-function tool_qeupgradehelper_load_question($questionid, $quizid) {
-    global $CFG, $DB;
-
-    $question = $DB->get_record_sql('
-            SELECT q.*, qqi.maxmark
-            FROM {question} q
-            JOIN {quiz_question_instances} qqi ON qqi.questionid = q.id
-            WHERE q.id = :questionid AND qqi.quizid = :quizid',
-            array('questionid' => $questionid, 'quizid' => $quizid));
-
-    if (tool_qeupgradehelper_is_upgraded()) {
-        require_once($CFG->dirroot . '/question/engine/bank.php');
-        $qtype = question_bank::get_qtype($question->qtype, false);
-    } else {
-        global $QTYPES;
-        if (!array_key_exists($question->qtype, $QTYPES)) {
-            $question->qtype = 'missingtype';
-            $question->questiontext = '<p>' . get_string('warningmissingtype', 'quiz') . '</p>' . $question->questiontext;
-        }
-        $qtype = $QTYPES[$question->qtype];
-    }
-
-    $qtype->get_question_options($question);
-
-    return $question;
-}
-
-function tool_qeupgradehelper_get_quiz_for_upgrade() {
-    global $DB;
-
-    return $DB->get_record_sql("SELECT quiz.id
-            FROM {quiz_attempts} quiza
-            JOIN {quiz} quiz ON quiz.id = quiza.quiz
-            JOIN {course} c ON c.id = quiz.course
-            WHERE quiza.preview = 0 AND quiza.needsupgradetonewqe = 1
-            GROUP BY quiz.id, quiz.name, c.shortname, c.id
-            ORDER BY MAX(quiza.timemodified) DESC", array(), IGNORE_MULTIPLE);
-}
diff --git a/admin/tool/qeupgradehelper/partialupgrade-example.php b/admin/tool/qeupgradehelper/partialupgrade-example.php
deleted file mode 100644 (file)
index 3617b5a..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?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/>.
-
-/**
- * Example script, showing how it is possible to only do a part-upgrade of the
- * attempt data during the main upgrade, and then finish the job off later.
- *
- * If you want to use this facility, then you need to:
- *
- * 1. Rename this script to partialupgrade.php.
- * 2. Look at the various example functions below for controlling the upgrade,
- *    chooose one you like, and un-comment it. Alternatively, write your own
- *    custom function.
- * 3. Use the List quizzes and attempts options in this plugin, which should now
- *    display updated information.
- * 4. Once you are sure that works, you can proceed with the upgrade as usual.
- *
- * @package    tool
- * @subpackage qeupgradehelper
- * @copyright  2011 The Open University
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-
-/**
- * This is a very simple example that just uses a hard-coded array to control
- * which attempts are upgraded.
- *
- * @return array of quiz ids that are the ones to upgrade during the main
- * upgrade from 2.0 to 2.1. Attempts at other quizzes are left alone, you will
- * have to take steps to upgrade them yourself using the facilities provided by
- * this plugin.
- */
-//function tool_qeupgradehelper_get_quizzes_to_upgrade() {
-//    return array(1, 2, 3);
-//}
-
-
-/**
- * This example function uses a list of quiz ids from a file.
- *
- * It is currently set to use the file quiz-ids-to-upgrade.txt in the same
- * folder as this script, but you can change that if you like.
- *
- * That file should contain one quiz id per line, with no punctuation. Any line
- * that does not look like an integer is ignored.
- *
- * @return array of quiz ids that are the ones to upgrade during the main
- * upgrade from 2.0 to 2.1. Attempts at other quizzes are left alone, you will
- * have to take steps to upgrade them yourself using the facilities provided by
- * this plugin.
- */
-//function tool_qeupgradehelper_get_quizzes_to_upgrade() {
-//    global $CFG;
-//    $rawids = file($CFG->dirroot . '/' . $CFG->admin . '/tool/qeupgradehelper/quiz-ids-to-upgrade.txt');
-//    $cleanids = array();
-//    foreach ($rawids as $id) {
-//        $id = clean_param($id, PARAM_INT);
-//        if ($id) {
-//            $cleanids[] = $id;
-//        }
-//    }
-//    return $cleanids;
-//}
-
-
-/**
- * This example uses a complex SQL query to decide which attempts to upgrade.
- *
- * The particular example I have done here is to return the ids of all the quizzes
- * in courses that started more recently than one year ago. Of coures, you can
- * write any query you like to meet your needs.
- *
- * Remember that you can use the List quizzes and attempts options option provided
- * by this plugin to verify that your query is selecting the quizzes you intend.
- *
- * @return array of quiz ids that are the ones to upgrade during the main
- * upgrade from 2.0 to 2.1. Attempts at other quizzes are left alone, you will
- * have to take steps to upgrade them yourself using the facilities provided by
- * this plugin.
- */
-//function tool_qeupgradehelper_get_quizzes_to_upgrade() {
-//    global $DB;
-//
-//    $quizmoduleid = $DB->get_field('modules', 'id', array('name' => 'quiz'));
-//
-//    $oneyearago = strtotime('-1 year');
-//
-//    return $DB->get_fieldset_sql('
-//        SELECT DISTINCT quiz.id
-//
-//        FROM {quiz} quiz
-//        JOIN {course_modules} cm ON cm.module = :quizmoduleid
-//                AND cm.instance = quiz.id
-//        JOIN {course} c ON quiz.course = c.id
-//
-//        WHERE c.startdate > :cutoffdate
-//
-//        ORDER BY quiz.id
-//        ', array('quizmoduleid' => $quizmoduleid, 'cutoffdate' => $oneyearago));
-//    ");
-//}
diff --git a/admin/tool/qeupgradehelper/renderer.php b/admin/tool/qeupgradehelper/renderer.php
deleted file mode 100644 (file)
index 6d291ed..0000000