4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
6 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
7 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
36 "sent_time",
"submission",
"idl",
"status",
"mark",
"status_time",
37 "feedback_time",
"comment",
"notice");
52 $this->ctrl = $DIC->ctrl();
53 $this->access = $DIC->access();
54 $this->tpl = $DIC[
"tpl"];
55 $this->lng = $DIC->language();
64 parent::__construct($a_parent_obj, $a_parent_cmd);
69 $this->
setRowTemplate(
"tpl.exc_members_row.html",
"Modules/Exercise");
72 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
84 foreach ($this->cols_order as
$id) {
85 if (in_array($id, $this->cols_mandatory) ||
86 in_array($id, $selected)) {
87 if (array_key_exists($id,
$columns)) {
94 $this->
addColumn($this->lng->txt(
"actions"));
99 $this->
addMultiCommand(
"saveStatusSelected", $this->lng->txt(
"exc_save_selected"));
104 if ($this->mode == self::MODE_BY_ASSIGNMENT &&
105 $this->ass->hasActiveIDl() &&
106 !$this->ass->hasReadOnlyIDl()) {
107 $this->
addMultiCommand(
"setIndividualDeadline", $this->lng->txt(
"exc_individual_deadline_action"));
110 if ($this->exc->hasTutorFeedbackMail() &&
111 $this->mode == self::MODE_BY_ASSIGNMENT) {
112 $this->
addMultiCommand(
"redirectFeedbackMail", $this->lng->txt(
"exc_tbl_action_feedback_mail"));
115 $this->
addMultiCommand(
"sendMembers", $this->lng->txt(
"exc_send_assignment"));
117 if ($this->mode == self::MODE_BY_ASSIGNMENT &&
119 $this->ass->hasTeam()) {
120 $this->
addMultiCommand(
"createTeams", $this->lng->txt(
"exc_team_multi_create"));
121 $this->
addMultiCommand(
"dissolveTeams", $this->lng->txt(
"exc_team_multi_dissolve"));
124 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
125 $this->
addMultiCommand(
"confirmDeassignMembers", $this->lng->txt(
"exc_deassign_members"));
134 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
139 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
140 $item = $this->
addFilterItemByMetaType(
"flt_name", self::FILTER_TEXT,
false, $this->lng->txt(
"name") .
" / " . $this->lng->txt(
"login"));
141 $this->filter[
"name"] = $item->getValue();
144 $this->lng->loadLanguageModule(
"search");
146 "" => $this->lng->txt(
"search_any"),
147 "notgraded" => $this->lng->txt(
"exc_notgraded"),
148 "passed" => $this->lng->txt(
"exc_passed"),
149 "failed" => $this->lng->txt(
"exc_failed")
151 $item = $this->
addFilterItemByMetaType(
"flt_status", self::FILTER_SELECT,
false, $this->lng->txt(
"exc_tbl_status"));
153 $this->filter[
"status"] = $item->getValue();
156 "" => $this->lng->txt(
"search_any"),
157 "y" => $this->lng->txt(
"exc_tbl_filter_has_submission"),
158 "n" => $this->lng->txt(
"exc_tbl_filter_has_no_submission")
160 $item = $this->
addFilterItemByMetaType(
"flt_subm", self::FILTER_SELECT,
false, $this->lng->txt(
"exc_tbl_filter_submission"));
162 $this->filter[
"subm"] = $item->getValue();
165 abstract protected function initMode($a_item_id);
176 foreach ($this->cols_order as
$id) {
177 if (in_array($id, $this->cols_mandatory)) {
181 if (array_key_exists($id,
$columns)) {
186 "default" => in_array($id, $this->cols_default)
198 $cols[
"submission"] =
array($this->lng->txt(
"exc_tbl_submission_date"),
"submission");
200 $cols[
"status"] =
array($this->lng->txt(
"exc_tbl_status"),
"status");
201 $cols[
"mark"] =
array($this->lng->txt(
"exc_tbl_mark"),
"mark");
202 $cols[
"status_time"] =
array($this->lng->txt(
"exc_tbl_status_time"),
"status_time");
204 $cols[
"sent_time"] =
array($this->lng->txt(
"exc_tbl_sent_time"),
"sent_time");
206 if ($this->exc->hasTutorFeedbackText() ||
207 $this->exc->hasTutorFeedbackMail() ||
208 $this->exc->hasTutorFeedbackFile()) {
209 $cols[
"feedback_time"] =
array($this->lng->txt(
"exc_tbl_feedback_time"),
"feedback_time");
212 if ($this->exc->hasTutorFeedbackText()) {
213 $cols[
"comment"] =
array($this->lng->txt(
"exc_tbl_comment"),
"comment");
216 $cols[
"notice"] =
array($this->lng->txt(
"exc_tbl_notice"),
"note");
226 $has_no_team_yet = ($a_ass->
hasTeam() &&
232 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
234 $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
237 if (!$ilAccess->checkAccessOfUser($a_user_id,
"read",
"", $this->exc->getRefId()) &&
238 is_array(
$info = $ilAccess->getInfo())) {
239 $this->tpl->setCurrentBlock(
'access_warning');
240 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
"text"]);
241 $this->tpl->parseCurrentBlock();
244 asort($a_row[
"team"]);
245 foreach ($a_row[
"team"] as $team_member_id => $team_member_name) {
246 if (
sizeof($a_row[
"team"]) > 1) {
247 $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI",
"id", $team_member_id);
248 $url =
$ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"confirmRemoveTeamMember");
249 $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI",
"id",
"");
251 include_once
"Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
253 $this->tpl->setCurrentBlock(
"team_member_removal_bl");
254 $this->tpl->setVariable(
"URL_TEAM_MEMBER_REMOVAL",
$url);
255 $this->tpl->setVariable(
256 "TXT_TEAM_MEMBER_REMOVAL",
259 $this->tpl->parseCurrentBlock();
263 if (!$ilAccess->checkAccessOfUser($team_member_id,
"read",
"", $this->exc->getRefId()) &&
264 is_array(
$info = $ilAccess->getInfo())) {
265 $this->tpl->setCurrentBlock(
'team_access_warning');
266 $this->tpl->setVariable(
'TEAM_PARENT_ACCESS',
$info[0][
"text"]);
267 $this->tpl->parseCurrentBlock();
270 $this->tpl->setCurrentBlock(
"team_member");
271 $this->tpl->setVariable(
"TXT_MEMBER_NAME", $team_member_name);
272 $this->tpl->parseCurrentBlock();
275 if ($has_no_team_yet) {
277 $this->tpl->setCurrentBlock(
"team_info");
278 $this->tpl->setVariable(
"TXT_TEAM_INFO", $this->lng->txt(
"exc_no_team_yet"));
282 $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
286 if (!$has_no_team_yet) {
288 $this->tpl->setVariable(
"SEL_" . strtoupper($a_row[
"status"]),
' selected="selected" ');
289 $this->tpl->setVariable(
"TXT_NOTGRADED", $this->lng->txt(
"exc_notgraded"));
290 $this->tpl->setVariable(
"TXT_PASSED", $this->lng->txt(
"exc_passed"));
291 $this->tpl->setVariable(
"TXT_FAILED", $this->lng->txt(
"exc_failed"));
297 $this->tpl->setVariable(
"NO_TEAM_COLSPAN", $nt_colspan);
303 if ($this->exc->hasTutorFeedbackText()) {
304 $comment_id =
"excasscomm_" . $a_ass->
getId() .
"_" . $a_user_id;
307 $modal->setId($comment_id);
308 $modal->setHeading($this->lng->txt(
"exc_tbl_action_feedback_text"));
311 $lcomment_form->setId($comment_id);
312 $lcomment_form->setPreventDoubleSubmission(
false);
314 $lcomment =
new ilTextAreaInputGUI($this->lng->txt(
"exc_comment_for_learner"),
"lcomment_" . $a_ass->
getId() .
"_" . $a_user_id);
315 $lcomment->
setInfo($this->lng->txt(
"exc_comment_for_learner_info"));
316 $lcomment->setValue($a_row[
"comment"]);
317 $lcomment->setCols(45);
318 $lcomment->setRows(10);
319 $lcomment_form->addItem($lcomment);
321 $lcomment_form->addCommandButton(
"save", $this->lng->txt(
"save"));
324 $modal->setBody($lcomment_form->getHTML());
326 $this->comment_modals[] = $modal->getHTML();
337 include_once
"./Services/Object/classes/class.ilObjectFactory.php";
339 $this->tpl->setVariable(
"VAL_IMAGE", $usr_obj->getPersonalPicturePath(
"xxsmall"));
340 $this->tpl->setVariable(
"TXT_IMAGE", $this->lng->txt(
"personal_picture"));
347 if (!
sizeof($a_row[
"team"])) {
348 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $this->lng->txt(
"exc_no_team_yet"));
350 foreach ($a_row[
"team"] as
$name) {
351 $this->tpl->setCurrentBlock(
"team_member_bl");
352 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $name);
353 $this->tpl->parseCurrentBlock();
357 $this->tpl->setVariable(
"VAL_TEAM_MEMBER",
" ");
362 $this->tpl->setVariable(
363 "VAL_" . strtoupper($col),
372 if ($has_no_team_yet) {
385 $this->tpl->setVariable(
"LCOMMENT_ID", $comment_id .
"_snip");
388 $this->tpl->setVariable(
"VAL_" . strtoupper($col), (trim($a_row[$col]) !==
"")
389 ? nl2br(trim($a_row[$col]))
394 if ($a_row[
"submission_obj"]) {
395 foreach ($a_row[
"submission_obj"]->getFiles() as
$file) {
397 $this->tpl->setVariable(
"TXT_LATE", $this->lng->txt(
"exc_late_submission"));
405 case "feedback_time":
408 $this->tpl->setVariable(
409 "VAL_" . strtoupper($col),
424 $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
434 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
436 $actions->setId($a_ass->
getId() .
"_" . $a_user_id);
437 $actions->setListTitle($this->lng->txt(
"actions"));
441 $counter = $file_info[
"files"][
"count"];
443 if ($file_info[
"files"][
"download_url"]) {
445 $file_info[
"files"][
"download_txt"] .
" (" .
$counter .
")",
447 $file_info[
"files"][
"download_url"]
451 if ($file_info[
"files"][
"download_new_url"]) {
453 $file_info[
"files"][
"download_new_txt"],
455 $file_info[
"files"][
"download_new_url"]
460 if (!$has_no_team_yet &&
467 $this->tpl->setVariable(
"VAL_IDL_ID", $a_ass->
getId() .
"_" . $idl_id);
470 $this->lng->txt(
"exc_individual_deadline_action"),
478 "il.ExcIDl.trigger('" . $idl_id .
"'," . $a_ass->
getId() .
")" 483 if ($this->exc->hasTutorFeedbackMail()) {
485 $this->lng->txt(
"exc_tbl_action_feedback_mail"),
487 $ilCtrl->getLinkTarget($this->parent_obj,
"redirectFeedbackMail")
492 if ($this->exc->hasTutorFeedbackFile()) {
493 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
495 $counter = $storage->countFeedbackFiles($a_row[
"submission_obj"]->getFeedbackId());
497 ?
" (" . $counter .
")" 500 $this->lng->txt(
"exc_tbl_action_feedback_file") .
$counter,
502 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles")
507 if ($this->exc->hasTutorFeedbackText()) {
509 $this->lng->txt(
"exc_tbl_action_feedback_text"),
517 "il.ExcManagement.showComment('" . $comment_id .
"')" 522 if (($peer_review = $a_row[
"submission_obj"]->getPeerReview()) && $a_ass->
afterDeadlineStrict()) {
523 $counter = $peer_review->countGivenFeedback(
true, $a_user_id);
528 $this->lng->txt(
"exc_tbl_action_peer_review_given") .
$counter,
530 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showGivenPeerReview")
533 $counter =
sizeof($peer_review->getPeerReviewsByPeerId($a_user_id,
true));
538 $this->lng->txt(
"exc_tbl_action_peer_review_received") .
$counter,
540 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showReceivedPeerReview")
545 if ($has_no_team_yet) {
547 $this->lng->txt(
"exc_create_team"),
549 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"createSingleMemberTeam")
553 $this->lng->txt(
"exc_tbl_action_team_log"),
555 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"showTeamLog")
559 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
566 $tpl = $DIC->ui()->mainTemplate();
570 $tpl->addJavaScript(
"Modules/Exercise/js/ilExcManagement.js");
571 $tpl->addOnLoadCode(
'il.ExcManagement.init("' .
$url .
'");');
573 return parent::render() .
574 implode(
"\n", $this->comment_modals);
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
setShowTemplates($a_value)
Toggle templates.
getId()
Get assignment id.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $id
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
static get($a_glyph, $a_text="")
Get glyph html.
getParentCmd()
Get parent command.
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
Exercise submission table.
addMultiCommand($a_cmd, $a_text)
Add Command button.
parseRow($a_user_id, ilExAssignment $a_ass, array $a_row)
getSelectedColumns()
Get selected columns.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
__construct($a_parent_obj, $a_parent_cmd, ilObjExercise $a_exc, $a_item_id)
Constructor.
afterDeadlineStrict($a_include_personal=true)
static getInstance()
Get instance.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
This class represents a text area property in a property form.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
setFilterCommand($a_val, $a_caption=null)
Set filter command.