Ejemplo n.º 1
0
 /**
  * Show the detailed evaluation
  *
  * Show the detailed evaluation
  *
  * @access private
  */
 function checkAnonymizedEvaluationAccess()
 {
     global $ilUser;
     if ($this->object->getAnonymize() == 1 && $_SESSION["anon_evaluation_access"] == $_GET["ref_id"]) {
         return true;
     }
     include_once "Modules/Survey/classes/class.ilObjSurveyAccess.php";
     if (ilObjSurveyAccess::_hasEvaluationAccess(ilObject::_lookupObjId($_GET["ref_id"]), $ilUser->getId())) {
         if ($this->object->getAnonymize() == 1) {
             $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
         }
         return true;
     }
     if ($this->object->getAnonymize() == 1) {
         // autocode
         $surveycode = $this->object->getUserAccessCode($ilUser->getId());
         if ($this->object->isAnonymizedParticipant($surveycode)) {
             $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
             return true;
         }
         /* try to find code for current (registered) user from existing run		
         			if($this->object->findCodeForUser($ilUser->getId()))
         			{
         				$_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
         				return true;
         			}		
         			*/
         // code needed
         $this->tpl->setVariable("TABS", "");
         $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_checkaccess.html", "Modules/Survey");
         $this->tpl->setCurrentBlock("adm_content");
         $this->tpl->setVariable("AUTHENTICATION_NEEDED", $this->lng->txt("svy_check_evaluation_authentication_needed"));
         $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "checkEvaluationAccess"));
         $this->tpl->setVariable("EVALUATION_CHECKACCESS_INTRODUCTION", $this->lng->txt("svy_check_evaluation_access_introduction"));
         $this->tpl->setVariable("VALUE_CHECK", $this->lng->txt("ok"));
         $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
         $this->tpl->setVariable("TEXT_SURVEY_CODE", $this->lng->txt("survey_code"));
         $this->tpl->parseCurrentBlock();
     }
     $_SESSION["anon_evaluation_access"] = null;
     return false;
 }
Ejemplo n.º 2
0
 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilAccess, $ilTabs, $ilUser, $ilToolbar;
     if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     $ilTabs->activateTab("info_short");
     include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
     $output_gui =& new ilSurveyExecutionGUI($this->object);
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $info->enablePrivateNotes();
     // "active" survey?
     $canStart = $this->object->canStartSurvey(null, $this->external_rater_360);
     $showButtons = $canStart["result"];
     if (!$showButtons) {
         if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) {
             $canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">&raquo; " . $this->lng->txt("survey_edit_settings") . "</a>";
         }
         ilUtil::sendInfo(implode("<br />", $canStart["messages"]));
     }
     $big_button = false;
     if ($showButtons) {
         // closing survey?
         $is_appraisee = false;
         if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) {
             $info->addSection($this->lng->txt("survey_360_appraisee_info"));
             $appr_data = $this->object->getAppraiseesData();
             $appr_data = $appr_data[$ilUser->getId()];
             $info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]);
             if (!$appr_data["closed"]) {
                 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                 $button = ilLinkButton::getInstance();
                 $button->setCaption("survey_360_appraisee_close_action");
                 $button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose"));
                 $close_button_360 = '<div>' . $button->render() . '</div>';
                 $txt = "survey_360_appraisee_close_action_info";
                 if ($this->object->get360SkillService()) {
                     $txt .= "_skill";
                 }
                 $info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt));
             } else {
                 ilDatePresentation::setUseRelativeDates(false);
                 $dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX);
                 $info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt)));
             }
             $is_appraisee = true;
         }
         // handle code
         // validate incoming
         $code_input = false;
         $anonymous_code = $_POST["anonymous_id"];
         if ($anonymous_code) {
             $code_input = true;
             // if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId()))
             if (!$this->object->checkSurveyCode($anonymous_code)) {
                 $anonymous_code = null;
             } else {
                 // #15860
                 $this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
             }
         }
         if ($anonymous_code) {
             $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
         } else {
             $anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()];
             if ($anonymous_code) {
                 $code_input = true;
             }
         }
         // try to find code for current (registered) user from existing run
         if ($this->object->getAnonymize() && !$anonymous_code) {
             $anonymous_code = $this->object->findCodeForUser($ilUser->getId());
         }
         // get existing runs for current user, might generate code
         $participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code);
         if ($participant_status) {
             $anonymous_code = $participant_status["code"];
             $participant_status = $participant_status["runs"];
         }
         // (final) check for proper anonymous code
         if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
             $anonymous_code = null;
             ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
         }
         // :TODO: really save in session?
         $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
         // code is mandatory and not given yet
         if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) {
             $info->setFormAction($this->ctrl->getFormAction($this, "infoScreen"));
             $info->addSection($this->lng->txt("anonymization"));
             $info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction"));
             $info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true);
         } else {
             // trunk/default
             if (!$this->object->get360Mode()) {
                 if ($anonymous_code) {
                     $info->addHiddenElement("anonymous_id", $anonymous_code);
                 }
                 $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymous_code);
                 if ($survey_started === 1) {
                     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
                         if ($this->object->hasViewOwnResults()) {
                             include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                             $button = ilLinkButton::getInstance();
                             $button->setCaption("svy_view_own_results");
                             $button->setUrl($this->ctrl->getLinkTarget($this, "viewUserResults"));
                             $ilToolbar->addButtonInstance($button);
                         }
                         if ($this->object->hasMailOwnResults()) {
                             if ($this->object->hasViewOwnResults()) {
                                 $ilToolbar->addSeparator();
                             }
                             require_once "Services/Form/classes/class.ilTextInputGUI.php";
                             $mail = new ilTextInputGUI($this->lng->txt("email"), "mail");
                             $mail->setSize(25);
                             $mail->setValue($ilUser->getEmail());
                             $ilToolbar->addInputItem($mail, true);
                             $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "mailUserResults"));
                             include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
                             $button = ilSubmitButton::getInstance();
                             $button->setCaption("svy_mail_own_results");
                             $button->setCommand("mailUserResults");
                             $ilToolbar->addButtonInstance($button);
                         }
                     }
                     ilUtil::sendInfo($this->lng->txt("already_completed_survey"));
                 } elseif ($survey_started === 0) {
                     $big_button = array("resume", $this->lng->txt("resume_survey"));
                 } elseif ($survey_started === FALSE) {
                     $big_button = array("start", $this->lng->txt("start_survey"));
                 }
             } else {
                 $appr_ids = array();
                 // use given code (if proper external one)
                 if ($anonymous_code) {
                     $anonymous_id = $this->object->getAnonymousIdByCode($anonymous_code);
                     if ($anonymous_id) {
                         $appr_ids = $this->object->getAppraiseesToRate(0, $anonymous_id);
                     }
                 }
                 // registered user
                 // if an auto-code was generated, we still have to check for the original user id
                 if (!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID) {
                     $appr_ids = $this->object->getAppraiseesToRate($ilUser->getId());
                 }
                 if (sizeof($appr_ids)) {
                     // map existing runs to appraisees
                     $active_appraisees = array();
                     if ($participant_status) {
                         foreach ($participant_status as $item) {
                             $active_appraisees[$item["appr_id"]] = $item["finished"];
                         }
                     }
                     $list = array();
                     foreach ($appr_ids as $appr_id) {
                         if ($this->object->isAppraiseeClosed($appr_id)) {
                             // closed
                             $list[$appr_id] = $this->lng->txt("survey_360_appraisee_is_closed");
                         } else {
                             if (array_key_exists($appr_id, $active_appraisees)) {
                                 // already done
                                 if ($active_appraisees[$appr_id]) {
                                     $list[$appr_id] = $this->lng->txt("already_completed_survey");
                                 } else {
                                     $list[$appr_id] = array("resume", $this->lng->txt("resume_survey"));
                                 }
                             } else {
                                 // start
                                 $list[$appr_id] = array("start", $this->lng->txt("start_survey"));
                             }
                         }
                     }
                     $info->addSection($this->lng->txt("survey_360_rate_other_appraisees"));
                     include_once "Services/User/classes/class.ilUserUtil.php";
                     foreach ($list as $appr_id => $item) {
                         $appr_name = ilUserUtil::getNamePresentation($appr_id, false, false, "", true);
                         if (!is_array($item)) {
                             $info->addProperty($appr_name, $item);
                         } else {
                             $this->ctrl->setParameter($output_gui, "appr_id", $appr_id);
                             $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
                             $this->ctrl->setParameter($output_gui, "appr_id", "");
                             include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
                             $button = ilLinkButton::getInstance();
                             $button->setCaption($item[1], false);
                             $button->setUrl($href);
                             $big_button_360 = '<div>' . $button->render() . '</div>';
                             $info->addProperty($appr_name, $big_button_360);
                         }
                     }
                 } else {
                     if (!$is_appraisee) {
                         ilUtil::sendFailure($this->lng->txt("survey_360_no_appraisees"));
                     }
                 }
             }
         }
         if ($this->object->get360Mode() && $this->object->get360SelfAppraisee() && !$this->object->isAppraisee($ilUser->getId()) && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $link = $this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "addSelfAppraisee");
             $link = '<a href="' . $link . '">' . $this->lng->txt("survey_360_add_self_appraisee") . '</a>';
             $info->addProperty("&nbsp;", $link);
         }
     }
     if ($big_button) {
         $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
         include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
         $button = ilSubmitButton::getInstance();
         $button->setCaption($big_button[1], false);
         $button->setCommand($big_button[0]);
         $button->setPrimary(true);
         $ilToolbar->addButtonInstance($button);
         $ilToolbar->setCloseFormTag(false);
         $info->setOpenFormTag(false);
     }
     /* #12016
     		else
     		{
     			$info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
     		}
     		*/
     if (strlen($this->object->getIntroduction())) {
         $introduction = $this->object->getIntroduction();
         $info->addSection($this->lng->txt("introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($introduction) . "<br />" . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $info->getHiddenToggleButton());
     }
     $info->hideFurtherSections(false);
     if (!$this->object->get360Mode()) {
         $info->addSection($this->lng->txt("svy_general_properties"));
         $info->addProperty($this->lng->txt("survey_results_anonymization"), !$this->object->hasAnonymizedResults() ? $this->lng->txt("survey_results_personalized_info") : $this->lng->txt("survey_results_anonymized_info"));
         include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
         if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) {
             $info->addProperty($this->lng->txt("evaluation_access"), $this->lng->txt("evaluation_access_info"));
         }
     }
     $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
     $this->ctrl->forwardCommand($info);
 }
 function _hasEvaluationAccess($a_obj_id, $user_id)
 {
     $evaluation_access = ilObjSurveyAccess::_lookupEvaluationAccess($a_obj_id);
     switch ($evaluation_access) {
         case 0:
             // no evaluation access
             return false;
             break;
         case 1:
             // evaluation access for all registered users
             if ($user_id > 0 && $user_id != ANONYMOUS_USER_ID) {
                 return true;
             } else {
                 return false;
             }
             break;
         case 2:
             if (!self::_lookup360Mode($a_obj_id)) {
                 // evaluation access for participants
                 // check if the user with the given id is a survey participant
                 // show the evaluation button for anonymized surveys for all users
                 // access is only granted with the survey access code
                 if (ilObjSurveyAccess::_lookupAnonymize($a_obj_id) == 1) {
                     return true;
                 }
                 global $ilDB;
                 $result = $ilDB->queryF("SELECT survey_id FROM svy_svy WHERE obj_fi = %s", array('integer'), array($a_obj_id));
                 if ($result->numRows() == 1) {
                     $row = $ilDB->fetchAssoc($result);
                     if (ilObjSurveyAccess::_isSurveyParticipant($user_id, $row["survey_id"])) {
                         return true;
                     }
                 }
                 return false;
             } else {
                 include_once "Modules/Survey/classes/class.ilObjSurvey.php";
                 $svy = new ilObjSurvey($a_obj_id, false);
                 $svy->read();
                 switch ($svy->get360Results()) {
                     case ilObjSurvey::RESULTS_360_NONE:
                         return false;
                     case ilObjSurvey::RESULTS_360_OWN:
                         return $svy->isAppraiseeClosed($user_id);
                     case ilObjSurvey::RESULTS_360_ALL:
                         return $svy->isAppraisee($user_id);
                 }
             }
             break;
     }
 }
Ejemplo n.º 4
0
 function _checkCondition($a_svy_id, $a_operator, $a_value, $a_usr_id = 0)
 {
     global $ilUser;
     $a_usr_id = $a_usr_id ? $a_usr_id : $ilUser->getId();
     switch ($a_operator) {
         case 'finished':
             //if (ilExerciseMembers::_lookupStatus($a_exc_id, $ilias->account->getId()) == "passed")
             include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
             if (ilObjSurveyAccess::_lookupFinished($a_svy_id, $a_usr_id)) {
                 return true;
             } else {
                 return false;
             }
             break;
         default:
             return true;
     }
     return true;
 }
Ejemplo n.º 5
0
 function isFullfilled($user_id, $item_id)
 {
     global $ilObjDataCache;
     include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
     $lm_continue =& new ilCourseLMHistory($this->getRefId(), $user_id);
     $continue_data = $lm_continue->getLMHistory();
     $obj_id = $ilObjDataCache->lookupObjId($item_id);
     $type = $ilObjDataCache->lookupType($obj_id);
     switch ($type) {
         case 'tst':
             include_once './Modules/Test/classes/class.ilObjTestAccess.php';
             include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
             if (!ilObjTestAccess::checkCondition($obj_id, ilConditionHandler::OPERATOR_FINISHED, '', $user_id)) {
                 return false;
             }
             break;
         case 'svy':
             include_once './Modules/Survey/classes/class.ilObjSurveyAccess.php';
             if (!ilObjSurveyAccess::_lookupFinished($obj_id, $user_id)) {
                 return false;
             }
             break;
         case 'sahs':
             include_once 'Services/Tracking/classes/class.ilLPStatus.php';
             if (!ilLPStatus::_hasUserCompleted($obj_id, $user_id)) {
                 return false;
             }
             break;
         default:
             if (!isset($continue_data[$item_id])) {
                 return false;
             }
     }
     return true;
 }
 function _hasEvaluationAccess($a_obj_id, $user_id)
 {
     $evaluation_access = ilObjSurveyAccess::_lookupEvaluationAccess($a_obj_id);
     switch ($evaluation_access) {
         case 0:
             // no evaluation access
             return false;
             break;
         case 1:
             // evaluation access for all registered users
             if ($user_id > 0 && $user_id != ANONYMOUS_USER_ID) {
                 return true;
             } else {
                 return false;
             }
             break;
         case 2:
             // evaluation access for participants
             // check if the user with the given id is a survey participant
             // show the evaluation button for anonymized surveys for all users
             // access is only granted with the survey access code
             if (ilObjSurveyAccess::_lookupAnonymize($a_obj_id) == 1) {
                 return true;
             }
             global $ilDB;
             $result = $ilDB->queryF("SELECT survey_id FROM svy_svy WHERE obj_fi = %s", array('integer'), array($a_obj_id));
             if ($result->numRows() == 1) {
                 $row = $ilDB->fetchAssoc($result);
                 if (ilObjSurveyAccess::_isSurveyParticipant($user_id, $row["survey_id"])) {
                     return true;
                 }
             }
             return false;
             break;
     }
 }
 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						"alert" (boolean) => display as an alert property (usually in red)
  *						"property" (string) => property name
  *						"value" (string) => property value
  */
 function getProperties()
 {
     global $lng, $ilUser, $rbacsystem;
     $props = array();
     if (!$rbacsystem->checkAccess("visible,read", $this->ref_id)) {
         return $props;
     }
     include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
     if (!ilObjSurveyAccess::_lookupOnline($this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     } else {
         // BEGIN Usability Distinguish between status and participation
         if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id)) {
             // no completion
             $props[] = array("alert" => true, "property" => $lng->txt("svy_participation"), "value" => $lng->txt("svy_warning_survey_not_complete"), 'propertyNameVisible' => false);
         } else {
             if ($ilUser->getId() != ANONYMOUS_USER_ID) {
                 $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
                 // finished
                 if ($finished === 1) {
                     $stat = $this->lng->txt("svy_finished");
                 } else {
                     if ($finished === 0) {
                         $stat = $this->lng->txt("svy_not_finished");
                     } else {
                         $stat = $this->lng->txt("svy_not_started");
                     }
                 }
                 $props[] = array("alert" => false, "property" => $lng->txt("participation"), "value" => $stat, 'propertyNameVisible' => false);
             }
         }
         // END Usability Distinguish between status and participation
     }
     return $props;
 }
 function isFullfilled($user_id, $item_id)
 {
     global $ilObjDataCache;
     include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
     $lm_continue =& new ilCourseLMHistory($this->getRefId(), $user_id);
     $continue_data = $lm_continue->getLMHistory();
     $obj_id = $ilObjDataCache->lookupObjId($item_id);
     $type = $ilObjDataCache->lookupType($obj_id);
     switch ($type) {
         case 'tst':
             include_once './Modules/Test/classes/class.ilObjTestAccess.php';
             if (!ilObjTestAccess::_checkCondition($obj_id, 'finished', '')) {
                 return false;
             }
             break;
         case 'svy':
             include_once './Modules/Survey/classes/class.ilObjSurveyAccess.php';
             if (!ilObjSurveyAccess::_lookupFinished($obj_id, $user_id)) {
                 return false;
             }
             break;
         case 'sahs':
             include_once 'Services/Tracking/classes/class.ilLPStatus.php';
             $completed = ilLPStatus::_lookupStatus($obj_id, $user_id);
             if ($completed == LP_STATUS_COMPLETED_NUM) {
                 return false;
             }
             break;
         default:
             if (!isset($continue_data[$item_id])) {
                 return false;
             }
     }
     return true;
 }
 function evaluation($details = 0)
 {
     global $ilUser;
     global $rbacsystem;
     global $ilias;
     global $ilToolbar;
     if (!$rbacsystem->checkAccess("read", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"));
         return;
     }
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $format = new ilSelectInputGUI("", "export_format");
     $format->setOptions(array("excel" => $this->lng->txt('exp_type_excel'), "csv" => $this->lng->txt('exp_type_csv')));
     $ilToolbar->addInputItem($format);
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $label = new ilSelectInputGUI("", "export_label");
     $label->setOptions(array('label_only' => $this->lng->txt('export_label_only'), 'title_only' => $this->lng->txt('export_title_only'), 'title_label' => $this->lng->txt('export_title_label')));
     $ilToolbar->addInputItem($label);
     if ($details) {
         $ilToolbar->addFormButton($this->lng->txt("export"), 'exportDetailData');
     } else {
         $ilToolbar->addFormButton($this->lng->txt("export"), 'exportData');
     }
     switch ($this->object->getEvaluationAccess()) {
         case EVALUATION_ACCESS_OFF:
             if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) {
                 ilUtil::sendFailure($this->lng->txt("permission_denied"));
                 return;
             }
             break;
         case EVALUATION_ACCESS_ALL:
             include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
             if (!($rbacsystem->checkAccess("write", $_GET["ref_id"]) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId()))) {
                 ilUtil::sendFailure($this->lng->txt("permission_denied"));
                 return;
             }
             break;
         case EVALUATION_ACCESS_PARTICIPANTS:
             if ($this->object->getAnonymize() == 1 && $_SESSION["anon_evaluation_access"] != $_GET["ref_id"]) {
                 $this->checkAnonymizedEvaluationAccess();
                 return;
             }
             break;
     }
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation.html", "Modules/Survey");
     $questions =& $this->object->getSurveyQuestions();
     $data = array();
     $counter = 1;
     $last_questionblock_id = null;
     foreach ($questions as $qdata) {
         include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
         $question_gui = SurveyQuestion::_instanciateQuestionGUI($qdata["question_id"]);
         $question = $question_gui->object;
         $c = $question->getCumulatedResultData($this->object->getSurveyId(), $counter);
         if (is_array($c[0])) {
             foreach ($c as $a) {
                 array_push($data, $a);
             }
         } else {
             array_push($data, $c);
         }
         $counter++;
         if ($details) {
             // questionblock title handling
             if ($qdata["questionblock_id"] && $qdata["questionblock_id"] != $last_questionblock_id) {
                 $qblock = $this->object->getQuestionblock($qdata["questionblock_id"]);
                 if ($qblock["show_blocktitle"]) {
                     $this->tpl->setCurrentBlock("detail_qblock");
                     $this->tpl->setVariable("BLOCKTITLE", $qdata["questionblock_title"]);
                     $this->tpl->parseCurrentBlock();
                 }
                 $last_questionblock_id = $qdata["questionblock_id"];
             }
             $detail = $question_gui->getCumulatedResultsDetails($this->object->getSurveyId(), $counter - 1);
             $this->tpl->setCurrentBlock("detail");
             $this->tpl->setVariable("DETAIL", $detail);
             $this->tpl->parseCurrentBlock();
         }
     }
     include_once "./Modules/Survey/classes/tables/class.ilSurveyResultsCumulatedTableGUI.php";
     $table_gui = new ilSurveyResultsCumulatedTableGUI($this, 'evaluation', $detail);
     $table_gui->setData($data);
     $this->tpl->setVariable('CUMULATED', $table_gui->getHTML());
     $this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this, 'evaluation'));
 }
 /**
  * adds tabs to tab gui object
  *
  * @param	object		$tabs_gui		ilTabsGUI object
  */
 function getTabs(&$tabs_gui)
 {
     global $ilAccess, $ilUser, $ilHelp;
     $ilHelp->setScreenIdComponent("svy");
     if (strcmp($this->ctrl->getNextClass(), 'ilrepositorysearchgui') != 0) {
         switch ($this->ctrl->getCmd()) {
             case "browseForQuestions":
             case "browseForQuestionblocks":
             case "insertQuestions":
             case "filterQuestions":
             case "resetFilterQuestions":
             case "changeDatatype":
             case "start":
             case "resume":
             case "next":
             case "previous":
             case "redirectQuestion":
             case "preview":
                 return;
             case "evaluation":
             case "checkEvaluationAccess":
             case "evaluationdetails":
             case "evaluationuser":
                 $this->setEvalSubtabs();
                 break;
         }
     }
     $hidden_tabs = array();
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template);
         $hidden_tabs = $template->getHiddenTabs();
     }
     // questions
     if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
         $force_active = $_GET["up"] != "" || $_GET["down"] != "" ? true : false;
         $cmd = $this->ctrl->getLinkTargetByClass("ilsurveypagegui", "renderPage");
         // $cmd = $this->ctrl->getLinkTarget($this, "questions");
         $tabs_gui->addTarget("survey_questions", $cmd, array("questions", "browseForQuestions", "createQuestion", "filterQuestions", "resetFilterQuestions", "changeDatatype", "insertQuestions", "removeQuestions", "cancelRemoveQuestions", "confirmRemoveQuestions", "defineQuestionblock", "saveDefineQuestionblock", "cancelDefineQuestionblock", "unfoldQuestionblock", "moveQuestions", "insertQuestionsBefore", "insertQuestionsAfter", "saveObligatory", "addHeading", "saveHeading", "cancelHeading", "editHeading", "confirmRemoveHeading", "cancelRemoveHeading", "printView", "renderPage", "addQuestionToolbarForm", "deleteBlock", "movePageForm", "copyQuestionsToPool"), "", "", $force_active);
     }
     if ($ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTarget($this, 'infoScreen'), array("infoScreen", "showSummary"));
     }
     // properties
     if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
         $force_active = $this->ctrl->getCmd() == "" ? true : false;
         $tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, 'properties'), array("properties", "save", "cancel", 'saveProperties'), "", "", $force_active);
     }
     // questions
     if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array("constraints", $hidden_tabs)) {
         // constraints
         $tabs_gui->addTarget("constraints", $this->ctrl->getLinkTarget($this, "constraints"), array("constraints", "constraintStep1", "constraintStep2", "constraintStep3", "constraintsAdd", "createConstraints", "editPrecondition"), "");
     }
     // #6969
     if ($ilAccess->checkAccess("invite", "", $this->ref_id) && !in_array("invitation", $hidden_tabs)) {
         // invite
         $tabs_gui->addTarget("invitation", $this->ctrl->getLinkTarget($this, 'invite'), array("invite", "saveInvitationStatus", "inviteUserGroup", "disinviteUserGroup"), "");
     }
     if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
         // maintenance
         $tabs_gui->addTarget("maintenance", $this->ctrl->getLinkTarget($this, 'maintenance'), array("maintenance", "deleteAllUserData"), "");
         if ($this->object->getAnonymize() == 1 || $this->object->isAccessibleWithCodeForAll()) {
             // code
             $tabs_gui->addTarget("codes", $this->ctrl->getLinkTarget($this, 'codes'), array("codes", "exportCodes", 'codesMail', 'saveMailTableFields', 'importExternalMailRecipients', 'mailCodes', 'sendCodesMail', 'importExternalRecipientsFromFile', 'importExternalRecipientsFromText', 'importExternalRecipientsFromDataset', 'insertSavedMessage', 'deleteSavedMessage'), "");
         }
     }
     include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
     if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) {
         // evaluation
         $tabs_gui->addTarget("svy_evaluation", $this->ctrl->getLinkTargetByClass("ilsurveyevaluationgui", "evaluation"), array("evaluation", "checkEvaluationAccess", "evaluationdetails", "evaluationuser"), "");
     }
     if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
         if (!in_array("meta_data", $hidden_tabs)) {
             // meta data
             $tabs_gui->addTarget("meta_data", $this->ctrl->getLinkTargetByClass('ilmdeditorgui', 'listSection'), "", "ilmdeditorgui");
         }
         if (!in_array("export", $hidden_tabs)) {
             // export
             $tabs_gui->addTarget("export", $this->ctrl->getLinkTarget($this, 'export'), array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"), "");
         }
     }
     if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id)) {
         // permissions
         $tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"), array("perm", "info", "owner"), 'ilpermissiongui');
     }
 }