ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.SurveyImportParser.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24require_once("./Services/Xml/classes/class.ilSaxParser.php");
25
36{
37 public $path;
38 public $depth;
40 public $spl;
43 public $error_col;
44 public $error_msg;
45 public $has_error;
46 public $size;
47 public $elements;
49 public $texts;
50 public $text_size;
52 public $activetag;
53 public $material;
54 public $metadata;
55 public $responses;
56 public $variables;
58 public $matrix;
60 public $is_matrix;
63 public $in_survey;
64 public $survey;
67 public $questions;
70 public $textblock;
77
85 public function __construct($a_spl_id, $a_xml_file = '', $spl_exists = false, $a_mapping = null)
86 {
87 parent::__construct($a_xml_file);
88 $this->spl_id = $a_spl_id;
89 $this->has_error = false;
90 $this->characterbuffer = "";
91 $this->survey_status = 0;
92 $this->activetag = "";
93 $this->material = array();
94 $this->depth = array();
95 $this->path = array();
96 $this->metadata = array();
97 $this->responses = array();
98 $this->variables = array();
99 $this->response_id = "";
100 $this->matrix = array();
101 $this->is_matrix = false;
102 $this->adjectives = array();
103 $this->spl_exists = $spl_exists;
104 $this->survey = null;
105 $this->in_survey = false;
106 $this->anonymisation = 0;
107 $this->surveyaccess = "restricted";
108 $this->questions = array();
109 $this->original_question_id = "";
110 $this->constraints = array();
111 $this->textblock = "";
112 $this->textblocks = array();
113 $this->in_questionblock = false;
114 $this->questionblocks = array();
115 $this->questionblock = array();
116 $this->showQuestiontext = 1;
117 $this->questionblocktitle = "";
118 $this->mapping = $a_mapping;
119 }
120
125 public function setSurveyObject($a_svy)
126 {
127 $this->survey = $a_svy;
128 }
129
135 public function setHandlers($a_xml_parser)
136 {
137 xml_set_object($a_xml_parser, $this);
138 xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
139 xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
140 }
141
145 public function startParsing()
146 {
147 parent::startParsing();
148 }
149
155 public function parse($a_xml_parser, $a_fp = null)
156 {
157 switch ($this->getInputType()) {
158 case 'file':
159
160 while ($data = fread($a_fp, 4096)) {
161 $parseOk = xml_parse($a_xml_parser, $data, feof($a_fp));
162 }
163 break;
164
165 case 'string':
166 $parseOk = xml_parse($a_xml_parser, $this->getXMLContent());
167 break;
168 }
169 if (!$parseOk
170 && (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE)) {
171 $this->error_code = xml_get_error_code($a_xml_parser);
172 $this->error_line = xml_get_current_line_number($a_xml_parser);
173 $this->error_col = xml_get_current_column_number($a_xml_parser);
174 $this->error_msg = xml_error_string($a_xml_parser);
175 $this->has_error = true;
176 return false;
177 }
178 return true;
179 }
180
181 public function getParent($a_xml_parser)
182 {
183 if ($this->depth[$a_xml_parser] > 0) {
184 return $this->path[$this->depth[$a_xml_parser]-1];
185 } else {
186 return "";
187 }
188 }
189
193 public function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
194 {
195 $this->depth[$a_xml_parser]++;
196 $this->path[$this->depth[$a_xml_parser]] = strtolower($a_name);
197 $this->characterbuffer = "";
198 $this->activetag = $a_name;
199 $this->elements++;
200 $this->attributes+=count($a_attribs);
201 switch ($a_name) {
202 case "questionblock":
203 $this->in_questionblock = true;
204 $this->questionblock = array();
205 $this->questionblocktitle = "";
206 $this->showQuestiontext = 1;
207 foreach ($a_attribs as $attrib => $value) {
208 switch ($attrib) {
209 case "showQuestiontext":
210 $this->showQuestiontext = $value;
211 break;
212 }
213 }
214 break;
215 case "surveyquestions":
216 foreach ($a_attribs as $attrib => $value) {
217 switch ($attrib) {
218 case "online":
219 if ($this->spl_id > 0) {
220 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
221 $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
222 $spl->setOnline($value);
223 $spl->saveToDb();
224 }
225 break;
226 }
227 }
228 break;
229 case "survey":
230 $this->in_survey = true;
231 foreach ($a_attribs as $attrib => $value) {
232 switch ($attrib) {
233 case "title":
234 if (is_object($this->survey)) {
235 $this->survey->setTitle($value);
236 }
237 break;
238 }
239 }
240 break;
241 case "anonymisation":
242 foreach ($a_attribs as $attrib => $value) {
243 switch ($attrib) {
244 case "enabled":
245 $this->anonymisation = $value;
246 break;
247 }
248 }
249 break;
250 case "access":
251 foreach ($a_attribs as $attrib => $value) {
252 switch ($attrib) {
253 case "type":
254 $this->surveyaccess = $value;
255 break;
256 }
257 }
258 break;
259 case "constraint":
260 array_push(
261 $this->constraints,
262 array(
263 "sourceref" => $a_attribs["sourceref"],
264 "destref" => $a_attribs["destref"],
265 "relation" => $a_attribs["relation"],
266 "value" => $a_attribs["value"],
267
268 // might be missing in old export files
269 "conjunction" => (int) $a_attribs["conjuction"]
270 )
271 );
272 break;
273 case "question":
274 // start with a new survey question
275 $type = $a_attribs["type"];
276 // patch due to changes in question types
277 switch ($type) {
278 case 'SurveyNominalQuestion':
279 $type = 'SurveyMultipleChoiceQuestion';
280 foreach ($a_attribs as $key => $value) {
281 switch ($key) {
282 case "subtype":
283 if ($value == 1) {
284 $type = 'SurveySingleChoiceQuestion';
285 } else {
286 $type = 'SurveyMultipleChoiceQuestion';
287 }
288 break;
289 }
290 }
291 break;
292 case 'SurveyOrdinalQuestion':
293 $type = 'SurveySingleChoiceQuestion';
294 break;
295 }
296 if (strlen($type)) {
297 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
299 $this->activequestion = new $type();
300
301 // if no pool is given, question will reference survey
302 $q_obj_id = $this->spl_id;
303 if ($this->spl_id < 0) {
304 $q_obj_id = $this->survey->getId();
305 }
306
307 $this->activequestion->setObjId($q_obj_id);
308 }
309 } else {
310 $this->activequestion = null;
311 }
312 $this->original_question_id = $a_attribs["id"];
313 if ($this->in_questionblock) {
314 array_push($this->questionblock, $this->original_question_id);
315 }
316 if (is_object($this->activequestion)) {
317 foreach ($a_attribs as $key => $value) {
318 switch ($key) {
319 case "title":
320 $this->activequestion->setTitle($value);
321 break;
322 case "subtype":
323 $this->activequestion->setSubtype($value);
324 break;
325 case "obligatory":
326 $this->activequestion->setObligatory($value);
327 break;
328 }
329 }
330 }
331 break;
332 case "material":
333 switch ($this->getParent($a_xml_parser)) {
334 case "question":
335 case "questiontext":
336 $this->material = array();
337 break;
338 }
339 array_push($this->material, array("text" => "", "image" => "", "label" => $a_attribs["label"]));
340 break;
341 case "matimage":
342 case "label":
343 if (array_key_exists("label", $a_attribs)) {
344 if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $a_attribs["label"], $matches)) {
345 // import an mediaobject which was inserted using tiny mce
346 if (!is_array($_SESSION["import_mob_xhtml"])) {
347 $_SESSION["import_mob_xhtml"] = array();
348 }
349 array_push($_SESSION["import_mob_xhtml"], array("mob" => $a_attribs["label"], "uri" => $a_attribs["uri"], "type" => $a_attribs["type"], "id" => $a_attribs["id"]));
350 }
351 }
352 break;
353 case "metadata":
354 $this->metadata = array();
355 break;
356 case "metadatafield":
357 array_push($this->metadata, array("label" => "", "entry" => ""));
358 break;
359 case "matrix":
360 $this->is_matrix = true;
361 $this->matrix = array();
362 break;
363 case "matrixrow":
364 $this->material = array();
365 array_push($this->matrix, "");
366 $this->matrixrowattribs = array("id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"]);
367 break;
368 case "responses":
369 $this->material = array();
370 $this->responses = array();
371 break;
372 case "variables":
373 $this->variables = array();
374 break;
375 case "response_single":
376 $this->material = array();
377 $this->responses[$a_attribs["id"]] = array("type" => "single", "id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"], "neutral" => $a_attribs["neutral"], "scale" => $a_attribs["scale"]);
378 $this->response_id = $a_attribs["id"];
379 break;
380 case "response_multiple":
381 $this->material = array();
382 $this->responses[$a_attribs["id"]] = array("type" => "multiple", "id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"], "neutral" => $a_attribs["neutral"], "scale" => $a_attribs["scale"]);
383 $this->response_id = $a_attribs["id"];
384 break;
385 case "response_text":
386 $this->material = array();
387 $this->responses[$a_attribs["id"]] = array("type" => "text", "id" => $a_attribs["id"], "columns" => $a_attribs["columns"], "maxlength" => $a_attribs["maxlength"], "rows" => $a_attribs["rows"], "label" => $a_attribs["label"]);
388 $this->response_id = $a_attribs["id"];
389 break;
390 case "response_num":
391 $this->material = array();
392 $this->responses[$a_attribs["id"]] = array("type" => "num", "id" => $a_attribs["id"], "format" => $a_attribs["format"], "max" => $a_attribs["max"], "min" => $a_attribs["min"], "size" => $a_attribs["size"], "label" => $a_attribs["label"]);
393 $this->response_id = $a_attribs["id"];
394 break;
395 case "response_time":
396 $this->material = array();
397 $this->responses[$a_attribs["id"]] = array("type" => "time", "id" => $a_attribs["id"], "format" => $a_attribs["format"], "max" => $a_attribs["max"], "min" => $a_attribs["min"], "label" => $a_attribs["label"]);
398 $this->response_id = $a_attribs["id"];
399 break;
400 case "bipolar_adjectives":
401 $this->adjectives = array();
402 break;
403 case "adjective":
404 array_push($this->adjectives, array("label" => $a_attribs["label"], "text" => ""));
405 break;
406 }
407 }
408
412 public function handlerCharacterData($a_xml_parser, $a_data)
413 {
414 $this->texts++;
415 $this->text_size+=strlen($a_data);
416 $this->characterbuffer .= $a_data;
417 $a_data = $this->characterbuffer;
418 }
419
423 public function handlerEndTag($a_xml_parser, $a_name)
424 {
425 switch ($a_name) {
426 case "surveyobject":
427 if (is_object($this->survey)) {
428 $this->survey->setStatus($this->survey_status);
429 $this->survey->saveToDb();
430
431 // write question blocks
432 if (count($this->questionblocks)) {
433 foreach ($this->questionblocks as $data) {
434 $questionblock = $data["questions"];
435 $title = $data["title"];
436 $qblock = array();
437 foreach ($questionblock as $question_id) {
438 array_push($qblock, $this->questions[$question_id]);
439 }
440 $this->survey->createQuestionblock($title, $this->showQuestiontext, false, $qblock);
441 }
442 }
443
444 // #13878 - write constraints
445 if (count($this->constraints)) {
446 $relations = $this->survey->getAllRelations(true);
447 foreach ($this->constraints as $constraint) {
448 $constraint_id= $this->survey->addConstraint($this->questions[$constraint["destref"]], $relations[$constraint["relation"]]["id"], $constraint["value"], $constraint["conjunction"]);
449 $this->survey->addConstraintToQuestion($this->questions[$constraint["sourceref"]], $constraint_id);
450 }
451 }
452
453 // write textblocks
454 if (count($this->textblocks)) {
455 foreach ($this->textblocks as $original_id => $textblock) {
456 $this->survey->saveHeading($textblock, $this->questions[$original_id]);
457 }
458 }
459 }
460 break;
461 case "survey":
462 $this->in_survey = false;
463 if (is_object($this->survey)) {
464 if (strcmp($this->surveyaccess, "free") == 0) {
465 $this->survey->setAnonymize(2);
466 } else {
467 if ($this->anonymisation == 0) {
468 $this->survey->setAnonymize(0);
469 } else {
470 $this->survey->setAnonymize(1);
471 }
472 }
473 }
474 break;
475 case "startingtime":
476 if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches)) {
477 if (is_object($this->survey)) {
478 $this->survey->setStartDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
479 }
480 }
481 break;
482 case "endingtime":
483 if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches)) {
484 if (is_object($this->survey)) {
485 $this->survey->setEndDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
486 }
487 }
488 break;
489 case "description":
490 if ($this->in_survey) {
491 if (is_object($this->survey)) {
492 $this->survey->setDescription($this->characterbuffer);
493 }
494 } else {
495 if (is_object($this->activequestion)) {
496 $this->activequestion->setDescription($this->characterbuffer);
497 }
498 }
499 break;
500 case "question":
501 if (is_object($this->activequestion)) {
502 if (strlen($this->textblock)) {
504 }
505 $this->activequestion->saveToDb();
506 // duplicate the question for the survey (if pool is to be used)
507 if (is_object($this->survey) &&
508 $this->spl_id > 0) {
509 $question_id = $this->activequestion->duplicate(true, "", "", "", $this->survey->getId());
510 } else {
511 $question_id = $this->activequestion->getId();
512 }
513 if (is_object($this->survey)) { // #15452
514 $this->survey->addQuestion($question_id);
515 }
516 $this->questions[$this->original_question_id] = $question_id;
517 if ($this->mapping) {
518 $this->mapping->addMapping("Modules/Survey", "svy_q", $this->original_question_id, $question_id);
519 }
520 $this->activequestion = null;
521 }
522 $this->textblock = "";
523 break;
524 case "author":
525 if ($this->in_survey) {
526 if (is_object($this->survey)) {
527 $this->survey->setAuthor($this->characterbuffer);
528 }
529 } else {
530 if (is_object($this->activequestion)) {
531 $this->activequestion->setAuthor($this->characterbuffer);
532 }
533 }
534 break;
535 case "mattext":
536 $this->material[count($this->material)-1]["text"] = $this->characterbuffer;
537 break;
538 case "matimage":
539 $this->material[count($this->material)-1]["image"] = $this->characterbuffer;
540 break;
541 case "material":
542 if ($this->in_survey) {
543 if (strcmp($this->getParent($a_xml_parser), "objectives") == 0) {
544 if (strcmp($this->material[0]["label"], "introduction") == 0) {
545 if (is_object($this->survey)) {
546 $this->survey->setIntroduction($this->material[0]["text"]);
547 }
548 }
549 if (strcmp($this->material[0]["label"], "outro") == 0) {
550 if (is_object($this->survey)) {
551 $this->survey->setOutro($this->material[0]["text"]);
552 }
553 }
554 $this->material = array();
555 }
556 } else {
557 if (strcmp($this->getParent($a_xml_parser), "question") == 0) {
558 $this->activequestion->setMaterial($this->material[0]["text"], true, $this->material[0]["label"]);
559 }
560 }
561 break;
562 case "questiontext":
563 if (is_object($this->activequestion)) {
564 $questiontext = "";
565 foreach ($this->material as $matarray) {
566 $questiontext .= $matarray["text"];
567 }
568 $this->activequestion->setQuestiontext($questiontext);
569 }
570 $this->material = array();
571 break;
572 case "fieldlabel":
573 $this->metadata[count($this->metadata)-1]["label"] = $this->characterbuffer;
574 break;
575 case "fieldentry":
576 $this->metadata[count($this->metadata)-1]["entry"] = $this->characterbuffer;
577 break;
578 case "metadata":
579 if (strcmp($this->getParent($a_xml_parser), "question") == 0) {
580 if (is_object($this->activequestion)) {
581 $this->activequestion->importAdditionalMetadata($this->metadata);
582 }
583 }
584 if (strcmp($this->getParent($a_xml_parser), "survey") == 0) {
585 foreach ($this->metadata as $key => $value) {
586 switch ($value["label"]) {
587 case "SCORM":
588 if (strlen($value["entry"])) {
589 if (is_object($this->survey)) {
590 include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
591 include_once "./Services/MetaData/classes/class.ilMD.php";
592 $md_sax_parser = new ilMDSaxParser();
593 $md_sax_parser->setXMLContent($value["entry"]);
594 $md_sax_parser->setMDObject($tmp = new ilMD($this->survey->getId(), 0, "svy"));
595 $md_sax_parser->enableMDParsing(true);
596 $md_sax_parser->startParsing();
597 $this->survey->MDUpdateListener("General");
598 }
599 }
600 break;
601 case "display_question_titles":
602 if ($value["entry"] == 1) {
603 $this->survey->showQuestionTitles();
604 } else {
605 $this->survey->hideQuestionTitles();
606 }
607 break;
608 case "status":
609 $this->survey_status = $value["entry"];
610 break;
611 case "evaluation_access":
612 $this->survey->setEvaluationAccess($value["entry"]);
613 break;
614 case "pool_usage":
615 $this->survey->setPoolUsage($value["entry"]);
616 break;
617 case "own_results_view":
618 $this->survey->setViewOwnResults($value["entry"]);
619 break;
620 case "own_results_mail":
621 $this->survey->setMailOwnResults($value["entry"]);
622 break;
623 case "confirmation_mail":
624 $this->survey->setMailConfirmation($value["entry"]);
625 break;
626 case "anon_user_list":
627 $this->survey->setAnonymousUserList($value["entry"]);
628 break;
629 case "mode_360":
630 $this->survey->set360Mode($value["entry"]);
631 break;
632 case "mode_360_self_eval":
633 $this->survey->set360SelfEvaluation($value["entry"]);
634 break;
635 case "mode_360_self_rate":
636 $this->survey->set360SelfRaters($value["entry"]);
637 break;
638 case "mode_360_self_appr":
639 $this->survey->set360SelfAppraisee($value["entry"]);
640 break;
641 case "mode_360_results":
642 $this->survey->set360Results($value["entry"]);
643 break;
644 case "mode_360_skill_service":
645 $this->survey->set360SkillService($value["entry"]);
646 break;
647 }
648 }
649 }
650 if (!$this->spl_exists) {
651 if (strcmp($this->getParent($a_xml_parser), "surveyquestions") == 0) {
652 foreach ($this->metadata as $key => $value) {
653 if (strcmp($value["label"], "SCORM") == 0) {
654 if (strlen($value["entry"])) {
655 if ($this->spl_id > 0) {
656 include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
657 include_once "./Services/MetaData/classes/class.ilMD.php";
658 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
659 $md_sax_parser = new ilMDSaxParser();
660 $md_sax_parser->setXMLContent($value["entry"]);
661 $md_sax_parser->setMDObject($tmp = new ilMD($this->spl_id, 0, "spl"));
662 $md_sax_parser->enableMDParsing(true);
663 $md_sax_parser->startParsing();
664 $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
665 $spl->MDUpdateListener("General");
666 }
667 }
668 }
669 }
670 }
671 }
672 break;
673 case "responses":
674 if (is_object($this->activequestion)) {
675 $this->activequestion->importResponses($this->responses);
676 }
677 $this->is_matrix = false;
678 break;
679 case "variable":
680 array_push($this->variables, $this->characterbuffer);
681 break;
682 case "variables":
683 if (is_object($this->activequestion)) {
684 $this->activequestion->importVariables($this->variables);
685 }
686 break;
687 case "response_single":
688 case "response_multiple":
689 case "response_text":
690 case "response_num":
691 case "response_time":
692 $this->responses[$this->response_id]["material"] = $this->material;
693 break;
694 case "adjective":
695 $this->adjectives[count($this->adjectives)-1]["text"] = $this->characterbuffer;
696 break;
697 case "bipolar_adjectives":
698 if (is_object($this->activequestion)) {
699 $this->activequestion->importAdjectives($this->adjectives);
700 }
701 break;
702 case "matrixrow":
703 $row = "";
704 foreach ($this->material as $material) {
705 $row .= $material["text"];
706 }
707 $this->matrix[count($this->matrix)-1] = array('title' => $row, 'id' => $this->matrixrowattribs['id'], 'label' => $this->matrixrowattribs['label'], 'other' => $this->matrixrowattribs['other']);
708 break;
709 case "matrix":
710 if (is_object($this->activequestion)) {
711 $this->activequestion->importMatrix($this->matrix);
712 }
713 break;
714 case "textblock":
715 $this->textblock = $this->characterbuffer;
716 break;
717 case "questionblocktitle":
718 $this->questionblocktitle = $this->characterbuffer;
719 break;
720 case "questionblock":
721 $this->in_questionblock = false;
722 array_push($this->questionblocks, array("title" => $this->questionblocktitle, "questions" => $this->questionblock));
723 break;
724 }
725 $this->depth[$a_xml_parser]--;
726 }
727
728 public function getErrorCode()
729 {
730 return $this->error_code;
731 }
732
733 public function getErrorLine()
734 {
735 return $this->error_line;
736 }
737
738 public function getErrorColumn()
739 {
740 return $this->error_col;
741 }
742
743 public function getErrorMessage()
744 {
745 return $this->error_msg;
746 }
747
748 public function getFullError()
749 {
750 return "Error: " . $this->error_msg . " at line:" . $this->error_line . " column:" . $this->error_col;
751 }
752
753 public function getXMLSize()
754 {
755 return $this->size;
756 }
757
758 public function getXMLElements()
759 {
760 return $this->elements;
761 }
762
763 public function getXMLAttributes()
764 {
765 return $this->attributes;
766 }
767
768 public function getXMLTextSections()
769 {
770 return $this->texts;
771 }
772
773 public function getXMLTextSize()
774 {
775 return $this->text_size;
776 }
777
778 public function hasError()
779 {
780 return $this->has_error;
781 }
782}
sprintf('%.4f', $callTime)
$attrib
Regular expression to match HTML/XML attribute pairs within a tag.
Definition: Sanitizer.php:42
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
Survey Question Import Parser.
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
startParsing()
start the parser
parse($a_xml_parser, $a_fp=null)
parse xml file
setSurveyObject($a_svy)
Sets a reference to a survey object @access public.
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private
__construct($a_spl_id, $a_xml_file='', $spl_exists=false, $a_mapping=null)
Constructor.
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
$key
Definition: croninfo.php:18
$type