ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
24 require_once("./Services/Xml/classes/class.ilSaxParser.php");
25 
36 {
37  public $path;
38  public $depth;
40  public $spl;
41  public $error_code;
42  public $error_line;
43  public $error_col;
44  public $error_msg;
45  public $has_error;
46  public $size;
47  public $elements;
48  public $attributes;
49  public $texts;
50  public $text_size;
52  public $activetag;
53  public $material;
54  public $metadata;
55  public $responses;
56  public $variables;
57  public $response_id;
58  public $matrix;
60  public $is_matrix;
61  public $adjectives;
62  public $spl_exists;
63  public $in_survey;
64  public $survey;
66  public $surveyaccess;
67  public $questions;
69  public $constraints;
70  public $textblock;
71  public $textblocks;
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  $this->survey->update(true);
237  }
238  break;
239  }
240  }
241  break;
242  case "anonymisation":
243  foreach ($a_attribs as $attrib => $value) {
244  switch ($attrib) {
245  case "enabled":
246  $this->anonymisation = $value;
247  break;
248  }
249  }
250  break;
251  case "access":
252  foreach ($a_attribs as $attrib => $value) {
253  switch ($attrib) {
254  case "type":
255  $this->surveyaccess = $value;
256  break;
257  }
258  }
259  break;
260  case "constraint":
261  array_push(
262  $this->constraints,
263  array(
264  "sourceref" => $a_attribs["sourceref"],
265  "destref" => $a_attribs["destref"],
266  "relation" => $a_attribs["relation"],
267  "value" => $a_attribs["value"],
268 
269  // might be missing in old export files
270  "conjunction" => (int) $a_attribs["conjuction"]
271  )
272  );
273  break;
274  case "question":
275  // start with a new survey question
276  $type = $a_attribs["type"];
277  // patch due to changes in question types
278  switch ($type) {
279  case 'SurveyNominalQuestion':
280  $type = 'SurveyMultipleChoiceQuestion';
281  foreach ($a_attribs as $key => $value) {
282  switch ($key) {
283  case "subtype":
284  if ($value == 1) {
285  $type = 'SurveySingleChoiceQuestion';
286  } else {
287  $type = 'SurveyMultipleChoiceQuestion';
288  }
289  break;
290  }
291  }
292  break;
293  case 'SurveyOrdinalQuestion':
294  $type = 'SurveySingleChoiceQuestion';
295  break;
296  }
297  if (strlen($type)) {
298  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
300  $this->activequestion = new $type();
301 
302  // if no pool is given, question will reference survey
303  $q_obj_id = $this->spl_id;
304  if ($this->spl_id < 0) {
305  $q_obj_id = $this->survey->getId();
306  }
307 
308  $this->activequestion->setObjId($q_obj_id);
309  }
310  } else {
311  $this->activequestion = null;
312  }
313  $this->original_question_id = $a_attribs["id"];
314  if ($this->in_questionblock) {
315  array_push($this->questionblock, $this->original_question_id);
316  }
317  if (is_object($this->activequestion)) {
318  foreach ($a_attribs as $key => $value) {
319  switch ($key) {
320  case "title":
321  $this->activequestion->setTitle($value);
322  break;
323  case "subtype":
324  $this->activequestion->setSubtype($value);
325  break;
326  case "obligatory":
327  $this->activequestion->setObligatory($value);
328  break;
329  }
330  }
331  }
332  break;
333  case "material":
334  switch ($this->getParent($a_xml_parser)) {
335  case "question":
336  case "questiontext":
337  $this->material = array();
338  break;
339  }
340  array_push($this->material, array("text" => "", "image" => "", "label" => $a_attribs["label"]));
341  break;
342  case "matimage":
343  case "label":
344  if (array_key_exists("label", $a_attribs)) {
345  if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $a_attribs["label"], $matches)) {
346  // import an mediaobject which was inserted using tiny mce
347  if (!is_array($_SESSION["import_mob_xhtml"])) {
348  $_SESSION["import_mob_xhtml"] = array();
349  }
350  array_push($_SESSION["import_mob_xhtml"], array("mob" => $a_attribs["label"], "uri" => $a_attribs["uri"], "type" => $a_attribs["type"], "id" => $a_attribs["id"]));
351  }
352  }
353  break;
354  case "metadata":
355  $this->metadata = array();
356  break;
357  case "metadatafield":
358  array_push($this->metadata, array("label" => "", "entry" => ""));
359  break;
360  case "matrix":
361  $this->is_matrix = true;
362  $this->matrix = array();
363  break;
364  case "matrixrow":
365  $this->material = array();
366  array_push($this->matrix, "");
367  $this->matrixrowattribs = array("id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"]);
368  break;
369  case "responses":
370  $this->material = array();
371  $this->responses = array();
372  break;
373  case "variables":
374  $this->variables = array();
375  break;
376  case "response_single":
377  $this->material = array();
378  $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"]);
379  $this->response_id = $a_attribs["id"];
380  break;
381  case "response_multiple":
382  $this->material = array();
383  $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"]);
384  $this->response_id = $a_attribs["id"];
385  break;
386  case "response_text":
387  $this->material = array();
388  $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"]);
389  $this->response_id = $a_attribs["id"];
390  break;
391  case "response_num":
392  $this->material = array();
393  $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"]);
394  $this->response_id = $a_attribs["id"];
395  break;
396  case "response_time":
397  $this->material = array();
398  $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"]);
399  $this->response_id = $a_attribs["id"];
400  break;
401  case "bipolar_adjectives":
402  $this->adjectives = array();
403  break;
404  case "adjective":
405  array_push($this->adjectives, array("label" => $a_attribs["label"], "text" => ""));
406  break;
407  }
408  }
409 
413  public function handlerCharacterData($a_xml_parser, $a_data)
414  {
415  $this->texts++;
416  $this->text_size += strlen($a_data);
417  $this->characterbuffer .= $a_data;
418  $a_data = $this->characterbuffer;
419  }
420 
424  public function handlerEndTag($a_xml_parser, $a_name)
425  {
426  switch ($a_name) {
427  case "surveyobject":
428  if (is_object($this->survey)) {
429  $this->survey->setOfflineStatus(!$this->survey_status);
430  $this->survey->saveToDb();
431 
432  // write question blocks
433  if (count($this->questionblocks)) {
434  foreach ($this->questionblocks as $data) {
435  $questionblock = $data["questions"];
436  $title = $data["title"];
437  $qblock = array();
438  foreach ($questionblock as $question_id) {
439  array_push($qblock, $this->questions[$question_id]);
440  }
441  $this->survey->createQuestionblock($title, $this->showQuestiontext, false, $qblock);
442  }
443  }
444 
445  // #13878 - write constraints
446  if (count($this->constraints)) {
447  $relations = $this->survey->getAllRelations(true);
448  foreach ($this->constraints as $constraint) {
449  $constraint_id = $this->survey->addConstraint($this->questions[$constraint["destref"]], $relations[$constraint["relation"]]["id"], $constraint["value"], $constraint["conjunction"]);
450  $this->survey->addConstraintToQuestion($this->questions[$constraint["sourceref"]], $constraint_id);
451  }
452  }
453 
454  // write textblocks
455  if (count($this->textblocks)) {
456  foreach ($this->textblocks as $original_id => $textblock) {
457  $this->survey->saveHeading($textblock, $this->questions[$original_id]);
458  }
459  }
460  }
461  break;
462  case "survey":
463  $this->in_survey = false;
464  if (is_object($this->survey)) {
465  if (strcmp($this->surveyaccess, "free") == 0) {
466  $this->survey->setAnonymize(2);
467  } else {
468  if ($this->anonymisation == 0) {
469  $this->survey->setAnonymize(0);
470  } else {
471  $this->survey->setAnonymize(1);
472  }
473  }
474  }
475  break;
476  case "startingtime":
477  if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches)) {
478  if (is_object($this->survey)) {
479  $this->survey->setStartDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
480  }
481  }
482  break;
483  case "endingtime":
484  if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches)) {
485  if (is_object($this->survey)) {
486  $this->survey->setEndDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
487  }
488  }
489  break;
490  case "description":
491  if ($this->in_survey) {
492  if (is_object($this->survey)) {
493  $this->survey->setDescription($this->characterbuffer);
494  $this->survey->update(true);
495  }
496  } else {
497  if (is_object($this->activequestion)) {
498  $this->activequestion->setDescription($this->characterbuffer);
499  }
500  }
501  break;
502  case "question":
503  if (is_object($this->activequestion)) {
504  if (strlen($this->textblock)) {
505  $this->textblocks[$this->original_question_id] = $this->textblock;
506  }
507  $this->activequestion->saveToDb();
508  // duplicate the question for the survey (if pool is to be used)
509  if (is_object($this->survey) &&
510  $this->spl_id > 0) {
511  $question_id = $this->activequestion->duplicate(true, "", "", "", $this->survey->getId());
512  } else {
513  $question_id = $this->activequestion->getId();
514  }
515  if (is_object($this->survey)) { // #15452
516  $this->survey->addQuestion($question_id);
517  }
518  $this->questions[$this->original_question_id] = $question_id;
519  if ($this->mapping) {
520  $this->mapping->addMapping("Modules/Survey", "svy_q", $this->original_question_id, $question_id);
521  }
522  $this->activequestion = null;
523  }
524  $this->textblock = "";
525  break;
526  case "author":
527  if ($this->in_survey) {
528  if (is_object($this->survey)) {
529  $this->survey->setAuthor($this->characterbuffer);
530  }
531  } else {
532  if (is_object($this->activequestion)) {
533  $this->activequestion->setAuthor($this->characterbuffer);
534  }
535  }
536  break;
537  case "mattext":
538  $this->material[count($this->material) - 1]["text"] = $this->characterbuffer;
539  break;
540  case "matimage":
541  $this->material[count($this->material) - 1]["image"] = $this->characterbuffer;
542  break;
543  case "material":
544  if ($this->in_survey) {
545  if (strcmp($this->getParent($a_xml_parser), "objectives") == 0) {
546  if (strcmp($this->material[0]["label"], "introduction") == 0) {
547  if (is_object($this->survey)) {
548  $this->survey->setIntroduction($this->material[0]["text"]);
549  }
550  }
551  if (strcmp($this->material[0]["label"], "outro") == 0) {
552  if (is_object($this->survey)) {
553  $this->survey->setOutro($this->material[0]["text"]);
554  }
555  }
556  $this->material = array();
557  }
558  } else {
559  if (strcmp($this->getParent($a_xml_parser), "question") == 0) {
560  $this->activequestion->setMaterial($this->material[0]["text"], true, $this->material[0]["label"]);
561  }
562  }
563  break;
564  case "questiontext":
565  if (is_object($this->activequestion)) {
566  $questiontext = "";
567  foreach ($this->material as $matarray) {
568  $questiontext .= $matarray["text"];
569  }
570  $this->activequestion->setQuestiontext($questiontext);
571  }
572  $this->material = array();
573  break;
574  case "fieldlabel":
575  $this->metadata[count($this->metadata) - 1]["label"] = $this->characterbuffer;
576  break;
577  case "fieldentry":
578  $this->metadata[count($this->metadata) - 1]["entry"] = $this->characterbuffer;
579  break;
580  case "metadata":
581  if (strcmp($this->getParent($a_xml_parser), "question") == 0) {
582  if (is_object($this->activequestion)) {
583  $this->activequestion->importAdditionalMetadata($this->metadata);
584  }
585  }
586  if (strcmp($this->getParent($a_xml_parser), "survey") == 0) {
587  foreach ($this->metadata as $key => $value) {
588  switch ($value["label"]) {
589  case "SCORM":
590  if (strlen($value["entry"])) {
591  if (is_object($this->survey)) {
592  include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
593  include_once "./Services/MetaData/classes/class.ilMD.php";
594  $md_sax_parser = new ilMDSaxParser();
595  $md_sax_parser->setXMLContent($value["entry"]);
596  $md_sax_parser->setMDObject($tmp = new ilMD($this->survey->getId(), 0, "svy"));
597  $md_sax_parser->enableMDParsing(true);
598  $md_sax_parser->startParsing();
599  $this->survey->MDUpdateListener("General");
600  }
601  }
602  break;
603  case "display_question_titles":
604  if ($value["entry"] == 1) {
605  $this->survey->showQuestionTitles();
606  } else {
607  $this->survey->hideQuestionTitles();
608  }
609  break;
610  case "status":
611  $this->survey_status = $value["entry"];
612  break;
613  case "evaluation_access":
614  $this->survey->setEvaluationAccess($value["entry"]);
615  break;
616  case "pool_usage":
617  $this->survey->setPoolUsage($value["entry"]);
618  break;
619  case "own_results_view":
620  $this->survey->setViewOwnResults($value["entry"]);
621  break;
622  case "own_results_mail":
623  $this->survey->setMailOwnResults($value["entry"]);
624  break;
625  case "confirmation_mail":
626  $this->survey->setMailConfirmation($value["entry"]);
627  break;
628  case "anon_user_list":
629  $this->survey->setAnonymousUserList($value["entry"]);
630  break;
631  case "mode":
632  $this->survey->setMode($value["entry"]);
633  break;
634  case "mode_360_self_eval":
635  $this->survey->set360SelfEvaluation($value["entry"]);
636  break;
637  case "mode_360_self_rate":
638  $this->survey->set360SelfRaters($value["entry"]);
639  break;
640  case "mode_360_self_appr":
641  $this->survey->set360SelfAppraisee($value["entry"]);
642  break;
643  case "mode_360_results":
644  $this->survey->set360Results($value["entry"]);
645  break;
646  case "mode_self_eval_results":
647  $this->survey->setSelfEvaluationResults($value["entry"]);
648  break;
649  case "mode_skill_service":
650  $this->survey->setSkillService($value["entry"]);
651  break;
652  }
653  }
654  }
655  if (!$this->spl_exists) {
656  if (strcmp($this->getParent($a_xml_parser), "surveyquestions") == 0) {
657  foreach ($this->metadata as $key => $value) {
658  if (strcmp($value["label"], "SCORM") == 0) {
659  if (strlen($value["entry"])) {
660  if ($this->spl_id > 0) {
661  include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
662  include_once "./Services/MetaData/classes/class.ilMD.php";
663  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
664  $md_sax_parser = new ilMDSaxParser();
665  $md_sax_parser->setXMLContent($value["entry"]);
666  $md_sax_parser->setMDObject($tmp = new ilMD($this->spl_id, 0, "spl"));
667  $md_sax_parser->enableMDParsing(true);
668  $md_sax_parser->startParsing();
669  $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
670  $spl->MDUpdateListener("General");
671  }
672  }
673  }
674  }
675  }
676  }
677  break;
678  case "responses":
679  if (is_object($this->activequestion)) {
680  $this->activequestion->importResponses($this->responses);
681  }
682  $this->is_matrix = false;
683  break;
684  case "variable":
685  array_push($this->variables, $this->characterbuffer);
686  break;
687  case "variables":
688  if (is_object($this->activequestion)) {
689  $this->activequestion->importVariables($this->variables);
690  }
691  break;
692  case "response_single":
693  case "response_multiple":
694  case "response_text":
695  case "response_num":
696  case "response_time":
697  $this->responses[$this->response_id]["material"] = $this->material;
698  break;
699  case "adjective":
700  $this->adjectives[count($this->adjectives) - 1]["text"] = $this->characterbuffer;
701  break;
702  case "bipolar_adjectives":
703  if (is_object($this->activequestion)) {
704  $this->activequestion->importAdjectives($this->adjectives);
705  }
706  break;
707  case "matrixrow":
708  $row = "";
709  foreach ($this->material as $material) {
710  $row .= $material["text"];
711  }
712  $this->matrix[count($this->matrix) - 1] = array('title' => $row, 'id' => $this->matrixrowattribs['id'], 'label' => $this->matrixrowattribs['label'], 'other' => $this->matrixrowattribs['other']);
713  break;
714  case "matrix":
715  if (is_object($this->activequestion)) {
716  $this->activequestion->importMatrix($this->matrix);
717  }
718  break;
719  case "textblock":
720  $this->textblock = $this->characterbuffer;
721  break;
722  case "questionblocktitle":
723  $this->questionblocktitle = $this->characterbuffer;
724  break;
725  case "questionblock":
726  $this->in_questionblock = false;
727  array_push($this->questionblocks, array("title" => $this->questionblocktitle, "questions" => $this->questionblock));
728  break;
729  }
730  $this->depth[$a_xml_parser]--;
731  }
732 
733  public function getErrorCode()
734  {
735  return $this->error_code;
736  }
737 
738  public function getErrorLine()
739  {
740  return $this->error_line;
741  }
742 
743  public function getErrorColumn()
744  {
745  return $this->error_col;
746  }
747 
748  public function getErrorMessage()
749  {
750  return $this->error_msg;
751  }
752 
753  public function getFullError()
754  {
755  return "Error: " . $this->error_msg . " at line:" . $this->error_line . " column:" . $this->error_col;
756  }
757 
758  public function getXMLSize()
759  {
760  return $this->size;
761  }
762 
763  public function getXMLElements()
764  {
765  return $this->elements;
766  }
767 
768  public function getXMLAttributes()
769  {
770  return $this->attributes;
771  }
772 
773  public function getXMLTextSections()
774  {
775  return $this->texts;
776  }
777 
778  public function getXMLTextSize()
779  {
780  return $this->text_size;
781  }
782 
783  public function hasError()
784  {
785  return $this->has_error;
786  }
787 }
$attrib
Regular expression to match HTML/XML attribute pairs within a tag.
Definition: Sanitizer.php:42
parse($a_xml_parser, $a_fp=null)
parse xml file
$_SESSION["AccountId"]
$type
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
setSurveyObject($a_svy)
Sets a reference to a survey object public.
Survey Question Import Parser.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
startParsing()
start the parser
__construct($a_spl_id, $a_xml_file='', $spl_exists=false, $a_mapping=null)
Constructor.
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
$row
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private
$key
Definition: croninfo.php:18
$data
Definition: bench.php:6