本文整理汇总了PHP中ilYuiUtil::initElementSelection方法的典型用法代码示例。如果您正苦于以下问题:PHP ilYuiUtil::initElementSelection方法的具体用法?PHP ilYuiUtil::initElementSelection怎么用?PHP ilYuiUtil::initElementSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilYuiUtil
的用法示例。
在下文中一共展示了ilYuiUtil::initElementSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTestOutput
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE, $show_feedback = FALSE)
{
// generate the question output
$template = new ilTemplate("tpl.il_as_qpl_errortext_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
if ($active_id) {
$solutions = NULL;
include_once "./Modules/Test/classes/class.ilObjTest.php";
if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
if (is_null($pass)) {
$pass = ilObjTest::_getPass($active_id);
}
}
$solutions =& $this->object->getSolutionValues($active_id, $pass);
}
$errortext_value = "";
if (strlen($_SESSION['qst_selection'])) {
$this->object->toggleSelection($_SESSION['qst_selection'], $active_id, $pass);
unset($_SESSION['qst_selection']);
$solutions =& $this->object->getSolutionValues($active_id, $pass);
}
$selections = array();
if (is_array($solutions)) {
foreach ($solutions as $solution) {
array_push($selections, $solution['value1']);
}
$errortext_value = join(",", $selections);
}
if ($this->object->getTextSize() >= 10) {
echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->getTextSize() . "%;\"");
}
$template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
$errortext = $this->object->createErrorTextOutput($selections);
$errortext = preg_replace_callback("/#HREF(\\d+)/is", array(&$this, 'exchangeURL'), $errortext);
$this->ctrl->setParameterByClass('iltestoutputgui', 'errorvalue', '');
$template->setVariable("ERRORTEXT", $errortext);
$template->setVariable("ERRORTEXT_ID", "qst_" . $this->object->getId());
$template->setVariable("ERRORTEXT_VALUE", $errortext_value);
$questionoutput = $template->get();
if (!$show_question_only) {
// get page object output
$questionoutput = $this->getILIASPage($questionoutput);
}
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initElementSelection();
$this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/errortext.js");
$questionoutput = $template->get();
$pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
return $pageoutput;
}