ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
12 abstract class ilExSubmissionBaseGUI
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 
38  public function __construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
39  {
40  global $DIC;
41 
42  $ilCtrl = $DIC->ctrl();
43  $ilTabs = $DIC->tabs();
44  $lng = $DIC->language();
45  $tpl = $DIC["tpl"];
46 
47  $this->exercise = $a_exercise;
48  $this->submission = $a_submission;
49  $this->assignment = $a_submission->getAssignment();
50 
51  // :TODO:
52  $this->ctrl = $ilCtrl;
53  $this->tabs_gui = $ilTabs;
54  $this->lng = $lng;
55  $this->tpl = $tpl;
56  }
57 
58  abstract public static function getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission);
59 
60  protected function handleTabs()
61  {
62  $this->tabs_gui->clearTargets();
63  $this->tabs_gui->setBackTarget(
64  $this->lng->txt("back"),
65  $this->ctrl->getLinkTarget($this, "returnToParent")
66  );
67 
68  $this->tabs_gui->addTab(
69  "submission",
70  $this->lng->txt("exc_submission"),
71  $this->ctrl->getLinkTarget($this, "")
72  );
73  $this->tabs_gui->activateTab("submission");
74 
75  if ($this->assignment->hasTeam()) {
76  include_once "Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
78  }
79  }
80 
81  public function returnToParentObject()
82  {
83  $this->ctrl->returnToParent($this);
84  }
85 
86 
87  //
88  // RETURNED/EXERCISE STATUS
89  //
90 
91  protected function handleNewUpload($a_no_notifications = false)
92  {
93  $has_submitted = $this->submission->hasSubmitted();
94 
95  $this->exercise->processExerciseStatus(
96  $this->assignment,
97  $this->submission->getUserIds(),
98  $has_submitted,
99  $this->submission->validatePeerReviews()
100  );
101 
102  if ($has_submitted &&
103  !$a_no_notifications) {
104  include_once "./Services/Notification/classes/class.ilNotification.php";
106 
107  include_once "./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
108  $not = new ilExerciseMailNotification();
110  $not->setAssignmentId($this->assignment->getId());
111  $not->setRefId($this->exercise->getRefId());
112  $not->setRecipients($users);
113  $not->send();
114  }
115  }
116 
117  protected function handleRemovedUpload()
118  {
119  // #16532 - always send notifications
120  $this->handleNewUpload();
121  }
122 }
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
Class ilInfoScreenGUI.
global $DIC
Definition: saml.php:7
Exercise submission base gui.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
global $ilCtrl
Definition: ilias.php:18
Class ilObjExercise.
handleNewUpload($a_no_notifications=false)
$users
Definition: authpage.php:44
Exercise submission.
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)