Moodle  2.2.1
http://www.collinsharper.com
qtype_multichoice_edit_form Class Reference
Inheritance diagram for qtype_multichoice_edit_form:
Collaboration diagram for qtype_multichoice_edit_form:

Public Member Functions

 validation ($data, $files)
 qtype ()

Protected Member Functions

 definition_inner ($mform)
 get_per_answer_fields ($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
 data_preprocessing ($question)

Detailed Description

Multiple choice editing form definition.

Definition at line 36 of file edit_multichoice_form.php.


Member Function Documentation

data_preprocessing ( question) [protected]

Perform an preprocessing needed on the data passed to set_data() before it is used to initialise the form.

Parameters:
object$questionthe data being passed to the form.
Returns:
object $question the modified data.

Reimplemented from question_edit_form.

Definition at line 86 of file edit_multichoice_form.php.

Here is the call graph for this function:

definition_inner ( mform) [protected]

Add question-type specific form fields.

Parameters:
object$mformthe form being built.

Reimplemented from question_edit_form.

Definition at line 42 of file edit_multichoice_form.php.

Here is the call graph for this function:

get_per_answer_fields ( mform,
label,
gradeoptions,
&$  repeatedoptions,
&$  answersoption 
) [protected]

Get the list of form elements to repeat, one for each answer.

Parameters:
object$mformthe form being built.
$labelthe label to use for each option.
$gradeoptionsthe possible grades for each answer.
$repeatedoptionsreference to array of repeated options to fill
$answersoptionreference to return the name of $question->options field holding an array of answers
Returns:
array of form fields.

Reimplemented from question_edit_form.

Definition at line 70 of file edit_multichoice_form.php.

qtype ( )

Override this in the subclass to question type name.

Returns:
the question type name, should be the same as the name() method in the question type class.

Reimplemented from question_edit_form.

Definition at line 155 of file edit_multichoice_form.php.

validation ( data,
files 
)

Dummy stub method - override if you needed to perform some extra validation. If there are errors return array of errors ("fieldname"=>"error message"), otherwise true if ok.

Server side rules do not work for uploaded files, implement serverside rules here if needed.

Parameters:
array$dataarray of ("fieldname"=>value) of submitted data
array$filesarray of uploaded files "element_name"=>tmp_file_path
Returns:
array of "element_name"=>"error_description" if there are errors, or an empty array if everything is OK (true allowed for backwards compatibility too).

Perform sanity checks on fractional grades

Reimplemented from question_edit_form.

Definition at line 101 of file edit_multichoice_form.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations