ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

31  {
32  $this->xmlWriter = null;
33  $this->questionIds = array();
34  $this->assignmentList = null;
35  }

Member Function Documentation

◆ export()

ilAssQuestionSkillAssignmentExporter::export ( )

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

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

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