◆ __construct()
ilAssQuestionTypeOrderer::__construct |
( |
|
$unOrderedTypes, |
|
|
|
$orderMode = self::ORDER_MODE_ALPHA |
|
) |
| |
Constructor.
- Parameters
-
array | $unOrderedTypes | |
string | $orderMode | |
- Exceptions
-
Definition at line 77 of file class.ilAssQuestionTypeOrderer.php.
79 self::$flippedQuestionTypeOrder = array_flip(self::$fixQuestionTypeOrder);
81 $this->types = $unOrderedTypes;
84 case self::ORDER_MODE_FIX:
86 uasort($this->types, array($this,
'fixQuestionTypeOrderSortCallback'));
89 case self::ORDER_MODE_ALPHA:
◆ fixQuestionTypeOrderSortCallback()
ilAssQuestionTypeOrderer::fixQuestionTypeOrderSortCallback |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
custom sort callback for ordering the question types
public
- Parameters
-
- Returns
- integer
Definition at line 134 of file class.ilAssQuestionTypeOrderer.php.
136 if (self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ] > self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ]) {
138 } elseif (!isset(self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ])) {
140 } elseif (self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ] < self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ]) {
142 } elseif (!isset(self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ])) {
◆ getOrderedTypes()
ilAssQuestionTypeOrderer::getOrderedTypes |
( |
|
$withDeprecatedTypes = true | ) |
|
getter for ordered question types
- Returns
- array $orderedQuestionTypes
Definition at line 107 of file class.ilAssQuestionTypeOrderer.php.
109 if ($withDeprecatedTypes) {
115 foreach ($this->types as $translation => $typeData) {
116 if (in_array($typeData[
'type_tag'], $this->deprecatedTypes)) {
120 $types[$translation] = $typeData;
◆ $deprecatedTypes
ilAssQuestionTypeOrderer::$deprecatedTypes |
|
protected |
◆ $fixQuestionTypeOrder
ilAssQuestionTypeOrderer::$fixQuestionTypeOrder |
|
static |
Initial value:= array(
'assSingleChoice',
'assMultipleChoice',
'assKprimChoice',
'assErrorText',
'assImagemapQuestion',
'assClozeTest',
'assNumeric',
'assFormulaQuestion',
'assTextSubset',
'assOrderingQuestion',
'assOrderingHorizontal',
'assMatchingQuestion',
'assTextQuestion',
'assFileUpload',
'assLongMenu',
'assFlashQuestion',
'assJavaApplet',
)
Definition at line 31 of file class.ilAssQuestionTypeOrderer.php.
◆ $flippedQuestionTypeOrder
ilAssQuestionTypeOrderer::$flippedQuestionTypeOrder = null |
|
static |
◆ ORDER_MODE_ALPHA
const ilAssQuestionTypeOrderer::ORDER_MODE_ALPHA = 'alpha' |
◆ ORDER_MODE_FIX
const ilAssQuestionTypeOrderer::ORDER_MODE_FIX = 'fix' |
The documentation for this class was generated from the following file: