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


PHP assQuestion::getGuiClassNameByQuestionType方法代码示例

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


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

示例1: ilSetting

 /**
 * Creates a question GUI instance of a given question type
 *
 * @param integer $question_type The question type of the question
 * @param integer $question_id The question id of the question, if available
 * @return assQuestionGUI $questionGUI The question GUI instance
 * @access	public
 */
 function &createQuestionGUI($question_type, $question_id = -1)
 {
     if (!$question_type and $question_id > 0) {
         $question_type = $this->getQuestionType($question_id);
     }
     if (!strlen($question_type)) {
         return null;
     }
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     assQuestion::_includeClass($question_type, 1);
     $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
     $question = new $question_type_gui();
     if ($question_id > 0) {
         $question->object->loadFromDb($question_id);
         global $ilCtrl, $ilDB, $ilUser, $lng;
         $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
         $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
         $assSettings = new ilSetting('assessment');
         require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
         $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
         $processLockerFactory->setQuestionId($question->object->getId());
         $processLockerFactory->setUserId($ilUser->getId());
         include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
         $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
         $question->object->setProcessLocker($processLockerFactory->getLocker());
     }
     return $question;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:36,代码来源:class.ilObjTest.php

示例2:

 /**
  * Creates a question gui representation and returns the alias to the question gui
  * note: please do not use $this inside this method to allow static calls
  *
  * @param string $question_type The question type as it is used in the language database
  * @param integer $question_id The database ID of an existing question to load it into assQuestionGUI
  * 
  * @return assQuestionGUI The alias to the question object
  */
 public function &_getQuestionGUI($question_type, $question_id = -1)
 {
     global $ilCtrl, $ilDB, $lng;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     if (!$question_type and $question_id > 0) {
         $question_type = assQuestion::getQuestionTypeFromDb($question_id);
     }
     if (strlen($question_type) == 0) {
         return NULL;
     }
     assQuestion::_includeClass($question_type, 1);
     $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
     $question =& new $question_type_gui();
     $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
     $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
     if ($question_id > 0) {
         $question->object->loadFromDb($question_id);
     }
     return $question;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:29,代码来源:class.assQuestionGUI.php


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