Esempio n. 1
0
 function addLocatorItems()
 {
     global $ilLocator;
     switch ($this->ctrl->getCmd()) {
         case "next":
         case "previous":
         case "start":
         case "resume":
         case "redirectQuestion":
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
             break;
         case "evaluation":
         case "checkEvaluationAccess":
         case "evaluationdetails":
         case "evaluationuser":
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "evaluation"), "", $_GET["ref_id"]);
             break;
         case "create":
         case "save":
         case "cancel":
         case "importFile":
         case "cloneAll":
             break;
         case "infoScreen":
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
             break;
         default:
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
             // this has to be done here because ilSurveyEditorGUI is called after finalizing the locator
             if ((int) $_GET["q_id"] && !(int) $_REQUEST["new_for_survey"]) {
                 // not on create
                 // see ilObjSurveyQuestionPool::addLocatorItems
                 $q_id = (int) $_GET["q_id"];
                 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
                 $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
                 $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
                 $ilLocator->addItem(SurveyQuestion::_getTitle($q_id), $this->ctrl->getLinkTargetByClass(array("ilSurveyEditorGUI", $q_type), "editQuestion"));
             }
             break;
     }
 }
Esempio n. 2
0
 /**
 * Creates an instance of a question with a given question id
 *
 * @param integer $question_id The question id
 * @return object The question instance
 * @access public
 */
 function &_instanciateQuestion($question_id)
 {
     if ($question_id < 1) {
         return FALSE;
     }
     include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
     $question_type = SurveyQuestion::_getQuestionType($question_id);
     if (strlen($question_type) == 0) {
         return FALSE;
     }
     SurveyQuestion::_includeClass($question_type);
     $question = new $question_type();
     $question->loadFromDb($question_id);
     return $question;
 }
 /**
  * Delete constraint confirmation
  */
 public function confirmDeleteConstraintsObject()
 {
     $id = (int) $_REQUEST["precondition"];
     if (!$this->validateConstraintForEdit($id)) {
         $this->ctrl->redirect($this, "constraints");
     }
     $constraint = $this->object->getPrecondition($id);
     $questions = $this->object->getSurveyQuestions();
     $question = $questions[$constraint["question_fi"]];
     $relation = $questions[$constraint["ref_question_fi"]];
     $relation = $relation["title"];
     // see ilSurveyConstraintsTableGUI
     include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
     $question_type = SurveyQuestion::_getQuestionType($constraint["question_fi"]);
     SurveyQuestion::_includeClass($question_type);
     $question_obj = new $question_type();
     $question_obj->loadFromDb($constraint["question_fi"]);
     $valueoutput = $question_obj->getPreconditionValueOutput($constraint["value"]);
     $title = $question["title"] . " " . $constraint["shortname"] . " " . $valueoutput;
     $this->ctrl->saveParameter($this, "precondition");
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     $cgui->setHeaderText(sprintf($this->lng->txt("survey_sure_delete_constraint"), $title, $relation));
     $cgui->setFormAction($this->ctrl->getFormAction($this, "deleteConstraints"));
     $cgui->setCancel($this->lng->txt("cancel"), "constraints");
     $cgui->setConfirm($this->lng->txt("confirm"), "deleteConstraints");
     $this->tpl->setContent($cgui->getHTML());
 }
 public function addLocatorItems()
 {
     global $ilLocator;
     switch ($this->ctrl->getCmd()) {
         case "create":
         case "importFile":
         case "cancel":
             break;
         default:
             $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
             break;
     }
     if ($_GET["q_id"] > 0) {
         include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
         $q_type = SurveyQuestion::_getQuestionType($_GET["q_id"]) . "GUI";
         $this->ctrl->setParameterByClass($q_type, "q_id", $_GET["q_id"]);
         $ilLocator->addItem(SurveyQuestion::_getTitle($_GET["q_id"]), $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
     }
 }
Esempio n. 5
0
 /**
  * Creates an instance of a question GUI with a given question id
  *
  * @param integer $question_id The question id
  * @return object The question GUI instance
  * @access public
  */
 function &_instanciateQuestionGUI($question_id)
 {
     $question_type = SurveyQuestion::_getQuestionType($question_id);
     if ($question_type) {
         SurveyQuestion::_includeClass($question_type, 1);
         $guitype = $question_type . "GUI";
         $question = new $guitype($question_id);
         return $question;
     }
 }