Public Member Functions | Data Fields

ilSurveyExport Class Reference

Public Member Functions

 ilSurveyExport (&$a_survey_obj, $a_mode="xml")
 Constructor public.
 getInstId ()
 buildExportFile ()
 build export file (complete zip file)
 buildExportFileXML ()
 build xml export file

Data Fields

 $err
 $db
 $ilias
 $survey_obj
 $inst_id
 $mode

Detailed Description

Definition at line 33 of file class.ilSurveyExport.php.


Member Function Documentation

ilSurveyExport::buildExportFile (  ) 

build export file (complete zip file)

public

Returns:

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

References buildExportFileXML().

        {
                switch ($this->mode)
                {
                        default:
                                return $this->buildExportFileXML();
                                break;
                }
        }

Here is the call graph for this function:

ilSurveyExport::buildExportFileXML (  ) 

build xml export file

Definition at line 98 of file class.ilSurveyExport.php.

References $ilBench.

Referenced by buildExportFile().

        {
                global $ilBench;

                $ilBench->start("SurveyExport", "buildExportFile");

                // create directories
                $this->survey_obj->createExportDirectory();

                // get Log File
                $expDir = $this->survey_obj->getExportDirectory();
                include_once "./classes/class.ilLog.php";
                $expLog = new ilLog($expDir, "export.log");
                $expLog->delete();
                $expLog->setLogFormat("");
                $expLog->write(date("[y-m-d H:i:s] ")."Start Export");
                // write qti file
                $qti_file = fopen($expDir . "/" . $this->filename, "w");
                fwrite($qti_file, $this->survey_obj->to_xml());
                fclose($qti_file);

                // destroy writer object
                $this->xml->_XmlWriter;

                $expLog->write(date("[y-m-d H:i:s] ")."Finished Export");
                $ilBench->stop("SurveyExport", "buildExportFile");

                return $this->filename;
        }

Here is the caller graph for this function:

ilSurveyExport::getInstId (  ) 

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

        {
                return $this->inst_id;
        }

ilSurveyExport::ilSurveyExport ( &$  a_survey_obj,
a_mode = "xml" 
)

Constructor public.

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

References $ilErr, and $ilias.

        {
                global $ilErr, $ilDB, $ilias;

                $this->survey_obj =& $a_survey_obj;

                $this->err =& $ilErr;
                $this->ilias =& $ilias;
                $this->db =& $ilDB;
                $this->mode = $a_mode;

                $settings = $this->ilias->getAllSettings();
                //$this->inst_id = $settings["inst_id"];
                $this->inst_id = IL_INST_ID;

                $date = time();
                switch($this->mode)
                {
                        default:
                                $this->export_dir = $this->survey_obj->getExportDirectory();
                                $this->subdir = $date."__".$this->inst_id."__".
                                        "survey"."__".$this->survey_obj->getId();
                                $this->filename = $this->subdir.".xml";
                                break;
                }
        }


Field Documentation

ilSurveyExport::$db

Definition at line 36 of file class.ilSurveyExport.php.

ilSurveyExport::$err

Definition at line 35 of file class.ilSurveyExport.php.

ilSurveyExport::$ilias

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

Referenced by ilSurveyExport().

ilSurveyExport::$inst_id

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

ilSurveyExport::$mode

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

ilSurveyExport::$survey_obj

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


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