|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| validation ($data, $files) | |
| qtype () | |
Protected Member Functions | |
| definition_inner ($mform) | |
| get_per_answer_fields ($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption) | |
| add_unit_options ($mform) | |
| add_unit_fields ($mform) | |
| data_preprocessing ($question) | |
| data_preprocessing_answers ($question) | |
| data_preprocessing_units ($question) | |
| data_preprocessing_unit_options ($question) | |
| validate_answers ($data, $errors) | |
| is_valid_answer ($answer, $data) | |
| is_valid_number ($x) | |
| valid_answer_message ($answer) | |
| validate_numerical_options ($data, $errors) | |
Protected Attributes | |
| $ap = null | |
numerical editing form definition.
Definition at line 39 of file edit_numerical_form.php.
| add_unit_fields | ( | $ | mform | ) | [protected] |
Add the input areas for each unit.
| object | $mform | the form being built. |
Definition at line 131 of file edit_numerical_form.php.


| add_unit_options | ( | $ | mform | ) | [protected] |
Add the unit handling options to the form.
| object | $mform | the form being built. |
Definition at line 70 of file edit_numerical_form.php.

| data_preprocessing | ( | $ | question | ) | [protected] |
Perform an preprocessing needed on the data passed to set_data() before it is used to initialise the form.
| object | $question | the data being passed to the form. |
Reimplemented from question_edit_form.
Reimplemented in qtype_calculatedsimple_edit_form, and qtype_calculated_edit_form.
Definition at line 168 of file edit_numerical_form.php.

| data_preprocessing_answers | ( | $ | question | ) | [protected] |
Reimplemented in qtype_calculated_edit_form.
Definition at line 177 of file edit_numerical_form.php.

| data_preprocessing_unit_options | ( | $ | question | ) | [protected] |
Perform the necessary preprocessing for the fields added by add_unit_options().
| object | $question | the data being passed to the form. |
Definition at line 220 of file edit_numerical_form.php.

| data_preprocessing_units | ( | $ | question | ) | [protected] |
Perform the necessary preprocessing for the fields added by add_unit_fields().
| object | $question | the data being passed to the form. |
Definition at line 201 of file edit_numerical_form.php.

| definition_inner | ( | $ | mform | ) | [protected] |
Add any question-type specific form fields.
| object | $mform | the form being built. |
Reimplemented from question_edit_form.
Reimplemented in qtype_calculatedsimple_edit_form, and qtype_calculated_edit_form.
Definition at line 42 of file edit_numerical_form.php.

| get_per_answer_fields | ( | $ | mform, |
| $ | label, | ||
| $ | gradeoptions, | ||
| &$ | repeatedoptions, | ||
| &$ | answersoption | ||
| ) | [protected] |
Get the list of form elements to repeat, one for each answer.
| object | $mform | the form being built. |
| $label | the label to use for each option. | |
| $gradeoptions | the possible grades for each answer. | |
| $repeatedoptions | reference to array of repeated options to fill | |
| $answersoption | reference to return the name of $question->options field holding an array of answers |
Reimplemented from question_edit_form.
Reimplemented in qtype_calculated_edit_form.
Definition at line 51 of file edit_numerical_form.php.
| is_valid_answer | ( | $ | answer, |
| $ | data | ||
| ) | [protected] |
Validate a particular answer.
| string | $answer | an answer to validate. Known to be non-blank and already trimmed. |
| array | $data | the submitted data. |
Reimplemented in qtype_calculated_edit_form.
Definition at line 293 of file edit_numerical_form.php.


| is_valid_number | ( | $ | x | ) | [protected] |
Validate that a string is a nubmer formatted correctly for the current locale.
| string | $x | a string |
Reimplemented in test_qtype_numerical_edit_form.
Definition at line 302 of file edit_numerical_form.php.

| qtype | ( | ) |
Override this in the subclass to question type name.
Reimplemented from question_edit_form.
Reimplemented in qtype_calculatedsimple_edit_form, and qtype_calculated_edit_form.
Definition at line 375 of file edit_numerical_form.php.
| valid_answer_message | ( | $ | answer | ) | [protected] |
Reimplemented in qtype_calculated_edit_form.
Definition at line 315 of file edit_numerical_form.php.

| validate_answers | ( | $ | data, |
| $ | errors | ||
| ) | [protected] |
Validate the answers.
| array | $data | the submitted data. |
| array | $errors | the errors array to add to. |
Definition at line 252 of file edit_numerical_form.php.


| validate_numerical_options | ( | $ | data, |
| $ | errors | ||
| ) | [protected] |
Validate the answers.
| array | $data | the submitted data. |
| array | $errors | the errors array to add to. |
Definition at line 325 of file edit_numerical_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.
| array | $data | array of ("fieldname"=>value) of submitted data |
| array | $files | array of uploaded files "element_name"=>tmp_file_path |
Reimplemented from question_edit_form.
Reimplemented in qtype_calculatedsimple_edit_form, and qtype_calculated_edit_form.
Definition at line 239 of file edit_numerical_form.php.

$ap = null [protected] |
Definition at line 40 of file edit_numerical_form.php.