Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
question_variant_selection_strategy Interface Reference

The interface for strategies for controlling which variant of each question is used. More...

Inheritance diagram for question_variant_selection_strategy:
core_question\engine\variants\least_used_strategy question_variant_forced_choices_selection_strategy question_variant_pseudorandom_no_repeats_strategy question_variant_random_strategy

Public Member Functions

 choose_variant ($maxvariants, $seed)
 

Detailed Description

The interface for strategies for controlling which variant of each question is used.

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

Member Function Documentation

◆ choose_variant()

question_variant_selection_strategy::choose_variant ( $maxvariants,
$seed )
Parameters
int$maxvariantsthe num
string$seeddata that can be used to controls how the variant is selected in a semi-random way.
Return values
intthe variant to use, a number betweeb 1 and $maxvariants inclusive.

Implemented in core_question\engine\variants\least_used_strategy, question_variant_forced_choices_selection_strategy, question_variant_pseudorandom_no_repeats_strategy, and question_variant_random_strategy.


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