Note:

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

Calculated question bugs and new features proposal

From MoodleDocs

This page will be used as a TODO-List in relation to the bug tracker tasks

Main objectives

The actual plan is to

  • Improve the actual calculated question
    • Correct the minor problems of the new 1.8 interface and add some features
    • Improving the code flow so that if something is badly set (datadesf, dataitems) the calculated question default to a numerical one with a warning in the quiz display (and in the question name so it appears clrealy in the questions display in the question or quiz edit form).
    • Adding the possibility to show calculated results in the question as data
    Given {m} and {x} and {b} ask for the slope of
    X1 = {x}  , Y1 = {= {x}*{m}+ {b})          
    X2 = {=2*{x}}  , Y2 = {= 2*{x}*{m}+ {b})
    Calculate the slope of the line
    The {=2*{x}}or {= 2*{x}*{m}+ {b}) displaying the result of the equation
    • Extending the actual php math function (sin(), cos() etc.) to complex function using php mathlibs
  • Develop the calculated questiontype
    • Adding multiples answers with different grade.
     So to be able to grade correctly typical errors related to units (i.e.10 times more or less)    
    • Using these multiple answers to create a multiple choice calculated question
     The user could select either type when creating the question  or saving it as new question
    • Going further and create a cloze version of the calculated question
   allowing to have multiple questions 
   and either 
     multiple answers or
     as a multiple choice calculated question

Improvement of the user interface

  1. Correct the minor problems of the new 1.8 interface and add some features. The interface should give consistent results independent of the question status
  • creating a new question
  • editing an existing question
  • saving an existing questiuon as a new question
    1. Removing the side effects when typing the enter key in dataitems_form.php input fields
      1. Verify that there is at least one wild card in either the question or the answer text.
        1. If so saving the datasetdefs with either
          1. default value ( new question)
          2. copy of the already defined datasetdefs when saving an existing question as a new one.
      2. change the code so that generating datatitems value ( for a quiz or preview) can handle this without error ( or possibly a warning) and send back a value on the fly.
    2. adding a table showing the shareable category wild cards available in the first page of question creation or edition
    3. identifying more clearly which of the wild cards has an already defined shareable category wild cards available
  1. ...

Adding new class functions or make substantial change to existing one

  1. adding a table display function showing the shareable category wild cards available in the first page of question creation or edition
    1. a general function for the abstractype class (showing only the name and nb of items)
    2. a specific function for the calculatedquestion class showing the definition (min:max:type) in a user readable format.
  2. ...

Improvement to import-export process and question category moving

  1. There is no way to import calculated questions in Moodle actually.The steps to correct this are:
    1. Adding an importdatadef() function and import dataitem function() to calculated questiontype class
    2. adding a preliminary verifyimporteddata() function to calculated questiontype class
    3. modify the savequestion() and saveoptions() function to accept import data.
    4. ...


(to be continued)Pierre Pichet 2 February 2007