ILIAS
Release_5_0_x_branch Revision 61816
|
Class for cloze question gaps. More...
Public Member Functions | |
assClozeGap ($a_type) | |
assClozeGap constructor | |
getType () | |
Gets the cloze gap type. | |
setType ($a_type=0) | |
Sets the cloze gap type. | |
getItems () | |
Gets the items of a cloze gap. | |
getItemsRaw () | |
Gets the items of a cloze gap. | |
getItemCount () | |
Gets the item count. | |
addItem ($a_item) | |
Adds a gap item. | |
setItemPoints ($order, $points) | |
Sets the points for a given item. | |
deleteItem ($order) | |
Deletes an item at a given index. | |
setItemLowerBound ($order, $bound) | |
Sets the lower bound for a given item. | |
setItemUpperBound ($order, $bound) | |
Sets the upper bound for a given item. | |
getItem ($a_index) | |
Gets the item with a given index. | |
clearItems () | |
Removes all gap items. | |
setShuffle ($a_shuffle=true) | |
Sets the shuffle state of the items. | |
getShuffle () | |
Gets the shuffle state of the items. | |
arrayShuffle ($array) | |
Shuffles the values of a given array. | |
getMaxWidth () | |
Returns the maximum width of the gap. | |
getBestSolutionIndexes () | |
Returns the indexes of the best solutions for the gap. | |
getBestSolutionOutput () | |
setGapSize ($gap_size) | |
getGapSize () |
Data Fields | |
$type | |
Type of gap. | |
$items | |
$shuffle |
Private Attributes | |
$gap_size = 0 |
Class for cloze question gaps.
assClozeGap is a class for the abstraction of cloze gaps. It represents a text gap.
Definition at line 18 of file class.assClozeGap.php.
assClozeGap::addItem | ( | $a_item | ) |
Adds a gap item.
Adds a gap item
object | $a_item | Cloze gap item public |
Definition at line 146 of file class.assClozeGap.php.
assClozeGap::arrayShuffle | ( | $array | ) |
Shuffles the values of a given array.
Shuffles the values of a given array
array | $array | An array which should be shuffled |
: Figure out why this method exists. (See note) MBecker: PHP knows the function shuffle since 4.2 which is out since April 2002. Still, Helmut built this function in 2007 with rev. 13281 ... This needs investigation.
Reimplemented in assClozeSelectGap.
Definition at line 331 of file class.assClozeGap.php.
Referenced by getItems().
assClozeGap::assClozeGap | ( | $a_type | ) |
assClozeGap constructor
int | $a_type |
Definition at line 55 of file class.assClozeGap.php.
assClozeGap::clearItems | ( | ) |
Removes all gap items.
Removes all gap items
public
Definition at line 290 of file class.assClozeGap.php.
assClozeGap::deleteItem | ( | $order | ) |
Deletes an item at a given index.
Deletes an item at a given index
integer | $0order Order of the item public |
Definition at line 205 of file class.assClozeGap.php.
assClozeGap::getBestSolutionIndexes | ( | ) |
Returns the indexes of the best solutions for the gap.
Returns the indexes of the best solutions for the gap
Definition at line 381 of file class.assClozeGap.php.
assClozeGap::getBestSolutionOutput | ( | ) |
Definition at line 402 of file class.assClozeGap.php.
References $lng, CLOZE_NUMERIC, CLOZE_SELECT, CLOZE_TEXT, getItems(), and getType().
assClozeGap::getGapSize | ( | ) |
assClozeGap::getItem | ( | $a_index | ) |
Gets the item with a given index.
Gets the item with a given index
integer | $a_index | Item index public |
Definition at line 270 of file class.assClozeGap.php.
assClozeGap::getItemCount | ( | ) |
Gets the item count.
Gets the item count
Definition at line 132 of file class.assClozeGap.php.
assClozeGap::getItems | ( | ) |
Gets the items of a cloze gap.
Gets the items of a cloze gap
Reimplemented in assClozeSelectGap.
Definition at line 97 of file class.assClozeGap.php.
References $items, and arrayShuffle().
Referenced by getBestSolutionOutput().
assClozeGap::getItemsRaw | ( | ) |
Gets the items of a cloze gap.
Gets the items of a cloze gap
Definition at line 118 of file class.assClozeGap.php.
References $items.
assClozeGap::getMaxWidth | ( | ) |
Returns the maximum width of the gap.
Returns the maximum width of the gap
Definition at line 360 of file class.assClozeGap.php.
assClozeGap::getShuffle | ( | ) |
Gets the shuffle state of the items.
Reimplemented in assClozeSelectGap.
Definition at line 312 of file class.assClozeGap.php.
References $shuffle.
assClozeGap::getType | ( | ) |
Gets the cloze gap type.
Gets the cloze gap type
Definition at line 71 of file class.assClozeGap.php.
References $type.
Referenced by getBestSolutionOutput().
assClozeGap::setGapSize | ( | $gap_size | ) |
integer | $gap_size |
Definition at line 448 of file class.assClozeGap.php.
References $gap_size.
assClozeGap::setItemLowerBound | ( | $order, | |
$bound | |||
) |
Sets the lower bound for a given item.
Sets the lower bound for a given item
integer | $order | Order of the item |
double | $bound | Lower bounds of the item public |
Definition at line 229 of file class.assClozeGap.php.
assClozeGap::setItemPoints | ( | $order, | |
$points | |||
) |
Sets the points for a given item.
Sets the points for a given item
integer | $order | Order of the item |
double | $points | Points of the item public |
Definition at line 185 of file class.assClozeGap.php.
assClozeGap::setItemUpperBound | ( | $order, | |
$bound | |||
) |
Sets the upper bound for a given item.
Sets the upper bound for a given item
integer | $order | Order of the item |
double | $bound | Upper bound of the item public |
Definition at line 250 of file class.assClozeGap.php.
assClozeGap::setShuffle | ( | $a_shuffle = true | ) |
Sets the shuffle state of the items.
Sets the shuffle state of the items
boolean | $a_shuffle | Shuffle state |
Definition at line 302 of file class.assClozeGap.php.
assClozeGap::setType | ( | $a_type = 0 | ) |
Sets the cloze gap type.
integer | $a_type | cloze gap type |
Reimplemented in assClozeSelectGap.
Definition at line 83 of file class.assClozeGap.php.
|
private |
Definition at line 47 of file class.assClozeGap.php.
Referenced by getGapSize(), and setGapSize().
assClozeGap::$items |
Definition at line 38 of file class.assClozeGap.php.
Referenced by getItems(), assClozeSelectGap\getItems(), and getItemsRaw().
assClozeGap::$shuffle |
Definition at line 45 of file class.assClozeGap.php.
Referenced by getShuffle().
int assClozeGap::$type |
Type of gap.
An integer value indicating the type of the gap 0 == text gap, 1 == select gap, 2 == numeric gap
Definition at line 29 of file class.assClozeGap.php.
Referenced by getType().