forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-35053 questions: question files outside an attempt.
Sometimes it is necssary to display parts of a question outside of an attempt. For example for staff review. When displaying the question, we need to handle images in the question text. In the past there was a mechanism for this that could only cope with the question text. This commit introduces a new method that can handle displaying any part of the question content. This commit intentionally does not upgrade the parts of the system that use the mecanism. That is so that this commit can be used to demonstrate that backwards-compatibility works. The next commit will upgrade the callers.
- Loading branch information
Showing
2 changed files
with
105 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
This files describes API changes for code that uses the question API. | ||
|
||
=== 2.6 === | ||
|
||
1) It is sometimes necessary to display bits of question content without having | ||
and attempt (question_usage) in progress. Two examples of this are the option | ||
in the question bank to display the questiontext, and in the quiz statistics | ||
report, where it displays the question text above the report. | ||
|
||
Previously, this display was done using a special method that only worked for | ||
the question text, but which would not work for other parts of the question. | ||
That old mechanism has been deprecated, and there is a new method that you | ||
should use. | ||
|
||
To display the question, replace calls to question_rewrite_questiontext_preview_urls | ||
with calls to question_rewrite_question_preview_urls. Because the new function | ||
is more flexibile, you have to pass more arguments. | ||
|
||
To perform the necessary permission checks when the file is downloaded, you need | ||
to implement the callback [component name]_question_preview_pluginfile. | ||
(Previously you implemented [component name]_questiontext_preview_pluginfile.) | ||
quiz_statistics_question_preview_pluginfile is an example of what to do. | ||
|
||
question_send_questiontext_file has been deprecated. It is no longer necessary. | ||
|
||
To ensure you are no longer using or defining any deprecated functions, | ||
search for the regular expression: | ||
question_rewrite_questiontext_preview_urls|_questiontext_preview_pluginfile|question_send_questiontext_file |