ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAppointmentExerciseFileHandler.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4
6
14{
18 public function getFiles(): array
19 {
20 global $DIC;
21
22 $user_id = $DIC->user()->getId();
23
24 $ass_id = $this->appointment['event']->getContextId() / 10; // see ilExAssignment->handleCalendarEntries $dl parameter
25 $assignment = new ilExAssignment($ass_id);
26 $ass_files = $assignment->getFiles();
27 $files = [];
28 $state = ilExcAssMemberState::getInstanceByIds($assignment->getId(), $user_id);
29 if (count($ass_files) && $state->areInstructionsVisible()) {
30 foreach ($ass_files as $ass_file) {
31 $file_property = new ilFileProperty();
32 $file_property->setAbsolutePath($ass_file['fullpath']);
33 $file_property->setFileName($ass_file['name']);
34
35 $files[] = $file_property;
36 }
37 }
38 return $files;
39 }
40}
An exception for terminatinating execution or to throw for unit testing.
Base file handler class for appointment classes.
Exercise assignment.
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
global $DIC
Definition: goto.php:24
Appointment file handler interface.