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