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

Public Member Functions

 __construct ($submiturl, $question, $category, $contexts, $formeditable=true)
 get_per_answer_fields ($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption)
 data_preprocessing ($question)
 qtype ()
 validation ($data, $files)

Data Fields

 $qtypeobj
 $questiondisplay
 $activecategory
 $categorychanged = false
 $initialname = ''
 $reload = false

Protected Member Functions

 definition_inner ($mform)
 data_preprocessing_answers ($question)
 is_valid_answer ($answer, $data)
 valid_answer_message ($answer)

Detailed Description

Calculated question type editing form definition.

Definition at line 38 of file edit_calculated_form.php.


Constructor & Destructor Documentation

__construct ( submiturl,
question,
category,
contexts,
formeditable = true 
)

Reimplemented from question_edit_form.

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 51 of file edit_calculated_form.php.

Here is the call graph for this function:


Member Function Documentation

data_preprocessing ( question)

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 qtype_numerical_edit_form.

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 151 of file edit_calculated_form.php.

Here is the call graph for this function:

data_preprocessing_answers ( question) [protected]

Reimplemented from qtype_numerical_edit_form.

Definition at line 165 of file edit_calculated_form.php.

Here is the caller graph for this function:

definition_inner ( mform) [protected]

Add question-type specific form fields.

Parameters:
MoodleQuickForm$mformthe form being built.

Reimplemented from qtype_numerical_edit_form.

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 105 of file edit_calculated_form.php.

Here is the call graph for this function:

get_per_answer_fields ( mform,
label,
gradeoptions,
&$  repeatedoptions,
&$  answersoption 
)

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 qtype_numerical_edit_form.

Definition at line 70 of file edit_calculated_form.php.

is_valid_answer ( answer,
data 
) [protected]

Validate a particular answer.

Parameters:
string$answeran answer to validate. Known to be non-blank and already trimmed.
array$datathe submitted data.
Returns:
bool whether this is a valid answer.

Reimplemented from qtype_numerical_edit_form.

Definition at line 244 of file edit_calculated_form.php.

Here is the call graph for this function:

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 qtype_numerical_edit_form.

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 187 of file edit_calculated_form.php.

Here is the caller graph for this function:

valid_answer_message ( answer) [protected]
Returns:
string erre describing what an answer should be.

Reimplemented from qtype_numerical_edit_form.

Definition at line 248 of file edit_calculated_form.php.

Here is the call graph for this function:

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).

Reimplemented from qtype_numerical_edit_form.

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 191 of file edit_calculated_form.php.

Here is the call graph for this function:


Field Documentation

$activecategory

Definition at line 46 of file edit_calculated_form.php.

$categorychanged = false

Definition at line 47 of file edit_calculated_form.php.

$initialname = ''

Definition at line 48 of file edit_calculated_form.php.

$qtypeobj

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 44 of file edit_calculated_form.php.

$questiondisplay

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 45 of file edit_calculated_form.php.

$reload = false

Reimplemented in qtype_calculatedsimple_edit_form.

Definition at line 49 of file edit_calculated_form.php.


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