/**
  * Questionpool properties
  */
 function propertiesObject()
 {
     $save = strcmp($this->ctrl->getCmd(), "save") == 0 ? true : false;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
     $form->setTitle($this->lng->txt("properties"));
     $form->setMultipart(false);
     //		$form->setTableWidth("100%");
     $form->setId("properties");
     // online
     $online = new ilCheckboxInputGUI($this->lng->txt("qpl_online_property"), "online");
     $online->setInfo($this->lng->txt("qpl_online_property_description"));
     $online->setChecked($this->object->getOnline());
     $form->addItem($online);
     $form->addCommandButton("saveProperties", $this->lng->txt("save"));
     if ($save) {
         $form->checkInput();
     }
     $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
 }
Ejemplo n.º 2
0
 private function loadQPList($qpItem)
 {
     $retval = array();
     $curT = intval(time());
     // $this->log(json_encode($qpItem));
     // check predefined timings
     if (intval($qpItem["timing_type"]) == 0) {
         // ensure that the correct timings are used
         if (array_key_exists("start", $qpItem) && ($curT < intval($qpItem["start"]) || $curT > intval($qpItem["end"])) || array_key_exists("timing_start", $qpItem) && ($curT < intval($qpItem["timing_start"]) || $curT > intval($qpItem["timing_end"]))) {
             $this->log('bad timig, skip question pool');
             return $retval;
         }
     }
     $questionPool = new ilObjQuestionPool($qpItem["ref_id"]);
     $questionPool->read();
     // check online state
     if ($questionPool->getOnline() == 0) {
         $this->log('offline, skip question pool');
         return $retval;
     }
     $questions = $questionPool->getQuestionList();
     if (empty($questions)) {
         // ignore empty question pools
         return $retval;
     }
     // load the actual questions.
     if ($this->iliasVersion != "4.2") {
         $retval["questions"] = $this->getQuestionListNew($questions);
     } else {
         $retval["questions"] = $this->getQuestionListOld($questions);
     }
     $retval["id"] = $qpItem["ref_id"];
     // pass only the reference id
     $retval["title"] = $questionPool->getTitle();
     $retval["description"] = $questionPool->getDescription();
     if (intval($qpItem["timing_type"]) == 0) {
         // pass the end-date on, so the remote broker can switch
         // the pool off if necessary.
         if (array_key_exists("end", $qpItem)) {
             $retval["end-date"] = intval($qpItem["end"]);
         } else {
             if (array_key_exists("timing_end", $qpItem)) {
                 $retval["end-date"] = intval($qpItem["timing_end"]);
             }
         }
     }
     return $retval;
 }