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

Public Member Functions

 is_manual_graded ()
 response_file_areas ()
 get_question_options ($question)
 save_question_options ($formdata)
 response_formats ()
 response_sizes ()
 attachment_options ()
 move_files ($questionid, $oldcontextid, $newcontextid)

Protected Member Functions

 initialise_question_instance (question_definition $question, $questiondata)
 delete_files ($questionid, $contextid)

Detailed Description

The essay question type.

Definition at line 36 of file questiontype.php.


Member Function Documentation

Returns:
array the choices that should be offered for the number of attachments.

Definition at line 108 of file questiontype.php.

delete_files ( questionid,
contextid 
) [protected]

Delete all the files belonging to this question.

Parameters:
int$questionidthe question being deleted.
int$contextidthe context the question is in.

Reimplemented from question_type.

Definition at line 125 of file questiontype.php.

Here is the call graph for this function:

get_question_options ( question)

Loads the question type specific options for the question.

This function loads any question type specific options for the question from the database into the question object. This information is placed in the $question->options field. A question type is free, however, to decide on a internal structure of the options field.

Returns:
bool Indicates success or failure.
Parameters:
object$questionThe question object for the question. This object should be updated to include the question type specific information (it is passed by reference).

Reimplemented from question_type.

Definition at line 45 of file questiontype.php.

initialise_question_instance ( question_definition question,
questiondata 
) [protected]

Initialise the common question_definition fields.

Parameters:
question_definition$questionthe question_definition we are creating.
object$questiondatathe question data loaded from the database.

Reimplemented from question_type.

Definition at line 72 of file questiontype.php.

Returns:
bool true if this question type sometimes requires manual grading.

Reimplemented from question_type.

Definition at line 37 of file questiontype.php.

move_files ( questionid,
oldcontextid,
newcontextid 
)

Move all the files belonging to this question from one context to another.

Parameters:
int$questionidthe question being moved.
int$oldcontextidthe context it is moving from.
int$newcontextidthe context it is moving to.

Reimplemented from question_type.

Definition at line 118 of file questiontype.php.

Here is the call graph for this function:

If the quetsion type uses files in responses, then this method should return an array of all the response variables that might have corresponding files. For example, the essay qtype returns array('attachments', 'answers').

Returns:
array response variable names that may have associated files.

Reimplemented from question_type.

Definition at line 41 of file questiontype.php.

Returns:
array the different response formats that the question type supports. internal name => human-readable name.

Definition at line 85 of file questiontype.php.

Returns:
array the choices that should be offered for the input box size.

Definition at line 97 of file questiontype.php.

save_question_options ( question)

Saves question-type specific options

This is called by save_question() to save the question-type specific data

Returns:
object $result->error or $result->noticeyesno or $result->notice
Parameters:
object$questionThis holds the information from the editing form, it is not a standard question object.

Reimplemented from question_type.

Definition at line 52 of file questiontype.php.

Here is the call graph for this function:


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