MDL-47691 quiz: only warn re overdue attempts if a Q has been answered
[moodle.git] / mod / quiz / upgrade.txt
CommitLineData
d869de66
TH
1This files describes API changes in the quiz code.
2
e1a2d0d9
CC
3=== 2.8 ===
4
ba2f9a96 5* Classes that were defined in various lib files have been moved to the classes
8aa5e0cf
TH
6 folder to take advantage of auto-loading. This has involved renaming them.
7 see the list in mod/quiz/db/renamedclasses.php.
8
1c2e05c0
TH
9* The quiz no longer handles its own \mod_quiz\event\attempt_becameoverdue event,
10 and so the event handler function quiz_attempt_overdue_handler has been deleted.
11 Also, the internal function quiz_send_overdue_message has add the arguments
12 changed. It now takes the $attemptobj object, not separate stdClass objects.
8aa5e0cf 13
e1a2d0d9
CC
14* Major changes to the Edit quiz page.
15
16 The goal of this work was to increase usability, and also clean up the page
17 enough that it will be possible to add new features in future.
18
19 Display of mod/quiz/edit.php is now entirely generated by
20 mod_quiz\output\edit_renderer. This uses a helper class mod_quiz\structure
21 to provide details of the structure of the quiz, and mod_quiz\repaginate to
22 alter that structure. (Actually, there are still some modification methods on
23 mod_quiz\structure. Expect that to be cleaned up in future.)
24
25 The new code uses much more ajax, and there are new scripts mod/quiz/edit_rest.php
26 and mod/quiz/repaginate.php to handle this. (Again, don't be surprised if those
27 two scripts get merged in future.) Also questionbank.ajax.php (which may, in
28 future, be made more generic, and moved into the core question bank code.)
29
16fa272e
TH
30 As a result of this, mod/quiz/editlib.php has gone. (A few remaining functions
31 were moved to locallib.php.)
e1a2d0d9
CC
32
33 Here is a list of all the old functions or classes that have changed.
34 If you used any of these in custom code, you will need to update your code.
35 (Note that many of these functions should have been considered private internals
36 of the quiz module, and you should not have been using them!)
37
38 From editlib.php:
39 quiz_remove_slot
40 quiz_delete_empty_page
41 quiz_add_page_break_after_slot - Use methods of structure or repaginate
42 quiz_update_slot_maxmark - classes instead.
43 _quiz_move_question
44 quiz_move_question_up
45 quiz_move_question_down
46
47 quiz_print_question_list
48 quiz_print_pagecontrols
49 quiz_print_singlequestion - Use methods of edit_renderer instead.
50 quiz_print_randomquestion
51 quiz_print_singlequestion_reordertool
52 quiz_print_randomquestion_reordertool
53 print_random_option_icon
54 quiz_print_grading_form
55 quiz_print_status_bar
56
57 Moved from editlib.php to locallib.php:
58 quiz_question_tostring - now always returns a string (the only option used).
59 The $return argument has gone.
60
61 Old editing JavaScript (e.g. mod/quiz/edit.js) is gone. Replaced with YUI modules.
62
63
b4cfcf5e
MN
64=== 2.7.1 ===
65
66* The function quiz_fire_attempt_started_event has been removed. This function
67 should not have been used outside the quiz, but if you were using it, you should
68 trigger the event outside this function. Note that the appropriate start event is
69 fired automatically by the quiz_attempt_save_started function.
70
dc4a3ea1
TH
71=== 2.7 ===
72
ccba5b88
TH
73* The old quiz.questions database column (comma-separated list of question ids)
74 is gone, and instead the quiz_question_instances table has been renamed to
75 to quiz_slots. Some of the columns of that table have been renamed to match
76 the coding guidelines. Specifically:
dc4a3ea1
TH
77 quiz -> quizid
78 question -> questionid
79 grade -> maxmark
ccba5b88
TH
80 also there are two new columns:
81 slot - numbers the questions in the quiz in order, as on the edit quiz page.
82 page - new way to determine which question is on which page.
83 naturally, other parts of the code and APIs have been updated to reflect that
84 change.
85
86* The following functions, which were part of the internal workings of the quiz,
87 have been removed.
88 quiz_get_slot_for_question
89 quiz_number_of_questions_in_quiz
90 quiz_repaginate (there is now a quiz_repaginate_questions with a different API).
91 quiz_add_page_break_at (see quiz_add_page_break_after_slot)
92 quiz_add_page_break_after (see quiz_add_page_break_after_slot)
93 quiz_number_of_pages
94 quiz_remove_question (see quiz_remove_slot)
95 quiz_update_question_instance (see quiz_update_slot_maxmark)
96
97* The following internal functions have had their API changed.
98 quiz_delete_empty_page: has had its arguments changed to $quiz and $pagenumber.
99 quiz_has_question_use: now takes $quiz and $slot, not $questionid.
d869de66 100
ad8f0117 101=== 2.6 ===
ccba5b88 102
c544ee92 103* As part of improving the page usability and accessibility, we updated the
104 heading levels for quiz module so it has a proper nesting. (MDL-41615)
ad8f0117
TH
105
106* mod_quiz_renderer::view_best_score has been removed. (It did not do what the
107 name suggested anyway.)
108
109
d869de66
TH
110=== 2.4 ===
111
112* mod_quiz_renderer::finish_review_link now requires $attemptobj to be passed in
113 instead of a moodle_url.
114
115
116=== Earlier changes ===
117
118* Were not documented in this way. Sorry.