ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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

Deprecated:
12: Use ILIAS\Test\ExportImport\Import\SkillLevelThresholdImporter instead

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

Constructor & Destructor Documentation

◆ __construct()

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

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

38 {
39 global $DIC;
40 $this->db = $DIC['ilDB'];
41 parent::__construct($path_to_file);
42 }
__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 67 of file class.ilTestSkillLevelThresholdXmlParser.php.

67 : void
68 {
69 $this->characterDataBuffer .= $characterData;
70 }

Referenced by handlerCharacterData().

+ Here is the caller graph for this function:

◆ getCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::getCharacterDataBuffer ( )
protected

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

References $characterDataBuffer.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::getCurSkillBaseId ( )

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

References $curSkillLevelThreshold.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::getCurSkillTrefId ( )

Definition at line 92 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.

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((int) $tagAttributes['BaseId']);
132 $this->setCurSkillTrefId((int) $tagAttributes['TrefId']);
133 break;
134
135 case 'OriginalLevelDescription':
136 case 'OriginalLevelTitle':
137 case 'ThresholdPercentage':
138 case 'OriginalSkillPath':
139 case 'OriginalSkillTitle':
141 break;
142
143 case 'SkillLevel':
144 $skillLevelThreshold = new ilTestSkillLevelThresholdImport();
145 $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
146 $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
147 $skillLevelThreshold->setImportLevelId((int) $tagAttributes['Id']);
148 $skillLevelThreshold->setOrderIndex((int) $tagAttributes['Nr']);
149 $this->setCurSkillLevelThreshold($skillLevelThreshold);
150 break;
151 }
152 }
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 212 of file class.ilTestSkillLevelThresholdXmlParser.php.

212 : void
213 {
214 if (!$this->isParsingActive()) {
215 return;
216 }
217
218 if ($charData != "\n") {
219 // Replace multiple tabs with one space
220 $charData = preg_replace("/\t+/", " ", $charData);
221
222 $this->appendToCharacterDataBuffer($charData);
223 }
224 }

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 154 of file class.ilTestSkillLevelThresholdXmlParser.php.

154 : void
155 {
156 if (!$this->isParsingActive()) {
157 return;
158 }
159
160 switch ($tagName) {
161 case 'SkillsLevelThresholds':
162 $this->setParsingActive(false);
163 break;
164
165 case 'QuestionsAssignedSkill':
166 $this->setCurSkillBaseId(null);
167 $this->setCurSkillTrefId(null);
168 break;
169
170 case 'OriginalSkillTitle':
171 $this->getSkillLevelThresholdImportList()->addOriginalSkillTitle(
172 $this->getCurSkillBaseId(),
173 $this->getCurSkillTrefId(),
175 );
177 break;
178
179 case 'OriginalSkillPath':
180 $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
181 $this->getCurSkillBaseId(),
182 $this->getCurSkillTrefId(),
184 );
186 break;
187
188 case 'SkillLevel':
189 $this->getSkillLevelThresholdImportList()->addSkillLevelThreshold(
191 );
192 $this->setCurSkillLevelThreshold(null);
193 break;
194
195 case 'ThresholdPercentage':
196 $this->getCurSkillLevelThreshold()->setThreshold((int) $this->getCharacterDataBuffer());
198 break;
199
200 case 'OriginalLevelTitle':
201 $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
203 break;
204
205 case 'OriginalLevelDescription':
206 $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
208 break;
209 }
210 }

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 77 of file class.ilTestSkillLevelThresholdXmlParser.php.

77 : void
78 {
79 $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList();
80 }

Referenced by handlerBeginTag().

+ Here is the caller graph for this function:

◆ isParsingActive()

ilTestSkillLevelThresholdXmlParser::isParsingActive ( )

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

62 : void
63 {
64 $this->characterDataBuffer = '';
65 }

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId ( ?int  $curSkillBaseId)

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

87 : void
88 {
89 $this->curSkillBaseId = $curSkillBaseId;
90 }

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold ( ?ilTestSkillLevelThresholdImport  $curSkillLevelThreshold)

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

107 : void
108 {
109 $this->curSkillLevelThreshold = $curSkillLevelThreshold;
110 }

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId ( ?int  $curSkillTrefId)

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

97 : void
98 {
99 $this->curSkillTrefId = $curSkillTrefId;
100 }

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 112 of file class.ilTestSkillLevelThresholdXmlParser.php.

112 : void
113 {
114 xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
115 xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
116 }

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

+ Here is the call graph for this function:

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive ( bool  $parsingActive)

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

49 : void
50 {
51 $this->parsingActive = $parsingActive;
52 }

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 27 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 31 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: