Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Moodle 2.0 question bank improvements

From MoodleDocs
Revision as of 08:56, 15 September 2008 by Tim Hunt (talk | contribs) (→‎Searching)

Moodle 2.0


Moodle 1.9 introduced the tagging infrastructure. In Moodle 2.0 we should support tagging questions.

With this added metadata, we should provide enhanced facilities for searching the question bank.

In addition, we need to find a way to display all of this extra information. It will not all fit when viewing the question bank on the quiz editing page, so we need to start separating the question bank display that is used to add questions to a quiz, and the stand-alone question bank interface.

This is MDL-16345.

Design

Database changes

New column in the question table, allquestiontext. This is a concatenation of the questiontext, generalfeedback, and any question type specific text fields, with tags stripped. Used for full-text searching. Then change all the places where the question table is queried, to not return this column by default.

New capability

moodle/question:tag.

Question bank display changes

New $compact parameter to question_showbank. The intention is that this will be true when called from mod/quiz/edit.php, and false from question/edit.php.

When $compact is false, there will be new columns "Creator", "Created", "Modified" and "Tags" in the question bank view.

UI for tagging questions

Assuming the user has moodle/question:tag in the relevant context:

  • there will be a new field on the question editing page.
  • there will be some UI at the bottom of the question preview page.
  • clicking on the list of tags in the question bank view will pop up (JS on, go to if not) a simple question tagging form.

Ways if filtering the question bank

Sorting

Currently, you can sort the question bank by type, name, or age, using a non-standard interface - a drop-down menu of choices.

Instead, make the question bank sortable by any column, using the standard click the column heading mechanism.

Searching

At the moment you can search by

  • question category, optionally including sub-categories
  • including hidden questions (deleted questions that were kept because they are still in use)

Add searching by the following conditions:

  • question type
  • tags
  • creator
  • full text search of the question

To facilitate this, we will make a new question_bank_filter base class, with sub-classes for each filter type. These will encapsulate generating where clauses, providing a description of the condition for display to users, and generating interface for the advanced search form.

Question bank advanced search interface

A form for setting the search options. With JavaScript on, this will appear as a pop-up form like the repository file-picker, although when it is submitted, it will have to reload the whole page.

See also