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.

(no description)

File Size: 115 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

question_version_info:: (3 methods):
  __construct()
  populate_latest_versions()
  export_for_template()


Class: question_version_info  - X-Ref

Track and display question version information.

This class handles rendering the question version information (the current version of the question, the total number of versions,
and if the current version is the latest). It also tracks loaded question definitions that don't yet have the latest version
loaded, and handles loading the latest version of all pending questions.

__construct(\question_definition $question, bool $shortversion = false)   X-Ref
Store the current and latest versions of the question, and whether we want to abbreviate the output string.

param: \question_definition $question
param: bool $shortversion

populate_latest_versions()   X-Ref
Find and set the latest version of all pending question_definition objects.

This will update all pending objects in one go, saving us having to do a query for each question.

return: void

export_for_template(renderer_base $output)   X-Ref
Return the question version info as a string, including the version number and whether this is the latest version.

param: renderer_base $output
return: array