ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestRandomQuestionSetBuilderWithAmountPerTest.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 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
5 
13 {
14  public function checkBuildable()
15  {
16  $questionStage = $this->getQuestionStageForSourcePoolDefinitionList($this->sourcePoolDefinitionList);
17 
18  if( $questionStage->isSmallerThan($this->questionSetConfig->getQuestionAmountPerTest()) )
19  {
20  return false;
21  }
22 
23  return true;
24  }
25 
26  public function performBuild(ilTestSession $testSession)
27  {
28  $questionStage = $this->getQuestionStageForSourcePoolDefinitionList($this->sourcePoolDefinitionList);
29 
30  $questionSet = $this->fetchQuestionsFromStageRandomly(
31  $questionStage, $this->questionSetConfig->getQuestionAmountPerTest()
32  );
33 
34  $this->handleQuestionOrdering($questionSet);
35 
36  $this->storeQuestionSet($testSession, $questionSet);
37  }
38 }