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

Public Member Functions

 set_data ($question)
 validation ($fromform, $files)
 qtype ()

Protected Member Functions

 definition ()

Detailed Description

random editing form definition.

Definition at line 36 of file edit_random_form.php.


Member Function Documentation

definition ( ) [protected]

Build the form definition.

This adds all the form files that the default question type supports. If your question type does not support all these fields, then you can override this method and remove the ones you don't want with $mform->removeElement().

Reimplemented from question_edit_form.

Definition at line 44 of file edit_random_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 question_edit_form.

Definition at line 80 of file edit_random_form.php.

set_data ( default_values)

Load in existing data as form defaults. Usually new entry defaults are stored directly in form definition (new entry form); this function is used to load in data where values already exist and data is being edited (edit entry form).

note: $slashed param removed

Parameters:
mixed$default_valuesobject or array of default values

Reimplemented from question_edit_form.

Definition at line 68 of file edit_random_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).

Reimplemented from question_edit_form.

Definition at line 74 of file edit_random_form.php.


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