ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssQuestionSkillAssignmentExporter Class Reference
+ Collaboration diagram for ilAssQuestionSkillAssignmentExporter:

Public Member Functions

 __construct ()
 ilAssQuestionSkillAssignmentExporter constructor. More...
 
 getXmlWriter ()
 
 setXmlWriter (ilXmlWriter $xmlWriter)
 
 getQuestionIds ()
 
 setQuestionIds ($questionIds)
 
 getAssignmentList ()
 
 setAssignmentList ($assignmentList)
 
 export ()
 

Protected Attributes

 $xmlWriter
 
 $questionIds
 
 $assignmentList
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionSkillAssignmentExporter::__construct ( )

ilAssQuestionSkillAssignmentExporter constructor.

Definition at line 30 of file class.ilAssQuestionSkillAssignmentExporter.php.

References array.

31  {
32  $this->xmlWriter = null;
33  $this->questionIds = array();
34  $this->assignmentList = null;
35  }
Create styles array
The data for the language used.

Member Function Documentation

◆ export()

ilAssQuestionSkillAssignmentExporter::export ( )

Definition at line 85 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $ilDB, array, ilAssQuestionSkillAssignment\EVAL_MODE_BY_QUESTION_RESULT, ilAssQuestionSkillAssignment\EVAL_MODE_BY_QUESTION_SOLUTION, getAssignmentList(), getQuestionIds(), and getXmlWriter().

86  {
87  global $ilDB;
88 
89  $this->getXmlWriter()->xmlStartTag('QuestionSkillAssignments');
90 
91  foreach ($this->getQuestionIds() as $questionId) {
92  $this->getXmlWriter()->xmlStartTag('TriggerQuestion', array('Id' => $questionId));
93 
94  foreach ($this->getAssignmentList()->getAssignmentsByQuestionId($questionId) as $questionSkillAssignment) {
95  /* @var ilAssQuestionSkillAssignment $questionSkillAssignment */
96 
97  $this->getXmlWriter()->xmlStartTag('TriggeredSkill', array(
98  'BaseId' => $questionSkillAssignment->getSkillBaseId(),
99  'TrefId' => $questionSkillAssignment->getSkillTrefId()
100  ));
101 
102  $this->getXmlWriter()->xmlElement(
103  'OriginalSkillTitle',
104  null,
105  $questionSkillAssignment->getSkillTitle()
106  );
107 
108  $this->getXmlWriter()->xmlElement(
109  'OriginalSkillPath',
110  null,
111  $questionSkillAssignment->getSkillPath()
112  );
113 
114  switch ($questionSkillAssignment->getEvalMode()) {
116 
117  $this->getXmlWriter()->xmlElement('EvalByQuestionResult', array(
118  'Points' => $questionSkillAssignment->getSkillPoints()
119  ));
120  break;
121 
123 
124  $this->getXmlWriter()->xmlStartTag('EvalByQuestionSolution');
125 
126  $questionSkillAssignment->initSolutionComparisonExpressionList();
127  $expressionList = $questionSkillAssignment->getSolutionComparisonExpressionList();
128 
129  foreach ($expressionList->get() as $expression) {
130  /* @var ilAssQuestionSolutionComparisonExpression $expression */
131 
132  $this->getXmlWriter()->xmlStartTag('SolutionComparisonExpression', array(
133  'Points' => $expression->getPoints(),
134  'Index' => $expression->getOrderIndex()
135  ));
136 
137  $this->getXmlWriter()->xmlData($expression->getExpression(), false, true);
138 
139  $this->getXmlWriter()->xmlEndTag('SolutionComparisonExpression');
140  }
141 
142  $this->getXmlWriter()->xmlEndTag('EvalByQuestionSolution');
143  break;
144  }
145 
146  $this->getXmlWriter()->xmlEndTag('TriggeredSkill');
147  }
148 
149  $this->getXmlWriter()->xmlEndTag('TriggerQuestion');
150  }
151 
152  $this->getXmlWriter()->xmlEndTag('QuestionSkillAssignments');
153  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getAssignmentList()

ilAssQuestionSkillAssignmentExporter::getAssignmentList ( )
Returns
ilAssQuestionSkillAssignmentList

Definition at line 72 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $assignmentList.

Referenced by export().

+ Here is the caller graph for this function:

◆ getQuestionIds()

ilAssQuestionSkillAssignmentExporter::getQuestionIds ( )
Returns
array

Definition at line 56 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $questionIds.

Referenced by export().

+ Here is the caller graph for this function:

◆ getXmlWriter()

ilAssQuestionSkillAssignmentExporter::getXmlWriter ( )
Returns
ilXmlWriter

Definition at line 40 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $xmlWriter.

Referenced by export().

+ Here is the caller graph for this function:

◆ setAssignmentList()

ilAssQuestionSkillAssignmentExporter::setAssignmentList (   $assignmentList)
Parameters
ilAssQuestionSkillAssignmentList$assignmentList

Definition at line 80 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $assignmentList.

◆ setQuestionIds()

ilAssQuestionSkillAssignmentExporter::setQuestionIds (   $questionIds)
Parameters
array$questionIds

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

References $questionIds.

◆ setXmlWriter()

ilAssQuestionSkillAssignmentExporter::setXmlWriter ( ilXmlWriter  $xmlWriter)
Parameters
ilXmlWriter$xmlWriter

Definition at line 48 of file class.ilAssQuestionSkillAssignmentExporter.php.

References $xmlWriter.

Field Documentation

◆ $assignmentList

ilAssQuestionSkillAssignmentExporter::$assignmentList
protected

◆ $questionIds

ilAssQuestionSkillAssignmentExporter::$questionIds
protected

◆ $xmlWriter

ilAssQuestionSkillAssignmentExporter::$xmlWriter
protected

Definition at line 15 of file class.ilAssQuestionSkillAssignmentExporter.php.

Referenced by getXmlWriter(), and setXmlWriter().


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