This files describes API changes in the quiz code.

=== 2.8 ===

* Classes that were defined in various lib files have been moved to the classes
  folder to take advantage of auto-loading. This has involved renaming them.
  see the list in mod/quiz/db/renamedclasses.php.

* The quiz no longer handles its own \mod_quiz\event\attempt_becameoverdue event,
  and so the event handler function quiz_attempt_overdue_handler has been deleted.
  Also, the internal function quiz_send_overdue_message has add the arguments
  changed. It now takes the $attemptobj object, not separate stdClass objects.

* Major changes to the Edit quiz page.

  The goal of this work was to increase usability, and also clean up the page
  enough that it will be possible to add new features in future.

  Display of mod/quiz/edit.php is now entirely generated by
  mod_quiz\output\edit_renderer. This uses a helper class mod_quiz\structure
  to provide details of the structure of the quiz, and mod_quiz\repaginate to
  alter that structure. (Actually, there are still some modification methods on
  mod_quiz\structure. Expect that to be cleaned up in future.)

  The new code uses much more ajax, and there are new scripts mod/quiz/edit_rest.php
  and mod/quiz/repaginate.php to handle this. (Again, don't be surprised if those
  two scripts get merged in future.) Also questionbank.ajax.php (which may, in
  future, be made more generic, and moved into the core question bank code.)

  As a result of this, mod/quiz/editlib.php has gone. (A few remaining functions
  were moved to locallib.php.)

  Here is a list of all the old functions or classes that have changed.
  If you used any of these in custom code, you will need to update your code.
  (Note that many of these functions should have been considered private internals
  of the quiz module, and you should not have been using them!)

  From editlib.php:
      quiz_remove_slot
      quiz_delete_empty_page
      quiz_add_page_break_after_slot    - Use methods of structure or repaginate
      quiz_update_slot_maxmark          - classes instead.
      _quiz_move_question
      quiz_move_question_up
      quiz_move_question_down

      quiz_print_question_list
      quiz_print_pagecontrols
      quiz_print_singlequestion         - Use methods of edit_renderer instead.
      quiz_print_randomquestion
      quiz_print_singlequestion_reordertool
      quiz_print_randomquestion_reordertool
      print_random_option_icon
      quiz_print_grading_form
      quiz_print_status_bar

  Moved from editlib.php to locallib.php:
      quiz_question_tostring - now always returns a string (the only option used).
                               The $return argument has gone.

  Old editing JavaScript (e.g. mod/quiz/edit.js) is gone. Replaced with YUI modules.


=== 2.7.1 ===

* The function quiz_fire_attempt_started_event has been removed. This function
  should not have been used outside the quiz, but if you were using it, you should
  trigger the event outside this function. Note that the appropriate start event is
  fired automatically by the quiz_attempt_save_started function.

=== 2.7 ===

* The old quiz.questions database column (comma-separated list of question ids)
  is gone, and instead the quiz_question_instances table has been renamed to
  to quiz_slots. Some of the columns of that table have been renamed to match
  the coding guidelines. Specifically:
      quiz     -> quizid
      question -> questionid
      grade    -> maxmark
  also there are two new columns:
      slot     -  numbers the questions in the quiz in order, as on the edit quiz page.
      page     -  new way to determine which question is on which page.
  naturally, other parts of the code and APIs have been updated to reflect that
  change.

* The following functions, which were part of the internal workings of the quiz,
  have been removed.
      quiz_get_slot_for_question
      quiz_number_of_questions_in_quiz
      quiz_repaginate               (there is now a quiz_repaginate_questions with a different API).
      quiz_add_page_break_at        (see quiz_add_page_break_after_slot)
      quiz_add_page_break_after     (see quiz_add_page_break_after_slot)
      quiz_number_of_pages
      quiz_remove_question          (see quiz_remove_slot)
      quiz_update_question_instance (see quiz_update_slot_maxmark)

* The following internal functions have had their API changed.
      quiz_delete_empty_page: has had its arguments changed to $quiz and $pagenumber.
      quiz_has_question_use: now takes $quiz and $slot, not $questionid.

=== 2.6 ===

* As part of improving the page usability and accessibility, we updated the
  heading levels for quiz module so it has a proper nesting. (MDL-41615)

* mod_quiz_renderer::view_best_score has been removed. (It did not do what the
  name suggested anyway.)


=== 2.4 ===

* mod_quiz_renderer::finish_review_link now requires $attemptobj to be passed in
  instead of a moodle_url.


=== Earlier changes ===

* Were not documented in this way. Sorry.
