Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_question\question_reference_manager Class Reference

This class should provide an API for managing question_references. More...

Static Public Member Functions

static convert_legacy_set_reference_filter_condition (array $filtercondition)
 This will transform set reference filter conditions to use the new filter structure.
 
static questions_with_references (array $questionids)
 Return a list of those questions from the list passed in, which are referenced.
 

Detailed Description

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.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ convert_legacy_set_reference_filter_condition()

static core_question\question_reference_manager::convert_legacy_set_reference_filter_condition ( array $filtercondition)
static

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.

Parameters
array$filterconditionPre-4.3 filter condition.
Return values
arrayPost-4.3 filter condition.

◆ questions_with_references()

static core_question\question_reference_manager::questions_with_references ( array $questionids)
static

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.
Parameters
array$questionidsa list of question ids to check.
Return values
arraya list of the question ids from the input array which are referenced.

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