本文整理匯總了PHP中assQuestion::instantiateQuestionGUI方法的典型用法代碼示例。如果您正苦於以下問題:PHP assQuestion::instantiateQuestionGUI方法的具體用法?PHP assQuestion::instantiateQuestionGUI怎麽用?PHP assQuestion::instantiateQuestionGUI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類assQuestion
的用法示例。
在下文中一共展示了assQuestion::instantiateQuestionGUI方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initQuestion
public function initQuestion($questionId, $parentObjId)
{
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
$this->questionGUI = assQuestion::instantiateQuestionGUI($questionId);
$this->questionOBJ = $this->questionGUI->object;
$this->questionOBJ->setObjId($parentObjId);
$this->questionGUI->setQuestionTabs();
$this->questionGUI->outAdditionalOutput();
$this->questionOBJ->setOutputType(OUTPUT_JAVASCRIPT);
$this->questionGUI->setTargetGui($this);
$this->questionGUI->setQuestionActionCmd(self::CMD_HANDLE_QUESTION_ACTION);
}
示例2: saveQuestion
protected function saveQuestion()
{
$question_id = $_POST['q_id'];
$question_pool_id = $_POST['qpl_id'];
$form = $this->buildAdjustQuestionForm($question_id, $question_pool_id);
$form->setValuesByPost($_POST);
if (!$form->checkInput()) {
ilUtil::sendFailure($this->lng->txt('adjust_question_form_error'));
$this->outputAdjustQuestionForm($form);
return;
}
require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
/** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable */
$question = assQuestion::instantiateQuestionGUI($question_id);
if ($question instanceof ilGuiQuestionScoringAdjustable) {
$question->writeQuestionSpecificPostData($form);
}
if ($question->object instanceof ilObjQuestionScoringAdjustable) {
$question->object->saveAdditionalQuestionDataToDb();
}
if ($question instanceof ilGuiAnswerScoringAdjustable) {
$question->writeAnswerSpecificPostData($form);
}
if ($question->object instanceof ilObjAnswerScoringAdjustable) {
$question->object->saveAnswerSpecificDataToDb();
}
$question->object->setPoints($question->object->getMaximumPoints());
$question->object->saveQuestionDataToDb();
require_once './Modules/Test/classes/class.ilTestScoring.php';
$scoring = new ilTestScoring($this->object);
$scoring->setPreserveManualScores($_POST['preserve_manscoring'] == 1 ? true : false);
$scoring->recalculateSolutions();
ilUtil::sendSuccess($this->lng->txt('saved_adjustment'));
$this->questionsObject();
}
示例3: copyQuestionToPool
public function copyQuestionToPool($sourceQuestionId, $targetParentId)
{
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
$question_gui = assQuestion::instantiateQuestionGUI($sourceQuestionId);
$newtitle = $question_gui->object->getTitle();
if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle())) {
$counter = 2;
while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() . " ({$counter})")) {
$counter++;
}
$newtitle = $question_gui->object->getTitle() . " ({$counter})";
}
return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
}