4 require_once
'Modules/Test/classes/class.ilTestExport.php';
26 global
$ilDB, $ilPluginAdmin;
28 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
30 $ilDB, $this->test_obj
33 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
35 $ilDB, $this->test_obj, $srcPoolDefFactory
38 $this->srcPoolDefList->loadDefinitions();
45 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
47 $this->stagingPoolQuestionListByPoolId =
array();
56 $xmlWriter->
xmlEndTag(
'RandomQuestionSetConfig');
61 global $tree,
$ilDB, $ilPluginAdmin;
63 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
65 $questionSetConfig->loadFromDb();
68 'amountMode' => $questionSetConfig->getQuestionAmountConfigurationMode(),
69 'questAmount' => $questionSetConfig->getQuestionAmountPerTest(),
70 'homogeneous' => $questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()
78 foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
82 $xmlWriter->
xmlStartTag(
'RandomQuestionStagingPool',
array(
'poolId' => $poolId));
83 $xmlWriter->
xmlData(implode(
',', $questionList->getQuestions()));
84 $xmlWriter->
xmlEndTag(
'RandomQuestionStagingPool');
87 $xmlWriter->
xmlEndTag(
'RandomQuestionStage');
92 $xmlWriter->
xmlStartTag(
'RandomQuestionSelectionDefinitions');
94 foreach($this->srcPoolDefList as $definition)
97 'id' => $definition->getId(),
98 'poolId' => $definition->getPoolId(),
99 'poolQuestCount' => $definition->getPoolQuestionCount(),
100 'questAmount' => $definition->getQuestionAmount(),
101 'position' => $definition->getSequencePosition()
104 if( $definition->getMappedFilterTaxId() && $definition->getMappedFilterTaxNodeId() )
106 $attributes[
'tax'] = $definition->getMappedFilterTaxId();
107 $attributes[
'taxNode'] = $definition->getMappedFilterTaxNodeId();
110 $xmlWriter->
xmlStartTag(
'RandomQuestionSelectionDefinition', $attributes);
111 $xmlWriter->
xmlElement(
'RandomQuestionSourcePoolTitle', null, $definition->getPoolTitle());
112 $xmlWriter->
xmlElement(
'RandomQuestionSourcePoolPath', null, $definition->getPoolPath());
113 $xmlWriter->
xmlEndTag(
'RandomQuestionSelectionDefinition', $attributes);
116 $xmlWriter->
xmlEndTag(
'RandomQuestionSelectionDefinitions');
121 $questionQtiXml =
'';
123 foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
127 foreach ($questionList as $questionId)
133 return $questionQtiXml;
141 $questionIds =
array();
143 foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
147 foreach ($questionList as $questionId)
149 $questionIds[] = $questionId;
162 if( !isset($this->stagingPoolQuestionListByPoolId[$poolId]) )
164 global
$ilDB, $ilPluginAdmin;
167 $questionList->setTestId($this->test_obj->getTestId());
168 $questionList->setPoolId($poolId);
169 $questionList->loadQuestions();
171 $this->stagingPoolQuestionListByPoolId[$poolId] = $questionList;
174 return $this->stagingPoolQuestionListByPoolId[$poolId];
getLoadedStagingPoolQuestionList($poolId)
xmlData($data, $encode=TRUE, $escape=TRUE)
Writes data.
getQuestionQtiXml($questionId)
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
populateQuestionSetConfigXml(ilXmlWriter $xmlWriter)
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
populateQuestionStages(ilXmlWriter $xmlWriter)
populateSelectionDefinitions(ilXmlWriter $xmlWriter)
$stagingPoolQuestionListByPoolId
populateCommonSettings(ilXmlWriter $xmlWriter)