Note:

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

Quiz Item Analysis of Multianswers Question Types: Difference between revisions

From MoodleDocs
No edit summary
 
Line 5: Line 5:
If we set this as a general framework, the code will be valid for all question types.
If we set this as a general framework, the code will be valid for all question types.
==We need a question type function to retrieve the embedded questions==
==We need a question type function to retrieve the embedded questions==
There is actually no question type function to extract the embeded questions in a question.
There is actually no question type function to know the number the embedded questions in a question.
This function extract from the question the embedded questions and build an array with the question orderedv as they appears in the question text. For a one question the default return the question itself.
The default '''function number_of_embedded_questions()''' returns 1;
function ordered_questions_array($question){
This is not the same as  actual_number_of_questions().
          $qarray = array();
        $qarray[0]= $question;
        return $qarray ;
    }

Revision as of 01:52, 8 January 2008

This page described a code proposal to access the embedded questions data in multianswers questiion types so that they can be displayed in the Item analysis report. See http://moodle.org/mod/forum/discuss.php?d=86598#387154 The code is experimental and need more testing and is not optimized.

All question types to be analyzed contain at least one embedded question

If we set this as a general framework, the code will be valid for all question types.

We need a question type function to retrieve the embedded questions

There is actually no question type function to know the number the embedded questions in a question. The default function number_of_embedded_questions() returns 1;

This is not the same as  actual_number_of_questions().