Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

Essay question renderer class.

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

Defines 7 classes

qtype_essay_renderer:: (4 methods):
  formulation_and_controls()
  files_read_only()
  files_input()
  manual_comment()

qtype_essay_format_renderer_base:: (0 methods):

qtype_essay_format_noinline_renderer:: (3 methods):
  class_name()
  response_area_read_only()
  response_area_input()

qtype_essay_format_editor_renderer:: (8 methods):
  class_name()
  response_area_read_only()
  response_area_input()
  prepare_response()
  prepare_response_for_editing()
  get_editor_options()
  get_filepicker_options()
  filepicker_html()

qtype_essay_format_editorfilepicker_renderer:: (7 methods):
  class_name()
  prepare_response()
  prepare_response_for_editing()
  get_editor_options()
  specific_filepicker_options()
  get_filepicker_options()
  filepicker_html()

qtype_essay_format_plain_renderer:: (4 methods):
  textarea()
  class_name()
  response_area_read_only()
  response_area_input()

qtype_essay_format_monospaced_renderer:: (1 method):
  class_name()


Class: qtype_essay_renderer  - X-Ref

Generates the output for essay questions.

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

files_read_only(question_attempt $qa, question_display_options $options)   X-Ref
Displays any attached files when the question is in read-only mode.

param: question_attempt $qa the question attempt to display.
param: question_display_options $options controls what should and should

files_input(question_attempt $qa, $numallowed,question_display_options $options)   X-Ref
Displays the input control for when the student should upload a single file.

param: question_attempt $qa the question attempt to display.
param: int $numallowed the maximum number of attachments allowed. -1 = unlimited.
param: question_display_options $options controls what should and should

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

Class: qtype_essay_format_renderer_base  - X-Ref

A base class to abstract out the differences between different type of
response format.

Class: qtype_essay_format_noinline_renderer  - X-Ref

An essay format renderer for essays where the student should not enter
any inline response.

class_name()   X-Ref
No description

response_area_read_only($name, $qa, $step, $lines, $context)   X-Ref
No description

response_area_input($name, $qa, $step, $lines, $context)   X-Ref
No description

Class: qtype_essay_format_editor_renderer  - X-Ref

An essay format renderer for essays where the student should use the HTML
editor without the file picker.

class_name()   X-Ref
No description

response_area_read_only($name, $qa, $step, $lines, $context)   X-Ref
No description

response_area_input($name, $qa, $step, $lines, $context)   X-Ref
No description

prepare_response($name, question_attempt $qa,question_attempt_step $step, $context)   X-Ref
Prepare the response for read-only display.

param: string $name the variable name this input edits.
param: question_attempt $qa the question attempt being display.
param: question_attempt_step $step the current step.
param: object $context the context the attempt belongs to.
return: string the response prepared for display.

prepare_response_for_editing($name,question_attempt_step $step, $context)   X-Ref
Prepare the response for editing.

param: string $name the variable name this input edits.
param: question_attempt_step $step the current step.
param: object $context the context the attempt belongs to.
return: string the response prepared for display.

get_editor_options($context)   X-Ref

param: object $context the context the attempt belongs to.
return: array options for the editor.

get_filepicker_options($context, $draftitemid)   X-Ref

param: object $context the context the attempt belongs to.
param: int $draftitemid draft item id.
return: array filepicker options for the editor.

filepicker_html($inputname, $draftitemid)   X-Ref

param: string $inputname input field name.
param: int $draftitemid draft file area itemid.
return: string HTML for the filepicker, if used.

Class: qtype_essay_format_editorfilepicker_renderer  - X-Ref

An essay format renderer for essays where the student should use the HTML
editor with the file picker.

class_name()   X-Ref
No description

prepare_response($name, question_attempt $qa,question_attempt_step $step, $context)   X-Ref
No description

prepare_response_for_editing($name,question_attempt_step $step, $context)   X-Ref
No description

get_editor_options($context)   X-Ref
Get editor options for question response text area.

param: object $context the context the attempt belongs to.
return: array options for the editor.

specific_filepicker_options($acceptedtypes, $draftitemid, $context)   X-Ref
Get the options required to configure the filepicker for one of the editor
toolbar buttons.

param: mixed $acceptedtypes array of types of '*'.
param: int $draftitemid the draft area item id.
param: object $context the context.
return: object the required options.

get_filepicker_options($context, $draftitemid)   X-Ref

param: object $context the context the attempt belongs to.
param: int $draftitemid draft item id.
return: array filepicker options for the editor.

filepicker_html($inputname, $draftitemid)   X-Ref
No description

Class: qtype_essay_format_plain_renderer  - X-Ref

An essay format renderer for essays where the student should use a plain
input box, but with a normal, proportional font.

textarea($response, $lines, $attributes)   X-Ref

return: string the HTML for the textarea.

class_name()   X-Ref
No description

response_area_read_only($name, $qa, $step, $lines, $context)   X-Ref
No description

response_area_input($name, $qa, $step, $lines, $context)   X-Ref
No description

Class: qtype_essay_format_monospaced_renderer  - X-Ref

An essay format renderer for essays where the student should use a plain
input box with a monospaced font. You might use this, for example, for a
question where the students should type computer code.

class_name()   X-Ref
No description