ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSkillLevelThresholdXmlParser Class Reference
+ Inheritance diagram for ilTestSkillLevelThresholdXmlParser:
+ Collaboration diagram for ilTestSkillLevelThresholdXmlParser:

Public Member Functions

 isParsingActive ()
 
 setParsingActive (bool $parsingActive)
 
 getSkillLevelThresholdImportList ()
 
 initSkillLevelThresholdImportList ()
 
 getCurSkillBaseId ()
 
 setCurSkillBaseId (?int $curSkillBaseId)
 
 getCurSkillTrefId ()
 
 setCurSkillTrefId (?int $curSkillTrefId)
 
 getCurSkillLevelThreshold ()
 
 setCurSkillLevelThreshold (?ilTestSkillLevelThresholdImport $curSkillLevelThreshold)
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($xmlParser, $tagName, $tagAttributes)
 
 handlerEndTag ($xmlParser, $tagName)
 
 handlerCharacterData ($xmlParser, $charData)
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Protected Member Functions

 getCharacterDataBuffer ()
 
 resetCharacterDataBuffer ()
 
 appendToCharacterDataBuffer (string $characterData)
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 

Protected Attributes

bool $parsingActive = false
 
string $characterDataBuffer = null
 
ilTestSkillLevelThresholdImportList $skillLevelThresholdImportList = null
 
int $curSkillBaseId = null
 
int $curSkillTrefId = null
 
ilTestSkillLevelThresholdImport $curSkillLevelThreshold = null
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 

Detailed Description

Definition at line 25 of file class.ilTestSkillLevelThresholdXmlParser.php.

Member Function Documentation

◆ appendToCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::appendToCharacterDataBuffer ( string  $characterData)
protected

Definition at line 62 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by handlerCharacterData().

62  : void
63  {
64  $this->characterDataBuffer .= $characterData;
65  }
+ Here is the caller graph for this function:

◆ getCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::getCharacterDataBuffer ( )
protected

Definition at line 49 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $characterDataBuffer.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::getCurSkillBaseId ( )

Definition at line 81 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::getCurSkillLevelThreshold ( )

Definition at line 101 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillLevelThreshold.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::getCurSkillTrefId ( )

Definition at line 91 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ getSkillLevelThresholdImportList()

ilTestSkillLevelThresholdXmlParser::getSkillLevelThresholdImportList ( )

◆ handlerBeginTag()

ilTestSkillLevelThresholdXmlParser::handlerBeginTag (   $xmlParser,
  $tagName,
  $tagAttributes 
)

Definition at line 118 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $DIC, $ilDB, getCurSkillBaseId(), getCurSkillTrefId(), initSkillLevelThresholdImportList(), isParsingActive(), resetCharacterDataBuffer(), setCurSkillBaseId(), setCurSkillLevelThreshold(), setCurSkillTrefId(), and setParsingActive().

118  : void
119  {
120  if ($tagName != 'SkillsLevelThresholds' && !$this->isParsingActive()) {
121  return;
122  }
123 
124  switch ($tagName) {
125  case 'SkillsLevelThresholds':
126  $this->setParsingActive(true);
128  break;
129 
130  case 'QuestionsAssignedSkill':
131  $this->setCurSkillBaseId($tagAttributes['BaseId']);
132  $this->setCurSkillTrefId($tagAttributes['TrefId']);
133  break;
134 
135  case 'OriginalLevelDescription':
136  case 'OriginalLevelTitle':
137  case 'ThresholdPercentage':
138  case 'OriginalSkillPath':
139  case 'OriginalSkillTitle':
140  $this->resetCharacterDataBuffer();
141  break;
142 
143  case 'SkillLevel':
144  global $DIC;
145  $ilDB = $DIC['ilDB'];
146  $skillLevelThreshold = new ilTestSkillLevelThresholdImport($ilDB);
147  $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
148  $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
149  $skillLevelThreshold->setImportLevelId($tagAttributes['Id']);
150  $skillLevelThreshold->setOrderIndex($tagAttributes['Nr']);
151  $this->setCurSkillLevelThreshold($skillLevelThreshold);
152  break;
153 
154  }
155  }
setCurSkillLevelThreshold(?ilTestSkillLevelThresholdImport $curSkillLevelThreshold)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilTestSkillLevelThresholdXmlParser::handlerCharacterData (   $xmlParser,
  $charData 
)

Definition at line 215 of file class.ilTestSkillLevelThresholdXmlParser.php.

References appendToCharacterDataBuffer(), and isParsingActive().

215  : void
216  {
217  if (!$this->isParsingActive()) {
218  return;
219  }
220 
221  if ($charData != "\n") {
222  // Replace multiple tabs with one space
223  $charData = preg_replace("/\t+/", " ", $charData);
224 
225  $this->appendToCharacterDataBuffer($charData);
226  }
227  }
+ Here is the call graph for this function:

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

Definition at line 157 of file class.ilTestSkillLevelThresholdXmlParser.php.

References getCharacterDataBuffer(), getCurSkillBaseId(), getCurSkillLevelThreshold(), getCurSkillTrefId(), getSkillLevelThresholdImportList(), isParsingActive(), resetCharacterDataBuffer(), setCurSkillBaseId(), setCurSkillLevelThreshold(), setCurSkillTrefId(), and setParsingActive().

157  : void
158  {
159  if (!$this->isParsingActive()) {
160  return;
161  }
162 
163  switch ($tagName) {
164  case 'SkillsLevelThresholds':
165  $this->setParsingActive(false);
166  break;
167 
168  case 'QuestionsAssignedSkill':
169  $this->setCurSkillBaseId(null);
170  $this->setCurSkillTrefId(null);
171  break;
172 
173  case 'OriginalSkillTitle':
174  $this->getSkillLevelThresholdImportList()->addOriginalSkillTitle(
175  $this->getCurSkillBaseId(),
176  $this->getCurSkillTrefId(),
177  $this->getCharacterDataBuffer()
178  );
179  $this->resetCharacterDataBuffer();
180  break;
181 
182  case 'OriginalSkillPath':
183  $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
184  $this->getCurSkillBaseId(),
185  $this->getCurSkillTrefId(),
186  $this->getCharacterDataBuffer()
187  );
188  $this->resetCharacterDataBuffer();
189  break;
190 
191  case 'SkillLevel':
192  $this->getSkillLevelThresholdImportList()->addSkillLevelThreshold(
194  );
195  $this->setCurSkillLevelThreshold(null);
196  break;
197 
198  case 'ThresholdPercentage':
199  $this->getCurSkillLevelThreshold()->setThreshold($this->getCharacterDataBuffer());
200  $this->resetCharacterDataBuffer();
201  break;
202 
203  case 'OriginalLevelTitle':
204  $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
205  $this->resetCharacterDataBuffer();
206  break;
207 
208  case 'OriginalLevelDescription':
209  $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
210  $this->resetCharacterDataBuffer();
211  break;
212  }
213  }
setCurSkillLevelThreshold(?ilTestSkillLevelThresholdImport $curSkillLevelThreshold)
+ Here is the call graph for this function:

◆ initSkillLevelThresholdImportList()

ilTestSkillLevelThresholdXmlParser::initSkillLevelThresholdImportList ( )

Definition at line 74 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $DIC, and $ilDB.

Referenced by handlerBeginTag().

74  : void
75  {
76  global $DIC;
77  $ilDB = $DIC['ilDB'];
78  $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList($ilDB);
79  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ isParsingActive()

ilTestSkillLevelThresholdXmlParser::isParsingActive ( )

Definition at line 39 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $parsingActive.

Referenced by handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ resetCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::resetCharacterDataBuffer ( )
protected
Parameters
string$characterDataBuffer

Definition at line 57 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by handlerBeginTag(), and handlerEndTag().

57  : void
58  {
59  $this->characterDataBuffer = '';
60  }
+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId ( ?int  $curSkillBaseId)

Definition at line 86 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

86  : void
87  {
88  $this->curSkillBaseId = $curSkillBaseId;
89  }
+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold ( ?ilTestSkillLevelThresholdImport  $curSkillLevelThreshold)

Definition at line 106 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

106  : void
107  {
108  $this->curSkillLevelThreshold = $curSkillLevelThreshold;
109  }
+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId ( ?int  $curSkillTrefId)

Definition at line 96 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

96  : void
97  {
98  $this->curSkillTrefId = $curSkillTrefId;
99  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $a_xml_parser)

Definition at line 111 of file class.ilTestSkillLevelThresholdXmlParser.php.

111  : void
112  {
113  xml_set_object($a_xml_parser, $this);
114  xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
115  xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
116  }

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive ( bool  $parsingActive)

Definition at line 44 of file class.ilTestSkillLevelThresholdXmlParser.php.

References $parsingActive.

Referenced by handlerBeginTag(), and handlerEndTag().

44  : void
45  {
46  $this->parsingActive = $parsingActive;
47  }
+ Here is the caller graph for this function:

Field Documentation

◆ $characterDataBuffer

string ilTestSkillLevelThresholdXmlParser::$characterDataBuffer = null
protected

Definition at line 29 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by getCharacterDataBuffer().

◆ $curSkillBaseId

int ilTestSkillLevelThresholdXmlParser::$curSkillBaseId = null
protected

◆ $curSkillLevelThreshold

ilTestSkillLevelThresholdImport ilTestSkillLevelThresholdXmlParser::$curSkillLevelThreshold = null
protected

◆ $curSkillTrefId

int ilTestSkillLevelThresholdXmlParser::$curSkillTrefId = null
protected

◆ $parsingActive

bool ilTestSkillLevelThresholdXmlParser::$parsingActive = false
protected

◆ $skillLevelThresholdImportList

ilTestSkillLevelThresholdImportList ilTestSkillLevelThresholdXmlParser::$skillLevelThresholdImportList = null
protected

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