本文整理汇总了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);
}