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: Difference between revisions

From MoodleDocs
Line 42: Line 42:


Instead, make the question bank sortable by any column, using the standard click the column heading mechanism.
Instead, make the question bank sortable by any column, using the standard click the column heading mechanism.
-''Though I am most of the time all for going with the general UI standards, I am not sure if this being nonstandard is such a big issue, since the current nonstandard element affords/communicates well exactly what it is meant for. Making the table standard in the question bank window is a problem, since, well, it is not really a table structure from the point of view of the user, but a list with some controls, and question type for instance is not a column of its own. And it cannot be, since there is no room for an extra column. So if you make the table sortable in the actual question bank, you will have inconsistency between the actual question bank and the question bank window of quiz.'' --[[User:Olli Savolainen|Olli Savolainen]] 08:38, 9 December 2008 (CST)


====Searching====
====Searching====

Revision as of 14:38, 9 December 2008

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.

Or possibly make the code for displaying the question bank into a class, which can then different sub-classes for showing the question bank in slightly different ways. That has worked well for me in other bits of code recently (the view, basic and advanced modes of the define roles page), and avoids having single huge functions.

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.
  • 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.
  • there will be some UI at the bottom of the question preview page. I now think this is a bad idea.

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.

-Though I am most of the time all for going with the general UI standards, I am not sure if this being nonstandard is such a big issue, since the current nonstandard element affords/communicates well exactly what it is meant for. Making the table standard in the question bank window is a problem, since, well, it is not really a table structure from the point of view of the user, but a list with some controls, and question type for instance is not a column of its own. And it cannot be, since there is no room for an extra column. So if you make the table sortable in the actual question bank, you will have inconsistency between the actual question bank and the question bank window of quiz. --Olli Savolainen 08:38, 9 December 2008 (CST)

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