24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
54 $this->qpl_obj =& $a_qpl_obj;
59 $this->mode = $a_mode;
62 $settings = $this->ilias->getAllSettings();
63 $this->inst_id = IL_INST_ID;
64 $this->questions = $array_questions;
66 $this->qpl_obj->createExportDirectory();
70 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
72 $this->export_dir = $this->qpl_obj->getExportDirectory();
73 $this->filename = $date.
"__".$this->inst_id.
"__".
74 "qpl".
"__".$this->qpl_obj->getId() .
"." . $adapter->getFileExtension();
78 $this->export_dir = $this->qpl_obj->getExportDirectory();
79 $this->subdir = $date.
"__".$this->inst_id.
"__".
80 "qpl".
"__".$this->qpl_obj->getId();
81 $this->filename = $this->subdir.
".xml";
82 $this->qti_filename = $date.
"__".$this->inst_id.
"__".
83 "qti".
"__".$this->qpl_obj->getId().
".xml";
121 $ilBench->start(
"QuestionpoolExport",
"buildExportFile");
123 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
127 $this->xml->
xmlSetDtdDef(
"<!DOCTYPE Test SYSTEM \"http://www.ilias.uni-koeln.de/download/dtd/ilias_co.dtd\">");
130 $this->xml->xmlSetGenCmt(
"Export of ILIAS Test Questionpool ".
131 $this->qpl_obj->getId().
" of installation ".$this->inst.
".");
134 $this->xml->xmlHeader();
137 include_once
"./Services/Utilities/classes/class.ilUtil.php";
142 $expDir = $this->qpl_obj->getExportDirectory();
143 include_once
"./Services/Logging/classes/class.ilLog.php";
144 $expLog =
new ilLog($expDir,
"export.log");
146 $expLog->setLogFormat(
"");
147 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
150 $qti_file = fopen($this->export_dir.
"/".$this->subdir.
"/".$this->qti_filename,
"w");
151 fwrite($qti_file, $this->qpl_obj->toXML($this->questions));
155 $ilBench->start(
"QuestionpoolExport",
"buildExportFile_getXML");
156 $this->qpl_obj->exportPagesXML($this->xml, $this->inst_id,
157 $this->export_dir.
"/".$this->subdir, $expLog, $this->questions);
158 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile_getXML");
168 $ilBench->start(
"QuestionpoolExport",
"buildExportFile_dumpToFile");
169 $this->xml->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->filename
171 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile_dumpToFile");
174 $ilBench->start(
"QuestionpoolExport",
"buildExportFile_saveAdditionalMobs");
176 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile_saveAdditionalMobs");
179 $ilBench->start(
"QuestionpoolExport",
"buildExportFile_zipFile");
181 $this->export_dir.
"/".$this->subdir.
".zip");
182 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile_zipFile");
185 $this->xml->_XmlWriter;
187 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
188 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile");
190 return $this->export_dir.
"/".$this->subdir.
".zip";
195 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
197 foreach ($this->questions as $question_id)
200 foreach (
$mobs as $mob)
205 $mob_obj->exportFiles($a_export_dir);
219 $ilBench->start(
"QuestionpoolExport",
"buildExportFile");
220 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
222 $adapter->setWorksheetTitle($this->lng->txt(
"tst_results_aggregated"));
227 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
241 $questions = $this->qpl_obj->getQuestionList();
244 $adapter->setCellValue(
$row, $col, $question[
"title"]);
246 $adapter->setCellValue(
$row, $col, $question[
"description"]);
248 $adapter->setCellValue(
$row, $col, $this->lng->txt($question[
"type_tag"]));
250 $adapter->setCellValue(
$row, $col, $question[
"author"]);
260 $file = $adapter->save();
261 @rename(
$file, $this->export_dir .
"/" . $this->filename);