ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestExportGUI Class Reference

Export User Interface Class. More...

+ Inheritance diagram for ilTestExportGUI:
+ Collaboration diagram for ilTestExportGUI:

Public Member Functions

 __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 ilTestParticipantAccessFilterFactory $participant_access_filter_factory, private readonly TestResultsRepository $test_results_repository, private readonly ilTestHTMLGenerator $html_generator)
 
 createTestArchiveExport ()
 
- Public Member Functions inherited from ilExportGUI
 __construct (object $a_parent_gui, ?ilObject $a_main_obj=null, bool $public_access_enabled=true, bool $default_export_option_enabled=true)
 
 isPublicAccessEnabled ()
 
 executeCommand ()
 
 addFormat ()
 @depricated More...
 
 listExportFiles ()
 
 getFormats ()
 @depricated More...
 

Additional Inherited Members

- Data Fields inherited from ilExportGUI
const CMD_LIST_EXPORT_FILES = "listExportFiles"
 
const CMD_EXPORT_XML = "createXmlExportFile"
 
- Protected Member Functions inherited from ilExportGUI
 initExportOptionsFromPost ()
 
 builtExportOptionCommand (ilExportHandlerConsumerExportOptionInterface $export_option)
 
 enableStandardXMLExport ()
 
 initExportOptions ()
 
 displayExportFiles ()
 
 createXMLExportFile ()
 
 showItemSelection ()
 Show container item selection table. More...
 
 saveItemSelection ()
 
 createXMLExport (ExportConfigCollectionInterface $export_configs)
 
 createXMLContainerExport ()
 
- Protected Attributes inherited from ilExportGUI
const CMD_SAVE_ITEM_SELECTION = "saveItemSelection"
 
const CMD_EXPORT_OPTION_PREFIX = "exportOption"
 
ilExportHandlerConsumerExportOptionCollectionInterface $export_options
 
ilUIServices $ui_services
 
ilHTTPServices $http
 
ilRefineryFactory $refinery
 
ilObjUser $il_user
 
ilLanguage $lng
 
ilObject $obj
 
ilGlobalTemplateInterface $tpl
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilErrorHandling $error
 
ilToolbarGUI $toolbar
 
ilObjectDefinition $obj_definition
 
ilTree $tree
 
ilExportHandler $export_handler
 
ilExportHandlerConsumerContextInterface $context
 
ilDataFactory $data_factory
 
object $parent_gui
 
bool $public_access_enabled
 

Detailed Description

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 @ilCtrl_Calls ilTestExportGUI: ilExportGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilTestExportGUI::__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 ilTestParticipantAccessFilterFactory  $participant_access_filter_factory,
private readonly TestResultsRepository  $test_results_repository,
private readonly ilTestHTMLGenerator  $html_generator 
)

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

49 {
51 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilExportGUI\$parent_gui, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ createTestArchiveExport()

ilTestExportGUI::createTestArchiveExport ( )

Definition at line 53 of file class.ilTestExportGUI.php.

54 {
55 if ($this->access->checkAccess('write', '', $this->obj->getRefId())) {
56 // prepare generation before contents are processed (for mathjax)
57 $evaluation = new ilTestEvaluationFactory($this->db, $this->obj);
58 $allActivesPasses = $evaluation->getAllActivesPasses();
59 $participantData = new ilTestParticipantData($this->db, $this->lng);
60 $participantData->setActiveIdsFilter(array_keys($allActivesPasses));
61 $participantData->load($this->obj->getTestId());
62
63 $archiveService = new ilTestArchiveService(
64 $this->obj,
65 $this->lng,
66 $this->db,
67 $this->user,
68 $this->ui_factory,
69 $this->ui_renderer,
70 $this->irss,
71 $this->request,
72 $this->obj_cache,
73 $this->participant_access_filter_factory,
74 $this->html_generator
75 );
76 $archiveService->setParticipantData($participantData);
77 $archiveService->archivePassesByActives($allActivesPasses);
78
79 $test_id = $this->obj->getId();
80 $test_ref = $this->obj->getRefId();
81 $archive_exp = new ilTestArchiver(
82 $this->lng,
83 $this->db,
84 $this->user,
85 $this->ui_factory,
86 $this->ui_renderer,
87 $this->irss,
88 $this->request,
89 $this->obj_cache,
90 $this->participant_access_filter_factory,
91 $this->parent_gui->getTestObject()->getTestLogViewer(),
92 $test_id,
93 $test_ref
94 );
95
96 $scoring = new TestScoring(
97 $this->obj,
98 $this->user,
99 $this->db,
100 $this->test_results_repository
101 );
102 $best_solution = $scoring->calculateBestSolutionForTest();
103
104 $tmpFileName = ilFileUtils::ilTempnam();
105 if (!is_dir($tmpFileName)) {
106 ilFileUtils::makeDirParents($tmpFileName);
107 }
108
109 $archive_exp->handInTestBestSolution($best_solution);
110
111 $archive_exp->updateTestArchive(
112 $this->access->checkAccess('tst_history_read', '', $this->obj->getRefId())
113 );
114 $archive_exp->compressTestArchive();
115 } else {
116 $this->tpl->setOnScreenMessage('info', 'cannot_export_archive', true);
117 }
118 $this->ctrl->redirectByClass('iltestexportgui');
119 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilFileUtils\ilTempnam(), ILIAS\Repository\lng(), ilFileUtils\makeDirParents(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

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