19 declare(strict_types=1);
47 private readonly
IRSS $irss,
62 $this->
ctrl->setParameterByClass(self::class,
'export_results', 1);
63 $manager = $this->export_handler->manager()->handler();
64 $export_info = $manager->getExportInfoWithObject(
67 $this->export_handler->consumer()->exportConfig()->allExportConfigs()
69 $element = $manager->createExport(
70 $this->il_user->getId(),
75 $file_name = $element->getIRSSInfo()->getFileName();
76 $this->temp_file_system->writeStream(
78 $this->irss->consume()->stream($element->getIRSSInfo()->getResourceId())->getStream()
80 $temp_stream = $this->temp_file_system->readStream($file_name);
81 $rid = $this->irss->manage()->stream(
84 $element->getIRSSInfo()->getFileName()
87 $temp_stream->close();
89 $this->temp_file_system->delete($file_name);
91 $this->export_repository->store(
93 ExportImportTypes::XML_WITH_RESULTS,
96 $this->export_options->getById(
'expxml')->onDeleteFiles(
98 $this->export_handler->consumer()->file()->identifier()->collection()->withElement(
99 $this->export_handler->consumer()->file()->identifier()->handler()->withIdentifier(
100 $element->getIRSSInfo()->getResourceIdSerialized()
105 $this->tpl->setOnScreenMessage(
107 $this->
lng->txt(
"exp_file_created"),
110 $this->
ctrl->redirect($this, self::CMD_LIST_EXPORT_FILES);
115 if ($this->
access->checkAccess(
'write',
'', $this->obj->getRefId())) {
118 $allActivesPasses = $evaluation->getAllActivesPasses();
120 $participantData->setActiveIdsFilter(array_keys($allActivesPasses));
121 $participantData->load($this->obj->getTestId());
133 $this->participant_access_filter_factory,
134 $this->html_generator
136 $archiveService->setParticipantData($participantData);
137 $archiveService->archivePassesByActives($allActivesPasses);
139 $test_id = $this->obj->getId();
140 $test_ref = $this->obj->getRefId();
150 $this->participant_access_filter_factory,
151 $this->parent_gui->getTestObject()->getTestLogViewer(),
157 $best_solution = $scoring->calculateBestSolutionForTest();
160 if (!is_dir($tmpFileName)) {
164 $archive_exp->handInTestBestSolution($best_solution);
166 $archive_exp->updateTestArchive();
167 $archive_exp->compressTestArchive();
169 $this->tpl->setOnScreenMessage(
'info',
'cannot_export_archive',
true);
171 $this->
ctrl->redirectByClass(
'iltestexportgui');
createTestArchiveExport()
Export User Interface Class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MESSAGE_TYPE_SUCCESS
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
createTestExportWithResults()
Create test export file.
Class that handles PDF generation for test and assessment.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
__construct(Container $dic, ilPlugin $plugin)
__construct(ilObjTestGUI $parent_gui, private readonly ilDBInterface $db, private readonly ilObjectDataCache $obj_cache, private readonly ilObjUser $user, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly IRSS $irss, private readonly ServerRequestInterface $request, private readonly DBRepository $export_repository, private readonly Filesystem $temp_file_system, private readonly ilTestParticipantAccessFilterFactory $participant_access_filter_factory, private readonly ilTestHTMLGenerator $html_generator)