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 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

(no description)

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

Defines 1 class

question_reference_manager:: (2 methods):
  questions_with_references()
  convert_legacy_set_reference_filter_condition()


Class: question_reference_manager  - X-Ref

This class should provide an API for managing question_references.

Unfortunately, question_references were introduced in the DB structure
without an nice API. This class is being added later, and is currently
terribly incomplete, but hopefully it can be improved in time.

questions_with_references(array $questionids)   X-Ref
Return a list of those questions from the list passed in, which are referenced.

A question is referenced if either:
- There is a question_reference pointing at exactly that version of that question; or
- There is an 'always latest' reference, and the question id is the latest non-draft version
of that question_bank_entry.

param: array $questionids a list of question ids to check.
return: array a list of the question ids from the input array which are referenced.

convert_legacy_set_reference_filter_condition(array $filtercondition)   X-Ref
This will transform set reference filter conditions to use the new filter structure.

Previously filterconditions had questioncategoryid, includesubcategories and tags options.
These have been replaced by the new category and tags filters. This function convers the old
pre-4.3 filter condition structure to the new one.

param: array $filtercondition Pre-4.3 filter condition.
return: array Post-4.3 filter condition.