當前位置: 首頁>>代碼示例>>PHP>>正文


PHP assQuestion::_getTotalAnswers方法代碼示例

本文整理匯總了PHP中assQuestion::_getTotalAnswers方法的典型用法代碼示例。如果您正苦於以下問題:PHP assQuestion::_getTotalAnswers方法的具體用法?PHP assQuestion::_getTotalAnswers怎麽用?PHP assQuestion::_getTotalAnswers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在assQuestion的用法示例。


在下文中一共展示了assQuestion::_getTotalAnswers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: assessmentObject

 /**
  * show assessment data of object
  */
 function assessmentObject()
 {
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
     $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
     // catch feedback message
     ilUtil::sendInfo();
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $question_title = assQuestion::_getTitle($_GET["q_id"]);
     $title = $this->lng->txt("statistics") . " - {$question_title}";
     if (!empty($title)) {
         $this->tpl->setVariable("HEADER", $title);
     }
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $total_of_answers = assQuestion::_getTotalAnswers($_GET["q_id"]);
     $counter = 0;
     $color_class = array("tblrow1", "tblrow2");
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_assessment_of_questions.html", "Modules/TestQuestionPool");
     if (!$total_of_answers) {
         $this->tpl->setCurrentBlock("emptyrow");
         $this->tpl->setVariable("TXT_NO_ASSESSMENT", $this->lng->txt("qpl_assessment_no_assessment_of_questions"));
         $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("row");
         $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_answers"));
         $this->tpl->setVariable("TXT_VALUE", $total_of_answers);
         $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
         $counter++;
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("row");
         $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_right_answers"));
         $this->tpl->setVariable("TXT_VALUE", sprintf("%2.2f", assQuestion::_getTotalRightAnswers($_GET["edit"]) * 100.0) . " %");
         $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("adm_content");
     $this->tpl->setVariable("TXT_QUESTION_TITLE", $question_title);
     $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("result"));
     $this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
     $this->tpl->parseCurrentBlock();
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:44,代碼來源:class.ilObjQuestionPoolGUI.php


注:本文中的assQuestion::_getTotalAnswers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。