[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 This files describes API changes in the quiz code. 2 3 === 3.1 === 4 5 * quiz_attempt::question_print_comment_fields() has been removed. It was broken 6 since at least Moodle 2.0. 7 8 * quiz::confirm_start_attempt_message and mod_quiz_view_object::$startattemptwarning 9 have been deprecated. This functionality is now entirely handled within the 10 quiz access rule plugins. 11 12 * The third argument to mod_quiz_renderer::start_attempt_button has been changed 13 from a warning string to a mod_quiz_preflight_check_form. 14 15 * mod_quiz_renderer::review_next_navigation has a new optional argument. If you 16 have overridden that method, consider updating your code to match. 17 18 * mod_quiz\output\edit_renderer::start_section_list now takes $structure as an 19 argument. If you have overridden this method (it's hard to believe anyone ever 20 would) you will need to update your renderer. 21 22 * Several methods relating to preview links/buttons/urls have a new optional 23 argument to make the preview be of a particular variant. 24 25 26 === 2.9 === 27 28 * There have been changes in classes/output/edit_renderer.php for MDL-40990. 29 + Some methods use to take $structure & $question as the first two arguments. 30 They now take $structure & $slot number. If you need $question, you can get 31 it using $question = $structure->get_question_in_slot($slot); 32 + Some methods used to take $quiz & $question. They now take $structure & $slot 33 number. You can get $question as above. $quiz is $structure->get_quiz(). 34 + initialise_editing_javascript has had some redundant arguments removed. 35 Hopefully, with these changes, we will have less need to make other changes in future. 36 37 * Due to MDL-40992, you should be aware that extra slots can get added to an attempt. 38 You may get slot numbers beyone the end of the original quiz layout, and you 39 may want to call $attemptobj->get_original_slot to find where the question 40 originally came from. 41 42 * You now need to pass an instance of the mod_quiz_renderer if you call 43 $attemptobj->render_question or $attemptobj->render_question_at_step. 44 45 * The array values in mod_quiz_links_to_other_attempts may now be either a moodle_url, 46 or renderable (or null). Previously they could only be a moodle_url or null. 47 48 * The contents of the navigation block is now not just quiz_nav_question_button-s. 49 It can also contain quiz_nav_section_heading-s. If you have overridden 50 mod_quiz_renderer::navigation_panel, then you may need to account for this. 51 This change also has implications for the Edit quiz page. 52 53 54 === 2.8 === 55 56 * Classes that were defined in various lib files have been moved to the classes 57 folder to take advantage of auto-loading. This has involved renaming them. 58 see the list in mod/quiz/db/renamedclasses.php. 59 60 * The quiz no longer handles its own \mod_quiz\event\attempt_becameoverdue event, 61 and so the event handler function quiz_attempt_overdue_handler has been deleted. 62 Also, the internal function quiz_send_overdue_message has add the arguments 63 changed. It now takes the $attemptobj object, not separate stdClass objects. 64 65 * Major changes to the Edit quiz page. 66 67 The goal of this work was to increase usability, and also clean up the page 68 enough that it will be possible to add new features in future. 69 70 Display of mod/quiz/edit.php is now entirely generated by 71 mod_quiz\output\edit_renderer. This uses a helper class mod_quiz\structure 72 to provide details of the structure of the quiz, and mod_quiz\repaginate to 73 alter that structure. (Actually, there are still some modification methods on 74 mod_quiz\structure. Expect that to be cleaned up in future.) 75 76 The new code uses much more ajax, and there are new scripts mod/quiz/edit_rest.php 77 and mod/quiz/repaginate.php to handle this. (Again, don't be surprised if those 78 two scripts get merged in future.) Also questionbank.ajax.php (which may, in 79 future, be made more generic, and moved into the core question bank code.) 80 81 As a result of this, mod/quiz/editlib.php has gone. (A few remaining functions 82 were moved to locallib.php.) 83 84 Here is a list of all the old functions or classes that have changed. 85 If you used any of these in custom code, you will need to update your code. 86 (Note that many of these functions should have been considered private internals 87 of the quiz module, and you should not have been using them!) 88 89 From editlib.php: 90 quiz_remove_slot 91 quiz_delete_empty_page 92 quiz_add_page_break_after_slot - Use methods of structure or repaginate 93 quiz_update_slot_maxmark - classes instead. 94 _quiz_move_question 95 quiz_move_question_up 96 quiz_move_question_down 97 98 quiz_print_question_list 99 quiz_print_pagecontrols 100 quiz_print_singlequestion - Use methods of edit_renderer instead. 101 quiz_print_randomquestion 102 quiz_print_singlequestion_reordertool 103 quiz_print_randomquestion_reordertool 104 print_random_option_icon 105 quiz_print_grading_form 106 quiz_print_status_bar 107 108 Moved from editlib.php to locallib.php: 109 quiz_question_tostring - now always returns a string (the only option used). 110 The $return argument has gone. 111 112 Old editing JavaScript (e.g. mod/quiz/edit.js) is gone. Replaced with YUI modules. 113 114 115 === 2.7.1 === 116 117 * The function quiz_fire_attempt_started_event has been removed. This function 118 should not have been used outside the quiz, but if you were using it, you should 119 trigger the event outside this function. Note that the appropriate start event is 120 fired automatically by the quiz_attempt_save_started function. 121 122 123 === 2.7 === 124 125 * The old quiz.questions database column (comma-separated list of question ids) 126 is gone, and instead the quiz_question_instances table has been renamed to 127 to quiz_slots. Some of the columns of that table have been renamed to match 128 the coding guidelines. Specifically: 129 quiz -> quizid 130 question -> questionid 131 grade -> maxmark 132 also there are two new columns: 133 slot - numbers the questions in the quiz in order, as on the edit quiz page. 134 page - new way to determine which question is on which page. 135 naturally, other parts of the code and APIs have been updated to reflect that 136 change. 137 138 * The following functions, which were part of the internal workings of the quiz, 139 have been removed. 140 quiz_get_slot_for_question 141 quiz_number_of_questions_in_quiz 142 quiz_repaginate (there is now a quiz_repaginate_questions with a different API). 143 quiz_add_page_break_at (see quiz_add_page_break_after_slot) 144 quiz_add_page_break_after (see quiz_add_page_break_after_slot) 145 quiz_number_of_pages 146 quiz_remove_question (see quiz_remove_slot) 147 quiz_update_question_instance (see quiz_update_slot_maxmark) 148 149 * The following internal functions have had their API changed. 150 quiz_delete_empty_page: has had its arguments changed to $quiz and $pagenumber. 151 quiz_has_question_use: now takes $quiz and $slot, not $questionid. 152 153 154 === 2.6 === 155 156 * As part of improving the page usability and accessibility, we updated the 157 heading levels for quiz module so it has a proper nesting. (MDL-41615) 158 159 * mod_quiz_renderer::view_best_score has been removed. (It did not do what the 160 name suggested anyway.) 161 162 163 === 2.4 === 164 165 * mod_quiz_renderer::finish_review_link now requires $attemptobj to be passed in 166 instead of a moodle_url. 167 168 169 === Earlier changes === 170 171 * Were not documented in this way. Sorry.
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |