ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
160  return;
161  }
162 
163  switch ($tagName) {
164  case 'SkillsLevelThresholds':
165  $this->setParsingActive(true);
167  break;
168 
169  case 'QuestionsAssignedSkill':
170  $this->setCurSkillBaseId($tagAttributes['BaseId']);
171  $this->setCurSkillTrefId($tagAttributes['TrefId']);
172  break;
173 
174  case 'OriginalSkillTitle':
175  $this->resetCharacterDataBuffer();
176  break;
177 
178  case 'OriginalSkillPath':
179  $this->resetCharacterDataBuffer();
180  break;
181 
182  case 'SkillLevel':
183  global $ilDB;
184  $skillLevelThreshold = new ilTestSkillLevelThresholdImport($ilDB);
185  $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
186  $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
187  $skillLevelThreshold->setImportLevelId($tagAttributes['Id']);
188  $skillLevelThreshold->setOrderIndex($tagAttributes['Nr']);
189  $this->setCurSkillLevelThreshold($skillLevelThreshold);
190  break;
191 
192  case 'ThresholdPercentage':
193  $this->resetCharacterDataBuffer();
194  break;
195 
196  case 'OriginalLevelTitle':
197  $this->resetCharacterDataBuffer();
198  break;
199 
200  case 'OriginalLevelDescription':
201  $this->resetCharacterDataBuffer();
202  break;
203  }
204  }
global $ilDB
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilTestSkillLevelThresholdXmlParser::handlerCharacterData (   $xmlParser,
  $charData 
)

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

References appendToCharacterDataBuffer(), and isParsingActive().

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

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

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

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