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


PHP ilObjTest::prepareTextareaOutput方法代码示例

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


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

示例1: buildForm


//.........这里部分代码省略.........
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_beginning_ending_information"));
         $form->addItem($header);
     }
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction");
     $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->testOBJ->getShowInfo());
     $showinfo->setOptionTitle($this->lng->txt("showinfo"));
     $showinfo->setInfo($this->lng->txt("showinfo_desc"));
     $intro->addSubItem($showinfo);
     $form->addItem($intro);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:67,代码来源:class.ilObjTestSettingsGeneralGUI.php

示例2: infoScreen


//.........这里部分代码省略.........
             $enter_anonymous_code = false;
         } elseif ($testQuestionSetConfig->areDepenciesInVulnerableState()) {
             ilUtil::sendInfo($testQuestionSetConfig->getDepenciesInVulnerableStateMessage($this->lng));
         }
     }
     if ($this->object->getShowInfo()) {
         $info->enablePrivateNotes();
     }
     if ($big_button || $enter_anonymous_code) {
         $ilToolbar->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
         foreach ($big_button as $button) {
             if (is_array($button[0])) {
                 $link = $this->ctrl->getLinkTargetByClass($button[0][0], $button[0][1]);
                 $ilToolbar->addButton($button[1], $link, '', '', '', '', $button[2] ? 'submit emphSubmit' : 'submit');
             } else {
                 $ilToolbar->addFormButton($button[1], $button[0], "", $button[2]);
             }
         }
         if ($enter_anonymous_code) {
             if ($big_button) {
                 $ilToolbar->addSeparator();
             }
             require_once 'Services/Form/classes/class.ilTextInputGUI.php';
             $anonymous_id = new ilTextInputGUI($this->lng->txt('enter_anonymous_code'), 'anonymous_id');
             $anonymous_id->setSize(8);
             $ilToolbar->addInputItem($anonymous_id, true);
             $ilToolbar->addFormButton($this->lng->txt('submit'), 'setAnonymousId');
         }
         $ilToolbar->setCloseFormTag(false);
         $info->setOpenFormTag(false);
     }
     if (strlen($this->object->getIntroduction())) {
         $info->addSection($this->lng->txt("tst_introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction(), true) . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $info->getHiddenToggleButton());
     }
     $info->addSection($this->lng->txt("tst_general_properties"));
     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($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
         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;
                 }
             }
             // hide previous results
             if (!$this->object->isRandomTest() && !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
                 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);
                     }
开发者ID:bheyser,项目名称:qplskl,代码行数:67,代码来源:class.ilObjTestGUI.php

示例3: infoScreen


//.........这里部分代码省略.........
             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"));
     			$info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
     		}
     		 * */
     if ($big_button) {
         $out = '<div class="il_ButtonGroup il_BigButton">';
         foreach ($big_button as $button) {
             $out .= '<input type="submit" class="submit il_BigButton" name="cmd[' . $button[0] . ']" value="' . $button[1] . '" />';
         }
         $out .= '</div>';
         $big_button = $out;
     }
     if (strlen($this->object->getIntroduction())) {
         $introduction = $this->object->getIntroduction();
         $info->addSection($this->lng->txt("tst_introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()) . $big_button . "<br />" . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $big_button . $info->getHiddenToggleButton());
     }
     $info->addSection($this->lng->txt("tst_general_properties"));
     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()) {
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:67,代码来源:class.ilObjTestGUI.php

示例4: getPassDetailsOverview

 /**
  * Returns the pass details overview for a given active ID and pass
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param string $targetclass The name of the ILIAS class for the "pass details" URL (optional)
  * @param string $targetcommand The name of the ILIAS command for the "pass details" URL (optional)
  * @param string $targetcommanddetails The name of the ILIAS command which should be called for the details of an answer (optional)
  * @param boolean $standard_header TRUE if the table headers should be plain text, FALSE if the table headers should be URL's for sortable columns
  * @return string HTML code of the pass details overview
  * @access public
  */
 function getPassDetailsOverview($result_array, $active_id, $pass, $targetclass = "", $targetcommandsort = "", $targetcommanddetails = "", $standard_header = TRUE)
 {
     global $ilUser;
     $testresults = $result_array["pass"];
     unset($result_array["test"]);
     $user_id = $this->object->_getUserIdFromActiveId($active_id);
     $sort = $_GET["sort"] ? $_GET["sort"] : "nr";
     $sortorder = $_GET["sortorder"] ? $_GET["sortorder"] : "asc";
     if (!$standard_header) {
         // change sortorder of result array
         usort($result_array, "sortResults");
     }
     $color_class = array("tblrow1top", "tblrow2top");
     $counter = 0;
     $template = new ilTemplate("tpl.il_as_tst_pass_details_overview.html", TRUE, TRUE, "Modules/Test");
     $this->ctrl->setParameterByClass($targetclass, "pass", "{$pass}");
     if (!$testresults["total_max_points"]) {
         $percentage = 0;
     } else {
         $percentage = $testresults["total_reached_points"] / $testresults["total_max_points"] * 100;
     }
     $total_max = $testresults["total_max_points"];
     $total_reached = $testresults["total_reached_points"];
     $totalRequestedHints = $testresults["total_requested_hints"];
     $img_title_percent = "";
     $img_title_nr = "";
     $hasSuggestedSolutions = FALSE;
     if ($this->object->getShowSolutionSuggested()) {
         foreach ($result_array as $key => $value) {
             if (strlen($value["solution"])) {
                 $hasSuggestedSolutions = TRUE;
             }
         }
     }
     foreach ($result_array as $key => $value) {
         if (preg_match("/\\d+/", $key)) {
             if (strlen($targetclass) && strlen($targetcommanddetails)) {
                 $template->setCurrentBlock("linked_title");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $this->ctrl->setParameterByClass($targetclass, "evaluation", $value["qid"]);
                 $this->ctrl->setParameterByClass($targetclass, "active_id", $active_id);
                 $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommanddetails));
                 $template->parseCurrentBlock();
             } else {
                 $template->setCurrentBlock("plain_title");
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->parseCurrentBlock();
             }
             if ($hasSuggestedSolutions) {
                 $template->setCurrentBlock("question_suggested_solution");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("SOLUTION_HINT", $this->object->prepareTextareaOutput($value["solution"], true));
                 $template->parseCurrentBlock();
             }
             $template->setCurrentBlock("question");
             $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
             $template->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
             $template->setVariable("VALUE_MAX_POINTS", $value["max"]);
             $template->setVariable("VALUE_REACHED_POINTS", $value["reached"]);
             if ($this->object->isOfferingQuestionHintsEnabled()) {
                 $template->setVariable("VALUE_HINT_COUNT", $value["requested_hints"]);
             }
             $template->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]);
             $template->parseCurrentBlock();
             $counter++;
         }
     }
     if ($hasSuggestedSolutions) {
         $template->touchBlock("footer_suggested_solution");
     }
     $template->setCurrentBlock("footer");
     $template->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>");
     $template->setVariable("VALUE_QUESTION_TITLE", "");
     $template->setVariable("VALUE_MAX_POINTS", "<strong>{$total_max}</strong>");
     $template->setVariable("VALUE_REACHED_POINTS", "<strong>{$total_reached}</strong>");
     if ($this->object->isOfferingQuestionHintsEnabled()) {
         $template->setVariable("VALUE_TOTAL_HINT_COUNT", "<strong>{$totalRequestedHints}</strong>");
     }
     $template->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>");
     $template->parseCurrentBlock();
     if ($standard_header) {
         if ($hasSuggestedSolutions) {
             $template->setCurrentBlock("standard_header_suggested_solution");
             $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
             $template->parseCurrentBlock();
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilTestServiceGUI.php

示例5: getPassListOfAnswersWithScoring

 /**
  * Returns the list of answers of a users test pass and offers a scoring option
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param boolean $show_solutions TRUE, if the solution output should be shown in the answers, FALSE otherwise
  * @return string HTML code of the list of answers
  * @access public
  * 
  * @deprecated
  */
 function getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions = FALSE)
 {
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test");
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     $scoring = ilObjAssessmentFolder::_getManualScoring();
     $counter = 1;
     // output of questions with solutions
     foreach ($result_array as $question_data) {
         $question = $question_data["qid"];
         if (is_numeric($question)) {
             $question_gui = $this->object->createQuestionGUI("", $question);
             if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
                 $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
                 $scoretemplate = new ilTemplate("tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE, "Modules/Test");
                 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question");
                 $template->setVariable("COUNTER_QUESTION", $counter . ". ");
                 $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
                 $points = $question_gui->object->getMaximumPoints();
                 if ($points == 1) {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point"));
                 } else {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points"));
                 }
                 $show_question_only = $this->object->getShowSolutionAnswersOnly() ? TRUE : FALSE;
                 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, TRUE);
                 $solout = $question_gui->object->getSuggestedSolutionOutput();
                 if (strlen($solout)) {
                     $scoretemplate->setCurrentBlock("suggested_solution");
                     $scoretemplate->setVariable("TEXT_SUGGESTED_SOLUTION", $this->lng->txt("solution_hint"));
                     $scoretemplate->setVariable("VALUE_SUGGESTED_SOLUTION", $solout);
                     $scoretemplate->parseCurrentBlock();
                 }
                 $scoretemplate->setCurrentBlock("feedback");
                 $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question);
                 $feedback = $this->object->getManualFeedback($active_id, $question, $pass);
                 $scoretemplate->setVariable("VALUE_FEEDBACK", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE)));
                 $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback"));
                 $scoretemplate->parseCurrentBlock();
                 $scoretemplate->setVariable("NAME_INPUT", $question);
                 $this->ctrl->setParameter($this, "active_id", $active_id);
                 $this->ctrl->setParameter($this, "pass", $pass);
                 $scoretemplate->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "manscoring"));
                 $scoretemplate->setVariable("LABEL_INPUT", $this->lng->txt("tst_change_points_for_question"));
                 $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\"");
                 $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save"));
                 $template->setVariable("SOLUTION_OUTPUT", $result_output);
                 $maintemplate->setCurrentBlock("printview_question");
                 $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
                 $maintemplate->setVariable("QUESTION_SCORING", $scoretemplate->get());
                 $maintemplate->parseCurrentBlock();
             }
             $counter++;
         }
     }
     if ($counter == 1) {
         // no scorable questions found
         $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found"));
     }
     $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass + 1));
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDomEvent();
     return $maintemplate->get();
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:76,代码来源:class.ilTestServiceGUI.php


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