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

Public Member Functions

 isParsingActive ()
 
 setParsingActive ($parsingActive)
 
 getSkillLevelThresholdImportList ()
 
 initSkillLevelThresholdImportList ()
 
 getCurSkillBaseId ()
 
 setCurSkillBaseId ($curSkillBaseId)
 
 getCurSkillTrefId ()
 
 setCurSkillTrefId ($curSkillTrefId)
 
 getCurSkillLevelThreshold ()
 
 setCurSkillLevelThreshold ($curSkillLevelThreshold)
 
 setHandlers ($xmlParser)
 
 handlerBeginTag ($xmlParser, $tagName, $tagAttributes)
 
 handlerEndTag ($xmlParser, $tagName)
 
 handlerCharacterData ($xmlParser, $charData)
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Protected Member Functions

 getCharacterDataBuffer ()
 
 resetCharacterDataBuffer ()
 
 appendToCharacterDataBuffer ($characterData)
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Protected Attributes

 $parsingActive = false
 
 $characterDataBuffer = null
 
 $skillLevelThresholdImportList = null
 
 $curSkillBaseId = null
 
 $curSkillTrefId = null
 
 $curSkillLevelThreshold = null
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 

Detailed Description

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

Member Function Documentation

◆ appendToCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::appendToCharacterDataBuffer (   $characterData)
protected
Parameters
string$characterData

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

Referenced by handlerCharacterData().

81  {
82  $this->characterDataBuffer .= $characterData;
83  }
+ Here is the caller graph for this function:

◆ getCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::getCharacterDataBuffer ( )
protected
Returns
string

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

References $characterDataBuffer.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::getCurSkillBaseId ( )
Returns
int

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

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::getCurSkillLevelThreshold ( )
Returns
ilTestSkillLevelThresholdImport

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

References $curSkillLevelThreshold.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::getCurSkillTrefId ( )
Returns
int

Definition at line 120 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 156 of file class.ilTestSkillLevelThresholdXmlParser.php.

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

157  {
158  if ($tagName != 'SkillsLevelThresholds' && !$this->isParsingActive()) {
159  return;
160  }
161 
162  switch ($tagName) {
163  case 'SkillsLevelThresholds':
164  $this->setParsingActive(true);
166  break;
167 
168  case 'QuestionsAssignedSkill':
169  $this->setCurSkillBaseId($tagAttributes['BaseId']);
170  $this->setCurSkillTrefId($tagAttributes['TrefId']);
171  break;
172 
173  case 'OriginalSkillTitle':
174  $this->resetCharacterDataBuffer();
175  break;
176 
177  case 'OriginalSkillPath':
178  $this->resetCharacterDataBuffer();
179  break;
180 
181  case 'SkillLevel':
182  global $ilDB;
183  $skillLevelThreshold = new ilTestSkillLevelThresholdImport($ilDB);
184  $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
185  $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
186  $skillLevelThreshold->setImportLevelId($tagAttributes['Id']);
187  $skillLevelThreshold->setOrderIndex($tagAttributes['Nr']);
188  $this->setCurSkillLevelThreshold($skillLevelThreshold);
189  break;
190 
191  case 'ThresholdPercentage':
192  $this->resetCharacterDataBuffer();
193  break;
194 
195  case 'OriginalLevelTitle':
196  $this->resetCharacterDataBuffer();
197  break;
198 
199  case 'OriginalLevelDescription':
200  $this->resetCharacterDataBuffer();
201  break;
202  }
203  }
global $ilDB
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilTestSkillLevelThresholdXmlParser::handlerCharacterData (   $xmlParser,
  $charData 
)

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

References appendToCharacterDataBuffer(), and isParsingActive().

264  {
265  if (!$this->isParsingActive()) {
266  return;
267  }
268 
269  if ($charData != "\n") {
270  // Replace multiple tabs with one space
271  $charData = preg_replace("/\t+/", " ", $charData);
272 
273  $this->appendToCharacterDataBuffer($charData);
274  }
275  }
+ Here is the call graph for this function:

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

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

206  {
207  if (!$this->isParsingActive()) {
208  return;
209  }
210 
211  switch ($tagName) {
212  case 'SkillsLevelThresholds':
213  $this->setParsingActive(false);
214  break;
215 
216  case 'QuestionsAssignedSkill':
217  $this->setCurSkillBaseId(null);
218  $this->setCurSkillTrefId(null);
219  break;
220 
221  case 'OriginalSkillTitle':
222  $this->getSkillLevelThresholdImportList()->addOriginalSkillTitle(
223  $this->getCurSkillBaseId(),
224  $this->getCurSkillTrefId(),
225  $this->getCharacterDataBuffer()
226  );
227  $this->resetCharacterDataBuffer();
228  break;
229 
230  case 'OriginalSkillPath':
231  $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
232  $this->getCurSkillBaseId(),
233  $this->getCurSkillTrefId(),
234  $this->getCharacterDataBuffer()
235  );
236  $this->resetCharacterDataBuffer();
237  break;
238 
239  case 'SkillLevel':
240  $this->getSkillLevelThresholdImportList()->addSkillLevelThreshold(
242  );
243  $this->setCurSkillLevelThreshold(null);
244  break;
245 
246  case 'ThresholdPercentage':
247  $this->getCurSkillLevelThreshold()->setThreshold($this->getCharacterDataBuffer());
248  $this->resetCharacterDataBuffer();
249  break;
250 
251  case 'OriginalLevelTitle':
252  $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
253  $this->resetCharacterDataBuffer();
254  break;
255 
256  case 'OriginalLevelDescription':
257  $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
258  $this->resetCharacterDataBuffer();
259  break;
260  }
261  }
+ Here is the call graph for this function:

◆ initSkillLevelThresholdImportList()

ilTestSkillLevelThresholdXmlParser::initSkillLevelThresholdImportList ( )

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

References $ilDB.

Referenced by handlerBeginTag().

96  {
97  global $ilDB;
98  $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList($ilDB);
99  }
global $ilDB
+ Here is the caller graph for this function:

◆ isParsingActive()

ilTestSkillLevelThresholdXmlParser::isParsingActive ( )
Returns
boolean

Definition at line 48 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 72 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by handlerBeginTag(), and handlerEndTag().

73  {
74  $this->characterDataBuffer = '';
75  }
+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId (   $curSkillBaseId)
Parameters
int$curSkillBaseId

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

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

113  {
114  $this->curSkillBaseId = $curSkillBaseId;
115  }
+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold (   $curSkillLevelThreshold)
Parameters
ilTestSkillLevelThresholdImport$curSkillLevelThreshold

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

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

145  {
146  $this->curSkillLevelThreshold = $curSkillLevelThreshold;
147  }
+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId (   $curSkillTrefId)
Parameters
int$curSkillTrefId

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

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

129  {
130  $this->curSkillTrefId = $curSkillTrefId;
131  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $xmlParser)

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

150  {
151  xml_set_object($xmlParser, $this);
152  xml_set_element_handler($xmlParser, 'handlerBeginTag', 'handlerEndTag');
153  xml_set_character_data_handler($xmlParser, 'handlerCharacterData');
154  }

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive (   $parsingActive)
Parameters
boolean$parsingActive

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

References $parsingActive.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

Field Documentation

◆ $characterDataBuffer

ilTestSkillLevelThresholdXmlParser::$characterDataBuffer = null
protected

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

Referenced by getCharacterDataBuffer().

◆ $curSkillBaseId

ilTestSkillLevelThresholdXmlParser::$curSkillBaseId = null
protected

◆ $curSkillLevelThreshold

ilTestSkillLevelThresholdXmlParser::$curSkillLevelThreshold = null
protected

◆ $curSkillTrefId

ilTestSkillLevelThresholdXmlParser::$curSkillTrefId = null
protected

◆ $parsingActive

ilTestSkillLevelThresholdXmlParser::$parsingActive = false
protected

◆ $skillLevelThresholdImportList

ilTestSkillLevelThresholdXmlParser::$skillLevelThresholdImportList = null
protected

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