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
 
(5 intermediate revisions by 5 users not shown)
Line 15: Line 15:
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 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===
To generate this column, we need a get_extra_question_text method in question types, to be called from the save_question method.


moodle/question:tag.
===<strike>New capability</strike>===
 
I used to thing that a separate moodle/question:tag capability would be a good idea. I now think it is an unnecessary complication. We will just rely on the standard moodle/question:edit.
 
===UI for tagging questions===
 
There will be a new field on the question editing page for editing the tags.


===Question bank display changes===
===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.
The code for rendering the question bank will be converting into a class. We will either have a abstract base class, and two sub-classes for viewing the question bank along, and within the quiz editing page; or the base class will be used for displaying the question bank alone, with one subclass for display within the quiz editing page.


When $compact is false, there will be new columns "Creator", "Created", "Modified" and "Tags" in the question bank view.
The code will be structured in such a way it is easy for subclasses (or people who want to customise the code) to control which columns are visible. Probably we will have a little class for each column (type) that controls rendering the heading and the data for a question, and generating the right sort clause and field names in the query. Then we will define the table as an array of column-class instances.


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.
Need to support 'columns' that take a whole extra row, like question text, as well as ones that fit into a &lt;td>.


===UI for tagging questions===
The compact view will look almost exactly as it does in Olli's new editing interface.


Assuming the user has moodle/question:tag in the relevant context:
In the full view, there will be new columns "Creator", "Created", "Modified" and "Tags" in addition to what we have now.


* there will be a new field on the question editing page.
We also need methods to customise exactly what appears at the top and bottom of the question bank display, and to control the new filtering UI.
* 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.
* <strike>there will be some UI at the bottom of the question preview page.</strike> I now think this is a bad idea.


===Ways if filtering the question bank===
===Ways of filtering the question bank===


====Sorting====
====Sorting====
Line 42: Line 46:


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.
 
====Searching====
====Searching====


Line 55: Line 59:
* tags
* tags
* creator
* creator
* dates
* full text search of the question
* full text search of the question


Line 71: Line 76:
* [http://moodle.org/mod/forum/discuss.php?d=63728#p298237 Question Creation as A Student Activity - Phase 3]
* [http://moodle.org/mod/forum/discuss.php?d=63728#p298237 Question Creation as A Student Activity - Phase 3]


 
[[Category:Question engine]]
[[Category:Quiz]]
[[Category:Quiz]]

Latest revision as of 06:30, 15 June 2011

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.

To generate this column, we need a get_extra_question_text method in question types, to be called from the save_question method.

New capability

I used to thing that a separate moodle/question:tag capability would be a good idea. I now think it is an unnecessary complication. We will just rely on the standard moodle/question:edit.

UI for tagging questions

There will be a new field on the question editing page for editing the tags.

Question bank display changes

The code for rendering the question bank will be converting into a class. We will either have a abstract base class, and two sub-classes for viewing the question bank along, and within the quiz editing page; or the base class will be used for displaying the question bank alone, with one subclass for display within the quiz editing page.

The code will be structured in such a way it is easy for subclasses (or people who want to customise the code) to control which columns are visible. Probably we will have a little class for each column (type) that controls rendering the heading and the data for a question, and generating the right sort clause and field names in the query. Then we will define the table as an array of column-class instances.

Need to support 'columns' that take a whole extra row, like question text, as well as ones that fit into a <td>.

The compact view will look almost exactly as it does in Olli's new editing interface.

In the full view, there will be new columns "Creator", "Created", "Modified" and "Tags" in addition to what we have now.

We also need methods to customise exactly what appears at the top and bottom of the question bank display, and to control the new filtering UI.

Ways of 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
  • dates
  • 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