MDL-69823 mod_quiz: Return question options via WS
[moodle.git] / mod / quiz / upgrade.txt
CommitLineData
d869de66
TH
1This files describes API changes in the quiz code.
2
a5dcaee3
JL
3=== 3.10.1 ===
4
5* External functions mod_quiz_external::get_attempt_data, mod_quiz_external::get_attempt_summary
6 and mod_quiz_external::get_attempt_review now return a new additional optional field:
7 - settings: Containing the question definition settings for displaying the question in an external system.
8
e49ccc92
JL
9=== 3.10 ===
10
11* External functions mod_quiz_external::get_attempt_data, mod_quiz_external::get_attempt_summary
12 and mod_quiz_external::get_attempt_review now return a new additional optional field:
13 - responsefileareas: Containing the user responses to questions file area names including files.
14
b09c036b
MH
15=== 3.7 ===
16
17* Quiz_cron() has been removed. Sub-plugins should implemented scheduled tasks, however legacy cron in subplugins are
18 supported.
19
eb8dfd5b
AG
20=== 3.6 ===
21
22* The following renamed classes have been completely removed:
23 - quiz_question_bank_view (now: mod_quiz\question\bank\custom_view)
24 - question_bank_add_to_quiz_action_column (now: mod_quiz\question\bank\add_action_column)
25 - question_bank_question_name_text_column (now: mod_quiz\question\bank\question_name_text_column)
26
e6743b4b
RW
27=== 3.5 ===
28* Removed questionbank.ajax.php. Please use the quiz_question_bank fragment instead.
4fa49cc6 29* Adding "random" questions to a quiz via quiz_add_quiz_question() has been deprecated. Please use quiz_add_random_questions().
e6743b4b 30
e5ca70ba 31=== 3.3.2 ===
9ffbdafc
AG
32
33* quiz_refresh_events() Now takes two additional parameters to refine the update to a specific instance. This function
34 now optionally takes the module instance object or ID, and the course module object or ID. Please try to send the full
35 objects instead of the ids to save DB calls.
36
33ef5cdc
DP
37=== 3.2 ===
38
39* External functions mod_quiz_external::get_attempt_data, mod_quiz_external::get_attempt_summary
40 and mod_quiz_external::get_attempt_review now return additional optional fields:
41 - blockedbyprevious: Whether a question is blocked by the previous question.
42
8440c780 43=== 3.1 ===
1f0f4131 44
8440c780
DP
45* quiz_attempt::question_print_comment_fields() has been removed. It was broken
46 since at least Moodle 2.0.
47
1f0f4131
TH
48* quiz::confirm_start_attempt_message and mod_quiz_view_object::$startattemptwarning
49 have been deprecated. This functionality is now entirely handled within the
50 quiz access rule plugins.
51
52* The third argument to mod_quiz_renderer::start_attempt_button has been changed
53 from a warning string to a mod_quiz_preflight_check_form.
54
190fbfb6
TH
55* mod_quiz_renderer::review_next_navigation has a new optional argument. If you
56 have overridden that method, consider updating your code to match.
57
6d19eb4b
TH
58* mod_quiz\output\edit_renderer::start_section_list now takes $structure as an
59 argument. If you have overridden this method (it's hard to believe anyone ever
60 would) you will need to update your renderer.
1f0f4131 61
de3b803d
TH
62* Several methods relating to preview links/buttons/urls have a new optional
63 argument to make the preview be of a particular variant.
64
65
441d284a
TH
66=== 2.9 ===
67
68* There have been changes in classes/output/edit_renderer.php for MDL-40990.
69 + Some methods use to take $structure & $question as the first two arguments.
70 They now take $structure & $slot number. If you need $question, you can get
71 it using $question = $structure->get_question_in_slot($slot);
72 + Some methods used to take $quiz & $question. They now take $structure & $slot
73 number. You can get $question as above. $quiz is $structure->get_quiz().
74 + initialise_editing_javascript has had some redundant arguments removed.
75 Hopefully, with these changes, we will have less need to make other changes in future.
76
5e63b335
TH
77* Due to MDL-40992, you should be aware that extra slots can get added to an attempt.
78 You may get slot numbers beyone the end of the original quiz layout, and you
79 may want to call $attemptobj->get_original_slot to find where the question
80 originally came from.
81
82* You now need to pass an instance of the mod_quiz_renderer if you call
83 $attemptobj->render_question or $attemptobj->render_question_at_step.
84
85* The array values in mod_quiz_links_to_other_attempts may now be either a moodle_url,
86 or renderable (or null). Previously they could only be a moodle_url or null.
441d284a 87
5d949702
K
88* The contents of the navigation block is now not just quiz_nav_question_button-s.
89 It can also contain quiz_nav_section_heading-s. If you have overridden
90 mod_quiz_renderer::navigation_panel, then you may need to account for this.
91 This change also has implications for the Edit quiz page.
92
93
e1a2d0d9
CC
94=== 2.8 ===
95
ba2f9a96 96* Classes that were defined in various lib files have been moved to the classes
8aa5e0cf
TH
97 folder to take advantage of auto-loading. This has involved renaming them.
98 see the list in mod/quiz/db/renamedclasses.php.
99
1c2e05c0
TH
100* The quiz no longer handles its own \mod_quiz\event\attempt_becameoverdue event,
101 and so the event handler function quiz_attempt_overdue_handler has been deleted.
102 Also, the internal function quiz_send_overdue_message has add the arguments
103 changed. It now takes the $attemptobj object, not separate stdClass objects.
8aa5e0cf 104
e1a2d0d9
CC
105* Major changes to the Edit quiz page.
106
107 The goal of this work was to increase usability, and also clean up the page
108 enough that it will be possible to add new features in future.
109
110 Display of mod/quiz/edit.php is now entirely generated by
111 mod_quiz\output\edit_renderer. This uses a helper class mod_quiz\structure
112 to provide details of the structure of the quiz, and mod_quiz\repaginate to
113 alter that structure. (Actually, there are still some modification methods on
114 mod_quiz\structure. Expect that to be cleaned up in future.)
115
116 The new code uses much more ajax, and there are new scripts mod/quiz/edit_rest.php
117 and mod/quiz/repaginate.php to handle this. (Again, don't be surprised if those
118 two scripts get merged in future.) Also questionbank.ajax.php (which may, in
119 future, be made more generic, and moved into the core question bank code.)
120
16fa272e
TH
121 As a result of this, mod/quiz/editlib.php has gone. (A few remaining functions
122 were moved to locallib.php.)
e1a2d0d9
CC
123
124 Here is a list of all the old functions or classes that have changed.
125 If you used any of these in custom code, you will need to update your code.
126 (Note that many of these functions should have been considered private internals
127 of the quiz module, and you should not have been using them!)
128
129 From editlib.php:
130 quiz_remove_slot
131 quiz_delete_empty_page
132 quiz_add_page_break_after_slot - Use methods of structure or repaginate
133 quiz_update_slot_maxmark - classes instead.
134 _quiz_move_question
135 quiz_move_question_up
136 quiz_move_question_down
137
138 quiz_print_question_list
139 quiz_print_pagecontrols
140 quiz_print_singlequestion - Use methods of edit_renderer instead.
141 quiz_print_randomquestion
142 quiz_print_singlequestion_reordertool
143 quiz_print_randomquestion_reordertool
144 print_random_option_icon
145 quiz_print_grading_form
146 quiz_print_status_bar
147
148 Moved from editlib.php to locallib.php:
149 quiz_question_tostring - now always returns a string (the only option used).
150 The $return argument has gone.
151
152 Old editing JavaScript (e.g. mod/quiz/edit.js) is gone. Replaced with YUI modules.
153
154
b4cfcf5e
MN
155=== 2.7.1 ===
156
157* The function quiz_fire_attempt_started_event has been removed. This function
158 should not have been used outside the quiz, but if you were using it, you should
159 trigger the event outside this function. Note that the appropriate start event is
160 fired automatically by the quiz_attempt_save_started function.
161
1f0f4131 162
dc4a3ea1
TH
163=== 2.7 ===
164
ccba5b88
TH
165* The old quiz.questions database column (comma-separated list of question ids)
166 is gone, and instead the quiz_question_instances table has been renamed to
167 to quiz_slots. Some of the columns of that table have been renamed to match
168 the coding guidelines. Specifically:
dc4a3ea1
TH
169 quiz -> quizid
170 question -> questionid
171 grade -> maxmark
ccba5b88
TH
172 also there are two new columns:
173 slot - numbers the questions in the quiz in order, as on the edit quiz page.
174 page - new way to determine which question is on which page.
175 naturally, other parts of the code and APIs have been updated to reflect that
176 change.
177
178* The following functions, which were part of the internal workings of the quiz,
179 have been removed.
180 quiz_get_slot_for_question
181 quiz_number_of_questions_in_quiz
182 quiz_repaginate (there is now a quiz_repaginate_questions with a different API).
183 quiz_add_page_break_at (see quiz_add_page_break_after_slot)
184 quiz_add_page_break_after (see quiz_add_page_break_after_slot)
185 quiz_number_of_pages
186 quiz_remove_question (see quiz_remove_slot)
187 quiz_update_question_instance (see quiz_update_slot_maxmark)
188
189* The following internal functions have had their API changed.
190 quiz_delete_empty_page: has had its arguments changed to $quiz and $pagenumber.
191 quiz_has_question_use: now takes $quiz and $slot, not $questionid.
d869de66 192
1f0f4131 193
ad8f0117 194=== 2.6 ===
ccba5b88 195
c544ee92 196* As part of improving the page usability and accessibility, we updated the
197 heading levels for quiz module so it has a proper nesting. (MDL-41615)
ad8f0117
TH
198
199* mod_quiz_renderer::view_best_score has been removed. (It did not do what the
200 name suggested anyway.)
201
202
d869de66
TH
203=== 2.4 ===
204
205* mod_quiz_renderer::finish_review_link now requires $attemptobj to be passed in
206 instead of a moodle_url.
207
208
209=== Earlier changes ===
210
211* Were not documented in this way. Sorry.