ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 orderQuestions (array $questions)
 
 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 165 of file class.ilTestExportRandomQuestionSet.php.

References $DIC, and $ilDB.

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

166  {
167  if (!isset($this->stagingPoolQuestionListByPoolId[$poolId])) {
168  global $DIC;
169  $ilDB = $DIC['ilDB'];
170  $ilPluginAdmin = $DIC['ilPluginAdmin'];
171 
172  $questionList = new ilTestRandomQuestionSetStagingPoolQuestionList($ilDB, $ilPluginAdmin);
173  $questionList->setTestId($this->test_obj->getTestId());
174  $questionList->setPoolId($poolId);
175  $questionList->loadQuestions();
176 
177  $this->stagingPoolQuestionListByPoolId[$poolId] = $questionList;
178  }
179 
180  return $this->stagingPoolQuestionListByPoolId[$poolId];
181  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ getQuestionIds()

ilTestExportRandomQuestionSet::getQuestionIds ( )
protected
Returns
array

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

References getLoadedStagingPoolQuestionList().

Referenced by initXmlExport().

147  {
148  $questionIds = array();
149 
150  foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
151  $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
152 
153  foreach ($questionList as $questionId) {
154  $questionIds[] = $questionId;
155  }
156  }
157 
158  return $questionIds;
159  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsQtiXml()

ilTestExportRandomQuestionSet::getQuestionsQtiXml ( )
protected

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

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

129  {
130  $questionQtiXml = '';
131 
132  foreach ($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId) {
133  $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
134 
135  foreach ($questionList as $questionId) {
136  $questionQtiXml .= $this->getQuestionQtiXml($questionId);
137  }
138  }
139 
140  return $questionQtiXml;
141  }
getQuestionQtiXml($questionId)
+ Here is the call graph for this function:

◆ initXmlExport()

ilTestExportRandomQuestionSet::initXmlExport ( )
protected

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

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

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  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:

◆ populateCommonSettings()

ilTestExportRandomQuestionSet::populateCommonSettings ( ilXmlWriter  $xmlWriter)
protected

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

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

Referenced by populateQuestionSetConfigXml().

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  }
global $DIC
Definition: goto.php:24
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateQuestionSetConfigXml()

ilTestExportRandomQuestionSet::populateQuestionSetConfigXml ( ilXmlWriter  $xmlWriter)
protected

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

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

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

◆ populateQuestionStages()

ilTestExportRandomQuestionSet::populateQuestionStages ( ilXmlWriter  $xmlWriter)
protected

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

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

Referenced by populateQuestionSetConfigXml().

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  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlData($data, $encode=true, $escape=true)
Writes data.
xmlEndTag($tag)
Writes an endtag.
+ 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.

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

Referenced by populateQuestionSetConfigXml().

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  'typeFilter' => implode(',', $definition->getTypeFilterAsTypeTags()),
111  );
112 
113  // #21330
114  $mappedTaxFilter = $definition->getMappedTaxonomyFilter();
115  if (is_array($mappedTaxFilter) && count($mappedTaxFilter) > 0) {
116  $attributes['taxFilter'] = serialize($mappedTaxFilter);
117  }
118 
119  $xmlWriter->xmlStartTag('RandomQuestionSelectionDefinition', $attributes);
120  $xmlWriter->xmlElement('RandomQuestionSourcePoolTitle', null, $definition->getPoolTitle());
121  $xmlWriter->xmlElement('RandomQuestionSourcePoolPath', null, $definition->getPoolPath());
122  $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinition');
123  }
124 
125  $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinitions');
126  }
$attributes
Definition: metadata.php:231
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ 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: