Skip to content

Commit

Permalink
Merge branch 'MDL-72958' of https://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Mar 27, 2022
2 parents ad2d361 + ee80bc4 commit 4344d4b
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 147 deletions.
80 changes: 3 additions & 77 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions mod/quiz/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions question/bank/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
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.
7 changes: 7 additions & 0 deletions question/behaviour/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
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.
Expand Down
21 changes: 14 additions & 7 deletions question/format/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===

Expand Down
13 changes: 13 additions & 0 deletions question/type/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
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()
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 4344d4b

Please sign in to comment.