示例#1
0
 public function testCreateShufflingWithShuffleFalse()
 {
     $choiceCollection = new SimpleChoiceCollection();
     $choiceCollection[] = new SimpleChoice('id1');
     $choiceCollection[] = new SimpleChoice('id2');
     $choiceCollection[] = new SimpleChoice('id3');
     $choiceInteraction = new ChoiceInteraction('RESPONSE', $choiceCollection);
     $choiceInteraction->setShuffle(false);
     $shuffling = StateUtils::createShufflingFromInteraction($choiceInteraction);
     $this->assertFalse($shuffling);
 }
示例#2
0
 /**
  * @see \qtism\data\IAssessmentItem::getShufflings()
  */
 public function getShufflings()
 {
     $classNames = array('choiceInteraction', 'orderInteraction', 'associateInteraction', 'matchInteraction', 'gapMatchInteraction', 'inlineChoiceInteraction');
     $shufflings = new ShufflingCollection();
     foreach ($this->getComponentsByClassName($classNames) as $interaction) {
         $shuffling = StateUtils::createShufflingFromInteraction($interaction);
         if ($shuffling !== false) {
             $shufflings[] = $shuffling;
         }
     }
     return $shufflings;
 }