96 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
99 $this->questionOBJ = $this->questionGUI->object;
101 $this->questionOBJ->setObjId($parentObjId);
103 $this->questionGUI->setQuestionTabs();
104 $this->questionGUI->outAdditionalOutput();
108 $this->questionGUI->setTargetGui($this);
109 $this->questionGUI->setQuestionActionCmd(self::CMD_HANDLE_QUESTION_ACTION);
114 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSettings.php';
117 $this->previewSettings->init();
122 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSession.php';
125 $this->previewSession->init();
130 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewHintTracking.php';
136 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
138 $this->tpl->setCurrentBlock(
"ContentStyle");
140 $this->tpl->parseCurrentBlock();
142 $this->tpl->setCurrentBlock(
"SyntaxStyle");
144 $this->tpl->parseCurrentBlock();
149 $this->tabs->setTabActive(self::TAB_ID_QUESTION_PREVIEW);
151 $this->lng->loadLanguageModule(
'content');
153 $nextClass = $this->ctrl->getNextClass($this);
157 case 'ilassquestionhintrequestgui':
159 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
162 $this->ctrl->forwardCommand($gui);
166 case 'ilassspecfeedbackpagegui':
167 case 'ilassgenfeedbackpagegui':
168 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
170 $forwarder->forward();
175 $cmd = $this->ctrl->getCmd(self::CMD_SHOW).
'Cmd';
183 $tpl =
new ilTemplate(
'tpl.qpl_question_preview.html',
true,
true,
'Modules/TestQuestionPool');
185 $tpl->setVariable(
'PREVIEW_FORMACTION', $this->ctrl->getFormAction($this, self::CMD_SHOW));
208 $this->tpl->setContent(
$tpl->get());
213 $this->previewSession->setRandomizerSeed(null);
214 $this->previewSession->setParticipantsSolution(null);
215 $this->previewSession->resetRequestedHints();
216 $this->previewSession->setInstantResponseActive(
false);
220 $this->ctrl->redirect($this, self::CMD_SHOW);
225 $this->questionOBJ->persistPreviewState($this->previewSession);
226 $this->previewSession->setInstantResponseActive(
true);
227 $this->ctrl->redirect($this, self::CMD_SHOW);
232 $this->questionOBJ->persistPreviewState($this->previewSession);
233 $this->ctrl->redirect($this, self::CMD_SHOW);
238 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
241 $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
242 $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
244 $toolbarGUI->build();
246 $tpl->
setVariable(
'PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
252 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
253 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
255 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
258 $pageGUI->setEditPreview(
true);
259 $pageGUI->setEnabledTabs(
false);
262 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
264 $this->ctrl->setCmdClass(get_class($pageGUI));
265 $this->ctrl->setCmd(
'preview');
268 $this->questionGUI->setPreviewSession($this->previewSession);
272 $this->questionGUI->magicAfterTestOutput();
274 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $questionHtml));
277 $pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
281 $tpl->
setVariable(
'QUESTION_OUTPUT', $pageGUI->preview());
287 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
288 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
290 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
294 $pageGUI->setEnabledTabs(
false);
297 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
299 $this->ctrl->setCmdClass(get_class($pageGUI));
300 $this->ctrl->setCmd(
'preview');
303 $this->questionGUI->setPreviewSession($this->previewSession);
305 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(
306 0, null,
false,
false,
true,
false,
316 $tpl->
setVariable(
'TXT_CORRECT_SOLUTION', $this->lng->txt(
'tst_best_solution_is'));
317 $tpl->
setVariable(
'SOLUTION_OUTPUT', $pageGUI->preview());
323 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionRelatedNavigationBarGUI.php';
326 $navGUI->setInstantResponseCmd(self::CMD_INSTANT_RESPONSE);
327 $navGUI->setHintRequestCmd(self::CMD_GATEWAY_CONFIRM_HINT_REQUEST);
328 $navGUI->setHintListCmd(self::CMD_GATEWAY_SHOW_HINT_LIST);
330 $navGUI->setInstantResponseEnabled($this->previewSettings->isInstantFeedbackNavigationRequired());
331 $navGUI->setHintProvidingEnabled($this->previewSettings->isHintProvidingEnabled());
333 $navGUI->setHintRequestsPossible($this->hintTracking->requestsPossible());
334 $navGUI->setHintRequestsExist($this->hintTracking->requestsExist());
336 $tpl->
setVariable(
'QUESTION_NAVIGATION', $this->ctrl->getHTML($navGUI));
341 if( $this->questionOBJ->isPreviewSolutionCorrect($this->previewSession) )
343 $feedback = $this->questionGUI->getGenericFeedbackOutputForCorrectSolution();
348 $feedback = $this->questionGUI->getGenericFeedbackOutputForIncorrectSolution();
352 if( strlen($feedback) )
364 $tpl->
setVariable(
'ANSWER_FEEDBACK', $this->questionGUI->getSpecificFeedbackOutput(0, -1));
370 if( !$this->previewSettings->isBestSolutionEnabled() )
375 return $this->previewSession->isInstantResponseActive();
380 if( !$this->previewSettings->isGenericFeedbackEnabled() )
385 return $this->previewSession->isInstantResponseActive();
390 if( !$this->previewSettings->isSpecificFeedbackEnabled() )
395 return $this->previewSession->isInstantResponseActive();
400 $this->questionOBJ->persistPreviewState($this->previewSession);
407 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
409 $this->ctrl->redirectByClass(
418 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
420 $this->ctrl->redirectByClass(
430 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
433 if( !$this->previewSession->randomizerSeedExists() )
435 $this->previewSession->setRandomizerSeed($shuffler->buildRandomSeed());
438 $shuffler->setSeed($this->previewSession->getRandomizerSeed());
const CMD_HANDLE_QUESTION_ACTION
populateQuestionOutput(ilTemplate $tpl)
This class provides processing control methods.
const CMD_CONFIRM_REQUEST
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
__construct(ilCtrl $ctrl, ilTabsGUI $tabs, ilTemplate $tpl, ilLanguage $lng, ilDB $db, ilObjUser $user)
const CMD_INSTANT_RESPONSE
initPreviewSettings($parentRefId)
const CSS_CLASS_FEEDBACK_CORRECT
getSyntaxStylePath()
get syntax style path
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
isShowSpecificQuestionFeedbackRequired()
getQuestionAnswerShuffler()
handleQuestionActionCmd()
setVariable($variable, $value='')
Sets a variable value.
special template class to simplify handling of ITX/PEAR
populatePreviewToolbar(ilTemplate $tpl)
populateGenericQuestionFeedback(ilTemplate $tpl)
setRenderPageContainer($a_val)
Set render page container.
const CSS_CLASS_FEEDBACK_WRONG
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
isShowBestSolutionRequired()
gatewayConfirmHintRequestCmd()
const CMD_SHOW_LIST
command constants
populateSolutionOutput(ilTemplate $tpl)
getContentStylePath($a_style_id)
get content style path
initQuestion($questionId, $parentObjId)
initPreviewSession($userId, $questionId)
isShowGenericQuestionFeedbackRequired()
const CMD_GATEWAY_SHOW_HINT_LIST
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
static instantiateQuestionGUI($a_question_id)
Creates an instance of a question gui with a given question id.
populateQuestionNavigation(ilTemplate $tpl)
const TAB_ID_QUESTION_PREVIEW
const CMD_GATEWAY_CONFIRM_HINT_REQUEST
populateSpecificQuestionFeedback(ilTemplate $tpl)