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

Public Member Functions

 get_page ()
 question (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options, $number)

Protected Member Functions

 info (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options, $number)
 number ($number)
 add_part_heading ($heading, $content)
 status (question_attempt $qa, qbehaviour_renderer $behaviouroutput, question_display_options $options)
 mark_summary (question_attempt $qa, question_display_options $options)
 question_flag (question_attempt $qa, $flagsoption)
 get_flag_html ($flagged, $id= '')
 edit_question_link (question_attempt $qa, question_display_options $options)
 formulation (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options)
 outcome (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options)
 manual_comment (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options)
 response_history (question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options)

Detailed Description

This renderer controls the overall output of questions. It works with a qbehaviour_renderer and a qtype_renderer to output the type-specific bits. The main entry point is the question() method.

Definition at line 38 of file renderer.php.


Member Function Documentation

add_part_heading ( heading,
content 
) [protected]

Add an invisible heading like 'question text', 'feebdack' at the top of a section's contents, but only if the section has some content.

Parameters:
string$headingthe heading to add.
string$contentthe content of the section.
Returns:
string HTML fragment with the heading added.

Definition at line 151 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

edit_question_link ( question_attempt qa,
question_display_options options 
) [protected]

Definition at line 271 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

formulation ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options 
) [protected]

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 feedback, for example ticks and crosses, in this area.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
qtype_renderer$qtoutputthe renderer to output the question type specific parts.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
HTML fragment.

Definition at line 307 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_flag_html ( flagged,
id = '' 
) [protected]

Work out the actual img tag needed for the flag

Parameters:
bool$flaggedwhether the question is currently flagged.
string$idan id to be added as an attribute to the img (optional).
Returns:
string the img tag.

Definition at line 249 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_page ( )

Definition at line 39 of file renderer.php.

Here is the caller graph for this function:

info ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options,
number 
) [protected]

Generate the information bit of the question display that contains the metadata like the question number, current state, and mark.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
qtype_renderer$qtoutputthe renderer to output the question type specific parts.
question_display_options$optionscontrols what should and should not be displayed.
string | null$numberThe question number to display. 'i' is a special value that gets displayed as Information. Null means no number is displayed.
Returns:
HTML fragment.

Definition at line 113 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

manual_comment ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options 
) [protected]

Definition at line 345 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mark_summary ( question_attempt qa,
question_display_options options 
) [protected]

Generate the display of the marks for this question.

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

Definition at line 179 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

number ( number) [protected]

Generate the display of the question number.

Parameters:
string | null$numberThe question number to display. 'i' is a special value that gets displayed as Information. Null means no number is displayed.
Returns:
HTML fragment.

Definition at line 130 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

outcome ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options 
) [protected]

Generate the display of the outcome part of the question. This is the area that contains the various forms of feedback.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
qtype_renderer$qtoutputthe renderer to output the question type specific parts.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
HTML fragment.

Definition at line 335 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

question ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options,
number 
)

Generate the display of a question in a particular state, and with certain display options. Normally you do not call this method directly. Intsead you call question_usage_by_activity::render_question() which will call this method with appropriate arguments.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
qtype_renderer$qtoutputthe renderer to output the question type specific parts.
question_display_options$optionscontrols what should and should not be displayed.
string | null$numberThe question number to display. 'i' is a special value that gets displayed as Information. Null means no number is displayed.
Returns:
string HTML representation of the question.

Definition at line 59 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

question_flag ( question_attempt qa,
flagsoption 
) [protected]

Render the question flag, assuming $flagsoption allows it.

Parameters:
question_attempt$qathe question attempt to display.
int$flagsoptionthe option that says whether flags should be displayed.

Definition at line 208 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

response_history ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
qtype_renderer qtoutput,
question_display_options options 
) [protected]

Generate the display of the response history part of the question. This is the table showing all the steps the question has been through.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
qtype_renderer$qtoutputthe renderer to output the question type specific parts.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
HTML fragment.

Definition at line 363 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

status ( question_attempt qa,
qbehaviour_renderer behaviouroutput,
question_display_options options 
) [protected]

Generate the display of the status line that gives the current state of the question.

Parameters:
question_attempt$qathe question attempt to display.
qbehaviour_renderer$behaviouroutputthe renderer to output the behaviour specific parts.
question_display_options$optionscontrols what should and should not be displayed.
Returns:
HTML fragment.

Definition at line 167 of file renderer.php.

Here is the call graph for this function:

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