ILIAS
Release_5_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.assClozeSelectGap.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
"./Modules/TestQuestionPool/classes/class.assClozeGap.php"
;
5
17
class
assClozeSelectGap
extends
assClozeGap
18
{
24
var
$shuffle
;
25
32
function
assClozeSelectGap
($a_type)
33
{
34
$this->type = $a_type;
35
$this->items = array();
36
$this->shuffle = TRUE;
37
}
38
48
function
getShuffle
()
49
{
50
return
$this->shuffle
;
51
}
52
62
function
setType
($a_shuffle = TRUE)
63
{
64
$this->shuffle = $a_shuffle ? TRUE : FALSE;
65
}
66
75
function
arrayShuffle
($array)
76
{
77
mt_srand((
double
)microtime()*1000000);
78
$i = count($array);
79
if
($i > 0)
80
{
81
while
(--$i)
82
{
83
$j = mt_rand(0, $i);
84
if
($i != $j)
85
{
86
// swap elements
87
$tmp = $array[$j];
88
$array[$j] = $array[$i];
89
$array[$i] = $tmp;
90
}
91
}
92
}
93
return
$array;
94
}
95
105
function
getItems
()
106
{
107
if
($this->shuffle)
108
{
109
return
$this->
arrayShuffle
($this->items);
110
}
111
else
112
{
113
return
$this->items
;
114
}
115
}
116
}
117
118
?>
Modules
TestQuestionPool
classes
class.assClozeSelectGap.php
Generated on Wed Apr 27 2016 21:01:19 for ILIAS by
1.8.1.2 (using
Doxyfile
)