本文整理汇总了PHP中ilInfoScreenGUI::addPropertyTextinput方法的典型用法代码示例。如果您正苦于以下问题:PHP ilInfoScreenGUI::addPropertyTextinput方法的具体用法?PHP ilInfoScreenGUI::addPropertyTextinput怎么用?PHP ilInfoScreenGUI::addPropertyTextinput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilInfoScreenGUI
的用法示例。
在下文中一共展示了ilInfoScreenGUI::addPropertyTextinput方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: infoScreen
//.........这里部分代码省略.........
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
$info->addProperty($this->lng->txt("title"), $this->object->getTitle());
}
if ($this->object->isOnline() && $this->object->isComplete()) {
if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
// use javascript
$checked_javascript = false;
if ($this->object->getJavaScriptOutput()) {
$checked_javascript = true;
}
if ($this->object->getForceJS()) {
$info->addProperty($this->lng->txt("tst_test_output"), $this->lng->txt("tst_use_javascript"));
} else {
$info->addPropertyCheckbox($this->lng->txt("tst_test_output"), "chb_javascript", 1, $this->lng->txt("tst_use_javascript"), $checked_javascript);
}
}
// hide previous results
if (!$this->object->isRandomTest()) {
if ($this->object->getNrOfTries() != 1) {
if ($this->object->getUsePreviousAnswers() == 0) {
if ($this->object->getShowInfo()) {
$info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers"));
}
} else {
$use_previous_answers = FALSE;
if ($ilUser->prefs["tst_use_previous_answers"]) {
$checked_previous_answers = TRUE;
}
$info->addPropertyCheckbox($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers", 1, $this->lng->txt("tst_use_previous_answers_user"), $checked_previous_answers);
}
}
}
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
$info->addPropertyTextinput($this->lng->txt("enter_anonymous_code"), "anonymous_id", "", 8, "setAnonymousId", $this->lng->txt("submit"));
}
}
}
$info->hideFurtherSections(false);
if ($this->object->getShowInfo()) {
$info->addSection($this->lng->txt("tst_sequence_properties"));
$info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone"));
$info->addSection($this->lng->txt("tst_heading_scoring"));
$info->addProperty($this->lng->txt("tst_text_count_system"), $this->lng->txt($this->object->getCountSystem() == COUNT_PARTIAL_SOLUTIONS ? "tst_count_partial_solutions" : "tst_count_correct_solutions"));
$info->addProperty($this->lng->txt("tst_score_mcmr_questions"), $this->lng->txt($this->object->getMCScoring() == SCORE_ZERO_POINTS_WHEN_UNANSWERED ? "tst_score_mcmr_zero_points_when_unanswered" : "tst_score_mcmr_use_scoring_system"));
if ($this->object->isRandomTest()) {
$info->addProperty($this->lng->txt("tst_pass_scoring"), $this->lng->txt($this->object->getPassScoring() == SCORE_BEST_PASS ? "tst_pass_best_pass" : "tst_pass_last_pass"));
}
$info->addSection($this->lng->txt("tst_score_reporting"));
$score_reporting_text = "";
switch ($this->object->getScoreReporting()) {
case REPORT_AFTER_TEST:
$score_reporting_text = $this->lng->txt("tst_report_after_test");
break;
case REPORT_ALWAYS:
$score_reporting_text = $this->lng->txt("tst_report_after_first_question");
break;
case REPORT_AFTER_DATE:
$score_reporting_text = $this->lng->txt("tst_report_after_date");
break;
case 4:
$score_reporting_text = $this->lng->txt("tst_report_never");
break;
}
$info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
$reporting_date = $this->object->getReportingDate();
if ($reporting_date) {
#preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
#$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
#$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
$info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP)));
}
$info->addSection($this->lng->txt("tst_session_settings"));
$info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries());
if ($this->object->getNrOfTries() != 1) {
$info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $this->object->getTestSession()->getPass() == false ? $this->lng->txt("tst_no_tries") : $this->object->getTestSession()->getPass());
}
if ($this->object->getEnableProcessingTime()) {
$info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime());
}
if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) {
$info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers());
}
$starting_time = $this->object->getStartingTime();
if ($starting_time) {
$info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP)));
}
$ending_time = $this->object->getEndingTime();
if ($ending_time) {
$info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP)));
}
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
// forward the command
if ($_GET['crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence()) {
#ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
}
}
$this->ctrl->forwardCommand($info);
}
示例2: infoScreen
/**
* 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") . "\">» " . $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) {
//.........这里部分代码省略.........
示例3: 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") . "\">» " . $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"));
//.........这里部分代码省略.........