ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 set event handler should be overwritten by inherited class @access private More...
 
 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 @access 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 @access 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.

81 {
82 $this->characterDataBuffer .= $characterData;
83 }

Referenced by handlerCharacterData().

+ 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 105 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 137 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 121 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 157 of file class.ilTestSkillLevelThresholdXmlParser.php.

158 {
159 if ($tagName != 'SkillsLevelThresholds' && !$this->isParsingActive()) {
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':
176 break;
177
178 case 'OriginalSkillPath':
180 break;
181
182 case 'SkillLevel':
183 global $DIC;
184 $ilDB = $DIC['ilDB'];
185 $skillLevelThreshold = new ilTestSkillLevelThresholdImport($ilDB);
186 $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
187 $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
188 $skillLevelThreshold->setImportLevelId($tagAttributes['Id']);
189 $skillLevelThreshold->setOrderIndex($tagAttributes['Nr']);
190 $this->setCurSkillLevelThreshold($skillLevelThreshold);
191 break;
192
193 case 'ThresholdPercentage':
195 break;
196
197 case 'OriginalLevelTitle':
199 break;
200
201 case 'OriginalLevelDescription':
203 break;
204 }
205 }
global $DIC
Definition: saml.php:7
global $ilDB

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

+ Here is the call graph for this function:

◆ handlerCharacterData()

ilTestSkillLevelThresholdXmlParser::handlerCharacterData (   $xmlParser,
  $charData 
)

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

266 {
267 if (!$this->isParsingActive()) {
268 return;
269 }
270
271 if ($charData != "\n") {
272 // Replace multiple tabs with one space
273 $charData = preg_replace("/\t+/", " ", $charData);
274
275 $this->appendToCharacterDataBuffer($charData);
276 }
277 }

References appendToCharacterDataBuffer(), and isParsingActive().

+ Here is the call graph for this function:

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

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

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

+ Here is the call graph for this function:

◆ initSkillLevelThresholdImportList()

ilTestSkillLevelThresholdXmlParser::initSkillLevelThresholdImportList ( )

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

96 {
97 global $DIC;
98 $ilDB = $DIC['ilDB'];
99 $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList($ilDB);
100 }

References $DIC, and $ilDB.

Referenced by handlerBeginTag().

+ 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.

73 {
74 $this->characterDataBuffer = '';
75 }

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

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

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

114 {
115 $this->curSkillBaseId = $curSkillBaseId;
116 }

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

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

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

146 {
147 $this->curSkillLevelThreshold = $curSkillLevelThreshold;
148 }

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

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

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

130 {
131 $this->curSkillTrefId = $curSkillTrefId;
132 }

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class @access private

Reimplemented from ilSaxParser.

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

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

◆ setParsingActive()

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

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

57 {
58 $this->parsingActive = $parsingActive;
59 }

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: