ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestSkillLevelThresholdXmlParser Class Reference
+ Inheritance diagram for ilTestSkillLevelThresholdXmlParser:
+ Collaboration diagram for ilTestSkillLevelThresholdXmlParser:

Public Member Functions

 __construct ()
 
 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 ( )

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

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

40  {
41  global $DIC;
42  $this->db = $DIC['ilDB'];
44  }
global $DIC
Definition: shib_login.php:22
__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 69 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by handlerCharacterData().

69  : void
70  {
71  $this->characterDataBuffer .= $characterData;
72  }
+ Here is the caller graph for this function:

◆ getCharacterDataBuffer()

ilTestSkillLevelThresholdXmlParser::getCharacterDataBuffer ( )
protected

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

References $characterDataBuffer.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::getCurSkillBaseId ( )

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

References $curSkillLevelThreshold.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::getCurSkillTrefId ( )

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

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

Referenced by setHandlers().

120  : void
121  {
122  if ($tagName != 'SkillsLevelThresholds' && !$this->isParsingActive()) {
123  return;
124  }
125 
126  switch ($tagName) {
127  case 'SkillsLevelThresholds':
128  $this->setParsingActive(true);
130  break;
131 
132  case 'QuestionsAssignedSkill':
133  $this->setCurSkillBaseId($tagAttributes['BaseId']);
134  $this->setCurSkillTrefId($tagAttributes['TrefId']);
135  break;
136 
137  case 'OriginalLevelDescription':
138  case 'OriginalLevelTitle':
139  case 'ThresholdPercentage':
140  case 'OriginalSkillPath':
141  case 'OriginalSkillTitle':
142  $this->resetCharacterDataBuffer();
143  break;
144 
145  case 'SkillLevel':
146  $skillLevelThreshold = new ilTestSkillLevelThresholdImport();
147  $skillLevelThreshold->setImportSkillBaseId($this->getCurSkillBaseId());
148  $skillLevelThreshold->setImportSkillTrefId($this->getCurSkillTrefId());
149  $skillLevelThreshold->setImportLevelId($tagAttributes['Id']);
150  $skillLevelThreshold->setOrderIndex($tagAttributes['Nr']);
151  $this->setCurSkillLevelThreshold($skillLevelThreshold);
152  break;
153  }
154  }
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 214 of file class.ilTestSkillLevelThresholdXmlParser.php.

References appendToCharacterDataBuffer(), and isParsingActive().

Referenced by setHandlers().

214  : void
215  {
216  if (!$this->isParsingActive()) {
217  return;
218  }
219 
220  if ($charData != "\n") {
221  // Replace multiple tabs with one space
222  $charData = preg_replace("/\t+/", " ", $charData);
223 
224  $this->appendToCharacterDataBuffer($charData);
225  }
226  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerEndTag()

ilTestSkillLevelThresholdXmlParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

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

Referenced by setHandlers().

156  : void
157  {
158  if (!$this->isParsingActive()) {
159  return;
160  }
161 
162  switch ($tagName) {
163  case 'SkillsLevelThresholds':
164  $this->setParsingActive(false);
165  break;
166 
167  case 'QuestionsAssignedSkill':
168  $this->setCurSkillBaseId(null);
169  $this->setCurSkillTrefId(null);
170  break;
171 
172  case 'OriginalSkillTitle':
173  $this->getSkillLevelThresholdImportList()->addOriginalSkillTitle(
174  $this->getCurSkillBaseId(),
175  $this->getCurSkillTrefId(),
176  $this->getCharacterDataBuffer()
177  );
178  $this->resetCharacterDataBuffer();
179  break;
180 
181  case 'OriginalSkillPath':
182  $this->getSkillLevelThresholdImportList()->addOriginalSkillPath(
183  $this->getCurSkillBaseId(),
184  $this->getCurSkillTrefId(),
185  $this->getCharacterDataBuffer()
186  );
187  $this->resetCharacterDataBuffer();
188  break;
189 
190  case 'SkillLevel':
191  $this->getSkillLevelThresholdImportList()->addSkillLevelThreshold(
193  );
195  break;
196 
197  case 'ThresholdPercentage':
198  $this->getCurSkillLevelThreshold()->setThreshold($this->getCharacterDataBuffer());
199  $this->resetCharacterDataBuffer();
200  break;
201 
202  case 'OriginalLevelTitle':
203  $this->getCurSkillLevelThreshold()->setOriginalLevelTitle($this->getCharacterDataBuffer());
204  $this->resetCharacterDataBuffer();
205  break;
206 
207  case 'OriginalLevelDescription':
208  $this->getCurSkillLevelThreshold()->setOriginalLevelDescription($this->getCharacterDataBuffer());
209  $this->resetCharacterDataBuffer();
210  break;
211  }
212  }
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 79 of file class.ilTestSkillLevelThresholdXmlParser.php.

Referenced by handlerBeginTag().

79  : void
80  {
81  $this->skillLevelThresholdImportList = new ilTestSkillLevelThresholdImportList();
82  }
+ Here is the caller graph for this function:

◆ isParsingActive()

ilTestSkillLevelThresholdXmlParser::isParsingActive ( )

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

Referenced by handlerBeginTag(), and handlerEndTag().

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

◆ setCurSkillBaseId()

ilTestSkillLevelThresholdXmlParser::setCurSkillBaseId ( ?int  $curSkillBaseId)

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

References $curSkillBaseId.

Referenced by handlerBeginTag(), and handlerEndTag().

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

◆ setCurSkillLevelThreshold()

ilTestSkillLevelThresholdXmlParser::setCurSkillLevelThreshold ( ?ilTestSkillLevelThresholdImport  $curSkillLevelThreshold)

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

References $curSkillLevelThreshold.

Referenced by handlerBeginTag(), and handlerEndTag().

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

◆ setCurSkillTrefId()

ilTestSkillLevelThresholdXmlParser::setCurSkillTrefId ( ?int  $curSkillTrefId)

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

References $curSkillTrefId.

Referenced by handlerBeginTag(), and handlerEndTag().

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

◆ setHandlers()

ilTestSkillLevelThresholdXmlParser::setHandlers (   $a_xml_parser)

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

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

114  : void
115  {
116  xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
117  xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
118  }
+ Here is the call graph for this function:

◆ setParsingActive()

ilTestSkillLevelThresholdXmlParser::setParsingActive ( bool  $parsingActive)

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

References $parsingActive.

Referenced by handlerBeginTag(), and handlerEndTag().

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