moodle/mod/quiz/upgrade.txt
Tim Hunt ccba5b8805 MDL-43749 normalise quiz database structure.
The sequence of questions that made up a quiz used to be stored as a
comma-separated list in quiz.questions. Now the same information is
stored in the rows in the quiz_slots table. This is not just 'better' in
a database design sense, but it allows for the future changes we will
need as we enhance the quiz in the MDL-40987 epic.

Having changed the database structure, all the rest of the code needs to
be changed to account for it, and that is done here.

Note that there are not many unit tests for the changed bit. That is
because as part of MDL-40987 we will be changing the code further, and
we will add unit tests then.
2014-03-02 10:00:40 +01:00

51 lines
1.9 KiB
Plaintext

This files describes API changes in the quiz code.
=== 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.