ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestExportRandomQuestionSet Class Reference
+ Inheritance diagram for ilTestExportRandomQuestionSet:
+ Collaboration diagram for ilTestExportRandomQuestionSet:

Protected Member Functions

 initXmlExport ()
 
 populateQuestionSetConfigXml (ilXmlWriter $xmlWriter)
 
 populateCommonSettings (ilXmlWriter $xmlWriter)
 
 populateQuestionStages (ilXmlWriter $xmlWriter)
 
 populateSelectionDefinitions (ilXmlWriter $xmlWriter)
 
 getQuestionsQtiXml ()
 
 getQuestionIds ()
 
 getLoadedStagingPoolQuestionList ($poolId)
 
- Protected Member Functions inherited from ilTestExport
 aggregatedResultsToExcel ($deliver=true)
 Exports the aggregated results to the Microsoft Excel file format. More...
 
 aggregatedResultsToCSV ($deliver=true)
 Exports the aggregated results to CSV. More...
 
 initXmlExport ()
 
 getQuestionIds ()
 
 populateQuestionSetConfigXml (ilXmlWriter $xmlWriter)
 
 getQtiXml ()
 
 getQuestionsQtiXml ()
 
 getQuestionQtiXml ($questionId)
 
 populateQuestionSkillAssignmentsXml (ilXmlWriter $a_xml_writer, ilAssQuestionSkillAssignmentList $assignmentList, $questions)
 
 populateSkillLevelThresholdsXml (ilXmlWriter $a_xml_writer, ilAssQuestionSkillAssignmentList $assignmentList)
 
 buildQuestionSkillAssignmentList ()
 

Protected Attributes

 $srcPoolDefList
 
 $stagingPoolQuestionListByPoolId
 
- Protected Attributes inherited from ilTestExport
 $resultExportingEnabledForTestExport = false
 
 $forcedAccessFilteredParticipantList = null
 

Additional Inherited Members

- Public Member Functions inherited from ilTestExport
 __construct (&$a_test_obj, $a_mode="xml")
 Constructor. More...
 
 isResultExportingEnabledForTestExport ()
 
 setResultExportingEnabledForTestExport ($resultExprtingEnabledForTestExport)
 
 getForcedAccessFilteredParticipantList ()
 
 setForcedAccessFilteredParticipantList (ilTestParticipantList $forcedAccessFilteredParticipantList)
 
 getAccessFilteredParticipantList ()
 
 getExtension ()
 
 getInstId ()
 
 buildExportFile ()
 build export file (complete zip file) More...
 
 buildExportResultFile ()
 build xml export file More...
 
 exportToExcel ($deliver=true, $filterby="", $filtertext="", $passedonly=false)
 Exports the evaluation data to the Microsoft Excel file format. More...
 
 exportToCSV ($deliver=true, $filterby="", $filtertext="", $passedonly=false)
 Exports the evaluation data to the CSV file format. More...
 
 buildExportFileXML ()
 build xml export file More...
 
 exportXHTMLMediaObjects ($a_export_dir)
 
- Data Fields inherited from ilTestExport
 $err
 
 $db
 
 $ilias
 
 $test_obj
 
 $inst_id
 
 $mode
 

Detailed Description

Definition at line 12 of file class.ilTestExportRandomQuestionSet.php.

Member Function Documentation

◆ getLoadedStagingPoolQuestionList()

ilTestExportRandomQuestionSet::getLoadedStagingPoolQuestionList (   $poolId)
protected
Parameters
$poolId
Returns
ilTestRandomQuestionSetStagingPoolQuestionList

Definition at line 164 of file class.ilTestExportRandomQuestionSet.php.

165 {
166 if (!isset($this->stagingPoolQuestionListByPoolId[$poolId])) {
167 global $DIC;
168 $ilDB = $DIC['ilDB'];
169 $ilPluginAdmin = $DIC['ilPluginAdmin'];
170
171 $questionList = new ilTestRandomQuestionSetStagingPoolQuestionList($ilDB, $ilPluginAdmin);
172 $questionList->setTestId($this->test_obj->getTestId());
173 $questionList->setPoolId($poolId);
174 $questionList->loadQuestions();
175
176 $this->stagingPoolQuestionListByPoolId[$poolId] = $questionList;
177 }
178
179 return $this->stagingPoolQuestionListByPoolId[$poolId];
180 }
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, and $ilDB.

Referenced by getQuestionIds(), getQuestionsQtiXml(), and populateQuestionStages().

+ Here is the caller graph for this function:

◆ getQuestionIds()

ilTestExportRandomQuestionSet::getQuestionIds ( )
protected
Returns
array

Reimplemented from ilTestExport.

Definition at line 145 of file class.ilTestExportRandomQuestionSet.php.

146 {
147 $questionIds = array();
148
149 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
150 $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
151
152 foreach ($questionList as $questionId) {
153 $questionIds[] = $questionId;
154 }
155 }
156
157 return $questionIds;
158 }

References getLoadedStagingPoolQuestionList().

Referenced by initXmlExport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsQtiXml()

ilTestExportRandomQuestionSet::getQuestionsQtiXml ( )
protected

Reimplemented from ilTestExport.

Definition at line 127 of file class.ilTestExportRandomQuestionSet.php.

128 {
129 $questionQtiXml = '';
130
131 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
132 $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
133
134 foreach ($questionList as $questionId) {
135 $questionQtiXml .= $this->getQuestionQtiXml($questionId);
136 }
137 }
138
139 return $questionQtiXml;
140 }
getQuestionQtiXml($questionId)

References getLoadedStagingPoolQuestionList(), and ilTestExport\getQuestionQtiXml().

+ Here is the call graph for this function:

◆ initXmlExport()

ilTestExportRandomQuestionSet::initXmlExport ( )
protected

Reimplemented from ilTestExport.

Definition at line 24 of file class.ilTestExportRandomQuestionSet.php.

25 {
26 global $DIC;
27 $ilDB = $DIC['ilDB'];
28 $ilPluginAdmin = $DIC['ilPluginAdmin'];
29
30 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
32 $ilDB,
33 $this->test_obj
34 );
35
36 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
37 $this->srcPoolDefList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
38 $ilDB,
39 $this->test_obj,
40 $srcPoolDefFactory
41 );
42
43 $this->srcPoolDefList->loadDefinitions();
44
45 // fau: fixRandomTestExportPages - use the complete random question list
46 // ilObjTest::exportPagesXML() uses $this->questions
47 // ilObjTest::loadQuestions() loads only those of the current active_id of ilUser
48 $this->test_obj->questions = $this->getQuestionIds();
49 // fau.
50 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
51
52 $this->stagingPoolQuestionListByPoolId = array();
53 }

References $DIC, $ilDB, and getQuestionIds().

+ Here is the call graph for this function:

◆ populateCommonSettings()

ilTestExportRandomQuestionSet::populateCommonSettings ( ilXmlWriter  $xmlWriter)
protected

Definition at line 64 of file class.ilTestExportRandomQuestionSet.php.

65 {
66 global $DIC;
67 $tree = $DIC['tree'];
68 $ilDB = $DIC['ilDB'];
69 $ilPluginAdmin = $DIC['ilPluginAdmin'];
70
71 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
72 $questionSetConfig = new ilTestRandomQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->test_obj);
73 $questionSetConfig->loadFromDb();
74
75 $xmlWriter->xmlElement('RandomQuestionSetSettings', array(
76 'amountMode' => $questionSetConfig->getQuestionAmountConfigurationMode(),
77 'questAmount' => $questionSetConfig->getQuestionAmountPerTest(),
78 'homogeneous' => $questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(),
79 'synctimestamp' => $questionSetConfig->getLastQuestionSyncTimestamp()
80 ));
81 }
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

References $DIC, $ilDB, $tree, and ilXmlWriter\xmlElement().

Referenced by populateQuestionSetConfigXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateQuestionSetConfigXml()

ilTestExportRandomQuestionSet::populateQuestionSetConfigXml ( ilXmlWriter  $xmlWriter)
protected

Reimplemented from ilTestExport.

Definition at line 55 of file class.ilTestExportRandomQuestionSet.php.

56 {
57 $xmlWriter->xmlStartTag('RandomQuestionSetConfig');
58 $this->populateCommonSettings($xmlWriter);
59 $this->populateQuestionStages($xmlWriter);
60 $this->populateSelectionDefinitions($xmlWriter);
61 $xmlWriter->xmlEndTag('RandomQuestionSetConfig');
62 }
xmlEndTag($tag)
Writes an endtag.
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.

References populateCommonSettings(), populateQuestionStages(), populateSelectionDefinitions(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ populateQuestionStages()

ilTestExportRandomQuestionSet::populateQuestionStages ( ilXmlWriter  $xmlWriter)
protected

Definition at line 83 of file class.ilTestExportRandomQuestionSet.php.

84 {
85 $xmlWriter->xmlStartTag('RandomQuestionStage');
86
87 foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
88 $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
89
90 $xmlWriter->xmlStartTag('RandomQuestionStagingPool', array('poolId' => $poolId));
91 $xmlWriter->xmlData(implode(',', $questionList->getQuestions()));
92 $xmlWriter->xmlEndTag('RandomQuestionStagingPool');
93 }
94
95 $xmlWriter->xmlEndTag('RandomQuestionStage');
96 }
xmlData($data, $encode=true, $escape=true)
Writes data.

References getLoadedStagingPoolQuestionList(), ilXmlWriter\xmlData(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by populateQuestionSetConfigXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSelectionDefinitions()

ilTestExportRandomQuestionSet::populateSelectionDefinitions ( ilXmlWriter  $xmlWriter)
protected

Definition at line 98 of file class.ilTestExportRandomQuestionSet.php.

99 {
100 $xmlWriter->xmlStartTag('RandomQuestionSelectionDefinitions');
101
102 foreach ($this->srcPoolDefList as $definition) {
103 $attributes = array(
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()
110 );
111
112 // #21330
113 $mappedTaxFilter = $definition->getMappedTaxonomyFilter();
114 if (is_array($mappedTaxFilter) && count($mappedTaxFilter) > 0) {
115 $attributes['taxFilter'] = serialize($mappedTaxFilter);
116 }
117
118 $xmlWriter->xmlStartTag('RandomQuestionSelectionDefinition', $attributes);
119 $xmlWriter->xmlElement('RandomQuestionSourcePoolTitle', null, $definition->getPoolTitle());
120 $xmlWriter->xmlElement('RandomQuestionSourcePoolPath', null, $definition->getPoolPath());
121 $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinition');
122 }
123
124 $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinitions');
125 }
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85

References $attributes, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by populateQuestionSetConfigXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $srcPoolDefList

ilTestExportRandomQuestionSet::$srcPoolDefList
protected

Definition at line 17 of file class.ilTestExportRandomQuestionSet.php.

◆ $stagingPoolQuestionListByPoolId

ilTestExportRandomQuestionSet::$stagingPoolQuestionListByPoolId
protected

Definition at line 22 of file class.ilTestExportRandomQuestionSet.php.


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