[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/question/classes/engine/variants/ -> least_used_strategy.php (summary)

A {@link \question_variant_selection_strategy} that randomly selects variants that were not used yet.

Copyright: 2015 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 137 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

least_used_strategy:: (2 methods):
  __construct()
  choose_variant()


Class: least_used_strategy  - X-Ref

A {@link \question_variant_selection_strategy} that randomly selects variants that were not used yet.

If all variants have been used at least once in the set of usages under
consideration, then then it picks one of the least often used.

Within one particular use of this class, each seed will always select the
same variant. This is so that shared datasets work in calculated questions,
and similar features in question types like varnumeric and STACK.

__construct(\question_usage_by_activity $quba, \qubaid_condition $qubaids)   X-Ref
Constructor.

param: question_usage_by_activity $quba the question usage we will be picking variants for.
param: qubaid_condition $qubaids ids of the usages to consider when counting previous uses of each variant.

choose_variant($maxvariants, $seed)   X-Ref
No description



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1