ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSurveyQuestionpoolExport Class Reference

Export class for survey questionpools. More...

+ Collaboration diagram for ilSurveyQuestionpoolExport:

Public Member Functions

 ilSurveyQuestionpoolExport (&$a_spl_obj, $a_mode="xml")
 Constructor public.
 getInstId ()
 buildExportFile ($questions=null)
 build export file (complete zip file)
 buildExportFileXML ($questions=null)
 build xml export file

Data Fields

 $err
 $db
 $ilias
 $spl_obj
 $inst_id
 $mode

Detailed Description

Export class for survey questionpools.

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:
class.ilSurveyQuestionpoolExport.php 43723 2013-07-29 11:19:02Z jluetzen

Definition at line 31 of file class.ilSurveyQuestionpoolExport.php.

Member Function Documentation

ilSurveyQuestionpoolExport::buildExportFile (   $questions = null)

build export file (complete zip file)

public

Returns

Definition at line 82 of file class.ilSurveyQuestionpoolExport.php.

References buildExportFileXML().

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

+ Here is the call graph for this function:

ilSurveyQuestionpoolExport::buildExportFileXML (   $questions = null)

build xml export file

Definition at line 95 of file class.ilSurveyQuestionpoolExport.php.

References $ilBench, ilLog\delete(), ilUtil\makeDir(), and ilUtil\zip().

Referenced by buildExportFile().

{
global $ilBench;
$ilBench->start("SurveyQuestionpoolExport", "buildExportFile");
// create directories
$this->spl_obj->createExportDirectory();
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::makeDir($this->export_dir."/".$this->subdir);
// get Log File
include_once "./Services/Logging/classes/class.ilLog.php";
$expLog = new ilLog($this->spl_obj->getExportDirectory(), "export.log");
$expLog->delete();
$expLog->setLogFormat("");
$expLog->write(date("[y-m-d H:i:s] ")."Start Export");
// write qti file
$qti_file = fopen($this->export_dir."/".$this->subdir."/". $this->filename, "w");
fwrite($qti_file, $this->spl_obj->toXML($questions));
fclose($qti_file);
// destroy writer object
$this->xml->_XmlWriter;
ilUtil::zip($this->export_dir."/".$this->subdir,
$this->export_dir."/".$this->subdir.".zip");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export");
$ilBench->stop("SurveyQuestionpoolExport", "buildExportFile");
return $this->export_dir."/".$this->subdir.".zip";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyQuestionpoolExport::getInstId ( )

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

References $inst_id.

{
}
ilSurveyQuestionpoolExport::ilSurveyQuestionpoolExport ( $a_spl_obj,
  $a_mode = "xml" 
)

Constructor public.

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

References $ilErr, and $ilias.

{
global $ilErr, $ilDB, $ilias;
$this->spl_obj =& $a_spl_obj;
$this->err =& $ilErr;
$this->ilias =& $ilias;
$this->db =& $ilDB;
$this->mode = $a_mode;
$settings = $this->ilias->getAllSettings();
$this->inst_id = IL_INST_ID;
$date = time();
switch($this->mode)
{
default:
$this->export_dir = $this->spl_obj->getExportDirectory();
$this->subdir = $date."__".$this->inst_id."__".
"spl"."_".$this->spl_obj->getId();
$this->filename = $this->subdir.".xml";
break;
}
}

Field Documentation

ilSurveyQuestionpoolExport::$db

Definition at line 34 of file class.ilSurveyQuestionpoolExport.php.

ilSurveyQuestionpoolExport::$err

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

ilSurveyQuestionpoolExport::$ilias

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

Referenced by ilSurveyQuestionpoolExport().

ilSurveyQuestionpoolExport::$inst_id

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

Referenced by getInstId().

ilSurveyQuestionpoolExport::$mode

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

ilSurveyQuestionpoolExport::$spl_obj

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


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