本文整理匯總了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;
}