protected function parse() { $peer_data = array(); if ($this->show_peer_review) { $peer_data = $this->ass->getAllPeerReviews(); } include_once "Services/User/classes/class.ilUserUtil.php"; include_once "Services/RTE/classes/class.ilRTE.php"; foreach (ilExAssignment::getAllDeliveredFiles($this->ass->getExerciseId(), $this->ass->getId()) as $file) { if (trim($file["atext"])) { $data[$file["user_id"]] = array("uid" => $file["user_id"], "uname" => ilUserUtil::getNamePresentation($file["user_id"]), "udate" => $file["ts"], "utext" => ilRTE::_replaceMediaObjectImageSrc($file["atext"], 1)); if (isset($peer_data[$file["user_id"]])) { $data[$file["user_id"]]["peer"] = $peer_data[$file["user_id"]]; } } } $this->setData($data); }
/** * Get current values for assignment from * */ public function getAssignmentValues() { $values = array(); $ass = new ilExAssignment($_GET["ass_id"]); $values["title"] = $ass->getTitle(); if ($ass->getStartTime() > 0) { $values["start_time_cb"] = true; } $values["mandatory"] = $ass->getMandatory(); $values["instruction"] = $ass->getInstruction(); $values["type"] = $ass->getType(); if ($ass->getDeadline() > 0) { $values["deadline_cb"] = true; } if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { $this->form->removeItemByPostVar("peer"); $this->form->removeItemByPostVar("peer_min"); $this->form->removeItemByPostVar("peer_dl"); } else { $values["peer"] = $ass->getPeerReview(); $values["peer_min"] = $ass->getPeerReviewMin(); $values["peer_file"] = $ass->hasPeerReviewFileUpload(); $values["peer_prsl"] = $ass->hasPeerReviewPersonalized(); if ($ass->getPeerReviewDeadline() > 0) { $values["peer_dl_tgl"] = true; $peer_dl_date = new ilDateTime($ass->getPeerReviewDeadline(), IL_CAL_UNIX); $peer_dl = $this->form->getItemByPostVar("peer_dl"); $peer_dl->setDate($peer_dl_date); } // #14450 if ($values["peer"] && $ass->hasPeerReviewGroups()) { $this->form->getItemByPostVar("deadline_cb")->setDisabled(true); $this->form->getItemByPostVar("deadline")->setDisabled(true); $this->form->getItemByPostVar("peer")->setDisabled(true); $this->form->getItemByPostVar("peer_min")->setDisabled(true); $this->form->getItemByPostVar("peer_dl")->setDisabled(true); $this->form->getItemByPostVar("peer_file")->setDisabled(true); $this->form->getItemByPostVar("peer_prsl")->setDisabled(true); } } $this->form->setValuesByArray($values); if ($ass->getDeadline() > 0) { $edit_date = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX); $ed_item = $this->form->getItemByPostVar("deadline"); $ed_item->setDate($edit_date); } if ($ass->getStartTime() > 0) { $edit_date = new ilDateTime($ass->getStartTime(), IL_CAL_UNIX); $ed_item = $this->form->getItemByPostVar("start_time"); $ed_item->setDate($edit_date); } if ($ass->getFeedbackFile()) { $this->form->getItemByPostVar("fb")->setChecked(true); $this->form->getItemByPostVar("fb_file")->setValue(basename($ass->getFeedbackFilePath())); } $this->form->getItemByPostVar("fb_cron")->setChecked($ass->hasFeedbackCron()); $this->form->getItemByPostVar("fb_date")->setValue($ass->getFeedbackDate()); // if there are any submissions we cannot change type anymore if (sizeof(ilExAssignment::getAllDeliveredFiles($this->object->getId(), $ass->getId())) || $this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { $this->form->getItemByPostVar("type")->setDisabled(true); } }
protected function handleDisabledAssignmentFields(ilExAssignment $a_ass, ilPropertyFormGUI $a_form) { // potentially disabled elements are initialized here to re-use this // method after setValuesByPost() - see updateAssignmentObject() // if there are any submissions we cannot change type anymore if (sizeof(ilExAssignment::getAllDeliveredFiles($this->object->getId(), $a_ass->getId())) || $a_ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { $a_form->getItemByPostVar("type")->setDisabled(true); } if ($a_ass->getDeadline() > 0) { $a_form->getItemByPostVar("deadline_cb")->setChecked(true); $edit_date = new ilDateTime($a_ass->getDeadline(), IL_CAL_UNIX); $ed_item = $a_form->getItemByPostVar("deadline"); $ed_item->setDate($edit_date); } // team assignments do not support peer review if ($a_ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { return; } $a_form->getItemByPostVar("peer")->setChecked($a_ass->getPeerReview()); $a_form->getItemByPostVar("peer_min")->setValue($a_ass->getPeerReviewMin()); $a_form->getItemByPostVar("peer_file")->setChecked($a_ass->hasPeerReviewFileUpload()); $a_form->getItemByPostVar("peer_prsl")->setChecked($a_ass->hasPeerReviewPersonalized()); // with no active peer review there is nothing to protect if (!$a_ass->getPeerReview()) { return; } // #14450 if ($a_ass->hasPeerReviewGroups()) { // deadline(s) are past and must not change $a_form->getItemByPostVar("deadline_cb")->setDisabled(true); $a_form->getItemByPostVar("deadline")->setDisabled(true); // JourFixe, 2015-05-11 - editable again // $a_form->getItemByPostVar("peer_dl")->setDisabled(true); $a_form->getItemByPostVar("peer")->setDisabled(true); $a_form->getItemByPostVar("peer_min")->setDisabled(true); $a_form->getItemByPostVar("peer_file")->setDisabled(true); $a_form->getItemByPostVar("peer_prsl")->setDisabled(true); } }
/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $a_exc, $a_ass_id) { global $ilCtrl, $lng, $ilAccess, $lng; $this->exc = $a_exc; $this->exc_id = $this->exc->getId(); $this->setId("exc_mem_" . $a_ass_id); include_once "./Modules/Exercise/classes/class.ilFSStorageExercise.php"; $this->storage = new ilFSStorageExercise($this->exc_id, $a_ass_id); include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $this->ass_id = $a_ass_id; parent::__construct($a_parent_obj, $a_parent_cmd); $this->setTitle($lng->txt("exc_assignment") . ": " . ilExAssignment::lookupTitle($a_ass_id)); $this->setTopCommands(true); //$this->setLimit(9999); $this->type = ilExAssignment::lookupType($this->ass_id); $data = ilExAssignment::getMemberListData($this->exc_id, $this->ass_id); // team upload? (1 row == 1 team) if ($this->type == ilExAssignment::TYPE_UPLOAD_TEAM) { $ass_obj = new ilExAssignment($this->ass_id); $team_map = ilExAssignment::getAssignmentTeamMap($this->ass_id); $tmp = array(); foreach ($data as $item) { $team_id = $team_map[$item["usr_id"]]; // #11058 if (!$team_id) { $team_id = $ass_obj->getTeamId($item["usr_id"], true); } if (!isset($tmp[$team_id])) { $tmp[$team_id] = $item; } $tmp[$team_id]["team"][$item["usr_id"]] = $item["name"]; $tmp[$team_id]["team_id"] = $team_id; } $data = $tmp; unset($tmp); } $this->setData($data); $this->addColumn("", "", "1", true); if ($this->type != ilExAssignment::TYPE_UPLOAD_TEAM) { $this->addColumn($this->lng->txt("image"), "", "1"); $this->addColumn($this->lng->txt("name"), "name"); $this->addColumn($this->lng->txt("login"), "login"); } else { $this->addColumn($this->lng->txt("exc_team")); } $this->sent_col = ilExAssignment::lookupAnyExerciseSent($this->exc->getId(), $this->ass_id); if ($this->sent_col) { $this->addColumn($this->lng->txt("exc_exercise_sent"), "sent_time"); } $this->addColumn($this->lng->txt("exc_submission"), "submission"); $this->addColumn($this->lng->txt("exc_grading"), "solved_time"); $this->addColumn($this->lng->txt("feedback"), "feedback_time"); $this->setDefaultOrderField("name"); $this->setDefaultOrderDirection("asc"); $this->setEnableHeader(true); $this->setFormAction($ilCtrl->getFormAction($a_parent_obj)); $this->setRowTemplate("tpl.exc_members_row.html", "Modules/Exercise"); //$this->disable("footer"); $this->setEnableTitle(true); $this->setSelectAllCheckbox("member"); $this->addMultiCommand("saveStatus", $lng->txt("exc_save_changes")); $this->addMultiCommand("redirectFeedbackMail", $lng->txt("exc_send_mail")); $this->addMultiCommand("sendMembers", $lng->txt("exc_send_assignment")); $this->addMultiCommand("confirmDeassignMembers", $lng->txt("exc_deassign_members")); //if(count($this->exc->members_obj->getAllDeliveredFiles())) if (count(ilExAssignment::getAllDeliveredFiles($this->exc_id, $this->ass_id))) { $this->addCommandButton("downloadAll", $lng->txt("download_all_returned_files")); } }
/** * Get current values for assignment from * */ public function getAssignmentValues() { $values = array(); $ass = new ilExAssignment($_GET["ass_id"]); $values["title"] = $ass->getTitle(); if ($ass->getStartTime() > 0) { $values["start_time_cb"] = true; } $values["mandatory"] = $ass->getMandatory(); $values["instruction"] = $ass->getInstruction(); $values["type"] = $ass->getType(); if ($ass->getDeadline() > 0) { $values["deadline_cb"] = true; } $this->form->setValuesByArray($values); if ($ass->getDeadline() > 0) { $edit_date = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX); $ed_item = $this->form->getItemByPostVar("deadline"); $ed_item->setDate($edit_date); } if ($ass->getStartTime() > 0) { $edit_date = new ilDateTime($ass->getStartTime(), IL_CAL_UNIX); $ed_item = $this->form->getItemByPostVar("start_time"); $ed_item->setDate($edit_date); } // if there are any submissions we cannot change type anymore if (sizeof(ilExAssignment::getAllDeliveredFiles($this->object->getId(), $ass->getId()))) { $this->form->getItemByPostVar("type")->setDisabled(true); } }