Moodle  2.2.1
http://www.collinsharper.com
question_variant_pseudorandom_no_repeats_strategy Class Reference
Inheritance diagram for question_variant_pseudorandom_no_repeats_strategy:
Collaboration diagram for question_variant_pseudorandom_no_repeats_strategy:

Public Member Functions

 __construct ($attemptno, $userid=null)
 choose_variant ($maxvariants, $seed)

Protected Attributes

 $attemptno
 $userid

Detailed Description

A question_variant_selection_strategy that is effectively random for the first attempt, and then after that cycles through the available variants so that the students will not get a repeated variant until they have seen them all.

Definition at line 834 of file lib.php.


Constructor & Destructor Documentation

__construct ( attemptno,
userid = null 
)

Constructor.

Parameters:
int$attemptnoThe attempt number.
int$useridthe user the attempt is for (defaults to $USER->id).

Definition at line 848 of file lib.php.


Member Function Documentation

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.
Returns:
int the variant to use, a number betweeb 1 and $maxvariants inclusive.

Implements question_variant_selection_strategy.

Definition at line 858 of file lib.php.


Field Documentation

$attemptno [protected]

Definition at line 838 of file lib.php.

$userid [protected]

Definition at line 841 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations