当前位置: 首页>>代码示例>>PHP>>正文


PHP ilInfoScreenGUI::addHiddenElement方法代码示例

本文整理汇总了PHP中ilInfoScreenGUI::addHiddenElement方法的典型用法代码示例。如果您正苦于以下问题:PHP ilInfoScreenGUI::addHiddenElement方法的具体用法?PHP ilInfoScreenGUI::addHiddenElement怎么用?PHP ilInfoScreenGUI::addHiddenElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilInfoScreenGUI的用法示例。


在下文中一共展示了ilInfoScreenGUI::addHiddenElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: infoScreen


//.........这里部分代码省略.........
         } 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) {
开发者ID:arlendotcn,项目名称:ilias,代码行数:67,代码来源:class.ilObjSurveyGUI.php

示例2: infoScreen

 /**
  * show information screen
  */
 function infoScreen($session_lock = "")
 {
     global $ilAccess;
     global $ilUser;
     // Disabled
     if ($_GET['crs_show_result']) {
         $this->object->hideCorrectAnsweredQuestions();
     } else {
         if ($this->object->getTestSequence()->hasHiddenQuestions()) {
             $this->object->getTestSequence()->clearHiddenQuestions();
             $this->object->getTestSequence()->saveToDb();
         }
     }
     if ($_GET['createRandomSolutions']) {
         $this->object->createRandomSolutions($_GET['createRandomSolutions']);
     }
     if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $seq = $this->object->getTestSession()->getLastSequence();
     include_once "./Modules/Test/classes/class.ilTestOutputGUI.php";
     $output_gui =& new ilTestOutputGUI($this->object);
     $this->ctrl->setParameter($output_gui, "sequence", $seq);
     $info->setFormAction($this->ctrl->getFormAction($output_gui));
     if (strlen($session_lock)) {
         $info->addHiddenElement("lock", $session_lock);
     } else {
         $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time()));
     }
     $online_access = false;
     if ($this->object->getFixedParticipants()) {
         include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
         $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
         if ($online_access_result === true) {
             $online_access = true;
         } else {
             ilUtil::sendInfo($online_access_result);
         }
     }
     if ($this->object->isOnline() && $this->object->isComplete()) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             $executable = $this->object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
             if ($executable["executable"]) {
                 if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) {
                     ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions'));
                 }
                 if ($this->object->getTestSession()->getActiveId() > 0) {
                     // resume test
                     $resume_text = $this->lng->txt("tst_resume_test");
                     if ($seq < 1 || $seq == $this->object->getTestSequence()->getFirstSequence()) {
                         $resume_text = $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId());
                     }
                     //$info->addFormButton("resume", $resume_text);
                     $big_button[] = array('resume', $resume_text);
                 } else {
                     // start new test
                     //$info->addFormButton("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
                     $big_button[] = array("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
                 }
             } else {
                 ilUtil::sendInfo($executable["errormessage"]);
             }
             if ($this->object->getTestSession()->getActiveId() > 0) {
                 // test results button
                 if ($this->object->canShowTestResults($ilUser->getId())) {
                     //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     $big_button[] = array("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     if ($this->object->getHighscoreEnabled()) {
                         // Can also compare results then
                         $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"));
                     }
                 }
             }
         }
         if ($this->object->getTestSession()->getActiveId() > 0) {
             if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
                 //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
                 $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
             }
         }
     }
     if (!$this->object->isOnline()) {
         $message = $this->lng->txt("test_is_offline");
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             $message .= "<br /><a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">" . $this->lng->txt("test_edit_settings") . "</a>";
         }
         ilUtil::sendInfo($message);
     }
     if ($this->object->getShowInfo()) {
         $info->enablePrivateNotes();
     }
     /*
     		if (strlen($this->object->getIntroduction()))
     		{
     			$info->addSection($this->lng->txt("tst_introduction"));
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjTestGUI.php

示例3: infoScreen

 /**
  * show information screen
  */
 function infoScreen($session_lock = "")
 {
     /**
      * @var $ilAccess  ilAccessHandler
      * @var $ilUser    ilObjUser
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilAccess, $ilUser, $ilToolbar;
     require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSetFilterSelection.php';
     $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
     $testSession = $this->testSessionFactory->getSession();
     $testSequence = $this->testSequenceFactory->getSequenceByTestSession($testSession);
     $testSequence->loadFromDb();
     $testSequence->loadQuestions($testQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
     $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
     if ($_GET['createRandomSolutions']) {
         $this->object->createRandomSolutions($_GET['createRandomSolutions']);
     }
     if (!$ilAccess->checkAccess("read", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $this->ctrl->setParameter($testPlayerGUI, "sequence", $testSession->getLastSequence());
     $info->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
     if (strlen($session_lock)) {
         $info->addHiddenElement("lock", $session_lock);
     } else {
         $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time()));
     }
     $online_access = false;
     if ($this->object->getFixedParticipants()) {
         include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
         $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
         if ($online_access_result === true) {
             $online_access = true;
         } else {
             ilUtil::sendInfo($online_access_result);
         }
     }
     $enter_anonymous_code = false;
     if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
             if ($executable["executable"]) {
                 if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) {
                     ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions'));
                 }
                 if ($testSession->getActiveId() > 0) {
                     // resume test
                     require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
                     $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
                     $testPassesSelector->setActiveId($testSession->getActiveId());
                     $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
                     $closedPasses = $testPassesSelector->getReportablePasses();
                     $existingPasses = $testPassesSelector->getExistingPasses();
                     if ($existingPasses > $closedPasses) {
                         $resumeTestLabel = $this->lng->txt("tst_resume_test");
                         $big_button[] = array('resumePlayer', $resumeTestLabel, true);
                     } else {
                         $resumeTestLabel = $this->object->getStartTestLabel($testSession->getActiveId());
                         $big_button[] = array('startPlayer', $resumeTestLabel, true);
                     }
                 } else {
                     // start new test
                     $big_button[] = array("startPlayer", $this->object->getStartTestLabel($testSession->getActiveId()), true);
                 }
             } else {
                 ilUtil::sendInfo($executable["errormessage"]);
             }
             if ($testSession->getActiveId() > 0) {
                 // test results button
                 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
                 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
                 $testPassesSelector->setActiveId($testSession->getActiveId());
                 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
                 if ($this->object->canShowTestResults($testSession, $ilUser->getId()) && count($testPassesSelector->getReportablePasses())) {
                     //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     $big_button[] = array(array('ilTestEvaluationGUI', 'outUserResultsOverview'), $this->lng->txt("tst_show_results"), false);
                     if ($this->object->getHighscoreEnabled()) {
                         // Can also compare results then
                         $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"), false);
                     }
                     if ($this->object->isSkillServiceToBeConsidered()) {
                         require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
                         $big_button[] = array(array('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW), $this->lng->txt("tst_show_comp_results"), false);
                     }
                 }
             }
         }
         if ($testSession->getActiveId() > 0) {
             if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
                 //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
                 $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"), false);
             }
         }
         if ($this->isDeleteDynamicTestResultsButtonRequired($testSession, $testSequence)) {
//.........这里部分代码省略.........
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilObjTestGUI.php

示例4: infoScreen

 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilAccess;
     global $ilUser;
     if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
     $output_gui =& new ilSurveyExecutionGUI($this->object);
     $info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen"));
     $info->enablePrivateNotes();
     $anonymize_key = NULL;
     if ($this->object->getAnonymize() == 1) {
         if ($_SESSION["anonymous_id"][$this->object->getId()]) {
             $anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()];
         } else {
             if ($_POST["anonymous_id"]) {
                 $anonymize_key = $_POST["anonymous_id"];
             }
         }
     }
     $canStart = $this->object->canStartSurvey($anonymize_key);
     $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) {
         // output of start/resume buttons for personalized surveys
         if (!$this->object->getAnonymize()) {
             $survey_started = $this->object->isSurveyStarted($ilUser->getId(), "");
             // Anonymous User tries to start a personalized survey
             if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
                 ilUtil::sendInfo($this->lng->txt("anonymous_with_personalized_survey"));
             } else {
                 if ($survey_started === 1) {
                     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 {
             if ($this->object->getAnonymize() && !$this->object->isAccessibleWithoutCode()) {
                 if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID || $this->object->isAccessibleWithCodeForAll()) && strlen($_POST["anonymous_id"]) == 0 && strlen($_SESSION["anonymous_id"][$this->object->getId()]) == 0) {
                     $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"));
                 } else {
                     if (strlen($_POST["anonymous_id"]) > 0) {
                         if (!$this->object->checkSurveyCode($_POST["anonymous_id"])) {
                             ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
                         } else {
                             $anonymize_key = $_POST["anonymous_id"];
                         }
                     } else {
                         if (strlen($_SESSION["anonymous_id"][$this->object->getId()]) > 0) {
                             if (!$this->object->checkSurveyCode($_SESSION["anonymous_id"][$this->object->getId()])) {
                                 ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
                             } else {
                                 $anonymize_key = $_SESSION["anonymous_id"][$this->object->getId()];
                             }
                         } else {
                             // registered users do not need to know that there is an anonymous key. The data is anonymized automatically
                             $anonymize_key = $this->object->getUserAccessCode($ilUser->getId());
                             if (!strlen($anonymize_key)) {
                                 $anonymize_key = $this->object->createNewAccessCode();
                                 $this->object->saveUserAccessCode($ilUser->getId(), $anonymize_key);
                             }
                         }
                     }
                     $info->addHiddenElement("anonymous_id", $anonymize_key);
                     $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymize_key);
                     if ($survey_started === 1) {
                         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 {
                 // free access
                 $survey_started = $this->object->isSurveyStarted($ilUser->getId(), "");
                 if ($survey_started === 1) {
                     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"));
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjSurveyGUI.php


注:本文中的ilInfoScreenGUI::addHiddenElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。