MDL-48004 question: prevent notices on import screen
[moodle.git] / question / upgrade.txt
... / ...
CommitLineData
1This files describes API changes for code that uses the question API.
2
3=== 2.9 ===
4
51) Some functions in questionlib.php which were deprecated in the past have now
6 been deleted:
7
8 Deprecated since 2.1
9 * question_list_instances
10 * get_grade_options
11 * question_category_isused
12 * save_question_options
13 * question_get_real_state
14
15 Deprecated since 2.6
16 * question_rewrite_questiontext_preview_urls
17 * question_send_questiontext_file
18 * question_pluginfile no longer falls back to using the old
19 {$previewcomponent}_questiontext_preview_pluginfile callback if the new
20 {$previewcomponent}_question_preview_pluginfile callback is missing.
21
22
23=== 2.8 ===
24
251) This is just a warning that some methods of the question_engine_data_mapper
26 class have changed. All these methods are ones that you should not have been
27 calling directly from your code, so this should not cause any problems.
28 The changed methods are:
29 * insert_question_attempt
30 * insert_step_data
31 * update_question_attempt_step
32
33
34=== 2.7 ===
35
361) Changes to class question_bank_view:
37
38 Filters, including $recurse and $showhidden, are now implemented as
39 pluggable \core_question\bank\search\condition classes.
40
41 Therefore $recurse and $showhidden are no longer passed to the following functions:
42 protected function display_options [deprecated, use display_options_form()]
43 protected function build_query_sql [deprecated, use build_query()]
44
45 protected function display_category_form() is deprecated. Use \core_question\bank\search\category_condition
46
47 protected function display_category_form_checkbox deprecated use html_writer::checkbox and separate JavaScript
48
49To add filters, local plugins can now implement the function local_[pluginname]_get_question_bank_search_conditions,
50
512) To make columns available to question_bank_view, plugins can extend core_question\bank\column_base.
52 Users may choose to display additional columns by setting $CFG->questionbankcolumns to a comma-delimited list of columns.
53
543) The subsort separator has changed from _ to - in order to distinuguish subsorts vs frankenstyle component separators.
55
564) Because of the move to autoloading, $knowncolumntypes and known_field_types() are no longer used.
57
585) question_bank_column_base and it's derived classes have been namespaced to core_question\bank\column_base.
59
60
61=== 2.6 ===
62
631) Modules using the question bank MUST now declare their use of it with the xxx_supports()
64 flag FEATURE_USES_QUESTIONS. question_module_uses_questions() should be used to determine
65 if a module uses questions.
66
672) It is sometimes necessary to display bits of question content without having
68 and attempt (question_usage) in progress. Two examples of this are the option
69 in the question bank to display the questiontext, and in the quiz statistics
70 report, where it displays the question text above the report.
71
72 Previously, this display was done using a special method that only worked for
73 the question text, but which would not work for other parts of the question.
74 That old mechanism has been deprecated, and there is a new method that you
75 should use.
76
77 To display the question, replace calls to question_rewrite_questiontext_preview_urls
78 with calls to question_rewrite_question_preview_urls. Because the new function
79 is more flexibile, you have to pass more arguments.
80
81 To perform the necessary permission checks when the file is downloaded, you need
82 to implement the callback [component name]_question_preview_pluginfile.
83 (Previously you implemented [component name]_questiontext_preview_pluginfile.)
84 quiz_statistics_question_preview_pluginfile is an example of what to do.
85
86 question_send_questiontext_file has been deprecated. It is no longer necessary.
87
88 To ensure you are no longer using or defining any deprecated functions,
89 search for the regular expression:
90 question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file
91
923) The argument list for core_question_renderer::mark_summary has changed.
93 Please update your calls. (The most likely scenario for this is if you have
94 overridden core_question_renderer::info in your own renderer.) You need to
95 make a change like:
96 - $this->mark_summary($qa, $options);
97 + $this->mark_summary($qa, $behaviouroutput, $options);