weekly release 2.7dev
[moodle.git] / question / upgrade.txt
CommitLineData
181393aa
TH
1This files describes API changes for code that uses the question API.
2
3=== 2.6 ===
4
b07ef13b
DP
51) Modules using the question bank MUST now declare their use of it with the xxx_supports()
6 flag FEATURE_USES_QUESTIONS. question_module_uses_questions() should be used to determine
7 if a module uses questions.
8
92) It is sometimes necessary to display bits of question content without having
181393aa
TH
10 and attempt (question_usage) in progress. Two examples of this are the option
11 in the question bank to display the questiontext, and in the quiz statistics
12 report, where it displays the question text above the report.
13
14 Previously, this display was done using a special method that only worked for
15 the question text, but which would not work for other parts of the question.
16 That old mechanism has been deprecated, and there is a new method that you
17 should use.
18
19 To display the question, replace calls to question_rewrite_questiontext_preview_urls
20 with calls to question_rewrite_question_preview_urls. Because the new function
21 is more flexibile, you have to pass more arguments.
22
23 To perform the necessary permission checks when the file is downloaded, you need
24 to implement the callback [component name]_question_preview_pluginfile.
25 (Previously you implemented [component name]_questiontext_preview_pluginfile.)
26 quiz_statistics_question_preview_pluginfile is an example of what to do.
27
28 question_send_questiontext_file has been deprecated. It is no longer necessary.
29
30 To ensure you are no longer using or defining any deprecated functions,
31 search for the regular expression:
32 question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file