Subclass for generating the bits of output specific to shortanswer subquestions.
More...
|
| correct_response (question_attempt $qa) |
| Gereate an automatic description of the correct response to this question.
|
|
| feedback_class ($fraction) |
|
| feedback_image ($fraction, $selected=true) |
| Return an appropriate icon (green tick, red cross, etc.) for a grade.
|
|
| feedback_popup (question_graded_automatically $subq, $fraction, $feedbacktext, $rightanswer, question_display_options $options) |
| Render the feedback pop-up contents.
|
|
| general_feedback (question_attempt $qa) |
| Gereate the general feedback.
|
|
| get_answer_label (string $langkey='answerx', string $component='question') |
| Generates a label for an answer field.
|
|
| get_feedback_image (string $icon, string $feedbackcontents) |
| Render the feedback icon for a sub-question which is also the trigger for the feedback popover.
|
|
| hint (question_attempt $qa, question_hint $hint) |
| Gereate the specific feedback.
|
|
| num_parts_correct (question_attempt $qa) |
| Gereate a brief statement of how many sub-parts of this question the student got right.
|
|
| specific_feedback (question_attempt $qa) |
| Generate the specific feedback.
|
|
|
question_display_options | $displayoptions |
| Question display options instance for any necessary information for rendering the question.
|
|
|
static int[] | $answercount = [] |
| Stores the counts of answer instances for questions.
|
|
Subclass for generating the bits of output specific to shortanswer subquestions.
- Copyright
- 2011 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ clear_wrong()
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
-
- Return values
-
Reimplemented in qtype_ddtoimage_renderer_base.
◆ correct_response()
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
-
- Return values
-
Reimplemented in qtype_calculated_renderer, qtype_ddtoimage_renderer_base, qtype_elements_embedded_in_question_text_renderer, qtype_match_renderer, qtype_multianswer_renderer, qtype_multichoice_multi_renderer, qtype_multichoice_single_renderer, qtype_numerical_renderer, qtype_ordering_renderer, qtype_shortanswer_renderer, and qtype_truefalse_renderer.
◆ feedback()
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
-
- Return values
-
Reimplemented in qtype_ordering_renderer.
◆ feedback_image()
qtype_renderer::feedback_image |
( |
| $fraction, |
|
|
| $selected = true ) |
|
protectedinherited |
Return an appropriate icon (green tick, red cross, etc.) for a grade.
- Parameters
-
float | $fraction | grade on a scale 0..1. |
bool | $selected | whether to show a big or small icon. (Deprecated) |
- Return values
-
Reimplemented in qtype_ordering_renderer.
◆ feedback_popup()
Render the feedback pop-up contents.
- Parameters
-
question_graded_automatically | $subq | the subquestion. |
float | $fraction | the mark the student got. null if this subq was not answered. |
string | $feedbacktext | the feedback text, already processed with format_text etc. |
string | $rightanswer | the right answer, already processed with format_text etc. |
question_display_options | $options | the display options. |
- Return values
-
string | the HTML for the feedback popup. |
◆ formulation_and_controls()
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
-
- Return values
-
Reimplemented in qtype_ddmarker_renderer, qtype_ddtoimage_renderer_base, qtype_ddwtos_renderer, qtype_description_renderer, qtype_elements_embedded_in_question_text_renderer, qtype_essay_renderer, qtype_match_renderer, qtype_multianswer_renderer, qtype_multichoice_renderer_base, qtype_numerical_renderer, qtype_ordering_renderer, qtype_shortanswer_renderer, and qtype_truefalse_renderer.
◆ formulation_heading()
qtype_renderer::formulation_heading |
( |
| ) |
|
|
inherited |
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.
- Return values
-
string | to use as the heading. |
Reimplemented in qtype_description_renderer.
◆ general_feedback()
Gereate the general feedback.
This is feedback is shown ot all students.
- Parameters
-
- Return values
-
◆ get_answer_label()
qtype_multianswer_subq_renderer_base::get_answer_label |
( |
string | $langkey = 'answerx', |
|
|
string | $component = 'question' ) |
|
protected |
Generates a label for an answer field.
If the question number is set ({
- See also
- qtype_renderer::$questionnumber}), the label will include the question number in order to indicate which question the answer field belongs to.
- Parameters
-
string | $langkey | The lang string key for the lang string that does not include the question number. |
string | $component | The Frankenstyle component name. |
- Return values
-
- Exceptions
-
◆ get_feedback_image()
qtype_multianswer_subq_renderer_base::get_feedback_image |
( |
string | $icon, |
|
|
string | $feedbackcontents ) |
|
protected |
Render the feedback icon for a sub-question which is also the trigger for the feedback popover.
- Parameters
-
string | $icon | The feedback icon |
string | $feedbackcontents | The feedback contents to be shown on the popover. |
- Return values
-
◆ head_code()
Return any HTML that needs to be included in the page's <head> when this question is used.
- Parameters
-
$qa | the question attempt that will be displayed on the page. |
- Return values
-
◆ hint()
Gereate the specific feedback.
This is feedback that varies according to the response the student gave.
- Parameters
-
- Return values
-
Reimplemented in qtype_ddmarker_renderer.
◆ manual_comment()
Display any extra question-type specific content that should be visible when grading, if appropriate.
- Parameters
-
- Return values
-
Reimplemented in qtype_essay_renderer.
◆ num_parts_correct()
◆ specific_feedback()
◆ subquestion()
The documentation for this class was generated from the following file:
- question/type/multianswer/renderer.php