ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
SurveyImportParser Class Reference

Survey Question Import Parser. More...

+ Inheritance diagram for SurveyImportParser:
+ Collaboration diagram for SurveyImportParser:

Public Member Functions

 SurveyImportParser ($a_spl_id, $a_xml_file= '', $spl_exists=FALSE)
 Constructor.
 setSurveyObject (&$a_svy)
 Sets a reference to a survey object public.
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private
 startParsing ()
 start the parser
 parse ($a_xml_parser, $a_fp=null)
 parse xml file
 getParent ($a_xml_parser)
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element
 getErrorCode ()
 getErrorLine ()
 getErrorColumn ()
 getErrorMessage ()
 getFullError ()
 getXMLSize ()
 getXMLElements ()
 getXMLAttributes ()
 getXMLTextSections ()
 getXMLTextSize ()
 hasError ()
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($a_xml_file= '', $throwException=false)
 Constructor setup ILIAS global object public.
 setXMLContent ($a_xml_content)
 getXMLContent ()
 getInputType ()
 createParser ()
 create parser
 setOptions ($a_xml_parser)
 set parser options
 openXMLFile ()
 open xml file
 freeParser ($a_xml_parser)
 free xml parser handle
 setThrowException ($throwException)
 set error handling
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor.
 _PEAR ()
 Destructor (the emulated type of...).
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.
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes.
 isError ($data, $code=null)
 Tell whether a value is a PEAR error.
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled.
 expectError ($code= '*')
 This method is used to tell which errors you expect to get.
 popExpect ()
 This method pops one element off the expected error codes stack.
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available.
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack.
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.
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options.
 staticPushErrorHandling ($mode, $options=null)
 staticPopErrorHandling ()
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack.
 popErrorHandling ()
 Pop the last error handler used.
 loadExtension ($ext)
 OS independant PHP extension load.

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
 $variables
 $response_id
 $matrix
 $matrixrowattribs
 $is_matrix
 $adjectives
 $spl_exists
 $in_survey
 $survey
 $anonymisation
 $surveyaccess
 $questions
 $original_question_id
 $constraints
 $textblock
 $textblocks
 $survey_status
 $in_questionblock
 $questionblock
 $questionblocks
 $questionblocktitle
- 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

- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle

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 35 of file class.SurveyImportParser.php.

Member Function Documentation

SurveyImportParser::getErrorCode ( )

Definition at line 822 of file class.SurveyImportParser.php.

References $error_code.

{
}
SurveyImportParser::getErrorColumn ( )

Definition at line 832 of file class.SurveyImportParser.php.

References $error_col.

{
}
SurveyImportParser::getErrorLine ( )

Definition at line 827 of file class.SurveyImportParser.php.

References $error_line.

{
}
SurveyImportParser::getErrorMessage ( )

Definition at line 837 of file class.SurveyImportParser.php.

References $error_msg.

{
}
SurveyImportParser::getFullError ( )

Definition at line 842 of file class.SurveyImportParser.php.

References $error_col.

{
return "Error: ".$this->error_msg." at line:".$this->error_line ." column:".$this->error_col;
}
SurveyImportParser::getParent (   $a_xml_parser)

Definition at line 183 of file class.SurveyImportParser.php.

Referenced by handlerBeginTag(), and handlerEndTag().

{
if ($this->depth[$a_xml_parser] > 0)
{
return $this->path[$this->depth[$a_xml_parser]-1];
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

SurveyImportParser::getXMLAttributes ( )

Definition at line 857 of file class.SurveyImportParser.php.

References $attributes.

{
}
SurveyImportParser::getXMLElements ( )

Definition at line 852 of file class.SurveyImportParser.php.

References $elements.

{
return $this->elements;
}
SurveyImportParser::getXMLSize ( )

Definition at line 847 of file class.SurveyImportParser.php.

References $size.

{
return $this->size;
}
SurveyImportParser::getXMLTextSections ( )

Definition at line 862 of file class.SurveyImportParser.php.

References $texts.

{
return $this->texts;
}
SurveyImportParser::getXMLTextSize ( )

Definition at line 867 of file class.SurveyImportParser.php.

References $text_size.

{
}
SurveyImportParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 198 of file class.SurveyImportParser.php.

References $_SESSION, $attrib, $spl, SurveyQuestion\_includeClass(), and getParent().

{
$this->depth[$a_xml_parser]++;
$this->path[$this->depth[$a_xml_parser]] = strtolower($a_name);
$this->characterbuffer = "";
$this->activetag = $a_name;
$this->elements++;
$this->attributes+=count($a_attribs);
switch ($a_name)
{
case "questionblock":
$this->in_questionblock = TRUE;
$this->questionblock = array();
$this->questionblocktitle = "";
$this->showQuestiontext = 1;
foreach ($a_attribs as $attrib => $value)
{
switch ($attrib)
{
case "showQuestiontext":
$this->showQuestiontext = $value;
break;
}
}
break;
case "surveyquestions":
foreach ($a_attribs as $attrib => $value)
{
switch ($attrib)
{
case "online":
if ($this->spl_id > 0)
{
include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
$spl = new ilObjSurveyQuestionPool($this->spl_id, false);
$spl->setOnline($value);
$spl->saveToDb();
}
break;
}
}
break;
case "survey":
$this->in_survey = TRUE;
foreach ($a_attribs as $attrib => $value)
{
switch ($attrib)
{
case "title":
if (is_object($this->survey))
{
$this->survey->setTitle($value);
}
break;
}
}
break;
case "anonymisation":
foreach ($a_attribs as $attrib => $value)
{
switch ($attrib)
{
case "enabled":
$this->anonymisation = $value;
break;
}
}
break;
case "access":
foreach ($a_attribs as $attrib => $value)
{
switch ($attrib)
{
case "type":
$this->surveyaccess = $value;
break;
}
}
break;
case "constraint":
array_push($this->constraints,
array(
"sourceref" => $a_attribs["sourceref"],
"destref" => $a_attribs["destref"],
"relation" => $a_attribs["relation"],
"value" => $a_attribs["value"],
// might be missing in old export files
"conjunction" => (int)$a_attribs["conjuction"]
)
);
break;
case "question":
// start with a new survey question
$type = $a_attribs["type"];
// patch due to changes in question types
switch ($type)
{
case 'SurveyNominalQuestion':
$type = 'SurveyMultipleChoiceQuestion';
foreach ($a_attribs as $key => $value)
{
switch ($key)
{
case "subtype":
if ($value == 1)
{
$type = 'SurveySingleChoiceQuestion';
}
else
{
$type = 'SurveyMultipleChoiceQuestion';
}
break;
}
}
break;
case 'SurveyOrdinalQuestion':
$type = 'SurveySingleChoiceQuestion';
break;
}
if (strlen($type))
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
{
$this->activequestion = new $type();
// if no pool is given, question will reference survey
$q_obj_id = $this->spl_id;
if($this->spl_id < 0)
{
$q_obj_id = $this->survey->getId();
}
$this->activequestion->setObjId($q_obj_id);
}
}
else
{
$this->activequestion = NULL;
}
$this->original_question_id = $a_attribs["id"];
if ($this->in_questionblock)
{
array_push($this->questionblock, $this->original_question_id);
}
if (is_object($this->activequestion))
{
foreach ($a_attribs as $key => $value)
{
switch ($key)
{
case "title":
$this->activequestion->setTitle($value);
break;
case "subtype":
$this->activequestion->setSubtype($value);
break;
case "obligatory":
$this->activequestion->setObligatory($value);
break;
}
}
}
break;
case "material":
switch ($this->getParent($a_xml_parser))
{
case "question":
case "questiontext":
$this->material = array();
break;
}
array_push($this->material, array("text" => "", "image" => "", "label" => $a_attribs["label"]));
break;
case "matimage":
case "label":
if (array_key_exists("label", $a_attribs))
{
if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $a_attribs["label"], $matches))
{
// import an mediaobject which was inserted using tiny mce
if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
array_push($_SESSION["import_mob_xhtml"], array("mob" => $a_attribs["label"], "uri" => $a_attribs["uri"], "type" => $a_attribs["type"], "id" => $a_attribs["id"]));
}
}
break;
case "metadata":
$this->metadata = array();
break;
case "metadatafield":
array_push($this->metadata, array("label" => "", "entry" => ""));
break;
case "matrix":
$this->is_matrix = TRUE;
$this->matrix = array();
break;
case "matrixrow":
$this->material = array();
array_push($this->matrix, "");
$this->matrixrowattribs = array("id" => $a_attribs["id"], "label" => $a_attribs["label"], "other" => $a_attribs["other"]);
break;
case "responses":
$this->material = array();
$this->responses = array();
break;
case "variables":
$this->variables = array();
break;
case "response_single":
$this->material = array();
$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"]);
$this->response_id = $a_attribs["id"];
break;
case "response_multiple":
$this->material = array();
$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"]);
$this->response_id = $a_attribs["id"];
break;
case "response_text":
$this->material = array();
$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"]);
$this->response_id = $a_attribs["id"];
break;
case "response_num":
$this->material = array();
$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"]);
$this->response_id = $a_attribs["id"];
break;
case "response_time":
$this->material = array();
$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"]);
$this->response_id = $a_attribs["id"];
break;
case "bipolar_adjectives":
$this->adjectives = array();
break;
case "adjective":
array_push($this->adjectives, array("label" => $a_attribs["label"], "text" => ""));
break;
}
}

+ Here is the call graph for this function:

SurveyImportParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 445 of file class.SurveyImportParser.php.

References $characterbuffer.

{
$this->texts++;
$this->text_size+=strlen($a_data);
$this->characterbuffer .= $a_data;
}
SurveyImportParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 456 of file class.SurveyImportParser.php.

References $characterbuffer, $material, $original_question_id, $questionblock, $response_id, $row, $spl, $textblock, and getParent().

{
switch ($a_name)
{
case "surveyobject":
if (is_object($this->survey))
{
$this->survey->setStatus($this->survey_status);
$this->survey->saveToDb();
// write question blocks
if (count($this->questionblocks))
{
foreach ($this->questionblocks as $data)
{
$questionblock = $data["questions"];
$title = $data["title"];
$qblock = array();
foreach ($questionblock as $question_id)
{
array_push($qblock, $this->questions[$question_id]);
}
$this->survey->createQuestionblock($title, $this->showQuestiontext, false, $qblock);
}
}
// #13878 - write constraints
if (count($this->constraints))
{
$relations = $this->survey->getAllRelations(TRUE);
foreach ($this->constraints as $constraint)
{
$constraint_id= $this->survey->addConstraint($this->questions[$constraint["destref"]], $relations[$constraint["relation"]]["id"], $constraint["value"], $constraint["conjunction"]);
$this->survey->addConstraintToQuestion($this->questions[$constraint["sourceref"]], $constraint_id);
}
}
// write textblocks
if (count($this->textblocks))
{
foreach ($this->textblocks as $original_id => $textblock)
{
$this->survey->saveHeading($textblock, $this->questions[$original_id]);
}
}
}
break;
case "survey":
$this->in_survey = FALSE;
if (is_object($this->survey))
{
if (strcmp($this->surveyaccess, "free") == 0)
{
$this->survey->setAnonymize(2);
}
else
{
if ($this->anonymisation == 0)
{
$this->survey->setAnonymize(0);
}
else
{
$this->survey->setAnonymize(1);
}
}
}
break;
case "startingtime":
if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2}).*/", $this->characterbuffer, $matches))
{
if (is_object($this->survey))
{
$this->survey->setStartDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
$this->survey->setStartDateEnabled(1);
}
}
break;
case "endingtime":
if (preg_match("/(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2}).*/", $this->characterbuffer, $matches))
{
if (is_object($this->survey))
{
$this->survey->setEndDate(sprintf("%04d%02d%02d%02d%02d%02d", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6]));
$this->survey->setEndDateEnabled(1);
}
}
break;
case "description":
if ($this->in_survey)
{
if (is_object($this->survey))
{
$this->survey->setDescription($this->characterbuffer);
}
}
else
{
if (is_object($this->activequestion))
{
$this->activequestion->setDescription($this->characterbuffer);
}
}
break;
case "question":
if (is_object($this->activequestion))
{
if (strlen($this->textblock))
{
}
$this->activequestion->saveToDb();
// duplicate the question for the survey (if pool is to be used)
if (is_object($this->survey) &&
$this->spl_id > 0)
{
$question_id = $this->activequestion->duplicate(TRUE);
}
else
{
$question_id = $this->activequestion->getId();
}
if (is_object($this->survey)) // #15452
{
$this->survey->addQuestion($question_id);
}
$this->questions[$this->original_question_id] = $question_id;
$this->activequestion = NULL;
}
$this->textblock = "";
break;
case "author":
if ($this->in_survey)
{
if (is_object($this->survey))
{
$this->survey->setAuthor($this->characterbuffer);
}
}
else
{
if (is_object($this->activequestion))
{
$this->activequestion->setAuthor($this->characterbuffer);
}
}
break;
case "mattext":
$this->material[count($this->material)-1]["text"] = $this->characterbuffer;
break;
case "matimage":
$this->material[count($this->material)-1]["image"] = $this->characterbuffer;
break;
case "material":
if ($this->in_survey)
{
if (strcmp($this->getParent($a_xml_parser), "objectives") == 0)
{
if (strcmp($this->material[0]["label"], "introduction") == 0)
{
if (is_object($this->survey))
{
$this->survey->setIntroduction($this->material[0]["text"]);
}
}
if (strcmp($this->material[0]["label"], "outro") == 0)
{
if (is_object($this->survey))
{
$this->survey->setOutro($this->material[0]["text"]);
}
}
$this->material = array();
}
}
else
{
if (strcmp($this->getParent($a_xml_parser), "question") == 0)
{
$this->activequestion->setMaterial($this->material[0]["text"], TRUE, $this->material[0]["label"]);
}
}
break;
case "questiontext":
if (is_object($this->activequestion))
{
$questiontext = "";
foreach ($this->material as $matarray)
{
$questiontext .= $matarray["text"];
}
$this->activequestion->setQuestiontext($questiontext);
}
$this->material = array();
break;
case "fieldlabel":
$this->metadata[count($this->metadata)-1]["label"] = $this->characterbuffer;
break;
case "fieldentry":
$this->metadata[count($this->metadata)-1]["entry"] = $this->characterbuffer;
break;
case "metadata":
if (strcmp($this->getParent($a_xml_parser), "question") == 0)
{
if (is_object($this->activequestion))
{
$this->activequestion->importAdditionalMetadata($this->metadata);
}
}
if (strcmp($this->getParent($a_xml_parser), "survey") == 0)
{
foreach ($this->metadata as $key => $value)
{
switch ($value["label"])
{
case "SCORM":
if (strlen($value["entry"]))
{
if (is_object($this->survey))
{
include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
include_once "./Services/MetaData/classes/class.ilMD.php";
$md_sax_parser = new ilMDSaxParser();
$md_sax_parser->setXMLContent($value["entry"]);
$md_sax_parser->setMDObject($tmp = new ilMD($this->survey->getId(),0, "svy"));
$md_sax_parser->enableMDParsing(true);
$md_sax_parser->startParsing();
$this->survey->MDUpdateListener("General");
}
}
break;
case "display_question_titles":
if ($value["entry"] == 1)
{
$this->survey->showQuestionTitles();
}
else
{
$this->survey->hideQuestionTitles();
}
break;
case "status":
$this->survey_status = $value["entry"];
break;
case "evaluation_access":
$this->survey->setEvaluationAccess($value["entry"]);
break;
case "pool_usage":
$this->survey->setPoolUsage($value["entry"]);
break;
case "own_results_view":
$this->survey->setViewOwnResults($value["entry"]);
break;
case "own_results_mail":
$this->survey->setMailOwnResults($value["entry"]);
break;
case "mode_360":
$this->survey->set360Mode($value["entry"]);
break;
case "mode_360_self_eval":
$this->survey->set360SelfEvaluation($value["entry"]);
break;
case "mode_360_self_rate":
$this->survey->set360SelfRaters($value["entry"]);
break;
case "mode_360_self_appr":
$this->survey->set360SelfAppraisee($value["entry"]);
break;
case "mode_360_results":
$this->survey->set360Results($value["entry"]);
break;
case "mode_360_skill_service":
$this->survey->set360SkillService($value["entry"]);
break;
}
}
}
if (!$this->spl_exists)
{
if (strcmp($this->getParent($a_xml_parser), "surveyquestions") == 0)
{
foreach ($this->metadata as $key => $value)
{
if (strcmp($value["label"], "SCORM") == 0)
{
if (strlen($value["entry"]))
{
if ($this->spl_id > 0)
{
include_once "./Services/MetaData/classes/class.ilMDSaxParser.php";
include_once "./Services/MetaData/classes/class.ilMD.php";
include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
$md_sax_parser = new ilMDSaxParser();
$md_sax_parser->setXMLContent($value["entry"]);
$md_sax_parser->setMDObject($tmp = new ilMD($this->spl_id,0, "spl"));
$md_sax_parser->enableMDParsing(true);
$md_sax_parser->startParsing();
$spl = new ilObjSurveyQuestionPool($this->spl_id, false);
$spl->MDUpdateListener("General");
}
}
}
}
}
}
break;
case "responses":
if (is_object($this->activequestion))
{
$this->activequestion->importResponses($this->responses);
}
$this->is_matrix = FALSE;
break;
case "variable":
array_push($this->variables, $this->characterbuffer);
break;
case "variables":
if (is_object($this->activequestion))
{
$this->activequestion->importVariables($this->variables);
}
break;
case "response_single":
case "response_multiple":
case "response_text":
case "response_num":
case "response_time":
$this->responses[$this->response_id]["material"] = $this->material;
break;
case "adjective":
$this->adjectives[count($this->adjectives)-1]["text"] = $this->characterbuffer;
break;
case "bipolar_adjectives":
if (is_object($this->activequestion))
{
$this->activequestion->importAdjectives($this->adjectives);
}
break;
case "matrixrow":
$row = "";
foreach ($this->material as $material)
{
$row .= $material["text"];
}
$this->matrix[count($this->matrix)-1] = array('title' => $row, 'id' => $this->matrixrowattribs['id'], 'label' => $this->matrixrowattribs['label'], 'other' => $this->matrixrowattribs['other']);
break;
case "matrix":
if (is_object($this->activequestion))
{
$this->activequestion->importMatrix($this->matrix);
}
break;
case "textblock":
$this->textblock = $this->characterbuffer;
break;
case "questionblocktitle":
$this->questionblocktitle = $this->characterbuffer;
break;
case "questionblock":
$this->in_questionblock = FALSE;
array_push($this->questionblocks, array("title" => $this->questionblocktitle, "questions" => $this->questionblock));
break;
}
$this->depth[$a_xml_parser]--;
}

+ Here is the call graph for this function:

SurveyImportParser::hasError ( )

Definition at line 872 of file class.SurveyImportParser.php.

References $has_error.

{
}
SurveyImportParser::parse (   $a_xml_parser,
  $a_fp = null 
)

parse xml file

private

Reimplemented from ilSaxParser.

Definition at line 154 of file class.SurveyImportParser.php.

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

{
switch($this->getInputType())
{
case 'file':
while($data = fread($a_fp,4096))
{
$parseOk = xml_parse($a_xml_parser,$data,feof($a_fp));
}
break;
case 'string':
$parseOk = xml_parse($a_xml_parser,$this->getXMLContent());
break;
}
if(!$parseOk
&& (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE))
{
$this->error_code = xml_get_error_code($a_xml_parser);
$this->error_line = xml_get_current_line_number($a_xml_parser);
$this->error_col = xml_get_current_column_number($a_xml_parser);
$this->error_msg = xml_error_string($a_xml_parser);
$this->has_error = TRUE;
return false;
}
return true;
}

+ Here is the call graph for this function:

SurveyImportParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class private

Reimplemented from ilSaxParser.

Definition at line 134 of file class.SurveyImportParser.php.

{
xml_set_object($a_xml_parser,$this);
xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
}
SurveyImportParser::setSurveyObject ( $a_svy)

Sets a reference to a survey object public.

Definition at line 124 of file class.SurveyImportParser.php.

{
$this->survey =& $a_svy;
}
SurveyImportParser::startParsing ( )

start the parser

Reimplemented from ilSaxParser.

Definition at line 144 of file class.SurveyImportParser.php.

SurveyImportParser::SurveyImportParser (   $a_spl_id,
  $a_xml_file = '',
  $spl_exists = FALSE 
)

Constructor.

Parameters
string$a_xml_filexml file

public

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

References $spl_exists, and ilSaxParser\ilSaxParser().

{
parent::ilSaxParser($a_xml_file);
$this->spl_id = $a_spl_id;
$this->has_error = FALSE;
$this->characterbuffer = "";
$this->survey_status = 0;
$this->activetag = "";
$this->material = array();
$this->depth = array();
$this->path = array();
$this->metadata = array();
$this->responses = array();
$this->variables = array();
$this->response_id = "";
$this->matrix = array();
$this->is_matrix = FALSE;
$this->adjectives = array();
$this->spl_exists = $spl_exists;
$this->survey = NULL;
$this->in_survey = FALSE;
$this->anonymisation = 0;
$this->surveyaccess = "restricted";
$this->questions = array();
$this->original_question_id = "";
$this->constraints = array();
$this->textblock = "";
$this->textblocks = array();
$this->in_questionblock = FALSE;
$this->questionblocks = array();
$this->questionblock = array();
$this->showQuestiontext = 1;
$this->questionblocktitle = "";
}

+ Here is the call graph for this function:

Field Documentation

SurveyImportParser::$activequestion

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

SurveyImportParser::$activetag

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

SurveyImportParser::$adjectives

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

SurveyImportParser::$anonymisation

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

SurveyImportParser::$attributes

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

Referenced by getXMLAttributes().

SurveyImportParser::$characterbuffer

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

Referenced by handlerCharacterData(), and handlerEndTag().

SurveyImportParser::$constraints

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

SurveyImportParser::$depth

Definition at line 38 of file class.SurveyImportParser.php.

SurveyImportParser::$elements

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

Referenced by getXMLElements().

SurveyImportParser::$error_code

Definition at line 41 of file class.SurveyImportParser.php.

Referenced by getErrorCode().

SurveyImportParser::$error_col

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

Referenced by getErrorColumn(), and getFullError().

SurveyImportParser::$error_line

Definition at line 42 of file class.SurveyImportParser.php.

Referenced by getErrorLine().

SurveyImportParser::$error_msg

Definition at line 44 of file class.SurveyImportParser.php.

Referenced by getErrorMessage().

SurveyImportParser::$has_error

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

Referenced by hasError().

SurveyImportParser::$in_questionblock

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

SurveyImportParser::$in_survey

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

SurveyImportParser::$is_matrix

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

SurveyImportParser::$material

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

Referenced by handlerEndTag().

SurveyImportParser::$matrix

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

SurveyImportParser::$matrixrowattribs

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

SurveyImportParser::$metadata

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

SurveyImportParser::$original_question_id

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

Referenced by handlerEndTag().

SurveyImportParser::$path

Definition at line 37 of file class.SurveyImportParser.php.

SurveyImportParser::$questionblock

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

Referenced by handlerEndTag().

SurveyImportParser::$questionblocks

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

SurveyImportParser::$questionblocktitle

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

SurveyImportParser::$questions

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

SurveyImportParser::$response_id

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

Referenced by handlerEndTag().

SurveyImportParser::$responses

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

SurveyImportParser::$size

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

Referenced by getXMLSize().

SurveyImportParser::$spl

Definition at line 40 of file class.SurveyImportParser.php.

Referenced by handlerBeginTag(), and handlerEndTag().

SurveyImportParser::$spl_exists

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

Referenced by SurveyImportParser().

SurveyImportParser::$survey

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

SurveyImportParser::$survey_status

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

SurveyImportParser::$surveyaccess

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

SurveyImportParser::$text_size

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

Referenced by getXMLTextSize().

SurveyImportParser::$textblock

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

Referenced by handlerEndTag().

SurveyImportParser::$textblocks

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

SurveyImportParser::$texts

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

Referenced by getXMLTextSections().

SurveyImportParser::$variables

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


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