39 $ilDB = $DIC->database();
41 $this->survey_obj = $a_survey_obj;
44 $this->mode = $a_mode;
48 switch ($this->mode) {
50 $this->export_dir = $this->survey_obj->getExportDirectory();
51 $this->subdir = $date .
"__" . $this->inst_id .
"__" .
52 "svy" .
"_" . $this->survey_obj->getId();
53 $this->filename = $this->subdir .
".xml";
69 switch ($this->mode) {
85 $this->survey_obj->createExportDirectory();
90 $expDir = $this->survey_obj->getExportDirectory();
91 $expLog =
new ilLog($expDir,
"export.log");
93 $expLog->setLogFormat(
"");
94 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export");
97 $xmlFile = fopen($this->export_dir .
"/" . $this->subdir .
"/" . $this->filename,
'wb');
98 fwrite($xmlFile, $this->survey_obj->toXML());
105 ilFileUtils::zip($this->export_dir .
"/" . $this->subdir, $this->export_dir .
"/" . $this->subdir .
".zip");
107 if (file_exists($this->export_dir .
"/" . $this->subdir .
".zip")) {
109 if (is_dir($this->export_dir .
"/" . $this->subdir)) {
113 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export");
115 return $this->export_dir .
"/" . $this->subdir .
".zip";
122 foreach (
$mobs as $mob) {
124 $mob_obj->exportFiles($a_export_dir);
128 foreach ($this->survey_obj->questions as $question_id) {
130 foreach (
$mobs as $mob) {
132 $mob_obj->exportFiles($a_export_dir);
exportXHTMLMediaObjects(string $a_export_dir)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildExportFileXML()
build xml export file
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static zip(string $a_dir, string $a_file, bool $compress_content=false)
zips given directory/file into given zip.file
__construct(ilObjSurvey $a_survey_obj, $a_mode="xml")
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...