GUI class for exercise assignments.
More...
GUI class for exercise assignments.
This is not a real GUI class, could be moved to ilObjExerciseGUI
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 11 of file class.ilExAssignmentGUI.php.
◆ __construct()
◆ addFiles()
Definition at line 247 of file class.ilExAssignmentGUI.php.
248 {
250
253 {
256 {
257 $a_info->
addProperty(
$file[
"name"],
$lng->txt(
"download"), $this->getSubmissionLink(
"downloadFile", array(
"file"=>urlencode(
$file[
"name"]))));
258 }
259 }
260 }
addProperty($a_name, $a_value, $a_link="")
add a property to current section
addSection($a_title)
add a new section
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
References $file, $files, $ilCtrl, $lng, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), and ilExAssignment\getFiles().
Referenced by getOverviewBody().
◆ addInstructions()
◆ addPublicSubmissions()
◆ addSchedule()
Definition at line 168 of file class.ilExAssignmentGUI.php.
169 {
171
173
176 {
179 }
180
181
182 $late_dl = "";
183 if ($idl &&
184 $idl < time() &&
186 {
187
189 $late_dl =
"<br />".sprintf(
$lng->txt(
"exc_late_submission_warning"), $late_dl);
190 $late_dl = '<span class="warning">'.$late_dl.'</span>';
191 }
192
194 {
196
197
198 if ($late_dl &&
200 {
201 $until .= $late_dl;
202 }
203
205 }
206
207 if ($idl &&
209 {
211
212
213 if ($late_dl)
214 {
215 $until .= $late_dl;
216 }
217
219 }
220
222 {
224 "<b>".$this->getTimeString($idl)."</b>");
225 }
226 }
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
getPersonalDeadline($a_user_id)
Get individual deadline.
getStartTime()
Get start time (timestamp)
getDeadline()
Get deadline (timestamp)
References $ilUser, $lng, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\beforeDeadline(), ilDatePresentation\formatDate(), ilExAssignment\getDeadline(), ilExAssignment\getPersonalDeadline(), ilExAssignment\getStartTime(), IL_CAL_UNIX, and ilExAssignment\notStartedYet().
Referenced by getOverviewBody().
◆ addSubmission()
Definition at line 262 of file class.ilExAssignmentGUI.php.
263 {
265
267
268 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
270
271 include_once "Modules/Exercise/classes/class.ilExSubmissionGUI.php";
273
274 $last_sub = null;
275 if($submission->hasSubmitted())
276 {
277 $last_sub = $submission->getLastSubmission();
278 if($last_sub)
279 {
282 }
283 }
284
285 include_once "Modules/Exercise/classes/class.ilExPeerReviewGUI.php";
287
288
290 {
292 }
293 else
294 {
296 }
297
299 }
addSubmissionFeedback(ilInfoScreenGUI $a_info, ilExAssignment $a_ass, $a_feedback_id, $a_show_global_feedback)
afterDeadlineStrict($a_include_personal=true)
getFeedbackDate()
Get (global) feedback file availability date.
const FEEDBACK_DATE_DEADLINE
getFeedbackFile()
Get (global) feedback file.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
References $ilCtrl, $ilUser, $lng, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), addSubmissionFeedback(), ilExAssignment\afterDeadlineStrict(), ilExAssignment\FEEDBACK_DATE_DEADLINE, ilDatePresentation\formatDate(), ilExAssignment\getFeedbackDate(), ilExAssignment\getFeedbackFile(), ilExPeerReviewGUI\getOverviewContent(), ilExSubmissionGUI\getOverviewContent(), and IL_CAL_DATETIME.
Referenced by getOverviewBody().
◆ addSubmissionFeedback()
Definition at line 301 of file class.ilExAssignmentGUI.php.
302 {
304
306 $cnt_files = $storage->countFeedbackFiles($a_feedback_id);
307
311
312 if ($lpcomment != "" ||
313 $mark != "" ||
314 $status != "notgraded" ||
315 $cnt_files > 0 ||
316 $a_show_global_feedback)
317 {
319 if ($lpcomment != "")
320 {
322 nl2br($lpcomment));
323 }
324 if ($mark != "")
325 {
327 $mark);
328 }
329
330 if ($status == "")
331 {
332
333
334 }
335 else if ($status != "notgraded")
336 {
337 $img =
'<img src="'.ilUtil::getImagePath(
"scorm/".$status.
".svg").
'" '.
338 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.
$lng->txt(
"exc_".$status).
339 '" />';
341 $img.
" ".
$lng->txt(
"exc_".$status));
342 }
343
344 if ($cnt_files > 0)
345 {
347 '<a name="fb'.$a_ass->getId().'"></a>');
348
349 if($cnt_files > 0)
350 {
351 $files = $storage->getFeedbackFiles($a_feedback_id);
353 {
355 $lng->txt(
"download"),
356 $this->getSubmissionLink(
"downloadFeedbackFile", array(
"file"=>urlencode(
$file))));
357 }
358 }
359 }
360
361
362 if($a_show_global_feedback)
363 {
365
367 $lng->txt(
"download"),
368 $this->getSubmissionLink("downloadGlobalFeedbackFile"));
369 }
370 }
371 }
getExerciseId()
Get exercise id.
getId()
Get assignment id.
getMemberStatus($a_user_id=null)
References $file, $files, $img, $lng, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\getExerciseId(), ilExAssignment\getFeedbackFile(), ilExAssignment\getId(), and ilExAssignment\getMemberStatus().
Referenced by addSubmission().
◆ getOverviewBody()
Get assignment body for overview.
Definition at line 115 of file class.ilExAssignmentGUI.php.
116 {
117 $this->current_ass_id = $a_ass->
getId();
118
119 $tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
120
121 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
122 include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
123
125 $info->setTableClass(
"");
126
129
130 if ($this->exc->getShowSubmissions())
131 {
133 }
134
136 {
139 }
140
141 $tpl->setVariable(
"CONTENT",
$info->getHTML());
142
144 }
addSubmission(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addSchedule(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addFiles(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addPublicSubmissions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addInstructions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
special template class to simplify handling of ITX/PEAR
References $info, $tpl, addFiles(), addInstructions(), addPublicSubmissions(), addSchedule(), addSubmission(), ilExAssignment\getId(), and ilExAssignment\notStartedYet().
◆ getOverviewHeader()
Get assignment header for overview.
Definition at line 27 of file class.ilExAssignmentGUI.php.
28 {
30
31 $lng->loadLanguageModule(
"exc");
32
33 $tpl =
new ilTemplate(
"tpl.assignment_head.html",
true,
true,
"Modules/Exercise");
34
35
36
38
39
41 if ($dl &&
42 $dl < time())
43 {
44 $tpl->setCurrentBlock(
"prop");
45 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_ended_on"));
46 $tpl->setVariable(
"PROP_VAL",
48 $tpl->parseCurrentBlock();
49
50
53 {
54 $tpl->setCurrentBlock(
"prop");
55 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_peer_review_deadline"));
56 $tpl->setVariable(
"PROP_VAL",
58 $tpl->parseCurrentBlock();
59 }
60 }
62 {
63 $tpl->setCurrentBlock(
"prop");
64 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_starting_on"));
65 $tpl->setVariable(
"PROP_VAL",
67 $tpl->parseCurrentBlock();
68 }
69 else
70 {
72 $tpl->setCurrentBlock(
"prop");
73 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_time_to_send"));
74 $tpl->setVariable(
"PROP_VAL", $time_str);
75 $tpl->parseCurrentBlock();
76
78 {
79 $tpl->setCurrentBlock(
"prop");
80 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_edit_until"));
81 $tpl->setVariable(
"PROP_VAL",
83 $tpl->parseCurrentBlock();
84 }
85
87 {
88 $tpl->setCurrentBlock(
"prop");
89 $tpl->setVariable(
"PROP",
$lng->txt(
"exc_individual_deadline"));
90 $tpl->setVariable(
"PROP_VAL",
92 $tpl->parseCurrentBlock();
93 }
94 }
95
96 $mand = "";
98 {
99 $mand = " (".$lng->txt("exc_mandatory").")";
100 }
102
103
107 $tpl->setVariable(
"ALT_STATUS",
$lng->txt(
"exc_".$stat));
108
110 }
getTimeString($a_deadline)
Get time string for deadline.
getPeerReview()
Get peer review status.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
getMandatory()
Get mandatory.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
References $ilUser, $lng, $tpl, ilDatePresentation\formatDate(), ilExAssignment\getDeadline(), ilUtil\getImagePath(), ilExAssignment\getMandatory(), ilExAssignment\getMemberStatus(), ilExAssignment\getPeerReview(), ilExAssignment\getPeerReviewDeadline(), ilExAssignment\getPersonalDeadline(), ilExAssignment\getStartTime(), getTimeString(), ilExAssignment\getTitle(), IL_CAL_UNIX, and ilExAssignment\notStartedYet().
◆ getSubmissionLink()
ilExAssignmentGUI::getSubmissionLink |
( |
|
$a_cmd, |
|
|
array |
$a_params = null |
|
) |
| |
|
protected |
Definition at line 397 of file class.ilExAssignmentGUI.php.
398 {
400
401 if(is_array($a_params))
402 {
403 foreach($a_params as $name => $value)
404 {
405 $ilCtrl->setParameterByClass(
"ilexsubmissiongui", $name, $value);
406 }
407 }
408
409 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
"ass_id", $this->current_ass_id);
410 $url =
$ilCtrl->getLinkTargetByClass(
"ilexsubmissiongui", $a_cmd);
411 $ilCtrl->setParameterByClass(
"ilexsubmissiongui",
"ass_id",
"");
412
413 if(is_array($a_params))
414 {
415 foreach($a_params as $name => $value)
416 {
417 $ilCtrl->setParameterByClass(
"ilexsubmissiongui", $name,
"");
418 }
419 }
420
422 }
References $ilCtrl, and $url.
Referenced by addPublicSubmissions().
◆ getTimeString()
ilExAssignmentGUI::getTimeString |
( |
|
$a_deadline | ) |
|
Get time string for deadline.
Definition at line 376 of file class.ilExAssignmentGUI.php.
377 {
379
380 if ($a_deadline == 0)
381 {
382 return $lng->txt(
"exc_no_deadline_specified");
383 }
384
385 if ($a_deadline - time() <= 0)
386 {
387 $time_str =
$lng->txt(
"exc_time_over_short");
388 }
389 else
390 {
392 }
393
394 return $time_str;
395 }
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.
References $lng, IL_CAL_UNIX, and ilUtil\period2String().
Referenced by getOverviewHeader().
◆ $current_ass_id
ilExAssignmentGUI::$current_ass_id |
|
protected |
◆ $exc
The documentation for this class was generated from the following file: