ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestSkillLevelThresholdXmlParser Class Reference
+ Inheritance diagram for ilTestSkillLevelThresholdXmlParser:
+ Collaboration diagram for ilTestSkillLevelThresholdXmlParser:

Public Member Functions

 __construct (?string $path_to_file='')
 
 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
 
int $curSkillBaseId = null
 
int $curSkillTrefId = null
 
ilTestSkillLevelThresholdImportList $skillLevelThresholdImportList = null
 
ilTestSkillLevelThresholdImport $curSkillLevelThreshold = null
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Private Attributes

ilDBInterface $db
 

Additional Inherited Members

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillLevelThresholdXmlParser::__construct ( ?string  $path_to_file = '')

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

41 {
42 global $DIC;
43 $this->db = $DIC['ilDB'];
44 parent::__construct($path_to_file);
45 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ appendToCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::appendToCharacterDataBuffer ( string  $characterData)
protected

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

70 : void
71 {
72 $this->characterDataBuffer .= $characterData;
73 }

Referenced by handlerCharacterData().

+ Here is the caller graph for this function:

◆ getCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::getCharacterDataBuffer ( )
protected

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

References $characterDataBuffer.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::getCurSkillBaseId ( )

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

References $curSkillLevelThreshold.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::getCurSkillTrefId ( )

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

121 : void
122 {
123 if ($tagName != 'SkillsLevelThresholds' && !$this->isParsingActive()) {
124 return;
125 }
126
127 switch ($tagName) {
128 case 'SkillsLevelThresholds':
129 $this->setParsingActive(true);
131 break;
132
133 case 'QuestionsAssignedSkill':
134 $this->setCurSkillBaseId((int) $tagAttributes['BaseId']);
135 $this->setCurSkillTrefId((int) $tagAttributes['TrefId']);
136 break;
137
138 case 'OriginalLevelDescription':
139 case 'OriginalLevelTitle':
140 case 'ThresholdPercentage':
141 case 'OriginalSkillPath':
142 case 'OriginalSkillTitle':
144 break;
145
146 case 'SkillLevel':
147 $skillLevelThreshold = new ilTestSkillLevelThresholdImport();
148 $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
149 $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
150 $skillLevelThreshold->setImportLevelId((int) $tagAttributes['Id']);
151 $skillLevelThreshold->setOrderIndex((int) $tagAttributes['Nr']);
152 $this->setCurSkillLevelThreshold($skillLevelThreshold);
153 break;
154 }
155 }
setCurSkillLevelThreshold(?ilTestSkillLevelThresholdImport $curSkillLevelThreshold)

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

Referenced by setHandlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerCharacterData()

ilTestSkillLevelThresholdXmlParser::handlerCharacterData (   $xmlParser,
  $charData 
)

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

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 }

References appendToCharacterDataBuffer(), and isParsingActive().

Referenced by setHandlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

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(),
178 );
180 break;
181
182 case 'OriginalSkillPath':
183 $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
184 $this->getCurSkillBaseId(),
185 $this->getCurSkillTrefId(),
187 );
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((int) $this->getCharacterDataBuffer());
201 break;
202
203 case 'OriginalLevelTitle':
204 $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
206 break;
207
208 case 'OriginalLevelDescription':
209 $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
211 break;
212 }
213 }

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

Referenced by setHandlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSkillLevelThresholdImportList()

ilTestSkillLevelThresholdXmlParser::initSkillLevelThresholdImportList ( )

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

80 : void
81 {
82 $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList();
83 }

Referenced by handlerBeginTag().

+ Here is the caller graph for this function:

◆ isParsingActive()

ilTestSkillLevelThresholdXmlParser::isParsingActive ( )

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

65 : void
66 {
67 $this->characterDataBuffer = '';
68 }

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId ( ?int  $curSkillBaseId)

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

90 : void
91 {
92 $this->curSkillBaseId = $curSkillBaseId;
93 }

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold ( ?ilTestSkillLevelThresholdImport  $curSkillLevelThreshold)

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

110 : void
111 {
112 $this->curSkillLevelThreshold = $curSkillLevelThreshold;
113 }

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId ( ?int  $curSkillTrefId)

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

100 : void
101 {
102 $this->curSkillTrefId = $curSkillTrefId;
103 }

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $a_xml_parser)
Parameters
XMLParser | resource$a_xml_parser
Returns
void

Reimplemented from ilSaxParser.

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

115 : void
116 {
117 xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
118 xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
119 }

References handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

+ Here is the call graph for this function:

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive ( bool  $parsingActive)

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

52 : void
53 {
54 $this->parsingActive = $parsingActive;
55 }

References $parsingActive.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

Field Documentation

◆ $characterDataBuffer

string ilTestSkillLevelThresholdXmlParser::$characterDataBuffer = null
protected

Definition at line 30 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

◆ $db

ilDBInterface ilTestSkillLevelThresholdXmlParser::$db
private

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

◆ $parsingActive

bool ilTestSkillLevelThresholdXmlParser::$parsingActive = false
protected

◆ $skillLevelThresholdImportList

ilTestSkillLevelThresholdImportList ilTestSkillLevelThresholdXmlParser::$skillLevelThresholdImportList = null
protected

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