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

Public Member Functions

 formulation_and_controls (question_attempt $qa, question_display_options $options)
 formulation_heading ()
 clear_wrong (question_attempt $qa)
 feedback (question_attempt $qa, question_display_options $options)
 manual_comment (question_attempt $qa, question_display_options $options)
 head_code (question_attempt $qa)

Protected Member Functions

 specific_feedback (question_attempt $qa)
 num_parts_correct (question_attempt $qa)
 hint (question_attempt $qa, question_hint $hint)
 general_feedback (question_attempt $qa)
 correct_response (question_attempt $qa)
 feedback_class ($fraction)
 feedback_image ($fraction, $selected=true)

Detailed Description

Renderer base classes for question types.

Definition at line 36 of file rendererbase.php.


Member Function Documentation

Output hidden form fields to clear any wrong parts of the student's response.

This method will only be called if the question is in read-only mode.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Definition at line 69 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

correct_response ( question_attempt qa) [protected]

Gereate an automatic description of the correct response to this question. Not all question types can do this. If it is not possible, this method should just return an empty string.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Reimplemented in qtype_multichoice_multi_renderer, qtype_multichoice_single_renderer, qtype_numerical_renderer, qtype_truefalse_renderer, qtype_match_renderer, qtype_shortanswer_renderer, and qtype_multianswer_renderer.

Definition at line 188 of file rendererbase.php.

Here is the caller graph for this function:

Generate the display of the outcome part of the question. This is the area that contains the various forms of feedback. This function generates the content of this area belonging to the question type.

Subclasses will normally want to override the more specific methods {specific_feedback()}, {general_feedback()} and {correct_response()} that this method calls.

Parameters:
question_attempt$qathe question attempt to display.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
string HTML fragment.

Definition at line 100 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

feedback_class ( fraction) [protected]

Definition at line 218 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

feedback_image ( fraction,
selected = true 
) [protected]

Return an appropriate icon (green tick, red cross, etc.) for a grade.

Parameters:
float$fractiongrade on a scale 0..1.
bool$selectedwhether to show a big or small icon. (Deprecated)
Returns:
string html fragment.

Definition at line 228 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Generate the display of the formulation part of the question. This is the area that contains the quetsion text, and the controls for students to input their answers. Some question types also embed bits of feedback, for example ticks and crosses, in this area.

Parameters:
question_attempt$qathe question attempt to display.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
string HTML fragment.

Reimplemented in qtype_multichoice_renderer_base, qtype_multianswer_renderer, qtype_match_renderer, qtype_description_renderer, qtype_essay_renderer, qtype_shortanswer_renderer, qtype_truefalse_renderer, and qtype_numerical_renderer.

Definition at line 47 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

In the question output there are some class="accesshide" headers to help screen-readers. This method returns the text to use for the heading above the formulation_and_controls section.

Returns:
string to use as the heading.

Reimplemented in qtype_description_renderer.

Definition at line 58 of file rendererbase.php.

Here is the caller graph for this function:

general_feedback ( question_attempt qa) [protected]

Gereate the general feedback. This is feedback is shown ot all students.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Definition at line 176 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Return any HTML that needs to be included in the page's <head> when this question is used.

Parameters:
$qathe question attempt that will be displayed on the page.
Returns:
string HTML fragment.

Definition at line 210 of file rendererbase.php.

Here is the call graph for this function:

hint ( question_attempt qa,
question_hint hint 
) [protected]

Gereate the specific feedback. This is feedback that varies accordin to the reponse the student gave.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Definition at line 165 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Display any extra question-type specific content that should be visible when grading, if appropriate.

Parameters:
question_attempt$qaa question attempt.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
string HTML fragment.

Reimplemented in qtype_essay_renderer.

Definition at line 200 of file rendererbase.php.

Here is the caller graph for this function:

num_parts_correct ( question_attempt qa) [protected]

Gereate a brief statement of how many sub-parts of this question the student got right.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Reimplemented in qtype_multichoice_multi_renderer.

Definition at line 148 of file rendererbase.php.

Here is the call graph for this function:

Here is the caller graph for this function:

specific_feedback ( question_attempt qa) [protected]

Gereate the specific feedback. This is feedback that varies accordin to the reponse the student gave.

Parameters:
question_attempt$qathe question attempt to display.
Returns:
string HTML fragment.

Reimplemented in qtype_multichoice_renderer_base, qtype_numerical_renderer, qtype_truefalse_renderer, qtype_match_renderer, and qtype_shortanswer_renderer.

Definition at line 138 of file rendererbase.php.

Here is the caller graph for this function:


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