19 declare(strict_types=1);
39 protected \ILIAS\DI\UIServices
$ui;
44 \
ILIAS\Blog\Exercise\BlogExercise $blog_exercise,
47 \
ILIAS\Blog\InternalGUIService $gui
51 $this->main_tpl = $gui->ui()->mainTemplate();
52 $this->
ctrl = $gui->ctrl();
55 $this->node_id = $a_node_id;
56 $this->blog_request = $gui->standardRequest();
58 $this->ass_id = $this->blog_request->getAssId();
59 $this->file = $this->blog_request->getAssFile();
60 $this->
ui = $gui->ui();
62 $this->submission = $DIC->exercise()->internal()->domain()->submission(
72 $this->
ctrl->returnToParent($this);
75 $next_class = $ilCtrl->getNextClass($this);
76 $cmd = $ilCtrl->getCmd();
78 switch ($next_class) {
89 $ass_files = $ass->getFiles();
90 if (count($ass_files) > 0) {
91 foreach ($ass_files as $file) {
92 if ($file[
"name"] == $this->file) {
100 protected function downloadExcSubFile():
void 103 $submissions = $this->submission->getSubmissionsOfUser(
107 if ($submitted = $submissions->current()) {
110 $ass->getTitle() .
" - " .
111 $user_data[
"firstname"] .
" " .
112 $user_data[
"lastname"] .
" (" .
113 $user_data[
"login"] .
").zip";
114 $this->submission->deliverFile(
115 $submitted->getUserId(),
116 $submitted->getRid(),
128 $exc_gui->submitBlog($this->node_id);
130 $this->main_tpl->setOnScreenMessage(
'success', $lng->
txt(
"blog_finalized"),
true);
131 $ilCtrl->returnToParent($this);
147 if ($state->isSubmissionAllowed()) {
148 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $ass_id);
149 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"finalize");
150 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
151 return $ui->factory()->button()->primary($lng->
txt(
"blog_finalize_blog"), $submit_link);
169 if ($submission->hasSubmitted()) {
171 $submitted = $submission->getSelectedObject();
172 if ($submitted?->getTimestamp() !==
"") {
173 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $ass_id);
174 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"downloadExcSubFile");
175 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
176 return $ui->factory()->button()->standard($lng->
txt(
"blog_download_submission"), $dl_link);
188 foreach ($be->getAssignmentsOfBlog() as
$exercise) {
192 if ($submit_button) {
193 $buttons[
$ass_id][] = $submit_button;
196 if ($download_button) {
197 $buttons[
$ass_id][] = $download_button;
ILIAS Blog Exercise BlogExercise $blog_exercise
SubmissionManager $submission
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Interface Observer Contains several chained tasks and infos about them.
static _lookupName(int $a_user_id)
lookup user name
StandardGUIRequest $blog_request
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getDownloadSubmissionButton(int $ass_id)
static _lookupTitle(int $obj_id)
static initGUIForSubmit(int $a_ass_id, ?int $a_user_id=null)
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
__construct(int $a_node_id, \ILIAS\Blog\Exercise\BlogExercise $blog_exercise, ilLanguage $lng, ilObjUser $user, \ILIAS\Blog\InternalGUIService $gui)
Exercise submission //TODO: This class has many static methods related to delivered "files"...
getSubmitButton(int $ass_id)
Get submit link.
ilGlobalTemplateInterface $main_tpl