37 'assImagemapQuestion',
44 'assOrderingQuestion',
45 'assOrderingHorizontal',
46 'assMatchingQuestion',
70 public function __construct($unOrderedTypes, $orderMode = self::ORDER_MODE_ALPHA)
72 self::$flippedQuestionTypeOrder = array_flip(self::$fixQuestionTypeOrder);
74 $this->types = $unOrderedTypes;
78 case self::ORDER_MODE_FIX:
80 uasort($this->types, array($this,
'fixQuestionTypeOrderSortCallback'));
83 case self::ORDER_MODE_ALPHA:
116 if( self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ] > self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ] )
120 elseif( !isset(self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ]) )
124 elseif( self::$flippedQuestionTypeOrder[ $a[
'type_tag'] ] < self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ] )
128 elseif( !isset(self::$flippedQuestionTypeOrder[ $b[
'type_tag'] ]) )
const ORDER_MODE_FIX
order mode with fixed priority for ordering
const ORDER_MODE_ALPHA
order mode that orders by alphanumerical priority
static $fixQuestionTypeOrder
__construct($unOrderedTypes, $orderMode=self::ORDER_MODE_ALPHA)
Constructor.
getOrderedTypes()
getter for ordered question types
static $flippedQuestionTypeOrder
fixQuestionTypeOrderSortCallback($a, $b)
custom sort callback for ordering the question types