This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Export User Interface Class
- Author
- Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
-
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
ilTestExportGUI: ilParticipantsTestResultsGUI
Definition at line 31 of file class.ilTestExportGUI.php.
◆ buildExportTableGUI()
ilTestExportGUI::buildExportTableGUI |
( |
| ) |
|
|
protected |
◆ createTestArchiveExport()
ilTestExportGUI::createTestArchiveExport |
( |
| ) |
|
Definition at line 111 of file class.ilTestExportGUI.php.
References $DIC, $ilDB, $lng, ilUtil\delDir(), ilTestEvaluation\getAllActivesPasses(), ilUtil\ilTempnam(), ilUtil\makeDirParents(), ilTestPDFGenerator\PDF_OUTPUT_FILE, PDF_USER_RESULT, ilPDFGeneratorUtils\prepareGenerationRequest(), and ilUtil\sendInfo().
114 $ilAccess = $DIC[
'ilAccess'];
115 $ilCtrl = $DIC[
'ilCtrl'];
116 $ilDB = $DIC[
'ilDB'];
119 if ($ilAccess->checkAccess(
"write",
"", $this->obj->ref_id)) {
123 require_once
'Modules/Test/classes/class.ilTestEvaluation.php';
128 $participantData->setActiveIdsFilter(array_keys($allActivesPasses));
129 $participantData->load($this->obj->getTestId());
131 require_once
'Modules/Test/classes/class.ilTestArchiveService.php';
133 $archiveService->setParticipantData($participantData);
134 $archiveService->archivePassesByActives($allActivesPasses);
136 include_once(
"./Modules/Test/classes/class.ilTestArchiver.php");
137 $test_id = $this->obj->getId();
140 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
142 $best_solution = $scoring->calculateBestSolutionForTest();
145 if (!is_dir($tmpFileName)) {
149 $directory_name = realpath($tmpFileName);
150 $file_name = $directory_name . DIRECTORY_SEPARATOR .
'Best_Solution.pdf';
152 require_once
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
155 $archive_exp->handInTestBestSolution($best_solution, $file_name);
158 $archive_exp->updateTestArchive();
159 $archive_exp->compressTestArchive();
163 $ilCtrl->redirectByClass(
'iltestexportgui');
static makeDirParents($a_dir)
Create a new directory and all parent directories.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PDF_USER_RESULT
PDF Purposes.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
◆ listExportFiles()
ilTestExportGUI::listExportFiles |
( |
| ) |
|
Definition at line 166 of file class.ilTestExportGUI.php.
References $_GET, $_POST, $c, $data, $DIC, Vendor\Package\$f, $filename, $format, $lng, $si, $tpl, buildExportTableGUI(), ilUtil\delDir(), ilUtil\deliverFile(), ilExportGUI\download(), ilExportGUI\getCustomColumns(), ilExportGUI\getCustomMultiCommands(), ilExportGUI\getFormats(), ilExportGUI\getParentGUI(), ilTestArchiver\getZipExportDirectory(), and ilUtil\sendInfo().
170 $ilToolbar = $DIC[
'ilToolbar'];
171 $ilCtrl = $DIC[
'ilCtrl'];
174 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
178 $options[
$f[
"key"]] = $f[
"txt"];
180 include_once
'Services/Form/classes/class.ilSelectInputGUI.php';
182 $si->setOptions($options);
183 $ilToolbar->addInputItem(
$si,
true);
184 $ilToolbar->addFormButton(
$lng->txt(
"exp_create_file"),
"createExportFile");
188 $ilToolbar->addFormButton(
$lng->txt(
"exp_create_file") .
" (" .
$format[
"txt"] .
")",
"create_" .
$format[
"key"]);
191 require_once
'class.ilTestArchiver.php';
194 $archive_files = array();
196 if (file_exists($archive_dir) && is_dir($archive_dir)) {
197 $archive_files = scandir($archive_dir);
200 $export_dir = $this->obj->getExportDirectory();
201 $export_files = $this->obj->getExportFiles($export_dir);
203 if (count($export_files) > 0) {
204 foreach ($export_files as $exp_file) {
205 $file_arr = explode(
"__", $exp_file);
206 if ($file_arr[0] == $exp_file) {
210 array_push(
$data, array(
212 'size' => filesize($export_dir .
"/" . $exp_file),
213 'timestamp' => $file_arr[0]
218 if (count($archive_files) > 0) {
219 foreach ($archive_files as $exp_file) {
220 if ($exp_file ==
'.' || $exp_file ==
'..') {
223 $file_arr = explode(
"_", $exp_file);
227 'size' => filesize($archive_dir .
"/" . $exp_file),
228 'timestamp' => $file_arr[4],
234 $table->setSelectAllCheckbox(
"file");
236 $table->addCustomColumn($c[
"txt"], $c[
"obj"], $c[
"func"]);
240 $table->addCustomMultiCommand($c[
"txt"],
"multi_" . $c[
"func"]);
243 $table->resetFormats();
244 foreach ($this->formats as
$format) {
245 $table->addFormat($format[
'key']);
248 $table->setData(
$data);
249 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
'no_manual_feedback_export_info'),
true);
250 $tpl->setContent($table->getHTML());
getCustomColumns()
Get custom columns.
getZipExportDirectory()
Return the export directory, where zips are placed.
getCustomMultiCommands()
Get custom multi commands.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
getParentGUI()
get parent gui
The documentation for this class was generated from the following file: