ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExSubmissionBaseGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13{
17 protected $ctrl;
18
22 protected $tabs_gui;
23
27 protected $lng;
28
32 protected $tpl;
33
34 protected $exercise; // [ilObjExercise]
35 protected $submission; // [ilExSubmission]
36 protected $assignment; // [ilExAssignment]
37
42
46 protected $tool_context;
47
51 protected $type_guis;
52
53 public function __construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
54 {
55 global $DIC;
56
57 $ilCtrl = $DIC->ctrl();
58 $ilTabs = $DIC->tabs();
59 $lng = $DIC->language();
60 $tpl = $DIC["tpl"];
61
62 $this->exercise = $a_exercise;
63 $this->submission = $a_submission;
64 $this->assignment = $a_submission->getAssignment();
65
66 $this->mandatory_manager = $DIC->exercise()->internal()->service()->getMandatoryAssignmentManager($this->exercise);
67
68 // :TODO:
69 $this->ctrl = $ilCtrl;
70 $this->tabs_gui = $ilTabs;
71 $this->lng = $lng;
72 $this->tpl = $tpl;
73
74 $this->type_guis = ilExAssignmentTypesGUI::getInstance();
75 $this->tool_context = $DIC->globalScreen()->tool()->context();
76 }
77
78 abstract public static function getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission);
79
80 protected function handleTabs()
81 {
82 $this->tabs_gui->clearTargets();
83 $this->tabs_gui->setBackTarget(
84 $this->lng->txt("back"),
85 $this->ctrl->getLinkTarget($this, "returnToParent")
86 );
87
88 $this->tabs_gui->addTab(
89 "submission",
90 $this->lng->txt("exc_submission"),
91 $this->ctrl->getLinkTarget($this, "")
92 );
93 $this->tabs_gui->activateTab("submission");
94
95 if ($this->assignment->hasTeam()) {
97 }
98 }
99
100 public function returnToParentObject()
101 {
102 $this->ctrl->returnToParent($this);
103 }
104
105
106 //
107 // RETURNED/EXERCISE STATUS
108 //
109
110 protected function handleNewUpload($a_no_notifications = false)
111 {
112 $has_submitted = $this->submission->hasSubmitted();
113
114 $this->exercise->processExerciseStatus(
115 $this->assignment,
116 $this->submission->getUserIds(),
117 $has_submitted,
118 $this->submission->validatePeerReviews()
119 );
120
121 if ($has_submitted &&
122 !$a_no_notifications) {
124
125 $not = new ilExerciseMailNotification();
127 $not->setAssignmentId($this->assignment->getId());
128 $not->setRefId($this->exercise->getRefId());
129 $not->setRecipients($users);
130 $not->send();
131 }
132 }
133
134 protected function handleRemovedUpload()
135 {
136 // #16532 - always send notifications
137 $this->handleNewUpload();
138 }
139
143 protected function triggerAssignmentTool()
144 {
145 $ass_ids = [$this->assignment->getId()];
146 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
147 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
148 }
149}
An exception for terminatinating execution or to throw for unit testing.
Exercise submission base gui.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
triggerAssignmentTool()
Trigger assigment tool.
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
handleNewUpload($a_no_notifications=false)
Exercise submission //TODO: This class has to much static methods related to delivered "files".
Class ilInfoScreenGUI.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
Class ilObjExercise.
global $DIC
Definition: goto.php:24