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

(no description)

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

Defines 1 class

slot_random:: (7 methods):
  __construct()
  get_quiz()
  set_quiz()
  set_tags()
  set_tags_by_id()
  set_filter_condition()
  insert()


Class: slot_random  - X-Ref

Class slot_random, represents a random question slot type.

__construct($slotrecord = null)   X-Ref
slot_random constructor.

param: \stdClass $slotrecord Represents a record in the quiz_slots table.

get_quiz()   X-Ref
Returns the quiz for this question slot.
The quiz is fetched the first time it is requested and then stored in a member variable to be returned each subsequent time.

return: mixed

set_quiz($quiz)   X-Ref
Sets the quiz object for the quiz slot.
It is not mandatory to set the quiz as the quiz slot can fetch it the first time it is accessed,
however it helps with the performance to set the quiz if you already have it.

param: \stdClass $quiz The qui object.

set_tags($tags)   X-Ref
Set some tags for this quiz slot.

param: \core_tag_tag[] $tags

set_tags_by_id($tagids)   X-Ref
Set some tags for this quiz slot. This function uses tag ids to find tags.

param: int[] $tagids

set_filter_condition($filters)   X-Ref
Set filter condition.

param: \stdClass $filters

insert($page)   X-Ref
Inserts the quiz slot at the $page page.
It is required to call this function if you are building a quiz slot object from scratch.

param: int $page The page that this slot will be inserted at.