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

Public Member Functions

 __construct ()
 make_behaviour (question_attempt $qa, $preferredbehaviour)
 get_expected_data ()
 get_correct_response ()
 get_question_summary ()

Detailed Description

This class represents a 'question' that actually does not allow the student to respond, like the description 'question' type.

Definition at line 350 of file questionbase.php.


Constructor & Destructor Documentation

Constructor. Normally to get a question, you call question_bank::load_question(), but questions can be created directly, for example in unit test code.

Returns:
unknown_type

Reimplemented from question_definition.

Definition at line 351 of file questionbase.php.


Member Function Documentation

What data would need to be submitted to get this question correct. If there is more than one correct answer, this method should just return one possibility. If it is not possible to compute a correct response, this method should return null.

Returns:
array|null parameter name => value.

Reimplemented from question_definition.

Definition at line 367 of file questionbase.php.

What data may be included in the form submission when a student submits this question in its current state?

This information is used in calls to optional_param. The parameter name has question_attempt::get_field_prefix() automatically prepended.

Returns:
array|string variable name => PARAM_... constant, or, as a special case that should only be used in unavoidable, the constant question_attempt::USE_RAW_DATA meaning take all the raw submitted data belonging to this question.

Reimplemented from question_definition.

Definition at line 363 of file questionbase.php.

Generate a brief, plain-text, summary of this question. This is used by various reports. This should show the particular variant of the question as presented to students. For example, the calculated quetsion type would fill in the particular numbers that were presented to the student. This method will return null if such a summary is not possible, or inappropriate.

Returns:
string|null a plain text summary of this question.

Reimplemented from question_definition.

Definition at line 371 of file questionbase.php.

make_behaviour ( question_attempt qa,
preferredbehaviour 
)

Creat the appropriate behaviour for an attempt at this quetsion, given the desired (archetypal) behaviour.

This default implementation will suit most normal graded questions.

If your question is of a patricular type, then it may need to do something different. For example, if your question can only be graded manually, then it should probably return a manualgraded behaviour, irrespective of what is asked for.

If your question wants to do somthing especially complicated is some situations, then you may wish to return a particular behaviour related to the one asked for. For example, you migth want to return a qbehaviour_interactive_adapted_for_myqtype.

Parameters:
question_attempt$qathe attempt we are creating an behaviour for.
string$preferredbehaviourthe requested type of behaviour.
Returns:
question_behaviour the new behaviour object.

Reimplemented from question_definition.

Definition at line 358 of file questionbase.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