ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestDynamicQuestionSet Class Reference
+ Collaboration diagram for ilTestDynamicQuestionSet:

Public Member Functions

 __construct (ilDB $db, ilLanguage $lng, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 Constructor.
 load (ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, ilTestDynamicQuestionSetFilterSelection $filterSelection)
 getActualQuestionSequence ()
 questionExists ($questionId)
 getQuestionData ($questionId)
 getAllQuestionsData ()
 getCompleteQuestionList ()
 getFilteredQuestionList ()

Private Member Functions

 initCompleteQuestionList (ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, $answerStatusActiveId)
 initFilteredQuestionList (ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, ilTestDynamicQuestionSetFilterSelection $filterSelection)
 initActualQuestionSequence (ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, ilAssQuestionList $questionList)
 getQuestionSequenceStructuredByTaxonomy (ilAssQuestionList $questionList, $orderingTaxId)
 getQuestionSequenceStructuredByUpdateDate (ilAssQuestionList $questionList)

Private Attributes

 $db = null
 $lng = null
 $pluginAdmin = null
 $testOBJ = null
 $completeQuestionList = null
 $filteredQuestionList = null
 $actualQuestionSequence = array()

Detailed Description

Definition at line 15 of file class.ilTestDynamicQuestionSet.php.

Constructor & Destructor Documentation

ilTestDynamicQuestionSet::__construct ( ilDB  $db,
ilLanguage  $lng,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)

Constructor.

Parameters
ilObjTest$testOBJ

Definition at line 57 of file class.ilTestDynamicQuestionSet.php.

References $db, $lng, $pluginAdmin, and $testOBJ.

{
$this->db = $db;
$this->lng = $lng;
$this->pluginAdmin = $pluginAdmin;
$this->testOBJ = $testOBJ;
}

Member Function Documentation

ilTestDynamicQuestionSet::getActualQuestionSequence ( )
ilTestDynamicQuestionSet::getAllQuestionsData ( )

Definition at line 221 of file class.ilTestDynamicQuestionSet.php.

{
return $this->completeQuestionList->getQuestionDataArray();
}
ilTestDynamicQuestionSet::getCompleteQuestionList ( )

Definition at line 228 of file class.ilTestDynamicQuestionSet.php.

References $completeQuestionList.

ilTestDynamicQuestionSet::getFilteredQuestionList ( )

Definition at line 233 of file class.ilTestDynamicQuestionSet.php.

References $filteredQuestionList.

ilTestDynamicQuestionSet::getQuestionData (   $questionId)

Definition at line 215 of file class.ilTestDynamicQuestionSet.php.

{
$questionData = $this->completeQuestionList->getQuestionDataArray();
return $questionData[$questionId];
}
ilTestDynamicQuestionSet::getQuestionSequenceStructuredByTaxonomy ( ilAssQuestionList  $questionList,
  $orderingTaxId 
)
private

Definition at line 151 of file class.ilTestDynamicQuestionSet.php.

References ilAssQuestionList\getQuestionDataArray().

Referenced by initActualQuestionSequence().

{
$questionsByNode = array();
$nodelessQuestions = array();
foreach($questionList->getQuestionDataArray() as $qId => $qData)
{
if( isset($qData['taxonomies'][$orderingTaxId]) && count($qData['taxonomies'][$orderingTaxId]) )
{
foreach($qData['taxonomies'][$orderingTaxId] as $nodeId => $itemData)
{
$questionsByNode[ $itemData['node_lft'] ][ $itemData['order_nr'] ] = $qId;
break;
}
}
else
{
$nodelessQuestions[$qData['tstamp'].'::'.$qId] = $qId;
}
}
foreach($questionsByNode as $nodeLft => $questions)
{
ksort($questions, SORT_NUMERIC);
$questionsByNode[$nodeLft] = array_values($questions);
}
ksort($questionsByNode, SORT_NUMERIC);
$sequence = array_values($questionsByNode);
ksort($nodelessQuestions);
$sequence[] = array_values($nodelessQuestions);
return $sequence;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestDynamicQuestionSet::getQuestionSequenceStructuredByUpdateDate ( ilAssQuestionList  $questionList)
private

Definition at line 187 of file class.ilTestDynamicQuestionSet.php.

References ilAssQuestionList\getQuestionDataArray().

Referenced by initActualQuestionSequence().

{
$sequence = array();
foreach($questionList->getQuestionDataArray() as $qId => $qData)
{
$sequence[ $qData['tstamp'].'::'.$qId ] = $qId;
}
ksort($sequence);
$sequence = array_values($sequence);
return array($sequence);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestDynamicQuestionSet::initActualQuestionSequence ( ilObjTestDynamicQuestionSetConfig  $dynamicQuestionSetConfig,
ilAssQuestionList  $questionList 
)
private

Definition at line 137 of file class.ilTestDynamicQuestionSet.php.

References ilObjTestDynamicQuestionSetConfig\getOrderingTaxonomyId(), getQuestionSequenceStructuredByTaxonomy(), and getQuestionSequenceStructuredByUpdateDate().

Referenced by load().

{
if( $dynamicQuestionSetConfig->getOrderingTaxonomyId() )
{
$questionList, $dynamicQuestionSetConfig->getOrderingTaxonomyId()
);
}
return $this->getQuestionSequenceStructuredByUpdateDate($questionList);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestDynamicQuestionSet::initCompleteQuestionList ( ilObjTestDynamicQuestionSetConfig  $dynamicQuestionSetConfig,
  $answerStatusActiveId 
)
private

Definition at line 84 of file class.ilTestDynamicQuestionSet.php.

References ilObjTestDynamicQuestionSetConfig\getSourceQuestionPoolId(), and ilAssQuestionList\setAnswerStatusActiveId().

Referenced by load().

{
$questionList = new ilAssQuestionList(
$this->db, $this->lng, $this->pluginAdmin, $dynamicQuestionSetConfig->getSourceQuestionPoolId()
);
$questionList->setAnswerStatusActiveId($answerStatusActiveId);
$questionList->load();
return $questionList;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestDynamicQuestionSet::initFilteredQuestionList ( ilObjTestDynamicQuestionSetConfig  $dynamicQuestionSetConfig,
ilTestDynamicQuestionSetFilterSelection  $filterSelection 
)
private

Definition at line 97 of file class.ilTestDynamicQuestionSet.php.

References ilTestDynamicQuestionSetFilterSelection\getAnswerStatusActiveId(), ilTestDynamicQuestionSetFilterSelection\getAnswerStatusSelection(), ilTestDynamicQuestionSetFilterSelection\getForcedQuestionIds(), ilObjTestDynamicQuestionSetConfig\getOrderingTaxonomyId(), ilObjTestDynamicQuestionSetConfig\getSourceQuestionPoolId(), ilTestDynamicQuestionSetFilterSelection\getTaxonomySelection(), ilObjTaxonomy\getUsageOfObject(), ilObjTestDynamicQuestionSetConfig\isAnswerStatusFilterEnabled(), ilObjTestDynamicQuestionSetConfig\isTaxonomyFilterEnabled(), and ilAssQuestionList\setAnswerStatusActiveId().

Referenced by load().

{
$questionList = new ilAssQuestionList(
$this->db, $this->lng, $this->pluginAdmin, $dynamicQuestionSetConfig->getSourceQuestionPoolId()
);
$questionList->setAnswerStatusActiveId($filterSelection->getAnswerStatusActiveId());
if( $dynamicQuestionSetConfig->isAnswerStatusFilterEnabled() )
{
$questionList->setAnswerStatusFilter($filterSelection->getAnswerStatusSelection());
}
if( $dynamicQuestionSetConfig->isTaxonomyFilterEnabled() )
{
require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
$questionList->setAvailableTaxonomyIds( ilObjTaxonomy::getUsageOfObject(
$dynamicQuestionSetConfig->getSourceQuestionPoolId()
));
foreach($filterSelection->getTaxonomySelection() as $taxId => $taxNodes)
{
$questionList->addTaxonomyFilter($taxId, $taxNodes);
}
}
elseif( $dynamicQuestionSetConfig->getOrderingTaxonomyId() )
{
$questionList->setAvailableTaxonomyIds( array(
$dynamicQuestionSetConfig->getOrderingTaxonomyId()
));
}
$questionList->setForcedQuestionIds($filterSelection->getForcedQuestionIds());
$questionList->load();
return $questionList;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestDynamicQuestionSet::load ( ilObjTestDynamicQuestionSetConfig  $dynamicQuestionSetConfig,
ilTestDynamicQuestionSetFilterSelection  $filterSelection 
)

Definition at line 67 of file class.ilTestDynamicQuestionSet.php.

References ilTestDynamicQuestionSetFilterSelection\getAnswerStatusActiveId(), initActualQuestionSequence(), initCompleteQuestionList(), and initFilteredQuestionList().

{
$this->completeQuestionList = $this->initCompleteQuestionList(
$dynamicQuestionSetConfig, $filterSelection->getAnswerStatusActiveId()
);
$this->filteredQuestionList = $this->initFilteredQuestionList(
$dynamicQuestionSetConfig, $filterSelection
);
$this->actualQuestionSequence = $this->initActualQuestionSequence(
$dynamicQuestionSetConfig, $this->filteredQuestionList
);
}

+ Here is the call graph for this function:

ilTestDynamicQuestionSet::questionExists (   $questionId)

Definition at line 209 of file class.ilTestDynamicQuestionSet.php.

{
$questionData = $this->completeQuestionList->getQuestionDataArray();
return isset($questionData[$questionId]);
}

Field Documentation

ilTestDynamicQuestionSet::$actualQuestionSequence = array()
private

Definition at line 50 of file class.ilTestDynamicQuestionSet.php.

Referenced by getActualQuestionSequence().

ilTestDynamicQuestionSet::$completeQuestionList = null
private

Definition at line 40 of file class.ilTestDynamicQuestionSet.php.

Referenced by getCompleteQuestionList().

ilTestDynamicQuestionSet::$db = null
private

Definition at line 20 of file class.ilTestDynamicQuestionSet.php.

Referenced by __construct().

ilTestDynamicQuestionSet::$filteredQuestionList = null
private

Definition at line 45 of file class.ilTestDynamicQuestionSet.php.

Referenced by getFilteredQuestionList().

ilTestDynamicQuestionSet::$lng = null
private

Definition at line 25 of file class.ilTestDynamicQuestionSet.php.

Referenced by __construct().

ilTestDynamicQuestionSet::$pluginAdmin = null
private

Definition at line 30 of file class.ilTestDynamicQuestionSet.php.

Referenced by __construct().

ilTestDynamicQuestionSet::$testOBJ = null
private

Definition at line 35 of file class.ilTestDynamicQuestionSet.php.

Referenced by __construct().


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