Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Multianswer question renderer classes. Handle shortanswer, numerical and various multichoice subquestions

Copyright: 2010 Pierre Pichet
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 665 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 classes

qtype_multianswer_renderer:: (3 methods):
  formulation_and_controls()
  subquestion()
  correct_response()

qtype_multianswer_subq_renderer_base:: (1 method):
  feedback_popup()

qtype_multianswer_textfield_renderer:: (1 method):
  subquestion()

qtype_multianswer_multichoice_inline_renderer:: (1 method):
  subquestion()

qtype_multianswer_multichoice_vertical_renderer:: (5 methods):
  subquestion()
  choice_wrapper_start()
  choice_wrapper_end()
  all_choices_wrapper_start()
  all_choices_wrapper_end()

qtype_multianswer_multichoice_horizontal_renderer:: (4 methods):
  choice_wrapper_start()
  choice_wrapper_end()
  all_choices_wrapper_start()
  all_choices_wrapper_end()

qtype_multianswer_multiresponse_vertical_renderer:: (5 methods):
  subquestion()
  choice_wrapper_start()
  choice_wrapper_end()
  all_choices_wrapper_start()
  all_choices_wrapper_end()

qtype_multianswer_multiresponse_horizontal_renderer:: (4 methods):
  choice_wrapper_start()
  choice_wrapper_end()
  all_choices_wrapper_start()
  all_choices_wrapper_end()


Class: qtype_multianswer_renderer  - X-Ref

Base class for generating the bits of output common to multianswer
(Cloze) questions.
This render the main question text and transfer to the subquestions
the task of display their input elements and status
feedback, grade, correct answer(s)

formulation_and_controls(question_attempt $qa,question_display_options $options)   X-Ref
No description

subquestion(question_attempt $qa,question_display_options $options, $index, question_graded_automatically $subq)   X-Ref
No description

correct_response(question_attempt $qa)   X-Ref
No description

Class: qtype_multianswer_subq_renderer_base  - X-Ref

Subclass for generating the bits of output specific to shortanswer
subquestions.

feedback_popup(question_graded_automatically $subq,$fraction, $feedbacktext, $rightanswer, question_display_options $options)   X-Ref
Render the feedback pop-up contents.

param: question_graded_automatically $subq the subquestion.
param: float $fraction the mark the student got. null if this subq was not answered.
param: string $feedbacktext the feedback text, already processed with format_text etc.
param: string $rightanswer the right answer, already processed with format_text etc.
param: question_display_options $options the display options.
return: string the HTML for the feedback popup.

Class: qtype_multianswer_textfield_renderer  - X-Ref

Subclass for generating the bits of output specific to shortanswer
subquestions.

subquestion(question_attempt $qa, question_display_options $options,$index, question_graded_automatically $subq)   X-Ref
No description

Class: qtype_multianswer_multichoice_inline_renderer  - X-Ref

Render an embedded multiple-choice question that is displayed as a select menu.

subquestion(question_attempt $qa, question_display_options $options,$index, question_graded_automatically $subq)   X-Ref
No description

Class: qtype_multianswer_multichoice_vertical_renderer  - X-Ref

Render an embedded multiple-choice question vertically, like for a normal
multiple-choice question.

subquestion(question_attempt $qa, question_display_options $options,$index, question_graded_automatically $subq)   X-Ref
No description

choice_wrapper_start($class)   X-Ref

param: string $class class attribute value.
return: string HTML to go before each choice.

choice_wrapper_end()   X-Ref

return: string HTML to go after each choice.

all_choices_wrapper_start()   X-Ref

return: string HTML to go before all the choices.

all_choices_wrapper_end()   X-Ref

return: string HTML to go after all the choices.

Class: qtype_multianswer_multichoice_horizontal_renderer  - X-Ref

Render an embedded multiple-choice question vertically, like for a normal
multiple-choice question.

choice_wrapper_start($class)   X-Ref
No description

choice_wrapper_end()   X-Ref
No description

all_choices_wrapper_start()   X-Ref
No description

all_choices_wrapper_end()   X-Ref
No description

Class: qtype_multianswer_multiresponse_vertical_renderer  - X-Ref

Class qtype_multianswer_multiresponse_renderer

subquestion(question_attempt $qa, question_display_options $options,$index, question_graded_automatically $subq)   X-Ref
Output the content of the subquestion.

param: question_attempt $qa
param: question_display_options $options
param: int $index
param: question_graded_automatically $subq
return: string

choice_wrapper_start($class)   X-Ref

param: string $class class attribute value.
return: string HTML to go before each choice.

choice_wrapper_end()   X-Ref

return: string HTML to go after each choice.

all_choices_wrapper_start()   X-Ref

return: string HTML to go before all the choices.

all_choices_wrapper_end()   X-Ref

return: string HTML to go after all the choices.

Class: qtype_multianswer_multiresponse_horizontal_renderer  - X-Ref

Render an embedded multiple-response question horizontally.

choice_wrapper_start($class)   X-Ref
No description

choice_wrapper_end()   X-Ref
No description

all_choices_wrapper_start()   X-Ref
No description

all_choices_wrapper_end()   X-Ref
No description