Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core_question\output\question_version_info Class Reference
Inheritance diagram for core_question\output\question_version_info:
renderable templatable

Public Member Functions

 __construct (\question_definition $question, bool $shortversion=false)
 Store the current and latest versions of the question, and whether we want to abbreviate the output string.
 
 export_for_template (renderer_base $output)
 Return the question version info as a string, including the version number and whether this is the latest version.
 

Static Public Member Functions

static populate_latest_versions ()
 Find and set the latest version of all pending question_definition objects.
 

Public Attributes

int int $latestversion
 $latestversion The latest version number of this question.
 
int int $version
 $version The current version number.
 

Static Public Attributes

static array array $pendingdefinitions = []
 List of definitions that don't know whether they are the latest version yet.
 

Protected Attributes

bool bool $shortversion
 $shortversion Are we displaying an abbreviation for "version" rather than the full word?
 

Constructor & Destructor Documentation

◆ __construct()

core_question\output\question_version_info::__construct ( \question_definition $question,
bool $shortversion = false )

Store the current and latest versions of the question, and whether we want to abbreviate the output string.

Parameters
question_definition$question
bool$shortversion

Member Function Documentation

◆ export_for_template()

core_question\output\question_version_info::export_for_template ( renderer_base $output)

Return the question version info as a string, including the version number and whether this is the latest version.

Parameters
renderer_base$output
Return values
array
Exceptions
coding_exception

Implements templatable.

◆ populate_latest_versions()

static core_question\output\question_version_info::populate_latest_versions ( )
static

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 values
void

The documentation for this class was generated from the following file: