ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
14 protected $exercise; // [ilObjExercise]
15 protected $submission; // [ilExSubmission]
16 protected $assignment; // [ilExAssignment]
17
18 public function __construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
19 {
20 global $ilCtrl, $ilTabs, $lng, $tpl;
21
22 $this->exercise = $a_exercise;
23 $this->submission = $a_submission;
24 $this->assignment = $a_submission->getAssignment();
25
26 // :TODO:
27 $this->ctrl = $ilCtrl;
28 $this->tabs_gui = $ilTabs;
29 $this->lng = $lng;
30 $this->tpl = $tpl;
31 }
32
33 abstract public static function getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission);
34
35 protected function handleTabs()
36 {
37 $this->tabs_gui->clearTargets();
38 $this->tabs_gui->setBackTarget($this->lng->txt("back"),
39 $this->ctrl->getLinkTarget($this, "returnToParent"));
40
41 $this->tabs_gui->addTab("submission", $this->lng->txt("exc_submission"),
42 $this->ctrl->getLinkTarget($this, ""));
43 $this->tabs_gui->activateTab("submission");
44
45 if($this->assignment->hasTeam())
46 {
47 include_once "Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
49 }
50 }
51
53 {
54 $this->ctrl->returnToParent($this);
55 }
56
57
58 //
59 // RETURNED/EXERCISE STATUS
60 //
61
62 protected function handleNewUpload($a_no_notifications = false)
63 {
64 $has_submitted = $this->submission->hasSubmitted();
65
66 $this->exercise->processExerciseStatus(
67 $this->assignment,
68 $this->submission->getUserIds(),
69 $has_submitted,
70 $this->submission->validatePeerReviews());
71
72 if($has_submitted &&
73 !$a_no_notifications)
74 {
75 include_once "./Services/Notification/classes/class.ilNotification.php";
77
78 include_once "./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
79 $not = new ilExerciseMailNotification();
81 $not->setAssignmentId($this->assignment->getId());
82 $not->setRefId($this->exercise->getRefId());
83 $not->setRecipients($users);
84 $not->send();
85 }
86 }
87
88 protected function handleRemovedUpload()
89 {
90 // #16532 - always send notifications
91 $this->handleNewUpload();
92 }
93}
global $tpl
Definition: ilias.php:8
Exercise submission base gui.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
handleNewUpload($a_no_notifications=false)
Exercise submission.
Class ilInfoScreenGUI.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
Class ilObjExercise.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40