Improved Question Bank Tags: Difference between revisions
Damyon Wiese (talk | contribs) |
Damyon Wiese (talk | contribs) No edit summary |
||
Line 36: | Line 36: | ||
=== Random question from a set of questions === | === Random question from a set of questions === | ||
DB changes: | DB changes: | ||
Line 67: | Line 50: | ||
API changes - create a new plugin "slottype" for quiz that has implementations of "direct", "randomfromcategory" or "randomfromset". | API changes - create a new plugin "slottype" for quiz that has implementations of "direct", "randomfromcategory" or "randomfromset". | ||
Function changes - quiz_start_new_attempt() will need to be modified to call the appropriate plugin to load the question for each slot. | |||
quiz::preload_questions() would need to be changed to quiz::preload_slots() returning information about slots instead of questions. quiz::get_questions() would then ask each slot to return the questionid which could then be used by load_questions(). | |||
quiz::process_redo_question() would need updating to ask the slot for the questionid. | |||
Backup should be modified to reflect the new table structure. Restore will need a version check to expect the new structure or the current structure. | |||
Any API changes should be done in as backwards compatible way as possible. | Any API changes should be done in as backwards compatible way as possible. | ||
=== Search for question by tag === | === Search for question by tag === |
Revision as of 13:33, 16 October 2017
Overview
This document is "under construction" (really!)
This document is the technical design for a set of features proposed by the Moodle Users Association for Moodle 3.5.
The project proposal is here: https://moodleassociation.org/mod/page/view.php?id=465
The requirements / user stories have been written by the MUA - a copy is included here for clarity
User Stories / Requirements
Must:
- As a teacher, I can add tag(s) to a question bank question for use in my course for organizational and search/filtering of questions.
- As a teacher, I can filter my questions in courses based on tags.
- As a teacher, I can see tags on questions at higher category assigned by Question sharer role holder.
- As another teacher in the same course, I have access to the question tags on the questions in that course context.
- As a teacher in a course, I do not see tags of other in contexts I do not have access to. (Instructor 1’s “midterm 1” question set would not be relevant to Instructor 2)
- As a teacher, I am able to add/modify/remove tags on questions.
- As a teacher, I should not have to copy a question into my course from higher category contexts to include it in a ‘random question from question set’ question type.
- As a teacher, I can add a 'random question from question set' question type to my quiz where the question set is a selectable list of questions. These questions can be searched for and filtered by tag but the set itself is not defined by specifying a tag.
Nice to have:
- Labels can contain any visible ASCII characters including characters such as apostrophes, slashes, and colons. Exception of Comma.
- As a teacher, when searching for questions to add to a ‘random question from question set’ I see the question with its context clearly visible.
- As a teacher, I can export/import questions with their tags.
- As a Question sharer role holder, I can add a tag(s) to a question bank questions that exist at the category context.
- As a Question sharer role holder, I can search/filter all the questions I have access to and see them along with their context.
Design
The requirements listed above can be met by implementing the following changes (which are described in detail further down):
- New question type "Random question from a set of questions"
- Enhanced question search allowing search/filter by tag everywhere
- Allow adding course level tags to questions that exist in a category
Random question from a set of questions
DB changes:
Remove questionid from the slots table and add 3 new tables (one per slot type).
slottype_question(id, quizslotid, questionid) (unique index quizslotid, foreign key quizslotid, foreign key questionid)
slottype_randomfromcategory(id, quizslotid, questioncategoryid) (foreign key quizslotid, foreign key questioncategoryid)
slottype_randomfromset(id, quizslotid, questionid) (foreign key quizslotid, foreign key questionid) (option one)
Discarded ideas: store the list of questionids in a varchar field. Discarded because it would add performance issues on searching, the list of questionids is not really needed anywhere as part of the join (e.g. randomquestionfromcategory does not have it either) and it would impose an upper limit on the number of questions in the set.
API changes - create a new plugin "slottype" for quiz that has implementations of "direct", "randomfromcategory" or "randomfromset".
Function changes - quiz_start_new_attempt() will need to be modified to call the appropriate plugin to load the question for each slot.
quiz::preload_questions() would need to be changed to quiz::preload_slots() returning information about slots instead of questions. quiz::get_questions() would then ask each slot to return the questionid which could then be used by load_questions().
quiz::process_redo_question() would need updating to ask the slot for the questionid.
Backup should be modified to reflect the new table structure. Restore will need a version check to expect the new structure or the current structure.
Any API changes should be done in as backwards compatible way as possible.
Search for question by tag
- Describe list of changes
Course level tags for questions
- Describe list of changes