MDL-35053 questions: question files outside an attempt.
[moodle.git] / question / upgrade.txt
... / ...
1This files describes API changes for code that uses the question API.
3=== 2.6 ===
51) It is sometimes necessary to display bits of question content without having
6 and attempt (question_usage) in progress. Two examples of this are the option
7 in the question bank to display the questiontext, and in the quiz statistics
8 report, where it displays the question text above the report.
10 Previously, this display was done using a special method that only worked for
11 the question text, but which would not work for other parts of the question.
12 That old mechanism has been deprecated, and there is a new method that you
13 should use.
15 To display the question, replace calls to question_rewrite_questiontext_preview_urls
16 with calls to question_rewrite_question_preview_urls. Because the new function
17 is more flexibile, you have to pass more arguments.
19 To perform the necessary permission checks when the file is downloaded, you need
20 to implement the callback [component name]_question_preview_pluginfile.
21 (Previously you implemented [component name]_questiontext_preview_pluginfile.)
22 quiz_statistics_question_preview_pluginfile is an example of what to do.
24 question_send_questiontext_file has been deprecated. It is no longer necessary.
26 To ensure you are no longer using or defining any deprecated functions,
27 search for the regular expression:
28 question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file