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);
162 switch ($nextClass) {
163 case 'ilassquestionhintrequestgui':
165 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
168 $this->ctrl->forwardCommand($gui);
172 case 'ilassspecfeedbackpagegui':
173 case 'ilassgenfeedbackpagegui':
174 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
176 $forwarder->forward();
181 $cmd = $this->ctrl->getCmd(self::CMD_SHOW) .
'Cmd';
189 $tpl =
new ilTemplate(
'tpl.qpl_question_preview.html',
true,
true,
'Modules/TestQuestionPool');
191 $tpl->setVariable(
'PREVIEW_FORMACTION', $this->ctrl->getFormAction($this, self::CMD_SHOW));
211 $this->tpl->setContent(
$tpl->get());
216 $this->previewSession->setRandomizerSeed(null);
217 $this->previewSession->setParticipantsSolution(null);
218 $this->previewSession->resetRequestedHints();
219 $this->previewSession->setInstantResponseActive(
false);
223 $this->ctrl->redirect($this, self::CMD_SHOW);
229 $this->previewSession->setInstantResponseActive(
true);
231 $this->previewSession->setInstantResponseActive(
false);
234 $this->ctrl->redirect($this, self::CMD_SHOW);
239 $this->questionOBJ->persistPreviewState($this->previewSession);
240 $this->ctrl->redirect($this, self::CMD_SHOW);
245 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
248 $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
249 $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
251 $toolbarGUI->build();
253 $tpl->
setVariable(
'PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
259 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
260 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
262 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
265 $pageGUI->setEditPreview(
true);
266 $pageGUI->setEnabledTabs(
false);
269 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x'])) {
270 $this->ctrl->setCmdClass(get_class($pageGUI));
271 $this->ctrl->setCmd(
'preview');
274 $this->questionGUI->setPreviewSession($this->previewSession);
278 $this->questionGUI->magicAfterTestOutput();
280 $pageGUI->setQuestionHTML(
array($this->questionOBJ->getId() => $questionHtml));
283 $pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
287 $tpl->
setVariable(
'QUESTION_OUTPUT', $pageGUI->preview());
293 $this->ctrl->setReturnByClass(
'ilAssQuestionPageGUI',
'view');
294 $this->ctrl->setReturnByClass(
'ilObjQuestionPoolGUI',
'questions');
296 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
300 $pageGUI->setEnabledTabs(
false);
303 if (strlen($this->ctrl->getCmd()) == 0 && !isset(
$_POST[
'editImagemapForward_x'])) {
304 $this->ctrl->setCmdClass(get_class($pageGUI));
305 $this->ctrl->setCmd(
'preview');
308 $this->questionGUI->setPreviewSession($this->previewSession);
310 $pageGUI->setQuestionHTML(
array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(
328 $tpl->
setVariable(
'TXT_CORRECT_SOLUTION', $this->lng->txt(
'tst_best_solution_is'));
329 $tpl->
setVariable(
'SOLUTION_OUTPUT', $pageGUI->preview());
335 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionRelatedNavigationBarGUI.php';
338 $navGUI->setInstantResponseCmd(self::CMD_INSTANT_RESPONSE);
339 $navGUI->setHintRequestCmd(self::CMD_GATEWAY_CONFIRM_HINT_REQUEST);
340 $navGUI->setHintListCmd(self::CMD_GATEWAY_SHOW_HINT_LIST);
342 $navGUI->setInstantResponseEnabled($this->previewSettings->isInstantFeedbackNavigationRequired());
343 $navGUI->setHintProvidingEnabled($this->previewSettings->isHintProvidingEnabled());
345 $navGUI->setHintRequestsPossible($this->hintTracking->requestsPossible());
346 $navGUI->setHintRequestsExist($this->hintTracking->requestsExist());
348 $tpl->
setVariable(
'QUESTION_NAVIGATION', $this->ctrl->getHTML($navGUI));
353 if ($this->questionOBJ->isPreviewSolutionCorrect($this->previewSession)) {
354 $feedback = $this->questionGUI->getGenericFeedbackOutputForCorrectSolution();
357 $feedback = $this->questionGUI->getGenericFeedbackOutputForIncorrectSolution();
361 if (strlen($feedback)) {
372 $tpl->
setVariable(
'ANSWER_FEEDBACK', $this->questionGUI->getSpecificFeedbackOutput(0, -1));
378 if (!$this->previewSettings->isBestSolutionEnabled()) {
382 return $this->previewSession->isInstantResponseActive();
387 if (!$this->previewSettings->isGenericFeedbackEnabled()) {
391 return $this->previewSession->isInstantResponseActive();
396 if (!$this->previewSettings->isSpecificFeedbackEnabled()) {
400 return $this->previewSession->isInstantResponseActive();
405 return $this->questionOBJ->persistPreviewState($this->previewSession);
411 $this->previewSession->setInstantResponseActive(
false);
416 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
418 $this->ctrl->redirectByClass(
419 'ilAssQuestionHintRequestGUI',
427 $this->previewSession->setInstantResponseActive(
false);
432 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
434 $this->ctrl->redirectByClass(
435 'ilAssQuestionHintRequestGUI',
445 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
448 if (!$this->previewSession->randomizerSeedExists()) {
449 $this->previewSession->setRandomizerSeed($shuffler->buildRandomSeed());
452 $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
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Create styles array
The data for the language used.
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)
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)