Commit ee80bc47 authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-72958 questions: tidy up all question-related upgrade.txt files

parent 34ce1463
......@@ -2,6 +2,7 @@ This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 4.0 ===
* To better detect wrong floats (like, for example, unformatted, using local-dependent separators ones) a number of
gradebook functions now have stricter float type checking. All them will require now the "float" being passed to be
a correct float value (numeric or string). Usually, that's achieved by using unformat_float() or
......@@ -90,72 +91,8 @@ information provided here is intended especially for developers.
that wants to listen for the events. Backwards compatibility with existing code using jQuery is preserved.
* The function message_send() in messagelib.php now returns false if there is an error sending the message to the
message processor (MDL-70046).
* Following methods are now deprecated in questionlib and moved to the new qbank_previewquestion plugin:
- question_preview_url() is moved to qbank_previewquestion\helper::question_preview_url()
- question_preview_popup_params() is moved to \qbank_previewquestion\helper::question_preview_popup_params()
Calling these functions in the question will point to the plugin.
The deprecated codes are removed from the questionlib for those two methods.
* The following functions are deprecated in questionlib.php and moved to the new location.
These are marked for final deprecation on 4.4:
- question_remove_stale_questions_from_category() =>
qbank_managecategories\helper::question_remove_stale_questions_from_category()
- flatten_category_tree() => qbank_managecategories\helper::flatten_category_tree()
- add_indented_names() => qbank_managecategories\helper::add_indented_names()
- question_category_select_menu() => qbank_managecategories\helper::question_category_select_menu()
- get_categories_for_contexts() => qbank_managecategories\helper::get_categories_for_contexts()
- question_category_options() => qbank_managecategories\helper::question_category_options()
- question_add_context_in_key() => qbank_managecategories\helper::question_add_context_in_key()
- question_fix_top_names() => qbank_managecategories\helper::question_fix_top_names()
* Following methods are now deprecated in questionlib and moved to the new qbank_previewquestion plugin:
- question_preview_url() is moved to qbank_previewquestion\helper::question_preview_url()
- question_preview_popup_params() is moved to \qbank_previewquestion\helper::question_preview_popup_params()
Calling these functions in the question will point to the plugin, but the deprecation message will be activated in MDL-72004.
The deprecated codes are removed from the questionlib for those two methods.
* Function question_hash() from questionlib.php is deprecated without replacement.
* Some of the new and old methods in the questionlib.php now using type hinting. Please make a note of this while making changes
or implementing any question bank related feature in a plugin. These are the list of methods:
- is_latest()
- get_next_version()
- get_question_version()
- get_question_bank_entry()
- core_question_find_next_unused_idnumber()
- question_module_uses_questions()
- question_page_type_list()
- core_question_question_preview_pluginfile()
- question_rewrite_question_preview_urls()
- question_rewrite_question_urls()
- question_get_all_capabilities()
- question_get_question_capabilities()
- question_require_capability_on()
- question_has_capability_on()
- question_default_export_filename()
- get_import_export_formats()
- question_categorylist_parents()
- question_categorylist()
- question_make_default_categories()
- question_get_top_categories_for_contexts()
- sort_categories_by_tree()
- print_question_icon()
- question_sort_tags()
- _tidy_question()
- question_preload_questions()
- question_move_category_to_context()
- move_question_set_references()
- question_move_questions_to_category()
- idnumber_exist_in_question_category()
- question_move_question_tags_to_new_context()
- question_delete_activity()
- question_delete_course_category()
- question_delete_course()
- question_delete_context()
- question_delete_question()
- delete_question_bank_entry()
- question_category_in_use()
- question_category_delete_safe()
- question_context_has_any_questions()
- questions_in_use()
- question_save_qtype_order()
- question_reorder_qtypes()
* Moodle 4.0 has major changes to the question bank. Therefore, there are major changes in questionlib.php
and the core_question database tables. These are documented in detail in question/upgrade.txt.
* The postgres driver now wraps calls to pg_field_type() and caches them in databasemeta to save an invisible internal
DB call on every request.
* The default type of 'core/toast' messages has been changed to 'information' (callers can still explicitely set the type)
......@@ -175,17 +112,6 @@ completely removed from Moodle core too.
* The method enable_plugin() has been added to the core_plugininfo\base class and it has been implemented by all the plugininfo
classes extending it. When possible, the enable_plugin() method will store these changes into the config_log table, to let admins
check when and who has enabled/disabled plugins.
* New tables are included as a part of https://docs.moodle.org/dev/Question_bank_improvements_for_Moodle_4.0
- question_bank_entries -> Each question bank entry. This table has one row for each question that appears in the question bank.
- question_versions -> Versions of the question. Store the data that defines how a particular version of the question works.
- question_references -> Records where a specific question is used.
- question_set_references -> Records where groups of questions are used (e.g.: Random questions).
Also, some tables have been updated or removed:
- question (fields migrated to the new tables)
- quiz_slot (fields removed)
- quiz_slot_tags (table removed)
During the upgrade, data from the question table will be copied to the new tables. After this process,
the data copied will be removed from question table quiz_slot and finally the the quiz_slot_tags table will be removed.
* Final deprecation: The following functions along with associated tests have been removed:
- core_grades_external::get_grades
- core_grades_external::get_grade_item
......
......@@ -10,19 +10,20 @@ This files describes API changes in the quiz code.
further information.
* New argument quizhasquestions has been added to public methods: view_information in mod/quiz/renderer.php.
* The function no_questions_message() in class mod_quiz_renderer is deprecated. There is no replacement.
* quiz_slots has been updated as a part of https://docs.moodle.org/dev/Question_bank_improvements_for_Moodle_4.0
The fields removed will be now manage by a new table in core_question:
- question_set_reference -> Records where a specific question is used.
- question_set_reference -> Records where groups of questions are used (e.g.: Random questions).
The quiz_slots_tags table will be removed entirely.
* The method get_slot_tags_for_slot_id() from mod/quiz/classes/structure.php has been deprecated and the associated
code for this method have been removed to make sure any unnecessary error doesn't happen as a part of any call.
* Related to the Moodle 4.0 question bank changes, the quiz_slots database table.
The fields removed are now manage by new core_question tables:
- question_references -> Records where a specific question is used.
- question_set_references -> Records where groups of questions are used (e.g. random questions).
The quiz_slots_tags table has been removed entirely, as has the get_slot_tags_for_slot_id() method
from mod/quiz/classes/structure.php. That information now comes from question_set_references.
=== 3.11 ===
* External function mod_quiz_external::get_user_best_grade now returns and additional optional field:
- gradetopass: The grade to pass the quiz (if set)
=== 3.10.1 ===
* External functions mod_quiz_external::get_attempt_data, mod_quiz_external::get_attempt_summary
......
This file describes core qbank plugin changes in /question/bank/*,
information provided here is intended especially for developers.
=== 4.0 ===
* This plugin type is new in Moodle 4.0. It is for adding features to the question bank.
They key entry point is the class plugin_feature in the plugin namespace. This tells
the core question bank API exactly which features this plugin implements.
These features can currently be new columns in the question bank display, and bulk actions.
Currently, actions on single questions are implemented as a type of column (but this
should probably change in the future.) To get started, have a look at the methods
in core_question\local\bank\plugin_features_base which you can override.
This files describes API changes for question behaviour plugins.
=== 4.0 ===
1) The major question bank changes should not affect behaviour plugins.
The navigation changes may affect Behat tests. If you encounter this,
the best way to fix it is to use the new navigation steps in MDL-74130.
=== 3.10 ===
1) The slot parameter of method M.core_question_engine.init_submit_button now removed.
......
......@@ -2,15 +2,22 @@ This files describes API changes for question import/export format plugins.
=== 4.0 ===
* The ExamView question format has been completely removed.
The last posts in http://forum.examview.com/index.php?
are from over 10 years ago and there are no moodle.org
discussions about Examview in the last 10 years.
1) The major question bank changes should not affect import/export plugins.
The navigation changes may affect Behat tests. If you encounter this,
the best way to fix it is to use the new navigation steps in MDL-74130.
* The WebCT question format has been completely removed (WebCT was acquired by Blackboard in 2006).
2) The new validate_file() method in question/format.php can be overwritten
to implement more expensive or detailed file integrity checks for question imports.
There is a simple way to do this if you just want to check that the file is valid UTF-8,
which you can see an example of in format_gift.
3) The ExamView question format has been completely removed.
(The last posts in http://forum.examview.com/index.php?
are from over 10 years ago and there are no moodle.org
discussions about Examview in the last 10 years.)
4) The WebCT question format has been completely removed (WebCT was acquired by Blackboard in 2006).
* The new validate_file() method in question/format.php can be overwritten
to implement more expensive or detailed file integrity checks for question imports.
=== 3.6 ===
......
This files describes API changes for question type plugins.
=== 4.0 ===
1) The major question bank changes should not affect most basic question type plugins.
The navigation changes may affect Behat tests. If you encounter this,
the best way to fix it is to use the new navigation steps in MDL-74130.
2) The qualification 'most' is because some question types do more complex things, which
will require changes related to question versionning. Some examples that come to mind:
- the way qtype_mulitanswer (or qtype_combined) aggregates several sub-questions into a parent question.
- the way some contrib plugins (e.g. qtype_stack, qtype_pmatch) store additional data (question tests)
linked to questions. That relationship will need to be updated.
=== 3.11 ===
* Introducing the following \question_type base class methods to save/fetch the last form values
that were used when creating questions as the new defaults when creating new questions:
- \question_type::get_default_value()
......@@ -19,6 +31,7 @@ This files describes API changes for question type plugins.
This will help teachers who repeatedly create questions and use the same values for the fields
(e.g. Default mark, Penalty for each incorrect try, etc.) in the question edit form.
=== 3.8 ===
* There is a new method for question types get_extra_question_bank_actions.
......
This files describes API changes for code that uses the question API.
=== 4.0 ==
1) Previously, the questionbank api classes were coupled in one place. Now the classes
are divided in two different parts, base classes and feature classes. All the base
classes are moved classes/local/bank and all the feature classes will be moved to
the plugin for that feature.
2) submit_tags_form and associated external services for question tag, tags_form in question/type,
core_question_output_fragment_tags_form method in lib is deprecated and moved to the tagquestion plugin.
3) Function question_get_export_single_question_url() in questionlib has been deprecated
and moved to qbank_exporttoxml plugin, the new location is:
qbank_exporttoxml\helper::question_get_export_single_question_url().
4) The following methods are deprecated in previewlib and moved to the previewquestion plugin:
restart_preview(), question_preview_form_url(), question_preview_action_url(),
question_preview_question_pluginfile()
The following classes are deprecated in previewlib and moves the previewquestion plugin:
question_preview_options, preview_options_form.
5) submit_tags_form and associated external services for question tag, tags_form in question/type,
core_question_output_fragment_tags_form method in lib is deprecated and moved to the tagquestion plugin.
6) Function question_get_export_single_question_url() in questionlib has been deprecated
and moved to qbank_exporttoxml plugin, the new location is:
qbank_exporttoxml\exporttoxml_helper::question_get_export_single_question_url().
7) The following classes are deleted and available in the new location:
=== 4.0 ===
Moodle 4.0 included the results of a major project to re-work the question bank.
1) Database changes (as usual, all existing data is updated automatically).
* Previously there was a single {question} table. This has now been split into three to handle versionning questions:
- question - This now has a row for each version of each question. Therefore, some of the metadata
(e.g. category) is moved to the next table. However, data that defines how a question works
is unchanged, so question type plugins will mostly keep working.
- question_bank_entries - Each question bank entry is a question that appears in the question bank, which can
have many versions.
- question_versions - This joins all the versions of a question in the {question} table to the
{question_bank_entries} row they belong to.
* Also, how other parts of the code refer to questions they want to to has changed, to be managed by the core
API in two new tables.
- question_references -> Records where a specific question is used.
- question_set_references -> Records where groups of questions are used (for example random questions in quizzes).
As a result of this, data from the two quiz tables {quiz_slot} and {quiz_slot_tags} was moved to these new tables.
2) There is a new plugin type 'qbank' for adding features to the question bank. See question/bank/upgrade.txt.
3) Many previously core features have been moved into new plugins, meaning that many old functionsand classes in
lib/questionlib.php and other locations have been deprecated and moved:
* Moved to qbank_previewquestion:
- question_preview_url() is moved to qbank_previewquestion\helper::question_preview_url()
- question_preview_popup_params() is moved to qbank_previewquestion\helper::question_preview_popup_params()
the following were really part of the internal implementation of preview, so should not have been used elsewhere,
but they were also moved (from previewlib.php).
- restart_preview() => qbank_previewquestion\helper::restart_preview(),
- question_preview_form_url() => qbank_previewquestion\helper::question_preview_form_url(),
- question_preview_action_url() => qbank_previewquestion\helper::question_preview_action_url(),
- question_preview_question_pluginfile() => qbank_previewquestion\helper::question_preview_question_pluginfile(),
- class preview_options_form => 'qbank_previewquestion\form\preview_options_form',
- class question_preview_options => 'qbank_previewquestion\output\question_preview_options',
* Moved to qbank_managecategories:
- qbank_managecategories\helper::question_remove_stale_questions_from_category()
- flatten_category_tree() => qbank_managecategories\helper::flatten_category_tree()
- add_indented_names() => qbank_managecategories\helper::add_indented_names()
- question_category_select_menu() => qbank_managecategories\helper::question_category_select_menu()
- get_categories_for_contexts() => qbank_managecategories\helper::get_categories_for_contexts()
- question_category_options() => qbank_managecategories\helper::question_category_options()
- question_add_context_in_key() => qbank_managecategories\helper::question_add_context_in_key()
- question_fix_top_names() => qbank_managecategories\helper::question_fix_top_names()
- class category_form => qbank_managecategories\form\category_form
- class question_category_list => qbank_managecategories\question_category_list
- class question_category_list_item => 'bank_managecategories\question_category_list_item
- class question_category_object => qbank_managecategories\question_category_object
- class question_category_edit_form => qbank_managecategories\form\category_form
- class question_move_form => qbank_managecategories\form\question_move_form
* Moved to qbank_exporttoxml:
- question_get_export_single_question_url() -> qbank_exporttoxml\helper::question_get_export_single_question_url().
* Moved to qbank_exportquestions:
- class question_export_form => qbank_exportquestions\form\export_form
- class export_form => qbank_exportquestions\form\export_form
* Moved to qbank_importquestions:
- class question_import_form => qbank_importquestions\form\question_import_form
* Moved to qbank_tagquestion:
- submit_tags_form and associated external services for question tag,
- tags_form in question/type,
- core_question_output_fragment_tags_form() => /question/bank/qbank_tagquestion/lib.php.
4) The following functions in questionlib.php now using type hinting. So, if you call them with the wrong types,
you will now get fatal errors.
- is_latest()
- get_next_version()
- get_question_version()
- get_question_bank_entry()
- core_question_find_next_unused_idnumber()
- question_module_uses_questions()
- question_page_type_list()
- core_question_question_preview_pluginfile()
- question_rewrite_question_preview_urls()
- question_rewrite_question_urls()
- question_get_all_capabilities()
- question_get_question_capabilities()
- question_require_capability_on()
- question_has_capability_on()
- question_default_export_filename()
- get_import_export_formats()
- question_categorylist_parents()
- question_categorylist()
- question_make_default_categories()
- question_get_top_categories_for_contexts()
- sort_categories_by_tree()
- print_question_icon()
- question_sort_tags()
- _tidy_question()
- question_preload_questions()
- question_move_category_to_context()
- move_question_set_references()
- question_move_questions_to_category()
- idnumber_exist_in_question_category()
- question_move_question_tags_to_new_context()
- question_delete_activity()
- question_delete_course_category()
- question_delete_course()
- question_delete_context()
- question_delete_question()
- delete_question_bank_entry()
- question_category_in_use()
- question_category_delete_safe()
- question_context_has_any_questions()
- questions_in_use()
- question_save_qtype_order()
- question_reorder_qtypes()
5) Function question_hash() from questionlib.php is deprecated without replacement.
6) The following classes have been moved, to better follow Moodle's name-space usage rules:
'core_question\bank\action_column_base' => 'core_question\local\bank\action_column_base',
'core_question\bank\checkbox_column' => 'core_question\local\bank\checkbox_column',
'core_question\bank\column_base' => 'core_question\local\bank\column_base',
......@@ -52,39 +133,13 @@ This files describes API changes for code that uses the question API.
'core_question\output\qbank_chooser' => 'qbank_editquestion\qbank_chooser',
'core_question\output\qbank_chooser_item' => 'qbank_editquestion\qbank_chooser_item',
8) The following classes are deprecated and moved to a new location. These are marked for final deprecation on 4.4:
'question_category_list' => 'qbank_managecategories\question_category_list',
'question_category_list_item' => 'qbank_managecategories\question_category_list_item',
'question_category_object' => 'qbank_managecategories\question_category_object',
'question_category_edit_form' => 'qbank_managecategories\form\category_form',
'question_export_form' => 'qbank_exportquestions\form\export_form',
'question_import_form' => 'qbank_importquestions\form\question_import_form',
'question_move_form' => 'qbank_managecategories\form\question_move_form',
'preview_options_form' => 'qbank_previewquestion\form\preview_options_form',
'question_preview_options' => 'qbank_previewquestion\output\question_preview_options',
'category_form' => 'qbank_managecategories\form\category_form',
'export_form' => 'qbank_exportquestions\form\export_form'.
9) The following functions are deprecated and moved to the new location:
question_preview_question_pluginfile() => qbank_previewquestion\helper::question_preview_question_pluginfile(),
question_preview_action_url() => qbank_previewquestion\helper::question_preview_action_url(),
question_preview_form_url() => qbank_previewquestion\helper::question_preview_form_url(),
restart_preview() => qbank_previewquestion\helper::restart_preview(),
core_question_output_fragment_tags_form() => /question/bank/qbank_tagquestion/lib.php.
10)The qbank api now allows bulk actions from qbank plugins. Its possible to implement a qbank plugin and pass the bulk
bulk action object from the plugin feature using the get_bulk_actions(). The base class for this feature is bulk_action_base.
The following methods are deprecated as a part of bulk actions ui implementation and its no more required to call these methods
anymore as the api is now self sufficient, calling the api will fetch all the features:
process_actions(), process_actions_needing_ui().
12) The Behat class for question-related steps has been renamed to behat_core_question
7) The Behat class for question-related steps has been renamed to behat_core_question
to match the expected naming convention. In the unlikely event that you are directly
referring to the behat_question class name (nothing in the standard Moodle code was)
then you will have to update your reference.
=== 3.9 ==
=== 3.9 ===
1) For years, the ..._questions_in_use callback has been the right way for plugins to
tell the core question system if questions are required. Previously this callback
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment