MDL-61407 privacy: Track changes in any context
[moodle.git] / question / upgrade.txt
CommitLineData
181393aa
TH
1This files describes API changes for code that uses the question API.
2
891750bc
FM
3=== 3.2 ===
4
51) The following renderers have been deprecated in favour of the renderable
6 core_question\output\qbank_chooser and associated render_* method.
7 * qbank_chooser
8 * qbank_chooser_types
9 * qbank_chooser_qtype
10 * qbank_chooser_title
11
5aeba199
DP
12=== 3.1 ===
13
141) The argument $requirecourseid was removed from question_edit_setup() and
15 is no longer respected. The behaviour was found to be buggy and now throws
16 debugging notices if passed.
17
4c3c1b51
TH
18=== 2.9 ===
19
1b49f31d
TH
201) Some functions in questionlib.php which were deprecated in the past have now
21 been deleted:
4c3c1b51
TH
22
23 Deprecated since 2.1
24 * question_list_instances
25 * get_grade_options
26 * question_category_isused
27 * save_question_options
28 * question_get_real_state
29
1b49f31d
TH
30 Deprecated since 2.6
31 * question_rewrite_questiontext_preview_urls
32 * question_send_questiontext_file
33 * question_pluginfile no longer falls back to using the old
34 {$previewcomponent}_questiontext_preview_pluginfile callback if the new
35 {$previewcomponent}_question_preview_pluginfile callback is missing.
36
4c3c1b51 37
16e246ac
TH
38=== 2.8 ===
39
f6579bea 401) This is just a warning that some methods of the question_engine_data_mapper
16e246ac
TH
41 class have changed. All these methods are ones that you should not have been
42 calling directly from your code, so this should not cause any problems.
43 The changed methods are:
44 * insert_question_attempt
45 * insert_step_data
46 * update_question_attempt_step
47
48
efa5155a
RM
49=== 2.7 ===
50
511) Changes to class question_bank_view:
52
53 Filters, including $recurse and $showhidden, are now implemented as
d62382d1 54 pluggable \core_question\bank\search\condition classes.
efa5155a
RM
55
56 Therefore $recurse and $showhidden are no longer passed to the following functions:
57 protected function display_options [deprecated, use display_options_form()]
58 protected function build_query_sql [deprecated, use build_query()]
59
d62382d1 60 protected function display_category_form() is deprecated. Use \core_question\bank\search\category_condition
efa5155a 61
d62382d1 62 protected function display_category_form_checkbox deprecated use html_writer::checkbox and separate JavaScript
efa5155a
RM
63
64To add filters, local plugins can now implement the function local_[pluginname]_get_question_bank_search_conditions,
65
17f229fa
RM
662) To make columns available to question_bank_view, plugins can extend core_question\bank\column_base.
67 Users may choose to display additional columns by setting $CFG->questionbankcolumns to a comma-delimited list of columns.
68
693) The subsort separator has changed from _ to - in order to distinuguish subsorts vs frankenstyle component separators.
70
714) Because of the move to autoloading, $knowncolumntypes and known_field_types() are no longer used.
72
735) question_bank_column_base and it's derived classes have been namespaced to core_question\bank\column_base.
d62382d1 74
16e246ac 75
181393aa
TH
76=== 2.6 ===
77
b07ef13b
DP
781) Modules using the question bank MUST now declare their use of it with the xxx_supports()
79 flag FEATURE_USES_QUESTIONS. question_module_uses_questions() should be used to determine
80 if a module uses questions.
81
822) It is sometimes necessary to display bits of question content without having
181393aa
TH
83 and attempt (question_usage) in progress. Two examples of this are the option
84 in the question bank to display the questiontext, and in the quiz statistics
85 report, where it displays the question text above the report.
86
87 Previously, this display was done using a special method that only worked for
88 the question text, but which would not work for other parts of the question.
89 That old mechanism has been deprecated, and there is a new method that you
90 should use.
91
92 To display the question, replace calls to question_rewrite_questiontext_preview_urls
93 with calls to question_rewrite_question_preview_urls. Because the new function
94 is more flexibile, you have to pass more arguments.
95
96 To perform the necessary permission checks when the file is downloaded, you need
97 to implement the callback [component name]_question_preview_pluginfile.
98 (Previously you implemented [component name]_questiontext_preview_pluginfile.)
99 quiz_statistics_question_preview_pluginfile is an example of what to do.
100
101 question_send_questiontext_file has been deprecated. It is no longer necessary.
102
103 To ensure you are no longer using or defining any deprecated functions,
104 search for the regular expression:
105 question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file
70f22d60 106
c2f35e0b
TH
1073) The argument list for core_question_renderer::mark_summary has changed.
108 Please update your calls. (The most likely scenario for this is if you have
109 overridden core_question_renderer::info in your own renderer.) You need to
110 make a change like:
111 - $this->mark_summary($qa, $options);
112 + $this->mark_summary($qa, $behaviouroutput, $options);