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


PHP assQuestion::_instanciateQuestionGUI方法代码示例

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


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

示例1: copyQuestionObject

 public function copyQuestionObject()
 {
     global $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
         // allow only write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirect($this, "infoScreen");
     }
     if ($_REQUEST['q_id'] && !is_array($_REQUEST['q_id'])) {
         $ids = array($_REQUEST['q_id']);
     } else {
         if ($_REQUEST['q_id']) {
             $ids = $_REQUEST['q_id'];
         } else {
             ilUtil::sendFailure($this->lng->txt('copy_no_questions_selected'), true);
             $this->ctrl->redirect($this, 'questions');
         }
     }
     $copy_count = 0;
     $questionTitles = $this->object->getQuestionTitles();
     foreach ($ids as $id) {
         include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
         $question = assQuestion::_instanciateQuestionGUI($id);
         if ($question) {
             $title = $question->object->getTitle();
             $i = 2;
             while (in_array($title . ' (' . $i . ')', $questionTitles)) {
                 $i++;
             }
             $title .= ' (' . $i . ')';
             $questionTitles[] = $title;
             $new_id = $question->object->duplicate(false, $title);
             $clone = assQuestion::_instanciateQuestionGUI($new_id);
             $clone->object->setObjId($this->object->getId());
             $clone->object->saveToDb();
             $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id, true);
             $copy_count++;
         }
     }
     ilUtil::sendSuccess($this->lng->txt('copy_questions_success'), true);
     $this->ctrl->redirect($this, 'questions');
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:42,代码来源:class.ilObjTestGUI.php

示例2:

 function &createQuestion($question_type, $question_id = -1)
 {
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     if ($question_id > 0) {
         return assQuestion::_instanciateQuestionGUI($question_id);
     }
     assQuestion::_includeClass($question_type, 1);
     $question_type_gui = $question_type . "GUI";
     $question_gui =& new $question_type_gui();
     return $question_gui;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:11,代码来源:class.ilObjQuestionPool.php

示例3: fillRow

 /**
  * fill row 
  *
  * @access public
  * @param
  * @return
  */
 public function fillRow($data)
 {
     ilDatePresentation::setUseRelativeDates(false);
     $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
     foreach ($this->getSelectedColumns() as $c) {
         if (strcmp($c, 'description') == 0) {
             $this->tpl->setCurrentBlock('description');
             $this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description']));
             $this->tpl->parseCurrentBlock();
         }
         if (strcmp($c, 'author') == 0) {
             $this->tpl->setCurrentBlock('author');
             $this->tpl->setVariable("AUTHOR", ilUtil::prepareFormOutput($data['author']));
             $this->tpl->parseCurrentBlock();
         }
         if (strcmp($c, 'ttype') == 0) {
             $this->tpl->setCurrentBlock('ttype');
             $this->tpl->setVariable("TYPE", ilUtil::prepareFormOutput($data['ttype']));
             $this->tpl->parseCurrentBlock();
         }
         if (strcmp($c, 'created') == 0) {
             $this->tpl->setCurrentBlock('created');
             $this->tpl->setVariable('CREATED', ilDatePresentation::formatDate(new ilDateTime($data['created'], IL_CAL_UNIX)));
             $this->tpl->parseCurrentBlock();
         }
         if (strcmp($c, 'updated') == 0) {
             $this->tpl->setCurrentBlock('updated');
             $this->tpl->setVariable('UPDATED', ilDatePresentation::formatDate(new ilDateTime($data['updated'], IL_CAL_UNIX)));
             $this->tpl->parseCurrentBlock();
         }
     }
     if (strcmp($this->outputmode, "detailed") == 0 || strcmp($this->outputmode, "detailed_printview") == 0) {
         $this->tpl->setCurrentBlock("overview_row_detail");
         include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
         $question_gui = assQuestion::_instanciateQuestionGUI($data["question_id"]);
         if (strcmp($this->outputmode, "detailed") == 0) {
             $solutionoutput = $question_gui->getSolutionOutput($active_id = "", $pass = NULL, $graphicalOutput = FALSE, $result_output = FALSE, $show_question_only = FALSE, $show_feedback = FALSE, $show_correct_solution = true, $show_manual_scoring = false);
             if (strlen($solutionoutput) == 0) {
                 $solutionoutput = $question_gui->getPreview();
             }
             $this->tpl->setVariable("DETAILS", $solutionoutput);
         } else {
             $this->tpl->setVariable("DETAILS", $question_gui->getPreview());
         }
         $this->tpl->parseCurrentBlock();
     }
     ilDatePresentation::setUseRelativeDates(true);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:55,代码来源:class.ilQuestionPoolPrintViewTableGUI.php


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