90 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
93 $this->questionOBJ = $this->questionGUI->object;
95 $this->questionOBJ->setObjId($parentObjId);
97 $this->questionGUI->setQuestionTabs();
98 $this->questionGUI->outAdditionalOutput();
102 $this->questionGUI->setTargetGui($this);
103 $this->questionGUI->setQuestionActionCmd(self::CMD_HANDLE_QUESTION_ACTION);
108 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSettings.php';
111 $this->previewSettings->init();
116 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSession.php';
119 $this->previewSession->init();
124 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewHintTracking.php';
130 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
132 $this->tpl->setCurrentBlock(
"ContentStyle");
134 $this->tpl->parseCurrentBlock();
136 $this->tpl->setCurrentBlock(
"SyntaxStyle");
138 $this->tpl->parseCurrentBlock();
143 $this->tabs->setTabActive(self::TAB_ID_QUESTION_PREVIEW);
145 $this->lng->loadLanguageModule(
'content');
147 $nextClass = $this->ctrl->getNextClass($this);
151 case 'ilassquestionhintrequestgui':
153 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
156 $this->ctrl->forwardCommand($gui);
160 case 'ilassspecfeedbackpagegui':
161 case 'ilassgenfeedbackpagegui':
162 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
164 $forwarder->forward();
169 $cmd = $this->ctrl->getCmd(self::CMD_SHOW).
'Cmd';
177 $tpl =
new ilTemplate(
'tpl.qpl_question_preview.html',
true,
true,
'Modules/TestQuestionPool');
179 $tpl->setVariable(
'PREVIEW_FORMACTION', $this->ctrl->getFormAction($this, self::CMD_SHOW));
202 $this->tpl->setContent(
$tpl->get());
207 $this->previewSession->resetRequestedHints();
208 $this->previewSession->setParticipantsSolution(null);
209 $this->previewSession->setInstantResponseActive(
false);
213 $this->ctrl->redirect($this, self::CMD_SHOW);
218 $this->questionOBJ->persistPreviewState($this->previewSession);
219 $this->previewSession->setInstantResponseActive(
true);
220 $this->ctrl->redirect($this, self::CMD_SHOW);
225 $this->questionOBJ->persistPreviewState($this->previewSession);
226 $this->ctrl->redirect($this, self::CMD_SHOW);
231 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
234 $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
235 $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
237 $toolbarGUI->build();
239 $tpl->
setVariable(
'PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
245 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
246 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
248 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
251 $pageGUI->setEditPreview(
true);
252 $pageGUI->setEnabledTabs(
false);
255 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
257 $this->ctrl->setCmdClass(get_class($pageGUI));
258 $this->ctrl->setCmd(
'preview');
261 $this->questionGUI->setPreviewSession($this->previewSession);
265 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $questionHtml));
268 $pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
272 $tpl->
setVariable(
'QUESTION_OUTPUT', $pageGUI->preview());
278 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
279 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
281 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
285 $pageGUI->setEnabledTabs(
false);
288 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
290 $this->ctrl->setCmdClass(get_class($pageGUI));
291 $this->ctrl->setCmd(
'preview');
294 $this->questionGUI->setPreviewSession($this->previewSession);
296 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(0)));
304 $tpl->
setVariable(
'TXT_CORRECT_SOLUTION', $this->lng->txt(
'tst_best_solution_is'));
305 $tpl->
setVariable(
'SOLUTION_OUTPUT', $pageGUI->preview());
311 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionRelatedNavigationBarGUI.php';
314 $navGUI->setInstantResponseCmd(self::CMD_INSTANT_RESPONSE);
315 $navGUI->setHintRequestCmd(self::CMD_GATEWAY_CONFIRM_HINT_REQUEST);
316 $navGUI->setHintListCmd(self::CMD_GATEWAY_SHOW_HINT_LIST);
318 $navGUI->setInstantResponseEnabled($this->previewSettings->isInstantFeedbackNavigationRequired());
319 $navGUI->setHintProvidingEnabled($this->previewSettings->isHintProvidingEnabled());
321 $navGUI->setHintRequestsPossible($this->hintTracking->requestsPossible());
322 $navGUI->setHintRequestsExist($this->hintTracking->requestsExist());
324 $tpl->
setVariable(
'QUESTION_NAVIGATION', $this->ctrl->getHTML($navGUI));
329 if( $this->questionOBJ->isPreviewSolutionCorrect($this->previewSession) )
331 $feedback = $this->questionGUI->getGenericFeedbackOutputForCorrectSolution();
335 $feedback = $this->questionGUI->getGenericFeedbackOutputForIncorrectSolution();
346 $tpl->
setVariable(
'ANSWER_FEEDBACK', $this->questionGUI->getSpecificFeedbackOutput(0, -1));
352 if( !$this->previewSettings->isBestSolutionEnabled() )
357 return $this->previewSession->isInstantResponseActive();
362 if( !$this->previewSettings->isGenericFeedbackEnabled() )
367 return $this->previewSession->isInstantResponseActive();
372 if( !$this->previewSettings->isSpecificFeedbackEnabled() )
377 return $this->previewSession->isInstantResponseActive();
382 $this->questionOBJ->persistPreviewState($this->previewSession);
389 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
391 $this->ctrl->redirectByClass(
400 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
402 $this->ctrl->redirectByClass(