ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 

Additional Inherited Members

- Public Member Functions inherited from ilTestExport
 __construct (&$a_test_obj, $a_mode="xml")
 Constructor. More...
 
 isResultExportingEnabledForTestExport ()
 
 setResultExportingEnabledForTestExport ($resultExprtingEnabledForTestExport)
 
 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 160 of file class.ilTestExportRandomQuestionSet.php.

References $ilDB.

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

161  {
162  if( !isset($this->stagingPoolQuestionListByPoolId[$poolId]) )
163  {
164  global $ilDB, $ilPluginAdmin;
165 
166  $questionList = new ilTestRandomQuestionSetStagingPoolQuestionList($ilDB, $ilPluginAdmin);
167  $questionList->setTestId($this->test_obj->getTestId());
168  $questionList->setPoolId($poolId);
169  $questionList->loadQuestions();
170 
171  $this->stagingPoolQuestionListByPoolId[$poolId] = $questionList;
172  }
173 
174  return $this->stagingPoolQuestionListByPoolId[$poolId];
175  }
global $ilDB
+ Here is the caller graph for this function:

◆ getQuestionIds()

ilTestExportRandomQuestionSet::getQuestionIds ( )
protected
Returns
array

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

References array, and getLoadedStagingPoolQuestionList().

Referenced by initXmlExport().

140  {
141  $questionIds = array();
142 
143  foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
144  {
145  $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
146 
147  foreach ($questionList as $questionId)
148  {
149  $questionIds[] = $questionId;
150  }
151  }
152 
153  return $questionIds;
154  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsQtiXml()

ilTestExportRandomQuestionSet::getQuestionsQtiXml ( )
protected

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

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

120  {
121  $questionQtiXml = '';
122 
123  foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
124  {
125  $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
126 
127  foreach ($questionList as $questionId)
128  {
129  $questionQtiXml .= $this->getQuestionQtiXml($questionId);
130  }
131  }
132 
133  return $questionQtiXml;
134  }
getQuestionQtiXml($questionId)
+ Here is the call graph for this function:

◆ initXmlExport()

ilTestExportRandomQuestionSet::initXmlExport ( )
protected

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

References $ilDB, array, and getQuestionIds().

25  {
26  global $ilDB, $ilPluginAdmin;
27 
28  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
30  $ilDB, $this->test_obj
31  );
32 
33  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
34  $this->srcPoolDefList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
35  $ilDB, $this->test_obj, $srcPoolDefFactory
36  );
37 
38  $this->srcPoolDefList->loadDefinitions();
39 
40 // fau: fixRandomTestExportPages - use the complete random question list
41 // ilObjTest::exportPagesXML() uses $this->questions
42 // ilObjTest::loadQuestions() loads only those of the current active_id of ilUser
43  $this->test_obj->questions = $this->getQuestionIds();
44 // fau.
45  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
46 
47  $this->stagingPoolQuestionListByPoolId = array();
48  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ populateCommonSettings()

ilTestExportRandomQuestionSet::populateCommonSettings ( ilXmlWriter  $xmlWriter)
protected

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

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

Referenced by populateQuestionSetConfigXml().

60  {
61  global $tree, $ilDB, $ilPluginAdmin;
62 
63  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
64  $questionSetConfig = new ilTestRandomQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->test_obj);
65  $questionSetConfig->loadFromDb();
66 
67  $xmlWriter->xmlElement('RandomQuestionSetSettings', array(
68  'amountMode' => $questionSetConfig->getQuestionAmountConfigurationMode(),
69  'questAmount' => $questionSetConfig->getQuestionAmountPerTest(),
70  'homogeneous' => $questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()
71  ));
72  }
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
Create styles array
The data for the language used.
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 50 of file class.ilTestExportRandomQuestionSet.php.

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

51  {
52  $xmlWriter->xmlStartTag('RandomQuestionSetConfig');
53  $this->populateCommonSettings($xmlWriter);
54  $this->populateQuestionStages($xmlWriter);
55  $this->populateSelectionDefinitions($xmlWriter);
56  $xmlWriter->xmlEndTag('RandomQuestionSetConfig');
57  }
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 74 of file class.ilTestExportRandomQuestionSet.php.

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

Referenced by populateQuestionSetConfigXml().

75  {
76  $xmlWriter->xmlStartTag('RandomQuestionStage');
77 
78  foreach($this->srcPoolDefList->getInvolvedSourcePoolIds() as $poolId)
79  {
80  $questionList = $this->getLoadedStagingPoolQuestionList($poolId);
81 
82  $xmlWriter->xmlStartTag('RandomQuestionStagingPool', array('poolId' => $poolId));
83  $xmlWriter->xmlData(implode(',', $questionList->getQuestions()));
84  $xmlWriter->xmlEndTag('RandomQuestionStagingPool');
85  }
86 
87  $xmlWriter->xmlEndTag('RandomQuestionStage');
88  }
xmlData($data, $encode=TRUE, $escape=TRUE)
Writes data.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
+ 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 90 of file class.ilTestExportRandomQuestionSet.php.

References array, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by populateQuestionSetConfigXml().

91  {
92  $xmlWriter->xmlStartTag('RandomQuestionSelectionDefinitions');
93 
94  foreach($this->srcPoolDefList as $definition)
95  {
96  $attributes = array(
97  'id' => $definition->getId(),
98  'poolId' => $definition->getPoolId(),
99  'poolQuestCount' => $definition->getPoolQuestionCount(),
100  'questAmount' => $definition->getQuestionAmount(),
101  'position' => $definition->getSequencePosition()
102  );
103 
104  if( $definition->getMappedFilterTaxId() && $definition->getMappedFilterTaxNodeId() )
105  {
106  $attributes['tax'] = $definition->getMappedFilterTaxId();
107  $attributes['taxNode'] = $definition->getMappedFilterTaxNodeId();
108  }
109 
110  $xmlWriter->xmlStartTag('RandomQuestionSelectionDefinition', $attributes);
111  $xmlWriter->xmlElement('RandomQuestionSourcePoolTitle', null, $definition->getPoolTitle());
112  $xmlWriter->xmlElement('RandomQuestionSourcePoolPath', null, $definition->getPoolPath());
113  $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinition', $attributes);
114  }
115 
116  $xmlWriter->xmlEndTag('RandomQuestionSelectionDefinitions');
117  }
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)
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
+ 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: