ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SurveyImportParserPre38 Class Reference

Survey Question Import Parser. More...

+ Inheritance diagram for SurveyImportParserPre38:
+ Collaboration diagram for SurveyImportParserPre38:

Public Member Functions

 __construct ($a_spl_id, $a_xml_file='', $spl_exists=false)
 Constructor. More...
 
 setSurveyObject ($a_svy)
 Sets a reference to a survey object @access public. More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class @access private More...
 
 startParsing ()
 start the parser More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 getParent ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 getErrorCode ()
 
 getErrorLine ()
 
 getErrorColumn ()
 
 getErrorMessage ()
 
 getFullError ()
 
 getXMLSize ()
 
 getXMLElements ()
 
 getXMLAttributes ()
 
 getXMLTextSections ()
 
 getXMLTextSize ()
 
 hasError ()
 
- 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...
 

Data Fields

 $path
 
 $depth
 
 $activequestion
 
 $spl
 
 $error_code
 
 $error_line
 
 $error_col
 
 $error_msg
 
 $has_error
 
 $size
 
 $elements
 
 $attributes
 
 $texts
 
 $text_size
 
 $characterbuffer
 
 $activetag
 
 $material
 
 $metadata
 
 $responses
 
 $response_id
 
 $matrix
 
 $is_matrix
 
 $adjectives
 
 $spl_exists
 
 $in_survey
 
 $survey
 
 $anonymisation
 
 $surveyaccess
 
 $questions
 
 $original_question_id
 
 $constraints
 
 $textblock
 
 $textblocks
 
 $in_questionblock
 
 $questionblock
 
 $questionblocks
 
 $questionblocktitle
 
 $question_title
 
 $in_question
 
 $in_reponse
 
 $question_description
 
- 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()
 

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...
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Survey Question Import Parser.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$

Definition at line 43 of file class.SurveyImportParserPre38.php.

Constructor & Destructor Documentation

◆ __construct()

SurveyImportParserPre38::__construct (   $a_spl_id,
  $a_xml_file = '',
  $spl_exists = false 
)

Constructor.

Parameters
string$a_xml_filexml file

@access public

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

96 {
97 die("Class surveyImportParserPre38 is deprecated.");
98 parent::__construct($a_xml_file);
99 $this->spl_id = $a_spl_id;
100 $this->has_error = false;
101 $this->characterbuffer = "";
102 $this->activetag = "";
103 $this->material = array();
104 $this->depth = array();
105 $this->path = array();
106 $this->metadata = array();
107 $this->responses = array();
108 $this->response_id = "";
109 $this->matrix = array();
110 $this->is_matrix = false;
111 $this->adjectives = array();
112 $this->spl_exists = $spl_exists;
113 $this->survey = null;
114 $this->in_survey = false;
115 $this->anonymisation = 0;
116 $this->surveyaccess = "restricted";
117 $this->questions = array();
118 $this->original_question_id = "";
119 $this->constraints = array();
120 $this->textblock = "";
121 $this->textblocks = array();
122 $this->in_questionblock = false;
123 $this->questionblocks = array();
124 $this->questionblock = array();
125 $this->questionblocktitle = "";
126 $this->question_title = "";
127 $this->in_question = false;
128 $this->in_response = false;
129 $this->question_description = "";
130 }

References $spl_exists.

Member Function Documentation

◆ getErrorCode()

SurveyImportParserPre38::getErrorCode ( )

Definition at line 596 of file class.SurveyImportParserPre38.php.

References $error_code.

◆ getErrorColumn()

SurveyImportParserPre38::getErrorColumn ( )

Definition at line 606 of file class.SurveyImportParserPre38.php.

References $error_col.

◆ getErrorLine()

SurveyImportParserPre38::getErrorLine ( )

Definition at line 601 of file class.SurveyImportParserPre38.php.

References $error_line.

◆ getErrorMessage()

SurveyImportParserPre38::getErrorMessage ( )

Definition at line 611 of file class.SurveyImportParserPre38.php.

References $error_msg.

◆ getFullError()

SurveyImportParserPre38::getFullError ( )

Definition at line 616 of file class.SurveyImportParserPre38.php.

617 {
618 return "Error: " . $this->error_msg . " at line:" . $this->error_line . " column:" . $this->error_col;
619 }

References $error_col.

◆ getParent()

SurveyImportParserPre38::getParent (   $a_xml_parser)

Definition at line 192 of file class.SurveyImportParserPre38.php.

193 {
194 if ($this->depth[$a_xml_parser] > 0) {
195 return $this->path[$this->depth[$a_xml_parser]-1];
196 } else {
197 return "";
198 }
199 }

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getXMLAttributes()

SurveyImportParserPre38::getXMLAttributes ( )

Definition at line 631 of file class.SurveyImportParserPre38.php.

References $attributes.

◆ getXMLElements()

SurveyImportParserPre38::getXMLElements ( )

Definition at line 626 of file class.SurveyImportParserPre38.php.

References $elements.

◆ getXMLSize()

SurveyImportParserPre38::getXMLSize ( )

Definition at line 621 of file class.SurveyImportParserPre38.php.

References $size.

◆ getXMLTextSections()

SurveyImportParserPre38::getXMLTextSections ( )

Definition at line 636 of file class.SurveyImportParserPre38.php.

References $texts.

◆ getXMLTextSize()

SurveyImportParserPre38::getXMLTextSize ( )

Definition at line 641 of file class.SurveyImportParserPre38.php.

References $text_size.

◆ handlerBeginTag()

SurveyImportParserPre38::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 204 of file class.SurveyImportParserPre38.php.

205 {
206 $this->depth[$a_xml_parser]++;
207 $this->path[$this->depth[$a_xml_parser]] = strtolower($a_name);
208 $this->characterbuffer = "";
209 $this->activetag = $a_name;
210 $this->elements++;
211 $this->attributes+=count($a_attribs);
212 switch ($a_name) {
213 case "survey":
214 $this->in_survey = true;
215 if (is_object($this->survey)) {
216 if (strlen($a_attribs["title"])) {
217 $this->survey->setTitle($a_attribs["title"]);
218 }
219 }
220 break;
221 case "section":
222 //$this->spl->setTitle($a_attribs["title"]);
223 break;
224 case "item":
225 $this->original_question_id = $a_attribs["ident"];
226 $this->question_title = $a_attribs["title"];
227 $this->in_question = true;
228 break;
229 case "qtimetadata":
230 $this->metadata = array();
231 break;
232 case "qtimetadatafield":
233 array_push($this->metadata, array("label" => "", "entry" => ""));
234 break;
235 case "material":
236 $this->material = array();
237 array_push($this->material, array("text" => "", "image" => "", "label" => $a_attribs["label"]));
238 break;
239 case "render_fib":
240 if (is_object($this->activequestion)) {
241 if (strlen($a_attribs["minnumber"])) {
242 $this->activequestion->setMinimum($a_attribs["minnumber"]);
243 }
244 if (strlen($a_attribs["maxnumber"])) {
245 $this->activequestion->setMaximum($a_attribs["maxnumber"]);
246 }
247 }
248 break;
249 case "response_lid":
250 if (is_object($this->activequestion)) {
251 if (strcmp($this->activequestion->getQuestiontype(), "SurveyNominalQuestion") == 0) {
252 switch (strtolower($a_attribs["rcardinality"])) {
253 case "single":
254 $this->activequestion->setSubtype(1);
255 break;
256 case "multiple":
257 $this->activequestion->setSubtype(2);
258 break;
259 }
260 }
261 }
262 break;
263 case "response_label":
264 $this->in_response = true;
265 break;
266 }
267 }

◆ handlerCharacterData()

SurveyImportParserPre38::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 272 of file class.SurveyImportParserPre38.php.

273 {
274 $this->texts++;
275 $this->text_size+=strlen($a_data);
276 $this->characterbuffer .= $a_data;
277 $a_data = $this->characterbuffer;
278 }

References $characterbuffer.

◆ handlerEndTag()

SurveyImportParserPre38::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 283 of file class.SurveyImportParserPre38.php.

284 {
285 switch ($a_name) {
286 case "questestinterop":
287 if (is_object($this->survey)) {
288 // write constraints
289 if (count($this->constraints)) {
290 $relations = $this->survey->getAllRelations(true);
291 foreach ($this->constraints as $constraint) {
292 $this->survey->addConstraint($this->questions[$constraint["sourceref"]], $this->questions[$constraint["destref"]], $relations[$constraint["relation"]]["id"], $constraint["value"]);
293 }
294 }
295 // write question blocks
296 if (count($this->questionblocks)) {
297 foreach ($this->questionblocks as $data) {
298 $questionblock = $data["questions"];
299 $title = $data["title"];
300 $qblock = array();
301 foreach ($questionblock as $question_id) {
302 array_push($qblock, $this->questions[$question_id]);
303 }
304 $this->survey->createQuestionblock($title, true, $qblock);
305 }
306 }
307 $this->survey->saveToDb();
308
309 // write textblocks
310 if (count($this->textblocks)) {
311 foreach ($this->textblocks as $original_id => $textblock) {
312 $this->survey->saveHeading($textblock, $this->questions[$original_id]);
313 }
314 }
315 }
316 break;
317 case "survey":
318 $this->in_survey = false;
319 break;
320 case "item":
321 if (is_object($this->activequestion)) {
322 $this->activequestion->setTitle($this->question_title);
323 $this->activequestion->setDescription($this->question_description);
324 $this->activequestion->saveToDb();
325 if (is_object($this->survey)) {
326 // duplicate the question for the survey
327 $question_id = $this->activequestion->duplicate(true);
328 $this->survey->addQuestion($question_id);
329 $this->questions[$this->original_question_id] = $question_id;
330 }
331 }
332 $this->in_question = false;
333 $this->question_description = "";
334 $this->activequestion = null;
335 break;
336 case "qticomment":
337 if (strcmp($this->getParent($a_xml_parser), "item") == 0) {
338 if (preg_match("/Questiontype\=(.*)/", $this->characterbuffer, $matches)) {
339 $questiontype = $matches[1];
340 switch ($matches[1]) {
342 $questiontype = "SurveyMetricQuestion";
343 break;
345 $questiontype = "SurveyMultipleChoiceQuestion";
346 break;
348 $questiontype = "SurveySingleChoiceQuestion";
349 break;
351 $questiontype = "SurveyTextQuestion";
352 break;
353 }
354 if (strlen($questiontype)) {
355 include_once "./Modules/SurveyQuestionPool/classes/class.$questiontype.php";
356 $this->activequestion = new $questiontype();
357 $this->activequestion->setObjId($this->spl_id);
358 } else {
359 $this->activequestion = null;
360 }
361 } elseif (preg_match("/Author\=(.*)/", $this->characterbuffer, $matches)) {
362 if (is_object($this->activequestion)) {
363 $this->activequestion->setAuthor($matches[1]);
364 }
365 } elseif (preg_match("/ILIAS Version\=(.*)/", $this->characterbuffer, $matches)) {
366 } else {
367 $this->question_description = $this->characterbuffer;
368 }
369 }
370 if (strcmp($this->getParent($a_xml_parser), "survey") == 0) {
371 if (preg_match("/Author\=(.*)/", $this->characterbuffer, $matches)) {
372 if (is_object($this->survey)) {
373 $this->survey->setAuthor($matches[1]);
374 }
375 } elseif (preg_match("/ILIAS Version\=(.*)/", $this->characterbuffer, $matches)) {
376 } else {
377 if (is_object($this->survey)) {
378 $this->survey->setDescription($this->characterbuffer);
379 }
380 }
381 }
382 break;
383 case "fieldlabel":
384 $this->metadata[count($this->metadata)-1]["label"] = $this->characterbuffer;
385 break;
386 case "fieldentry":
387 $this->metadata[count($this->metadata)-1]["entry"] = $this->characterbuffer;
388 break;
389 case "qtimetadata":
390 if (strcmp($this->getParent($a_xml_parser), "section") == 0) {
391 foreach ($this->metadata as $meta) {
392 switch ($meta["label"]) {
393 case "SCORM":
394 if (!$this->spl_exists) {
395 include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
396 include_once "./Services/MetaData/classes/class.ilMD.php";
397 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
398 $md_sax_parser = new ilMDSaxParser();
399 $md_sax_parser->setXMLContent($value["entry"]);
400 $md_sax_parser->setMDObject($tmp = new ilMD($this->spl_id, 0, "spl"));
401 $md_sax_parser->enableMDParsing(true);
402 $md_sax_parser->startParsing();
403 $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
404 $spl->MDUpdateListener("General");
405 break;
406 }
407 }
408 }
409 }
410 if (is_object($this->activequestion)) {
411 foreach ($this->metadata as $meta) {
412 switch ($this->activequestion->getQuestionType()) {
413 case "SurveyMultipleQuestion":
414 switch ($meta["label"]) {
415 case "obligatory":
416 $this->activequestion->setObligatory($meta["entry"]);
417 break;
418 case "orientation":
419 $this->activequestion->setOrientation($meta["entry"]);
420 break;
421 }
422 break;
423 case "SurveySingleChoiceQuestion":
424 switch ($meta["label"]) {
425 case "obligatory":
426 $this->activequestion->setObligatory($meta["entry"]);
427 break;
428 case "orientation":
429 $this->activequestion->setOrientation($meta["entry"]);
430 break;
431 }
432 break;
433 case "SurveyMetricQuestion":
434 switch ($meta["label"]) {
435 case "obligatory":
436 $this->activequestion->setObligatory($meta["entry"]);
437 break;
438 case "subtype":
439 $this->activequestion->setSubtype($meta["entry"]);
440 break;
441 }
442 break;
443 case "SurveyTextQuestion":
444 switch ($meta["label"]) {
445 case "obligatory":
446 $this->activequestion->setObligatory($meta["entry"]);
447 break;
448 case "maxchars":
449 if (strlen($meta["entry"])) {
450 $this->activequestion->setMaxChars($meta["entry"]);
451 }
452 break;
453 }
454 break;
455 }
456 }
457 }
458 if (is_object($this->survey)) {
459 foreach ($this->metadata as $meta) {
460 switch ($meta["label"]) {
461 case "SCORM":
462 if (strcmp($this->getParent($a_xml_parser), "survey") == 0) {
463 include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
464 include_once "./Services/MetaData/classes/class.ilMD.php";
465 $md_sax_parser = new ilMDSaxParser();
466 $md_sax_parser->setXMLContent($meta["entry"]);
467 $md_sax_parser->setMDObject($tmp = new ilMD($this->survey->getId(), 0, "svy"));
468 $md_sax_parser->enableMDParsing(true);
469 $md_sax_parser->startParsing();
470 $this->survey->MDUpdateListener("General");
471 }
472 break;
473 case "author":
474 $this->survey->setAuthor($meta["entry"]);
475 break;
476 case "description":
477 $this->survey->setDescription($meta["entry"]);
478 break;
479 case "evaluation_access":
480 $this->survey->setEvaluationAccess($meta["entry"]);
481 break;
482 case "evaluation_access":
483 $this->survey->setEvaluationAccess($meta["entry"]);
484 break;
485 case "anonymize":
486 $this->survey->setAnonymize($meta["entry"]);
487 break;
488 case "status":
489 $this->survey->setStatus($meta["entry"]);
490 break;
491 case "startdate":
492 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT0H0M0S/", $meta["entry"], $matches)) {
493 $this->survey->setStartDate(sprintf("%04d-%02d-%02d", $matches[1], $matches[2], $matches[3]));
494 $this->survey->setStartDateEnabled(1);
495 }
496 break;
497 case "enddate":
498 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT0H0M0S/", $meta["entry"], $matches)) {
499 $this->survey->setEndDate(sprintf("%04d-%02d-%02d", $matches[1], $matches[2], $matches[3]));
500 $this->survey->setEndDateEnabled(1);
501 }
502 break;
503 case "display_question_titles":
504 if ($meta["entry"]) {
505 $this->survey->showQuestionTitles();
506 }
507 break;
508 }
509 if (preg_match("/questionblock_(\d+)/", $meta["label"], $matches)) {
510 // handle questionblocks
511 $qb = $meta["entry"];
512 preg_match("/<title>(.*?)<\/title>/", $qb, $matches);
513 $qb_title = $matches[1];
514 preg_match("/<questions>(.*?)<\/questions>/", $qb, $matches);
515 $qb_questions = $matches[1];
516 $qb_questions_array = explode(",", $qb_questions);
517 array_push($this->questionblocks, array(
518 "title" => $qb_title,
519 "questions" => $qb_questions_array
520 ));
521 }
522 if (preg_match("/constraint_(\d+)/", $meta["label"], $matches)) {
523 $constraint = $meta["entry"];
524 $constraint_array = explode(",", $constraint);
525 if (count($constraint_array) == 3) {
526 array_push($this->constraints, array(
527 "sourceref" => $matches[1],
528 "destref" => $constraint_array[0],
529 "relation" => $constraint_array[1],
530 "value" => $constraint_array[2]
531 ));
532 }
533 }
534 if (preg_match("/heading_(\d+)/", $meta["label"], $matches)) {
535 $heading = $meta["entry"];
536 $this->textblocks[$matches[1]] = $heading;
537 }
538 }
539 }
540 break;
541 case "mattext":
542 $this->material[count($this->material)-1]["text"] = $this->characterbuffer;
543 break;
544 case "matimage":
545 $this->material[count($this->material)-1]["image"] = $this->characterbuffer;
546 break;
547 case "material":
548 if ($this->in_survey) {
549 if (strcmp($this->getParent($a_xml_parser), "objectives") == 0) {
550 if (strcmp($this->material[0]["label"], "introduction") == 0) {
551 if (is_object($this->survey)) {
552 $this->survey->setIntroduction($this->material[0]["text"]);
553 }
554 }
555 if (strcmp($this->material[0]["label"], "outro") == 0) {
556 if (is_object($this->survey)) {
557 $this->survey->setOutro($this->material[0]["text"]);
558 }
559 }
560 $this->material = array();
561 }
562 } else {
563 switch ($this->getParent($a_xml_parser)) {
564 case "response_num":
565 case "response_lid":
566 case "response_str":
567 if (is_object($this->activequestion)) {
568 $this->activequestion->setMaterial($this->material[0]["text"], true, $this->material[0]["label"]);
569 }
570 break;
571 case "flow":
572 if (is_object($this->activequestion)) {
573 $this->activequestion->setQuestiontext($this->material[0]["text"]);
574 }
575 break;
576 }
577 if (is_object($this->activequestion)) {
578 if ($this->in_response) {
579 switch ($this->activequestion->getQuestiontype()) {
580 case "SurveyMultipleChoiceQuestion":
581 case "SurveySingleChoiceQuestion":
582 $this->activequestion->categories->addCategory($this->material[0]["text"]);
583 break;
584 }
585 }
586 }
587 }
588 break;
589 case "response_label":
590 $this->in_response = false;
591 break;
592 }
593 $this->depth[$a_xml_parser]--;
594 }
sprintf('%.4f', $callTime)
const ORDINAL_QUESTION_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
const METRIC_QUESTION_IDENTIFIER
Old survey question import/export identifiers.
const NOMINAL_QUESTION_IDENTIFIER

References $characterbuffer, $data, $original_question_id, $questionblock, $spl, $textblock, $title, getParent(), METRIC_QUESTION_IDENTIFIER, NOMINAL_QUESTION_IDENTIFIER, ORDINAL_QUESTION_IDENTIFIER, sprintf, and TEXT_QUESTION_IDENTIFIER.

+ Here is the call graph for this function:

◆ hasError()

SurveyImportParserPre38::hasError ( )

Definition at line 646 of file class.SurveyImportParserPre38.php.

References $has_error.

◆ parse()

SurveyImportParserPre38::parse (   $a_xml_parser,
  $a_fp = null 
)

parse xml file

@access private

Reimplemented from ilSaxParser.

Definition at line 166 of file class.SurveyImportParserPre38.php.

167 {
168 switch ($this->getInputType()) {
169 case 'file':
170
171 while ($data = fread($a_fp, 4096)) {
172 $parseOk = xml_parse($a_xml_parser, $data, feof($a_fp));
173 }
174 break;
175
176 case 'string':
177 $parseOk = xml_parse($a_xml_parser, $this->getXMLContent());
178 break;
179 }
180 if (!$parseOk
181 && (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE)) {
182 $this->error_code = xml_get_error_code($a_xml_parser);
183 $this->error_line = xml_get_current_line_number($a_xml_parser);
184 $this->error_col = xml_get_current_column_number($a_xml_parser);
185 $this->error_msg = xml_error_string($a_xml_parser);
186 $this->has_error = true;
187 return false;
188 }
189 return true;
190 }

References $data, ilSaxParser\getInputType(), and ilSaxParser\getXMLContent().

+ Here is the call graph for this function:

◆ setHandlers()

SurveyImportParserPre38::setHandlers (   $a_xml_parser)

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

Reimplemented from ilSaxParser.

Definition at line 146 of file class.SurveyImportParserPre38.php.

147 {
148 xml_set_object($a_xml_parser, $this);
149 xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
150 xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
151 }

◆ setSurveyObject()

SurveyImportParserPre38::setSurveyObject (   $a_svy)

Sets a reference to a survey object @access public.

Definition at line 136 of file class.SurveyImportParserPre38.php.

137 {
138 $this->survey = $a_svy;
139 }

◆ startParsing()

SurveyImportParserPre38::startParsing ( )

start the parser

Reimplemented from ilSaxParser.

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

157 {
158 parent::startParsing();
159 }

Field Documentation

◆ $activequestion

SurveyImportParserPre38::$activequestion

Definition at line 47 of file class.SurveyImportParserPre38.php.

◆ $activetag

SurveyImportParserPre38::$activetag

Definition at line 60 of file class.SurveyImportParserPre38.php.

◆ $adjectives

SurveyImportParserPre38::$adjectives

Definition at line 67 of file class.SurveyImportParserPre38.php.

◆ $anonymisation

SurveyImportParserPre38::$anonymisation

Definition at line 71 of file class.SurveyImportParserPre38.php.

◆ $attributes

SurveyImportParserPre38::$attributes

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

Referenced by getXMLAttributes().

◆ $characterbuffer

SurveyImportParserPre38::$characterbuffer

Definition at line 59 of file class.SurveyImportParserPre38.php.

Referenced by handlerCharacterData(), and handlerEndTag().

◆ $constraints

SurveyImportParserPre38::$constraints

Definition at line 75 of file class.SurveyImportParserPre38.php.

◆ $depth

SurveyImportParserPre38::$depth

Definition at line 46 of file class.SurveyImportParserPre38.php.

◆ $elements

SurveyImportParserPre38::$elements

Definition at line 55 of file class.SurveyImportParserPre38.php.

Referenced by getXMLElements().

◆ $error_code

SurveyImportParserPre38::$error_code

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

Referenced by getErrorCode().

◆ $error_col

SurveyImportParserPre38::$error_col

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

Referenced by getErrorColumn(), and getFullError().

◆ $error_line

SurveyImportParserPre38::$error_line

Definition at line 50 of file class.SurveyImportParserPre38.php.

Referenced by getErrorLine().

◆ $error_msg

SurveyImportParserPre38::$error_msg

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

Referenced by getErrorMessage().

◆ $has_error

SurveyImportParserPre38::$has_error

Definition at line 53 of file class.SurveyImportParserPre38.php.

Referenced by hasError().

◆ $in_question

SurveyImportParserPre38::$in_question

Definition at line 84 of file class.SurveyImportParserPre38.php.

◆ $in_questionblock

SurveyImportParserPre38::$in_questionblock

Definition at line 78 of file class.SurveyImportParserPre38.php.

◆ $in_reponse

SurveyImportParserPre38::$in_reponse

Definition at line 85 of file class.SurveyImportParserPre38.php.

◆ $in_survey

SurveyImportParserPre38::$in_survey

Definition at line 69 of file class.SurveyImportParserPre38.php.

◆ $is_matrix

SurveyImportParserPre38::$is_matrix

Definition at line 66 of file class.SurveyImportParserPre38.php.

◆ $material

SurveyImportParserPre38::$material

Definition at line 61 of file class.SurveyImportParserPre38.php.

◆ $matrix

SurveyImportParserPre38::$matrix

Definition at line 65 of file class.SurveyImportParserPre38.php.

◆ $metadata

SurveyImportParserPre38::$metadata

Definition at line 62 of file class.SurveyImportParserPre38.php.

◆ $original_question_id

SurveyImportParserPre38::$original_question_id

Definition at line 74 of file class.SurveyImportParserPre38.php.

Referenced by handlerEndTag().

◆ $path

SurveyImportParserPre38::$path

Definition at line 45 of file class.SurveyImportParserPre38.php.

◆ $question_description

SurveyImportParserPre38::$question_description

Definition at line 86 of file class.SurveyImportParserPre38.php.

◆ $question_title

SurveyImportParserPre38::$question_title

Definition at line 83 of file class.SurveyImportParserPre38.php.

◆ $questionblock

SurveyImportParserPre38::$questionblock

Definition at line 79 of file class.SurveyImportParserPre38.php.

Referenced by handlerEndTag().

◆ $questionblocks

SurveyImportParserPre38::$questionblocks

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

◆ $questionblocktitle

SurveyImportParserPre38::$questionblocktitle

Definition at line 81 of file class.SurveyImportParserPre38.php.

◆ $questions

SurveyImportParserPre38::$questions

Definition at line 73 of file class.SurveyImportParserPre38.php.

◆ $response_id

SurveyImportParserPre38::$response_id

Definition at line 64 of file class.SurveyImportParserPre38.php.

◆ $responses

SurveyImportParserPre38::$responses

Definition at line 63 of file class.SurveyImportParserPre38.php.

◆ $size

SurveyImportParserPre38::$size

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

Referenced by getXMLSize().

◆ $spl

SurveyImportParserPre38::$spl

Definition at line 48 of file class.SurveyImportParserPre38.php.

Referenced by handlerEndTag().

◆ $spl_exists

SurveyImportParserPre38::$spl_exists

Definition at line 68 of file class.SurveyImportParserPre38.php.

Referenced by __construct().

◆ $survey

SurveyImportParserPre38::$survey

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

◆ $surveyaccess

SurveyImportParserPre38::$surveyaccess

Definition at line 72 of file class.SurveyImportParserPre38.php.

◆ $text_size

SurveyImportParserPre38::$text_size

Definition at line 58 of file class.SurveyImportParserPre38.php.

Referenced by getXMLTextSize().

◆ $textblock

SurveyImportParserPre38::$textblock

Definition at line 76 of file class.SurveyImportParserPre38.php.

Referenced by handlerEndTag().

◆ $textblocks

SurveyImportParserPre38::$textblocks

Definition at line 77 of file class.SurveyImportParserPre38.php.

◆ $texts

SurveyImportParserPre38::$texts

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

Referenced by getXMLTextSections().


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