Note:

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

Matrix Question Type Specification: Difference between revisions

From MoodleDocs
Line 6: Line 6:
The follow serves as my very high level (mostly technical) specification.
The follow serves as my very high level (mostly technical) specification.


===Database Tables===
===Some examples===


====Question Definition Tables====
Here are three simple examples of the way this question type could be used. ( ) is mean to be a radio button. [ ] is a checkbox.


=====question_matrix=====
-----
 
Evaluate the following statements:
 
{|
!  !! True !! False
|-
| Moodle is a learning management system || (*) || ( )
|-
| Mahara is an ePortfolio system || (*) || ( )
|-
| Moodle has no bugs || ( ) || (*)
|-
| This proposal is a good idea || (*) || ( )
|}
 
-----
 
Which colours are mixed on your computer's monitor to make each of the listed colours:
 
{|
!  !! Red !! Green !! Blue
|-
| Red || [*] || [ ] || [ ]
|-
| Magenta || [*] || [ ] || [*]
|-
| Cyan || [ ] || [*] || [*]
|-
| Black || [ ] || [ ] || [ ]
|-
| White || [*] || [*] || [*]
|}
 
-----
 
Match the adult to their young:
 
{|
!  !! Tadpole !! Joey !! Foal
|-
| Poney || ( ) || ( ) || (*)
|-
| Frog || (*) || ( ) || ( )
|-
| Kangaroo || ( ) || (*) || ( )
|}
 
==Database Tables==
 
===Question Definition Tables===
 
====question_matrix====
Contains basic information about the matrix - what the grading method and
Contains basic information about the matrix - what the grading method and
whether multiple checks per row are supported(eg checkboxes vs radio buttons)
whether multiple checks per row are supported(eg checkboxes vs radio buttons)
Line 43: Line 95:
|}
|}


=====question_matrix_option=====
====question_matrix_option====
Contains the definition of the matrix.
Contains the definition of the matrix.


Line 68: Line 120:




=====question_matrix_weight=====
====question_matrix_weight====
Contains more information about how each cell should be graded.
Contains more information about how each cell should be graded.
EVERY cell should have an entry in this table.  When the grading method is
EVERY cell should have an entry in this table.  When the grading method is
Line 94: Line 146:




====Student Answer Tables====
===Student Answer Tables===


=====question_matrix_answer=====
====question_matrix_answer====
This table contains a list of all the cells that the student has selected.
This table contains a list of all the cells that the student has selected.


Line 114: Line 166:
|}
|}


===Implementation notes===
==Implementation notes==


====Grading====
===Grading===
There should be classes to match the grading types (all or any or weighted) so
There should be classes to match the grading types (all or any or weighted) so
that new options could be written.
that new options could be written.


====Renderers====
===Renderers===
It may make sense for some point for some different method to be used to render
It may make sense for some point for some different method to be used to render
this to the user, so we can start with a matrix class and maybe add more later
this to the user, so we can start with a matrix class and maybe add more later
if necessary.
if necessary.

Revision as of 04:45, 26 February 2009

Introduction

I need to develop a n:n matching type of question that is suited to a matrix. The teacher should be able to define the matrix and the various grading options.

The follow serves as my very high level (mostly technical) specification.

Some examples

Here are three simple examples of the way this question type could be used. ( ) is mean to be a radio button. [ ] is a checkbox.


Evaluate the following statements:

True False
Moodle is a learning management system (*) ( )
Mahara is an ePortfolio system (*) ( )
Moodle has no bugs ( ) (*)
This proposal is a good idea (*) ( )

Which colours are mixed on your computer's monitor to make each of the listed colours:

Red Green Blue
Red [*] [ ] [ ]
Magenta [*] [ ] [*]
Cyan [ ] [*] [*]
Black [ ] [ ] [ ]
White [*] [*] [*]

Match the adult to their young:

Tadpole Joey Foal
Poney ( ) ( ) (*)
Frog (*) ( ) ( )
Kangaroo ( ) (*) ( )

Database Tables

Question Definition Tables

question_matrix

Contains basic information about the matrix - what the grading method and whether multiple checks per row are supported(eg checkboxes vs radio buttons) The grading methods translate to:

  • ALL - the student must select ALL correct answers and get 100%, else 0%.
  • ANY - the student must select at least one of the correct answers, and get 100% else 0%.
  • WEIGHTED - each cell has a weighting from -100% to 100%. The "correct" answers must add up to 100%, but the 0 and negative ones don't have any constraint on them.
field notes
id sequence
question fk to mdl_question (or mdl_question_instances)
multiple boolean
grading (ALL or ANY of WEIGHTED) enum or fk to another table containing these values.
roundzero If the total for the question is less than 0, set it to 0. (This can be triggered by highly negative weights)
renderer 'matrix' hardcoded at the moment (see implementation notes)

question_matrix_option

Contains the definition of the matrix.

field notes
id sequence
matrix fk to question_matrix
shorttext short word to fit in
longtext title or hover or something
xory enum (x, y)


question_matrix_weight

Contains more information about how each cell should be graded. EVERY cell should have an entry in this table. When the grading method is 'all' or 'any', the 'correct' answers will be stored here as a non-zero percentage automatically and the non-correct answers will be zero.

field notes
id sequence
x fk to question_matrix_option
y fk to question_matrix_option
weight percentage value


Student Answer Tables

question_matrix_answer

This table contains a list of all the cells that the student has selected.

field notes
id sequence
x fk to question_matrix_option
y fk to question_matrix_option

Implementation notes

Grading

There should be classes to match the grading types (all or any or weighted) so that new options could be written.

Renderers

It may make sense for some point for some different method to be used to render this to the user, so we can start with a matrix class and maybe add more later if necessary.