Note:

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

Question Engine 2:Numerical questions

From MoodleDocs

The Question Engine 2 structure allows implementation of new features for numerical question types ( numerical and calculated).

The new question engine define a new rationale for classifying questions and there are possible conflicts between the new models and the numerical question type that is inherited from preceeding moodle versions mainly 2,0 and 1,9.

See also http://tracker.moodle.org/browse/MDL-27418 and

See also http://tracker.moodle.org/browse/MDL-28118 where the work will be continued.

See also Question Engine 2:Numerical formats

This page should be seen more or less as a blackboard that Tim Hunt and Pierre Pichet will use to discuss and set proposals for numerical questions.

We will set a forum issue when it will be appropriate to set it.

As questiontypes

The actual numerical questiontype offere many options that can be related to various question types even if they are not identifed clearly in the actual code.

Raw numerical question

The simplest version of a numerical question is a question where

  1. The answer is defined as a numercial quantity that is written be the teacher following PHP valid syntax
  1. A response which is a numerical quanttity that is written be the student following PHP valid syntax

The grading is done allowing for a numerical tolerance that is set by the teacher following PHP valid syntatx.

The actual moodle numerical questions (1,9 , 2,0 , 2,1 ) differ from this simple model.

Such a raw numerical question is not user frendly as it necessicates that the student should know PHP numerical syntax.

Basic numerical question : universal number to numerical PHP value converter

A user frendly interface is necessary either at the question editing process and more important at the student response.

Use of numercial question in cloze question type or imported in various format as GIFT also necessitate such an interface.

Although PHP uses . as decimal separator, it does not allow thousands separators.

This is why a function has been developped to eliminate space as thousands separator and , if there is already a . in the number type by the user.

The last version (2,1) improve the number syntax recognition but it would benefit from a more complete analysis like the relative positon of the , and . decimal separator.

However there will always remain an ambiguity if the number written is 1,234 or 1.234 
.

Is the , or . are decimal or thousand separator ?

This could be resolved if we use the locale user decsep 
or if we use an help info that specify to always put the decimal separator 
if the thousand separator is , or.  as was used in 2,0 interface.

We could also plan to add fraction has valid input i.e. 1 2/3  
wich is often asked by users and is quite pertinent to such repetitive fraction 

A numerical question which such an universal number to numerical value translator can be considered as the main basic numerical question type

Numerical - unit (unity multiply factor) question type

There a many cases( i.e real numbers related to the physical world) where the numerical question is used to test numerical values that are assoicate with specific units.

For a given numerical value in most case there is just one unit that corresponds although there can be exceptions.

Such a numerical question that asked for the number and the unit should be considered as a double response question although the the 2 answers are related.

For convenience as double entry questions are not well handle the grade related to the use of the correct unit is expressed as a unit penalty.

A similar case is the multiplechoice multiple response question type

Version 1,9, 20 and 2,1 handle this somehow differently.

Many numerical -unit ( different multiply unity factors unity )

Such a case occurs when the good responses can be different numerical values associated with units that have a different multiply but express the same physical quantity i. e. 0,05 m and 5 cm . Here 0,05 and 5 are correct numerical answers if they are compared with the good answer using there corresponding multiply factor.

"This is one of the main difficulties related to the MDL-27418 tracker issue

I think that we should see this case as a different question type than the preceeding and find a way to classify this correclty in the question engine 2 formalism.

Number - Number format

Here the teacher want to test the numerical value and the number syntax and apply a given penalty is the number is not written following a specific syntax ( thousand seps and decimal sep).

As the number unit types this can be considered as a multiquestion or as a single question with a numerical format penalty

Number - Number format and single or many units

How should we handle them ?

single question with number format and unit penalty? a simili cloze question type ? Given the interface complexity to set such a question, this could be handle

a single question type and a flexible interface

With a single numerical question type for all preceeding options and a new edit question interface. However these options cannot be used or defined easily for numerical questions used.

more than one numerical question type

  1. Convert to the universal translator type all the actual numerical that do not used units.
  1. Convert to a numerical-unit type that used the two variants unit (factor = 1 and not 1 )
  1. Convert to a general (cloze ...) question type for those who want the full flexibiltiy ( and complexity)

Conversion to the other types could be done when editing.

As question engine 2

The rationale of handling question and the related code in the new engine differs significantly from the previous code. This can be seen in the actual new engine question.php and render.php code for question types as multichoice or multianswer question types.

As we plan to add number format grading in numerical, this will be relted in a supplementary grading step and will lead to new definition of the question.php and render.php. How this should be optimally structured ?

Pierre Pichet 23:31, 3 July 2011 (WST)