ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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.

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

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

Referenced by handlerCharacterData().

70  : void
71  {
72  $this->characterDataBuffer .= $characterData;
73  }
+ 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.

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

Referenced by setHandlers().

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':
143  $this->resetCharacterDataBuffer();
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)
+ 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.

References appendToCharacterDataBuffer(), and isParsingActive().

Referenced by setHandlers().

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

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

Referenced by setHandlers().

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(),
177  $this->getCharacterDataBuffer()
178  );
179  $this->resetCharacterDataBuffer();
180  break;
181 
182  case 'OriginalSkillPath':
183  $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
184  $this->getCurSkillBaseId(),
185  $this->getCurSkillTrefId(),
186  $this->getCharacterDataBuffer()
187  );
188  $this->resetCharacterDataBuffer();
189  break;
190 
191  case 'SkillLevel':
192  $this->getSkillLevelThresholdImportList()->addSkillLevelThreshold(
194  );
196  break;
197 
198  case 'ThresholdPercentage':
199  $this->getCurSkillLevelThreshold()->setThreshold((int) $this->getCharacterDataBuffer());
200  $this->resetCharacterDataBuffer();
201  break;
202 
203  case 'OriginalLevelTitle':
204  $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
205  $this->resetCharacterDataBuffer();
206  break;
207 
208  case 'OriginalLevelDescription':
209  $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
210  $this->resetCharacterDataBuffer();
211  break;
212  }
213  }
setCurSkillLevelThreshold(?ilTestSkillLevelThresholdImport $curSkillLevelThreshold)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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.

Referenced by handlerBeginTag().

80  : void
81  {
82  $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList();
83  }
+ 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.

Referenced by handlerBeginTag(), and handlerEndTag().

65  : void
66  {
67  $this->characterDataBuffer = '';
68  }
+ Here is the caller graph for this function:

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId ( ?int  $curSkillBaseId)

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

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

90  : void
91  {
92  $this->curSkillBaseId = $curSkillBaseId;
93  }
+ Here is the caller graph for this function:

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold ( ?ilTestSkillLevelThresholdImport  $curSkillLevelThreshold)

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

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

110  : void
111  {
112  $this->curSkillLevelThreshold = $curSkillLevelThreshold;
113  }
+ Here is the caller graph for this function:

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId ( ?int  $curSkillTrefId)

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

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

100  : void
101  {
102  $this->curSkillTrefId = $curSkillTrefId;
103  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $a_xml_parser)

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

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

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  }
+ Here is the call graph for this function:

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive ( bool  $parsingActive)

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

References $parsingActive.

Referenced by handlerBeginTag(), and handlerEndTag().

52  : void
53  {
54  $this->parsingActive = $parsingActive;
55  }
+ 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: