ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  var $path;
38  var $depth;
40  var $spl;
46  var $size;
47  var $elements;
49  var $texts;
53  var $material;
54  var $metadata;
58  var $matrix;
64  var $survey;
77 
85  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  function setSurveyObject($a_svy)
126  {
127  $this->survey = $a_svy;
128  }
129 
135  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  function startParsing()
146  {
147  parent::startParsing();
148  }
149 
155  function parse($a_xml_parser,$a_fp = null)
156  {
157  switch($this->getInputType())
158  {
159  case 'file':
160 
161  while($data = fread($a_fp,4096))
162  {
163  $parseOk = xml_parse($a_xml_parser,$data,feof($a_fp));
164  }
165  break;
166 
167  case 'string':
168  $parseOk = xml_parse($a_xml_parser,$this->getXMLContent());
169  break;
170  }
171  if(!$parseOk
172  && (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE))
173  {
174  $this->error_code = xml_get_error_code($a_xml_parser);
175  $this->error_line = xml_get_current_line_number($a_xml_parser);
176  $this->error_col = xml_get_current_column_number($a_xml_parser);
177  $this->error_msg = xml_error_string($a_xml_parser);
178  $this->has_error = TRUE;
179  return false;
180  }
181  return true;
182  }
183 
184  function getParent($a_xml_parser)
185  {
186  if ($this->depth[$a_xml_parser] > 0)
187  {
188  return $this->path[$this->depth[$a_xml_parser]-1];
189  }
190  else
191  {
192  return "";
193  }
194  }
195 
199  function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
200  {
201  $this->depth[$a_xml_parser]++;
202  $this->path[$this->depth[$a_xml_parser]] = strtolower($a_name);
203  $this->characterbuffer = "";
204  $this->activetag = $a_name;
205  $this->elements++;
206  $this->attributes+=count($a_attribs);
207  switch ($a_name)
208  {
209  case "questionblock":
210  $this->in_questionblock = TRUE;
211  $this->questionblock = array();
212  $this->questionblocktitle = "";
213  $this->showQuestiontext = 1;
214  foreach ($a_attribs as $attrib => $value)
215  {
216  switch ($attrib)
217  {
218  case "showQuestiontext":
219  $this->showQuestiontext = $value;
220  break;
221  }
222  }
223  break;
224  case "surveyquestions":
225  foreach ($a_attribs as $attrib => $value)
226  {
227  switch ($attrib)
228  {
229  case "online":
230  if ($this->spl_id > 0)
231  {
232  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
233  $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
234  $spl->setOnline($value);
235  $spl->saveToDb();
236  }
237  break;
238  }
239  }
240  break;
241  case "survey":
242  $this->in_survey = TRUE;
243  foreach ($a_attribs as $attrib => $value)
244  {
245  switch ($attrib)
246  {
247  case "title":
248  if (is_object($this->survey))
249  {
250  $this->survey->setTitle($value);
251  }
252  break;
253  }
254  }
255  break;
256  case "anonymisation":
257  foreach ($a_attribs as $attrib => $value)
258  {
259  switch ($attrib)
260  {
261  case "enabled":
262  $this->anonymisation = $value;
263  break;
264  }
265  }
266  break;
267  case "access":
268  foreach ($a_attribs as $attrib => $value)
269  {
270  switch ($attrib)
271  {
272  case "type":
273  $this->surveyaccess = $value;
274  break;
275  }
276  }
277  break;
278  case "constraint":
279  array_push($this->constraints,
280  array(
281  "sourceref" => $a_attribs["sourceref"],
282  "destref" => $a_attribs["destref"],
283  "relation" => $a_attribs["relation"],
284  "value" => $a_attribs["value"],
285 
286  // might be missing in old export files
287  "conjunction" => (int)$a_attribs["conjuction"]
288  )
289  );
290  break;
291  case "question":
292  // start with a new survey question
293  $type = $a_attribs["type"];
294  // patch due to changes in question types
295  switch ($type)
296  {
297  case 'SurveyNominalQuestion':
298  $type = 'SurveyMultipleChoiceQuestion';
299  foreach ($a_attribs as $key => $value)
300  {
301  switch ($key)
302  {
303  case "subtype":
304  if ($value == 1)
305  {
306  $type = 'SurveySingleChoiceQuestion';
307  }
308  else
309  {
310  $type = 'SurveyMultipleChoiceQuestion';
311  }
312  break;
313  }
314  }
315  break;
316  case 'SurveyOrdinalQuestion':
317  $type = 'SurveySingleChoiceQuestion';
318  break;
319  }
320  if (strlen($type))
321  {
322  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
324  {
325  $this->activequestion = new $type();
326 
327  // if no pool is given, question will reference survey
328  $q_obj_id = $this->spl_id;
329  if($this->spl_id < 0)
330  {
331  $q_obj_id = $this->survey->getId();
332  }
333 
334  $this->activequestion->setObjId($q_obj_id);
335  }
336  }
337  else
338  {
339  $this->activequestion = NULL;
340  }
341  $this->original_question_id = $a_attribs["id"];
342  if ($this->in_questionblock)
343  {
344  array_push($this->questionblock, $this->original_question_id);
345  }
346  if (is_object($this->activequestion))
347  {
348  foreach ($a_attribs as $key => $value)
349  {
350  switch ($key)
351  {
352  case "title":
353  $this->activequestion->setTitle($value);
354  break;
355  case "subtype":
356  $this->activequestion->setSubtype($value);
357  break;
358  case "obligatory":
359  $this->activequestion->setObligatory($value);
360  break;
361  }
362  }
363  }
364  break;
365  case "material":
366  switch ($this->getParent($a_xml_parser))
367  {
368  case "question":
369  case "questiontext":
370  $this->material = array();
371  break;
372  }
373  array_push($this->material, array("text" => "", "image" => "", "label" => $a_attribs["label"]));
374  break;
375  case "matimage":
376  case "label":
377  if (array_key_exists("label", $a_attribs))
378  {
379  if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $a_attribs["label"], $matches))
380  {
381  // import an mediaobject which was inserted using tiny mce
382  if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
383  array_push($_SESSION["import_mob_xhtml"], array("mob" => $a_attribs["label"], "uri" => $a_attribs["uri"], "type" => $a_attribs["type"], "id" => $a_attribs["id"]));
384  }
385  }
386  break;
387  case "metadata":
388  $this->metadata = array();
389  break;
390  case "metadatafield":
391  array_push($this->metadata, array("label" => "", "entry" => ""));
392  break;
393  case "matrix":
394  $this->is_matrix = TRUE;
395  $this->matrix = array();
396  break;
397  case "matrixrow":
398  $this->material = array();
399  array_push($this->matrix, "");
400  $this->matrixrowattribs = array("id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"]);
401  break;
402  case "responses":
403  $this->material = array();
404  $this->responses = array();
405  break;
406  case "variables":
407  $this->variables = array();
408  break;
409  case "response_single":
410  $this->material = array();
411  $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"]);
412  $this->response_id = $a_attribs["id"];
413  break;
414  case "response_multiple":
415  $this->material = array();
416  $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"]);
417  $this->response_id = $a_attribs["id"];
418  break;
419  case "response_text":
420  $this->material = array();
421  $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"]);
422  $this->response_id = $a_attribs["id"];
423  break;
424  case "response_num":
425  $this->material = array();
426  $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"]);
427  $this->response_id = $a_attribs["id"];
428  break;
429  case "response_time":
430  $this->material = array();
431  $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"]);
432  $this->response_id = $a_attribs["id"];
433  break;
434  case "bipolar_adjectives":
435  $this->adjectives = array();
436  break;
437  case "adjective":
438  array_push($this->adjectives, array("label" => $a_attribs["label"], "text" => ""));
439  break;
440  }
441  }
442 
446  function handlerCharacterData($a_xml_parser, $a_data)
447  {
448  $this->texts++;
449  $this->text_size+=strlen($a_data);
450  $this->characterbuffer .= $a_data;
451  $a_data = $this->characterbuffer;
452  }
453 
457  function handlerEndTag($a_xml_parser, $a_name)
458  {
459  switch ($a_name)
460  {
461  case "surveyobject":
462  if (is_object($this->survey))
463  {
464  $this->survey->setStatus($this->survey_status);
465  $this->survey->saveToDb();
466 
467  // write question blocks
468  if (count($this->questionblocks))
469  {
470  foreach ($this->questionblocks as $data)
471  {
472  $questionblock = $data["questions"];
473  $title = $data["title"];
474  $qblock = array();
475  foreach ($questionblock as $question_id)
476  {
477  array_push($qblock, $this->questions[$question_id]);
478  }
479  $this->survey->createQuestionblock($title, $this->showQuestiontext, false, $qblock);
480  }
481  }
482 
483  // #13878 - write constraints
484  if (count($this->constraints))
485  {
486  $relations = $this->survey->getAllRelations(TRUE);
487  foreach ($this->constraints as $constraint)
488  {
489  $constraint_id= $this->survey->addConstraint($this->questions[$constraint["destref"]], $relations[$constraint["relation"]]["id"], $constraint["value"], $constraint["conjunction"]);
490  $this->survey->addConstraintToQuestion($this->questions[$constraint["sourceref"]], $constraint_id);
491  }
492  }
493 
494  // write textblocks
495  if (count($this->textblocks))
496  {
497  foreach ($this->textblocks as $original_id => $textblock)
498  {
499  $this->survey->saveHeading($textblock, $this->questions[$original_id]);
500  }
501  }
502  }
503  break;
504  case "survey":
505  $this->in_survey = FALSE;
506  if (is_object($this->survey))
507  {
508  if (strcmp($this->surveyaccess, "free") == 0)
509  {
510  $this->survey->setAnonymize(2);
511  }
512  else
513  {
514  if ($this->anonymisation == 0)
515  {
516  $this->survey->setAnonymize(0);
517  }
518  else
519  {
520  $this->survey->setAnonymize(1);
521  }
522  }
523  }
524  break;
525  case "startingtime":
526  if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches))
527  {
528  if (is_object($this->survey))
529  {
530  $this->survey->setStartDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
531  }
532  }
533  break;
534  case "endingtime":
535  if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/", $this->characterbuffer, $matches))
536  {
537  if (is_object($this->survey))
538  {
539  $this->survey->setEndDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
540  }
541  }
542  break;
543  case "description":
544  if ($this->in_survey)
545  {
546  if (is_object($this->survey))
547  {
548  $this->survey->setDescription($this->characterbuffer);
549  }
550  }
551  else
552  {
553  if (is_object($this->activequestion))
554  {
555  $this->activequestion->setDescription($this->characterbuffer);
556  }
557  }
558  break;
559  case "question":
560  if (is_object($this->activequestion))
561  {
562  if (strlen($this->textblock))
563  {
564  $this->textblocks[$this->original_question_id] = $this->textblock;
565  }
566  $this->activequestion->saveToDb();
567  // duplicate the question for the survey (if pool is to be used)
568  if (is_object($this->survey) &&
569  $this->spl_id > 0)
570  {
571  $question_id = $this->activequestion->duplicate(TRUE, "", "", "", $this->survey->getId());
572  }
573  else
574  {
575  $question_id = $this->activequestion->getId();
576  }
577  if (is_object($this->survey)) // #15452
578  {
579  $this->survey->addQuestion($question_id);
580  }
581  $this->questions[$this->original_question_id] = $question_id;
582  if($this->mapping)
583  {
584  $this->mapping->addMapping("Modules/Survey", "svy_q", $this->original_question_id, $question_id);
585  }
586  $this->activequestion = NULL;
587  }
588  $this->textblock = "";
589  break;
590  case "author":
591  if ($this->in_survey)
592  {
593  if (is_object($this->survey))
594  {
595  $this->survey->setAuthor($this->characterbuffer);
596  }
597  }
598  else
599  {
600  if (is_object($this->activequestion))
601  {
602  $this->activequestion->setAuthor($this->characterbuffer);
603  }
604  }
605  break;
606  case "mattext":
607  $this->material[count($this->material)-1]["text"] = $this->characterbuffer;
608  break;
609  case "matimage":
610  $this->material[count($this->material)-1]["image"] = $this->characterbuffer;
611  break;
612  case "material":
613  if ($this->in_survey)
614  {
615  if (strcmp($this->getParent($a_xml_parser), "objectives") == 0)
616  {
617  if (strcmp($this->material[0]["label"], "introduction") == 0)
618  {
619  if (is_object($this->survey))
620  {
621  $this->survey->setIntroduction($this->material[0]["text"]);
622  }
623  }
624  if (strcmp($this->material[0]["label"], "outro") == 0)
625  {
626  if (is_object($this->survey))
627  {
628  $this->survey->setOutro($this->material[0]["text"]);
629  }
630  }
631  $this->material = array();
632  }
633  }
634  else
635  {
636  if (strcmp($this->getParent($a_xml_parser), "question") == 0)
637  {
638  $this->activequestion->setMaterial($this->material[0]["text"], TRUE, $this->material[0]["label"]);
639  }
640  }
641  break;
642  case "questiontext":
643  if (is_object($this->activequestion))
644  {
645  $questiontext = "";
646  foreach ($this->material as $matarray)
647  {
648  $questiontext .= $matarray["text"];
649  }
650  $this->activequestion->setQuestiontext($questiontext);
651  }
652  $this->material = array();
653  break;
654  case "fieldlabel":
655  $this->metadata[count($this->metadata)-1]["label"] = $this->characterbuffer;
656  break;
657  case "fieldentry":
658  $this->metadata[count($this->metadata)-1]["entry"] = $this->characterbuffer;
659  break;
660  case "metadata":
661  if (strcmp($this->getParent($a_xml_parser), "question") == 0)
662  {
663  if (is_object($this->activequestion))
664  {
665  $this->activequestion->importAdditionalMetadata($this->metadata);
666  }
667  }
668  if (strcmp($this->getParent($a_xml_parser), "survey") == 0)
669  {
670  foreach ($this->metadata as $key => $value)
671  {
672  switch ($value["label"])
673  {
674  case "SCORM":
675  if (strlen($value["entry"]))
676  {
677  if (is_object($this->survey))
678  {
679  include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
680  include_once "./Services/MetaData/classes/class.ilMD.php";
681  $md_sax_parser = new ilMDSaxParser();
682  $md_sax_parser->setXMLContent($value["entry"]);
683  $md_sax_parser->setMDObject($tmp = new ilMD($this->survey->getId(),0, "svy"));
684  $md_sax_parser->enableMDParsing(true);
685  $md_sax_parser->startParsing();
686  $this->survey->MDUpdateListener("General");
687  }
688  }
689  break;
690  case "display_question_titles":
691  if ($value["entry"] == 1)
692  {
693  $this->survey->showQuestionTitles();
694  }
695  else
696  {
697  $this->survey->hideQuestionTitles();
698  }
699  break;
700  case "status":
701  $this->survey_status = $value["entry"];
702  break;
703  case "evaluation_access":
704  $this->survey->setEvaluationAccess($value["entry"]);
705  break;
706  case "pool_usage":
707  $this->survey->setPoolUsage($value["entry"]);
708  break;
709  case "own_results_view":
710  $this->survey->setViewOwnResults($value["entry"]);
711  break;
712  case "own_results_mail":
713  $this->survey->setMailOwnResults($value["entry"]);
714  break;
715  case "confirmation_mail":
716  $this->survey->setMailConfirmation($value["entry"]);
717  break;
718  case "anon_user_list":
719  $this->survey->setAnonymousUserList($value["entry"]);
720  break;
721  case "mode_360":
722  $this->survey->set360Mode($value["entry"]);
723  break;
724  case "mode_360_self_eval":
725  $this->survey->set360SelfEvaluation($value["entry"]);
726  break;
727  case "mode_360_self_rate":
728  $this->survey->set360SelfRaters($value["entry"]);
729  break;
730  case "mode_360_self_appr":
731  $this->survey->set360SelfAppraisee($value["entry"]);
732  break;
733  case "mode_360_results":
734  $this->survey->set360Results($value["entry"]);
735  break;
736  case "mode_360_skill_service":
737  $this->survey->set360SkillService($value["entry"]);
738  break;
739  }
740  }
741  }
742  if (!$this->spl_exists)
743  {
744  if (strcmp($this->getParent($a_xml_parser), "surveyquestions") == 0)
745  {
746  foreach ($this->metadata as $key => $value)
747  {
748  if (strcmp($value["label"], "SCORM") == 0)
749  {
750  if (strlen($value["entry"]))
751  {
752  if ($this->spl_id > 0)
753  {
754  include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
755  include_once "./Services/MetaData/classes/class.ilMD.php";
756  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
757  $md_sax_parser = new ilMDSaxParser();
758  $md_sax_parser->setXMLContent($value["entry"]);
759  $md_sax_parser->setMDObject($tmp = new ilMD($this->spl_id,0, "spl"));
760  $md_sax_parser->enableMDParsing(true);
761  $md_sax_parser->startParsing();
762  $spl = new ilObjSurveyQuestionPool($this->spl_id, false);
763  $spl->MDUpdateListener("General");
764  }
765  }
766  }
767  }
768  }
769  }
770  break;
771  case "responses":
772  if (is_object($this->activequestion))
773  {
774  $this->activequestion->importResponses($this->responses);
775  }
776  $this->is_matrix = FALSE;
777  break;
778  case "variable":
779  array_push($this->variables, $this->characterbuffer);
780  break;
781  case "variables":
782  if (is_object($this->activequestion))
783  {
784  $this->activequestion->importVariables($this->variables);
785  }
786  break;
787  case "response_single":
788  case "response_multiple":
789  case "response_text":
790  case "response_num":
791  case "response_time":
792  $this->responses[$this->response_id]["material"] = $this->material;
793  break;
794  case "adjective":
795  $this->adjectives[count($this->adjectives)-1]["text"] = $this->characterbuffer;
796  break;
797  case "bipolar_adjectives":
798  if (is_object($this->activequestion))
799  {
800  $this->activequestion->importAdjectives($this->adjectives);
801  }
802  break;
803  case "matrixrow":
804  $row = "";
805  foreach ($this->material as $material)
806  {
807  $row .= $material["text"];
808  }
809  $this->matrix[count($this->matrix)-1] = array('title' => $row, 'id' => $this->matrixrowattribs['id'], 'label' => $this->matrixrowattribs['label'], 'other' => $this->matrixrowattribs['other']);
810  break;
811  case "matrix":
812  if (is_object($this->activequestion))
813  {
814  $this->activequestion->importMatrix($this->matrix);
815  }
816  break;
817  case "textblock":
818  $this->textblock = $this->characterbuffer;
819  break;
820  case "questionblocktitle":
821  $this->questionblocktitle = $this->characterbuffer;
822  break;
823  case "questionblock":
824  $this->in_questionblock = FALSE;
825  array_push($this->questionblocks, array("title" => $this->questionblocktitle, "questions" => $this->questionblock));
826  break;
827  }
828  $this->depth[$a_xml_parser]--;
829  }
830 
831  function getErrorCode()
832  {
833  return $this->error_code;
834  }
835 
836  function getErrorLine()
837  {
838  return $this->error_line;
839  }
840 
841  function getErrorColumn()
842  {
843  return $this->error_col;
844  }
845 
846  function getErrorMessage()
847  {
848  return $this->error_msg;
849  }
850 
851  function getFullError()
852  {
853  return "Error: ".$this->error_msg." at line:".$this->error_line ." column:".$this->error_col;
854  }
855 
856  function getXMLSize()
857  {
858  return $this->size;
859  }
860 
861  function getXMLElements()
862  {
863  return $this->elements;
864  }
865 
866  function getXMLAttributes()
867  {
868  return $this->attributes;
869  }
870 
871  function getXMLTextSections()
872  {
873  return $this->texts;
874  }
875 
876  function getXMLTextSize()
877  {
878  return $this->text_size;
879  }
880 
881  function hasError()
882  {
883  return $this->has_error;
884  }
885 }
886 ?>
parse($a_xml_parser, $a_fp=null)
parse xml file
$_SESSION["AccountId"]
$attrib
Regular expression to match HTML/XML attribute pairs within a tag.
Definition: Sanitizer.php:41
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
Create styles array
The data for the language used.
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private