4 require_once
'Modules/Test/classes/class.ilTestExport.php';
28 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
30 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
36 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
43 $this->srcPoolDefList->loadDefinitions();
50 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
52 $this->stagingPoolQuestionListByPoolId = array();
61 $xmlWriter->
xmlEndTag(
'RandomQuestionSetConfig');
69 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
71 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
73 $questionSetConfig->loadFromDb();
75 $xmlWriter->
xmlElement(
'RandomQuestionSetSettings', array(
76 'amountMode' => $questionSetConfig->getQuestionAmountConfigurationMode(),
77 'questAmount' => $questionSetConfig->getQuestionAmountPerTest(),
78 'homogeneous' => $questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(),
79 'synctimestamp' => $questionSetConfig->getLastQuestionSyncTimestamp()
87 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
90 $xmlWriter->
xmlStartTag(
'RandomQuestionStagingPool', array(
'poolId' => $poolId));
91 $xmlWriter->
xmlData(implode(
',', $questionList->getQuestions()));
92 $xmlWriter->
xmlEndTag(
'RandomQuestionStagingPool');
95 $xmlWriter->
xmlEndTag(
'RandomQuestionStage');
100 $xmlWriter->
xmlStartTag(
'RandomQuestionSelectionDefinitions');
102 foreach ($this->srcPoolDefList as $definition) {
104 'id' => $definition->getId(),
105 'ref_id' => $definition->getPoolRefId(),
106 'poolId' => $definition->getPoolId(),
107 'poolQuestCount' => $definition->getPoolQuestionCount(),
108 'questAmount' => $definition->getQuestionAmount(),
109 'position' => $definition->getSequencePosition()
113 $mappedTaxFilter = $definition->getMappedTaxonomyFilter();
114 if (is_array($mappedTaxFilter) && count($mappedTaxFilter) > 0) {
115 $attributes[
'taxFilter'] = serialize($mappedTaxFilter);
119 $xmlWriter->
xmlElement(
'RandomQuestionSourcePoolTitle', null, $definition->getPoolTitle());
120 $xmlWriter->
xmlElement(
'RandomQuestionSourcePoolPath', null, $definition->getPoolPath());
121 $xmlWriter->
xmlEndTag(
'RandomQuestionSelectionDefinition');
124 $xmlWriter->
xmlEndTag(
'RandomQuestionSelectionDefinitions');
129 $questionQtiXml =
'';
131 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
134 foreach ($questionList as $questionId) {
139 return $questionQtiXml;
147 $questionIds = array();
149 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
152 foreach ($questionList as $questionId) {
153 $questionIds[] = $questionId;
166 if (!isset($this->stagingPoolQuestionListByPoolId[$poolId])) {
168 $ilDB = $DIC[
'ilDB'];
169 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
172 $questionList->setTestId($this->test_obj->getTestId());
173 $questionList->setPoolId($poolId);
174 $questionList->loadQuestions();
176 $this->stagingPoolQuestionListByPoolId[$poolId] = $questionList;
179 return $this->stagingPoolQuestionListByPoolId[$poolId];
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
getLoadedStagingPoolQuestionList($poolId)
getQuestionQtiXml($questionId)
populateQuestionSetConfigXml(ilXmlWriter $xmlWriter)
xmlData($data, $encode=true, $escape=true)
Writes data.
xmlEndTag($tag)
Writes an endtag.
if(array_key_exists('yes', $_REQUEST)) $attributes
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
populateQuestionStages(ilXmlWriter $xmlWriter)
populateSelectionDefinitions(ilXmlWriter $xmlWriter)
$stagingPoolQuestionListByPoolId
populateCommonSettings(ilXmlWriter $xmlWriter)