/**
  * 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);
     }
 }