38 $this->lng = $DIC->language();
39 $this->
user = $DIC->user();
40 $this->ctrl = $DIC->ctrl();
41 $this->ui = $DIC->ui();
54 $lng->loadLanguageModule(
"exc");
56 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
59 $tpl =
new ilTemplate(
"tpl.assignment_head.html",
true,
true,
"Modules/Exercise");
69 if (
$state->exceededOfficialDeadline()) {
70 $tpl->setCurrentBlock(
"prop");
71 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_ended_on"));
72 $tpl->setVariable(
"PROP_VAL",
$state->getCommonDeadlinePresentation());
73 $tpl->parseCurrentBlock();
76 if (
$state->getPeerReviewDeadline()) {
77 $tpl->setCurrentBlock(
"prop");
78 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_peer_review_deadline"));
79 $tpl->setVariable(
"PROP_VAL",
$state->getPeerReviewDeadlinePresentation());
80 $tpl->parseCurrentBlock();
82 } elseif (!
$state->hasGenerallyStarted()) {
83 if (
$state->getRelativeDeadline()) {
84 $tpl->setCurrentBlock(
"prop");
85 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_earliest_start_time"));
86 $tpl->setVariable(
"PROP_VAL",
$state->getGeneralStartPresentation());
87 $tpl->parseCurrentBlock();
89 $tpl->setCurrentBlock(
"prop");
90 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_starting_on"));
91 $tpl->setVariable(
"PROP_VAL",
$state->getGeneralStartPresentation());
92 $tpl->parseCurrentBlock();
95 if (
$state->getCommonDeadline() > 0) {
96 $tpl->setCurrentBlock(
"prop");
97 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_time_to_send"));
98 $tpl->setVariable(
"PROP_VAL",
$state->getRemainingTimePresentation());
99 $tpl->parseCurrentBlock();
101 $tpl->setCurrentBlock(
"prop");
102 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_edit_until"));
103 $tpl->setVariable(
"PROP_VAL",
$state->getCommonDeadlinePresentation());
104 $tpl->parseCurrentBlock();
105 } elseif (
$state->getRelativeDeadline()) {
106 $tpl->setCurrentBlock(
"prop");
107 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_rem_time_after_start"));
108 $tpl->setVariable(
"PROP_VAL",
$state->getRelativeDeadlinePresentation());
109 $tpl->parseCurrentBlock();
113 if (
$state->getIndividualDeadline() > 0) {
114 $tpl->setCurrentBlock(
"prop");
115 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_individual_deadline"));
116 $tpl->setVariable(
"PROP_VAL",
$state->getIndividualDeadlinePresentation());
117 $tpl->parseCurrentBlock();
123 $mand =
" (" .
$lng->txt(
"exc_mandatory") .
")";
125 $tpl->setVariable(
"TITLE", $a_ass->
getTitle() . $mand);
131 $tpl->setVariable(
"ALT_STATUS",
$lng->txt(
"exc_" . $stat));
145 $this->current_ass_id = $a_ass->
getId();
147 $tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
149 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
152 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
153 include_once(
"./Services/UIComponent/Button/classes/class.ilLinkButton.php");
156 $info->setTableClass(
"");
158 if (
$state->areInstructionsVisible()) {
165 if (
$state->hasSubmissionStarted()) {
169 $tpl->setVariable(
"CONTENT",
$info->getHTML());
180 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
183 if (
$state->areInstructionsVisible()) {
188 $is_html = (strlen($inst) != strlen(strip_tags($inst)));
205 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
209 if (
$state->getGeneralStart() > 0) {
210 if (
$state->getRelativeDeadline()) {
222 if (
$state->inLateSubmissionPhase()) {
224 $late_dl =
$state->getOfficialDeadlinePresentation();
225 $late_dl =
"<br />" . sprintf(
$lng->txt(
"exc_late_submission_warning"), $late_dl);
226 $late_dl =
'<span class="warning">' . $late_dl .
'</span>';
229 if (
$state->getCommonDeadline()) {
230 $until =
$state->getCommonDeadlinePresentation();
234 $state->getOfficialDeadline() ==
$state->getCommonDeadline()) {
238 $prop =
$lng->txt(
"exc_edit_until");
239 if (
$state->exceededOfficialDeadline()) {
240 $prop =
$lng->txt(
"exc_ended_on");
244 } elseif (
$state->getRelativeDeadline()) {
246 if (
$state->hasGenerallyStarted()) {
247 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_ass->
getId());
248 $but = $this->ui->factory()->button()->primary(
$lng->txt(
"exc_start_assignment"),
$ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"startAssignment"));
249 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id",
$_GET[
"ass_id"]);
250 $but = $this->ui->renderer()->render($but);
252 $a_info->
addProperty(
$lng->txt(
"exc_rem_time_after_start"),
$state->getRelativeDeadlinePresentation() .
256 if (
$state->getOfficialDeadline() >
$state->getCommonDeadline()) {
257 $until =
$state->getOfficialDeadlinePresentation();
267 if (
$state->hasSubmissionStarted()) {
269 $lng->txt(
"exc_time_to_send"),
270 "<b>" .
$state->getRemainingTimePresentation() .
"</b>" 281 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
285 if (
$state->hasSubmissionEnded()) {
287 $button->setCaption(
"exc_list_submission");
290 $a_info->
addProperty(
$lng->txt(
"exc_public_submission"), $button->render());
293 $lng->txt(
"exc_public_submission"),
294 $lng->txt(
"exc_msg_public_submission")
312 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
313 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
314 include_once
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php";
317 foreach (
$files as $file) {
324 $ui_factory = $DIC->ui()->factory();
325 $ui_renderer = $DIC->ui()->renderer();
327 if (in_array($mime, array(
"image/jpeg",
"image/svg+xml",
"image/gif",
"image/png"))) {
328 $item_id =
"il-ex-modal-img-" . $a_ass->
getId() .
"-" . $cnt;
331 $image = $ui_renderer->render($ui_factory->image()->responsive($file[
'fullpath'], $file[
'name']));
335 $modal->setId($item_id);
337 $modal->setBody($image);
338 $modal->setHeading($file[
"name"]);
339 $modal = $modal->getHTML();
341 $img_tpl =
new ilTemplate(
"tpl.image_file.html",
true,
true,
"Modules/Exercise");
342 $img_tpl->setCurrentBlock(
"image_content");
343 $img_tpl->setVariable(
"MODAL", $modal);
344 $img_tpl->setVariable(
"ITEM_ID", $item_id);
345 $img_tpl->setVariable(
"IMAGE", $image);
346 $img_tpl->setvariable(
"IMAGE_LENS", $image_lens);
347 $img_tpl->parseCurrentBlock();
349 $a_info->
addProperty($file[
"name"], $img_tpl->get());
350 } elseif (in_array($mime, array(
"audio/mpeg",
"audio/ogg",
"video/mp4",
"video/x-flv",
"video/webm"))) {
351 $media_tpl =
new ilTemplate(
"tpl.media_file.html",
true,
true,
"Modules/Exercise");
353 $mp->setFile($file[
'fullpath']);
354 $media_tpl->setVariable(
"MEDIA", $mp->getMediaPlayerHtml());
356 $but = $ui_factory->button()->shy(
357 $lng->txt(
"download"),
358 $this->
getSubmissionLink(
"downloadFile", array(
"file" => urlencode($file[
"name"])))
360 $media_tpl->setVariable(
"DOWNLOAD_BUTTON", $ui_renderer->render($but));
361 $a_info->
addProperty($file[
"name"], $media_tpl->get());
375 include_once(
"./Modules/Exercise/classes/class.ilExcAssMemberState.php");
380 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
383 include_once
"Modules/Exercise/classes/class.ilExSubmissionGUI.php";
387 if ($submission->hasSubmitted()) {
388 $last_sub = $submission->getLastSubmission();
395 if ($this->exc->getShowSubmissions()) {
399 include_once
"Modules/Exercise/classes/class.ilExPeerReviewGUI.php";
422 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
431 if ($lpcomment !=
"" ||
433 $status !=
"notgraded" ||
435 $a_show_global_feedback) {
437 if ($lpcomment !=
"") {
439 $lng->txt(
"exc_comment"),
445 $lng->txt(
"exc_mark"),
453 } elseif ($status !=
"notgraded") {
455 ' alt="' .
$lng->txt(
"exc_" . $status) .
'" title="' .
$lng->txt(
"exc_" . $status) .
459 $img .
" " .
$lng->txt(
"exc_" . $status)
463 if ($cnt_files > 0) {
465 '<a name="fb' . $a_ass->
getId() .
'"></a>');
467 if ($cnt_files > 0) {
468 $files = $storage->getFeedbackFiles($a_feedback_id);
469 foreach (
$files as $file) {
472 $lng->txt(
"download"),
473 $this->
getSubmissionLink(
"downloadFeedbackFile", array(
"file" => urlencode($file)))
480 if ($a_show_global_feedback) {
485 $lng->txt(
"download"),
499 if ($a_deadline == 0) {
500 return $lng->txt(
"exc_submit_convenience_no_deadline");
503 if ($a_deadline - time() <= 0) {
504 $time_str =
$lng->txt(
"exc_time_over_short");
516 if (is_array($a_params)) {
517 foreach ($a_params as
$name => $value) {
518 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
$name, $value);
522 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
"ass_id", $this->current_ass_id);
523 $url =
$ilCtrl->getLinkTargetByClass(
"ilexsubmissiongui", $a_cmd);
524 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
"ass_id",
"");
526 if (is_array($a_params)) {
527 foreach ($a_params as
$name => $value) {
528 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
$name,
"");
addSubmissionFeedback(ilInfoScreenGUI $a_info, ilExAssignment $a_ass, $a_feedback_id, $a_show_global_feedback)
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
getMemberStatus($a_user_id=null)
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline) ...
addPublicSubmissions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
getFeedbackDate()
Get (global) feedback file availability date.
getId()
Get assignment id.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission, ilObjExercise $a_exc)
getDeadline()
Get deadline (timestamp)
addInstructions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addSection($a_title)
add a new section
addSchedule(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
GUI class for exercise assignments.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
getExerciseId()
Get exercise id.
getOverviewBody(ilExAssignment $a_ass)
Get assignment body for overview.
getTimeString($a_deadline)
Get time string for deadline.
addFiles(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
special template class to simplify handling of ITX/PEAR
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.
getFeedbackFile()
Get (global) feedback file.
__construct(ilObjExercise $a_exc)
Constructor.
getMandatory()
Get mandatory.
getOverviewHeader(ilExAssignment $a_ass)
Get assignment header for overview.
const FEEDBACK_DATE_DEADLINE
static getInstance()
Get instance.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
getInstruction()
Get instruction.
addSubmission(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
const FEEDBACK_DATE_CUSTOM
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
getSubmissionLink($a_cmd, array $a_params=null)