/**
  * 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);
     }
 }
 /**
  * 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);
     }
 }
 /**
  * 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 {
         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);
         }
     }
     $this->form->setValuesByArray($values);
     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());
     $this->handleDisabledAssignmentFields($ass, $this->form);
 }
 function __formatBody($a_ass_id)
 {
     global $lng;
     $lng->loadLanguageModule("exc");
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     $ass = new ilExAssignment($a_ass_id);
     $body = $ass->getInstruction();
     $body .= "\n\n";
     if ($ass->getDeadline() == 0) {
         $body .= $lng->txt("exc_edit_until") . ": " . $lng->txt("exc_no_deadline_specified");
     } else {
         $body .= $lng->txt("exc_edit_until") . ": " . ilFormat::formatDate(date("Y-m-d H:i:s", $ass->getDeadline()), "datetime", true);
     }
     $body .= "\n\n";
     $body .= ILIAS_HTTP_PATH . "/goto.php?target=" . $this->getType() . "_" . $this->getRefId() . "&client_id=" . CLIENT_ID;
     return $body;
 }