4 include_once
"Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
5 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
67 $this->
user = $DIC->user();
69 $ilTabs = $DIC->tabs();
70 $lng = $DIC->language();
78 $this->assignment = $a_ass;
79 $this->exercise = $a_exercise;
80 $this->user_id = $a_user_id;
82 include_once(
"./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssignmentTypesGUI.php");
86 if (!$this->exercise->members_obj->isAssigned($a_user_id)) {
87 $this->exercise->members_obj->assignMember($a_user_id);
91 $public_submissions =
false;
92 if ($this->exercise->getShowSubmissions() &&
93 $this->exercise->getTimestamp() - time() <= 0) {
94 $public_submissions =
true;
96 $this->submission =
new ilExSubmission($a_ass, $a_user_id, null,
false, $public_submissions);
100 $this->tabs_gui = $ilTabs;
109 $class =
$ilCtrl->getNextClass($this);
110 $cmd =
$ilCtrl->getCmd(
"listPublicSubmissions");
113 case "ilexsubmissionteamgui":
116 $this->tabs_gui->clearTargets();
117 $this->tabs_gui->setBackTarget(
118 $this->lng->txt(
"back"),
119 $this->ctrl->getLinkTarget($this,
"returnToParent")
124 $this->tabs_gui->addTab(
126 $this->lng->txt(
"exc_submission"),
127 $this->ctrl->getLinkTargetByClass(
"ilexsubmission" . $this->submission->getSubmissionType() .
"gui",
"")
131 include_once
"Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
136 case "ilexsubmissiontextgui":
137 include_once
"Modules/Exercise/classes/class.ilExSubmissionTextGUI.php";
142 case "ilexsubmissionfilegui":
143 include_once
"Modules/Exercise/classes/class.ilExSubmissionFileGUI.php";
148 case "ilexsubmissionobjectgui":
149 include_once
"Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
154 case "ilexpeerreviewgui":
155 $this->tabs_gui->clearTargets();
156 $this->tabs_gui->setBackTarget(
157 $this->lng->txt(
"back"),
158 $this->ctrl->getLinkTarget($this,
"returnToParent")
161 include_once(
"./Modules/Exercise/classes/class.ilExPeerReviewGUI.php");
163 $this->ctrl->forwardCommand($peer_gui);
170 if ($this->type_guis->isExAssTypeGUIClass($class)) {
171 $type_gui = $this->type_guis->getByClassName($class);
172 $type_gui->setSubmission($this->submission);
173 $type_gui->setExercise($this->exercise);
174 return $ilCtrl->forwardCommand($type_gui);
177 $this->{$cmd .
"Object"}();
195 if (!$a_submission->
canView()) {
199 $ilCtrl->setParameterByClass(
"ilExSubmissionGUI",
"ass_id", $a_submission->
getAssignment()->getId());
202 include_once
"Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
210 $class =
"ilExSubmission" . $submission_type .
"GUI";
211 include_once
"Modules/Exercise/classes/class." . $class .
".php";
212 $class::getOverviewContent($a_info, $a_submission);
214 include_once(
"./Modules/Exercise/classes/class.ilExSubmissionGUI.php");
216 $ilCtrl->getHTML($sub_gui, array(
217 "mode" => self::MODE_OVERVIEW_CONTENT,
219 "submission" => $a_submission
223 $ilCtrl->setParameterByClass(
"ilExSubmissionGUI",
"ass_id",
"");
234 switch ($par[
"mode"]) {
236 case self::MODE_OVERVIEW_CONTENT:
237 $type_gui = $this->type_guis->getById($par[
"submission"]->getAssignment()->getType());
238 return $type_gui->getOverviewContent($par[
"info"], $par[
"submission"]);
253 if (!$this->exercise->getShowSubmissions()) {
257 $ilTabs->clearTargets();
258 $ilTabs->setBackTarget(
260 $ilCtrl->getLinkTarget($this,
"returnToParent")
264 include_once(
"./Modules/Exercise/classes/class.ilPublicSubmissionsTableGUI.php");
266 $this->tpl->setContent(
$tab->getHTML());
269 include_once
"Modules/Exercise/classes/class.ilExAssignmentListTextTableGUI.php";
271 $this->tpl->setContent(
$tbl->getHTML());
282 $file = $_REQUEST[
"file"];
286 $this->ctrl->redirect($this,
"view");
290 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
292 $files = $storage->getFeedbackFiles($this->submission->getFeedbackId());
294 foreach ($files as $fb_file) {
295 if ($fb_file == $file) {
301 echo "FILE DOES NOT EXIST";
306 if (!$this->assignment->notStartedYet()) {
308 $p = $storage->getFeedbackFilePath($this->submission->getFeedbackId(), $file);
319 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
324 if (!
$state->isGlobalFeedbackFileAccessible($this->submission)) {
325 $ilCtrl->redirect($this,
"returnToParent");
329 $file = (is_file($this->assignment->getGlobalFeedbackFilePath()))
330 ? $this->assignment->getGlobalFeedbackFilePath()
331 : $this->assignment->getGlobalFeedbackFileStoragePath() . $this->assignment->getFeedbackFile();
341 $file = $_REQUEST[
"file"];
345 $this->ctrl->redirect($this,
"view");
350 if (
$state->areInstructionsVisible()) {
352 $files = $this->assignment->getFiles();
354 foreach (
$files as $lfile) {
355 if ($lfile[
"name"] == $file) {
362 echo "FILE DOES NOT EXIST";
372 $this->ctrl->returnToParent($this);
downloadFileObject()
Download assignment file.
downloadFeedbackFileObject()
Download feedback file.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission, ilObjExercise $a_exc)
listPublicSubmissionsObject()
List all submissions.
static getInstance()
Get instance.
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
__construct(ilObjExercise $a_exercise, ilExAssignment $a_ass, $a_user_id=null)
Constructor.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const MODE_OVERVIEW_CONTENT
downloadGlobalFeedbackFileObject()
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
Object-based submissions (ends up as static file)
Object-based submissions (ends up as static file)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.