Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

Essay

Copyright: 2009 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 441 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

lesson_page_type_essay:: (15 methods):
  get_typeid()
  get_typestring()
  get_idstring()
  extract_useranswer()
  display()
  create_answers()
  on_after_write_attempt()
  format_answer()
  check_answer()
  update()
  stats()
  report_answers()
  is_unanswered()
  requires_manual_grading()
  get_earnedscore()

lesson_add_page_form_essay:: (1 method):
  custom_definition()

lesson_display_answer_form_essay:: (1 method):
  definition()


Class: lesson_page_type_essay  - X-Ref

get_typeid()   X-Ref
No description

get_typestring()   X-Ref
No description

get_idstring()   X-Ref
No description

extract_useranswer($useranswer)   X-Ref
Unserialize attempt useranswer and add missing responseformat if needed
for compatibility with old records.

param: string $useranswer serialized object
return: object

display($renderer, $attempt)   X-Ref
No description

create_answers($properties)   X-Ref
No description

on_after_write_attempt($attempt, $result)   X-Ref
Overridden function

param: object $attempt
param: object $result
return: array

format_answer($answer, $context, $answerformat, $options = [])   X-Ref
Custom formats the answer to display

param: string $answer
param: context $context
param: int $answerformat
param: array $options Optional param for additional options.
return: string Returns formatted string

check_answer()   X-Ref
No description

update($properties, $context = null, $maxbytes = null)   X-Ref
No description

stats(array &$pagestats, $tries)   X-Ref
No description

report_answers($answerpage, $answerdata, $useranswer, $pagestats, &$i, &$n)   X-Ref
No description

is_unanswered($nretakes)   X-Ref
No description

requires_manual_grading()   X-Ref
No description

get_earnedscore($answers, $attempt)   X-Ref
No description

Class: lesson_add_page_form_essay  - X-Ref

custom_definition()   X-Ref
No description

Class: lesson_display_answer_form_essay  - X-Ref

definition()   X-Ref
No description