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();
106 $this->questionGUI->populateJavascriptFilesRequiredForWorkForm($this->tpl);
109 $this->questionGUI->setTargetGui($this);
110 $this->questionGUI->setQuestionActionCmd(self::CMD_HANDLE_QUESTION_ACTION);
117 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSettings.php';
120 $this->previewSettings->init();
125 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSession.php';
128 $this->previewSession->init();
133 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewHintTracking.php';
139 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
141 $this->tpl->setCurrentBlock(
"ContentStyle");
143 $this->tpl->parseCurrentBlock();
145 $this->tpl->setCurrentBlock(
"SyntaxStyle");
147 $this->tpl->parseCurrentBlock();
153 $ilHelp = $DIC[
'ilHelp'];
154 $ilHelp->setScreenIdComponent(
'qpl');
156 $this->tabs->setTabActive(self::TAB_ID_QUESTION_PREVIEW);
158 $this->lng->loadLanguageModule(
'content');
160 $nextClass = $this->ctrl->getNextClass($this);
164 case 'ilassquestionhintrequestgui':
166 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
169 $this->ctrl->forwardCommand($gui);
173 case 'ilassspecfeedbackpagegui':
174 case 'ilassgenfeedbackpagegui':
175 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
177 $forwarder->forward();
182 $cmd = $this->ctrl->getCmd(self::CMD_SHOW).
'Cmd';
190 $tpl =
new ilTemplate(
'tpl.qpl_question_preview.html',
true,
true,
'Modules/TestQuestionPool');
192 $tpl->setVariable(
'PREVIEW_FORMACTION', $this->ctrl->getFormAction($this, self::CMD_SHOW));
215 $this->tpl->setContent(
$tpl->get());
220 $this->previewSession->setRandomizerSeed(null);
221 $this->previewSession->setParticipantsSolution(null);
222 $this->previewSession->resetRequestedHints();
223 $this->previewSession->setInstantResponseActive(
false);
227 $this->ctrl->redirect($this, self::CMD_SHOW);
234 $this->previewSession->setInstantResponseActive(
true);
238 $this->previewSession->setInstantResponseActive(
false);
241 $this->ctrl->redirect($this, self::CMD_SHOW);
246 $this->questionOBJ->persistPreviewState($this->previewSession);
247 $this->ctrl->redirect($this, self::CMD_SHOW);
252 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
255 $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
256 $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
258 $toolbarGUI->build();
260 $tpl->
setVariable(
'PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
266 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
267 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
269 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
272 $pageGUI->setEditPreview(
true);
273 $pageGUI->setEnabledTabs(
false);
276 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
278 $this->ctrl->setCmdClass(get_class($pageGUI));
279 $this->ctrl->setCmd(
'preview');
282 $this->questionGUI->setPreviewSession($this->previewSession);
286 $this->questionGUI->magicAfterTestOutput();
288 $pageGUI->setQuestionHTML(
array($this->questionOBJ->getId() => $questionHtml));
291 $pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
295 $tpl->
setVariable(
'QUESTION_OUTPUT', $pageGUI->preview());
301 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
302 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
304 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
308 $pageGUI->setEnabledTabs(
false);
311 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x']))
313 $this->ctrl->setCmdClass(get_class($pageGUI));
314 $this->ctrl->setCmd(
'preview');
317 $this->questionGUI->setPreviewSession($this->previewSession);
319 $pageGUI->setQuestionHTML(
array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(
320 0, null,
false,
false,
true,
false,
330 $tpl->
setVariable(
'TXT_CORRECT_SOLUTION', $this->lng->txt(
'tst_best_solution_is'));
331 $tpl->
setVariable(
'SOLUTION_OUTPUT', $pageGUI->preview());
337 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionRelatedNavigationBarGUI.php';
340 $navGUI->setInstantResponseCmd(self::CMD_INSTANT_RESPONSE);
341 $navGUI->setHintRequestCmd(self::CMD_GATEWAY_CONFIRM_HINT_REQUEST);
342 $navGUI->setHintListCmd(self::CMD_GATEWAY_SHOW_HINT_LIST);
344 $navGUI->setInstantResponseEnabled($this->previewSettings->isInstantFeedbackNavigationRequired());
345 $navGUI->setHintProvidingEnabled($this->previewSettings->isHintProvidingEnabled());
347 $navGUI->setHintRequestsPossible($this->hintTracking->requestsPossible());
348 $navGUI->setHintRequestsExist($this->hintTracking->requestsExist());
350 $tpl->
setVariable(
'QUESTION_NAVIGATION', $this->ctrl->getHTML($navGUI));
355 if( $this->questionOBJ->isPreviewSolutionCorrect($this->previewSession) )
357 $feedback = $this->questionGUI->getGenericFeedbackOutputForCorrectSolution();
362 $feedback = $this->questionGUI->getGenericFeedbackOutputForIncorrectSolution();
366 if( strlen($feedback) )
378 $tpl->
setVariable(
'ANSWER_FEEDBACK', $this->questionGUI->getSpecificFeedbackOutput(0, -1));
384 if( !$this->previewSettings->isBestSolutionEnabled() )
389 return $this->previewSession->isInstantResponseActive();
394 if( !$this->previewSettings->isGenericFeedbackEnabled() )
399 return $this->previewSession->isInstantResponseActive();
404 if( !$this->previewSettings->isSpecificFeedbackEnabled() )
409 return $this->previewSession->isInstantResponseActive();
414 return $this->questionOBJ->persistPreviewState($this->previewSession);
421 $this->previewSession->setInstantResponseActive(
false);
426 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
428 $this->ctrl->redirectByClass(
437 $this->previewSession->setInstantResponseActive(
false);
442 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
444 $this->ctrl->redirectByClass(
454 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
457 if( !$this->previewSession->randomizerSeedExists() )
459 $this->previewSession->setRandomizerSeed($shuffler->buildRandomSeed());
462 $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, ilDBInterface $db, ilObjUser $user)
const CMD_INSTANT_RESPONSE
initPreviewSettings($parentRefId)
const CSS_CLASS_FEEDBACK_CORRECT
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)
const RENDER_PURPOSE_DEMOPLAY
setRenderPageContainer($a_val)
Set render page container.
static getSyntaxStylePath()
get syntax style path
const CSS_CLASS_FEEDBACK_WRONG
Create styles array
The data for the language used.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
isShowBestSolutionRequired()
static getContentStylePath($a_style_id)
get content style path
gatewayConfirmHintRequestCmd()
const CMD_SHOW_LIST
command constants
populateSolutionOutput(ilTemplate $tpl)
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)