ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestRandomQuestionSetBuilderWithAmountPerTest Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetBuilderWithAmountPerTest:
+ Collaboration diagram for ilTestRandomQuestionSetBuilderWithAmountPerTest:

Public Member Functions

 checkBuildable ()
 
 performBuild (ilTestSession $testSession)
 
- Public Member Functions inherited from ilTestRandomQuestionSetBuilder
 checkBuildable ()
 
 performBuild (ilTestSession $testSession)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestRandomQuestionSetBuilder
static getInstance (ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
 
- Protected Member Functions inherited from ilTestRandomQuestionSetBuilder
 __construct (ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
 
 getQuestionStageForSourcePoolDefinition (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 storeQuestionSet (ilTestSession $testSession, $questionSet)
 
 fetchQuestionsFromStageRandomly (ilTestRandomQuestionSetQuestionCollection $questionStage, $requiredQuestionAmount)
 
 handleQuestionOrdering (ilTestRandomQuestionSetQuestionCollection $questionSet)
 
- Protected Attributes inherited from ilTestRandomQuestionSetBuilder
 $db = null
 
 $testOBJ = null
 
 $questionSetConfig = null
 
 $sourcePoolDefinitionList = null
 
 $stagingPoolQuestionList = null
 

Detailed Description

Member Function Documentation

◆ checkBuildable()

ilTestRandomQuestionSetBuilderWithAmountPerTest::checkBuildable ( )

Definition at line 14 of file class.ilTestRandomQuestionSetBuilderWithAmountPerTest.php.

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  }

◆ performBuild()

ilTestRandomQuestionSetBuilderWithAmountPerTest::performBuild ( ilTestSession  $testSession)

Definition at line 26 of file class.ilTestRandomQuestionSetBuilderWithAmountPerTest.php.

References ilTestRandomQuestionSetBuilder\fetchQuestionsFromStageRandomly(), ilTestRandomQuestionSetBuilder\handleQuestionOrdering(), and ilTestRandomQuestionSetBuilder\storeQuestionSet().

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  }
handleQuestionOrdering(ilTestRandomQuestionSetQuestionCollection $questionSet)
fetchQuestionsFromStageRandomly(ilTestRandomQuestionSetQuestionCollection $questionStage, $requiredQuestionAmount)
storeQuestionSet(ilTestSession $testSession, $questionSet)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: