Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403]

Multiple choice question renderer classes.

Copyright: 2009 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 414 lines (16 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 3 classes

qtype_multichoice_renderer_base:: (5 methods):
  formulation_and_controls()
  number_html()
  number_in_style()
  specific_feedback()
  correct_choices()

qtype_multichoice_single_renderer:: (8 methods):
  get_input_type()
  get_input_name()
  get_input_value()
  get_input_id()
  is_right()
  prompt()
  correct_response()
  after_choices()

qtype_multichoice_multi_renderer:: (9 methods):
  after_choices()
  get_input_type()
  get_input_name()
  get_input_value()
  get_input_id()
  is_right()
  prompt()
  correct_response()
  num_parts_correct()


Class: qtype_multichoice_renderer_base  - X-Ref

Base class for generating the bits of output common to multiple choice
single and multiple questions.

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

number_html($qnum)   X-Ref
No description

number_in_style($num, $style)   X-Ref

param: int $num The number, starting at 0.
param: string $style The style to render the number in. One of the
return: string the number $num in the requested style.

specific_feedback(question_attempt $qa)   X-Ref
No description

correct_choices(array $right)   X-Ref
Function returns string based on number of correct answers

param: array $right An Array of correct responses to the current question
return: string based on number of correct responses

Class: qtype_multichoice_single_renderer  - X-Ref

Subclass for generating the bits of output specific to multiple choice
single questions.

get_input_type()   X-Ref
No description

get_input_name(question_attempt $qa, $value)   X-Ref
No description

get_input_value($value)   X-Ref
No description

get_input_id(question_attempt $qa, $value)   X-Ref
No description

is_right(question_answer $ans)   X-Ref
No description

prompt()   X-Ref
No description

correct_response(question_attempt $qa)   X-Ref
No description

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

Class: qtype_multichoice_multi_renderer  - X-Ref

Subclass for generating the bits of output specific to multiple choice
multi=select questions.

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

get_input_type()   X-Ref
No description

get_input_name(question_attempt $qa, $value)   X-Ref
No description

get_input_value($value)   X-Ref
No description

get_input_id(question_attempt $qa, $value)   X-Ref
No description

is_right(question_answer $ans)   X-Ref
No description

prompt()   X-Ref
No description

correct_response(question_attempt $qa)   X-Ref
No description

num_parts_correct(question_attempt $qa)   X-Ref
No description