[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/quiz/ -> upgrade.txt (source)

   1  This files describes API changes in the quiz code.
   2  
   3  === 2.8 ===
   4  
   5  * Classes that were defined in various lib files have been moved to the classes
   6    folder to take advantage of auto-loading. This has involved renaming them.
   7    see the list in mod/quiz/db/renamedclasses.php.
   8  
   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.
  13  
  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  
  30    As a result of this, mod/quiz/editlib.php has gone. (A few remaining functions
  31    were moved to locallib.php.)
  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  
  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  
  71  === 2.7 ===
  72  
  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:
  77        quiz     -> quizid
  78        question -> questionid
  79        grade    -> maxmark
  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.
 100  
 101  === 2.6 ===
 102  
 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)
 105  
 106  * mod_quiz_renderer::view_best_score has been removed. (It did not do what the
 107    name suggested anyway.)
 108  
 109  
 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.


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1