ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilAssQuestionPreviewGUI Class Reference
+ Collaboration diagram for ilAssQuestionPreviewGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilTabsGUI $tabs, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilDBInterface $db, ilObjUser $user)
 
 initQuestion ($questionId, $parentObjId)
 
 initPreviewSettings ($parentRefId)
 
 initPreviewSession ($userId, $questionId)
 
 initHintTracking ()
 
 initStyleSheets ()
 
 executeCommand ()
 
 saveQuestionSolution ()
 
 gatewayConfirmHintRequestCmd ()
 
 gatewayShowHintListCmd ()
 

Data Fields

const CMD_SHOW = 'show'
 
const CMD_RESET = 'reset'
 
const CMD_INSTANT_RESPONSE = 'instantResponse'
 
const CMD_HANDLE_QUESTION_ACTION = 'handleQuestionAction'
 
const CMD_GATEWAY_CONFIRM_HINT_REQUEST = 'gatewayConfirmHintRequest'
 
const CMD_GATEWAY_SHOW_HINT_LIST = 'gatewayShowHintList'
 
const TAB_ID_QUESTION_PREVIEW = 'preview'
 
const FEEDBACK_FOCUS_ANCHOR = 'focus'
 

Protected Member Functions

 buildPreviewFormAction ()
 
 isCommentingRequired ()
 
 handleInstantResponseRendering (ilTemplate $tpl)
 
 populateReachedPointsOutput (ilTemplate $tpl)
 
 populateInstantResponseHeader (ilTemplate $tpl, $withFocusAnchor)
 
 populateNotesPanel (ilTemplate $tpl, $notesPanelHTML)
 

Protected Attributes

 $ctrl
 
 $tabs
 
 $tpl
 
 $lng
 
 $db
 
 $user
 
 $questionGUI
 
 $questionOBJ
 
 $previewSettings
 
 $previewSession
 
 $hintTracking
 

Private Member Functions

 showCmd ($notesPanelHTML='')
 
 resetCmd ()
 
 instantResponseCmd ()
 
 handleQuestionActionCmd ()
 
 populatePreviewToolbar (ilTemplate $tpl)
 
 populateQuestionOutput (ilTemplate $tpl)
 
 populateSolutionOutput (ilTemplate $tpl)
 
 getQuestionNavigationHtml ()
 
 populateGenericQuestionFeedback (ilTemplate $tpl)
 
 populateSpecificQuestionFeedback (ilTemplate $tpl)
 
 isShowBestSolutionRequired ()
 
 isShowGenericQuestionFeedbackRequired ()
 
 isShowSpecificQuestionFeedbackRequired ()
 
 isShowReachedPointsRequired ()
 
 getQuestionAnswerShuffler ()
 

Detailed Description

Definition at line 18 of file class.ilAssQuestionPreviewGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionPreviewGUI::__construct ( ilCtrl  $ctrl,
ilTabsGUI  $tabs,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
ilDBInterface  $db,
ilObjUser  $user 
)

Definition at line 86 of file class.ilAssQuestionPreviewGUI.php.

References $ctrl, $db, $lng, $tabs, $tpl, $user, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildPreviewFormAction()

ilAssQuestionPreviewGUI::buildPreviewFormAction ( )
protected
Returns
string

Definition at line 202 of file class.ilAssQuestionPreviewGUI.php.

203 {
204 return $this->ctrl->getFormAction($this, self::CMD_SHOW) . '#' . self::FEEDBACK_FOCUS_ANCHOR;
205 }

References FEEDBACK_FOCUS_ANCHOR.

Referenced by showCmd().

+ Here is the caller graph for this function:

◆ executeCommand()

ilAssQuestionPreviewGUI::executeCommand ( )

Definition at line 152 of file class.ilAssQuestionPreviewGUI.php.

153 {
154 global $DIC; /* @var \ILIAS\DI\Container $DIC */
155 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
156 $ilHelp->setScreenIdComponent('qpl');
157
158 $this->tabs->setTabActive(self::TAB_ID_QUESTION_PREVIEW);
159
160 $this->lng->loadLanguageModule('content');
161
162 $nextClass = $this->ctrl->getNextClass($this);
163
164 switch ($nextClass) {
165 case 'ilassquestionhintrequestgui':
166
167 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
168 $gui = new ilAssQuestionHintRequestGUI($this, self::CMD_SHOW, $this->questionGUI, $this->hintTracking);
169
170 $this->ctrl->forwardCommand($gui);
171
172 break;
173
174 case 'ilassspecfeedbackpagegui':
175 case 'ilassgenfeedbackpagegui':
176 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
177 $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
178 $forwarder->forward();
179 break;
180
181 case 'ilnotegui':
182
183 $notesGUI = new ilNoteGUI($this->questionOBJ->getObjId(), $this->questionOBJ->getId(), 'quest');
184 $notesGUI->enablePublicNotes(true);
185 $notesGUI->enablePublicNotesDeletion(true);
186 $notesPanelHTML = $this->ctrl->forwardCommand($notesGUI);
187 $this->showCmd($notesPanelHTML);
188 break;
189
190
191 default:
192
193 $cmd = $this->ctrl->getCmd(self::CMD_SHOW) . 'Cmd';
194
195 $this->$cmd();
196 }
197 }
Notes GUI class.
$DIC
Definition: xapitoken.php:46

References $DIC, and showCmd().

+ Here is the call graph for this function:

◆ gatewayConfirmHintRequestCmd()

ilAssQuestionPreviewGUI::gatewayConfirmHintRequestCmd ( )

Definition at line 513 of file class.ilAssQuestionPreviewGUI.php.

514 {
515 if (!$this->saveQuestionSolution()) {
516 $this->previewSession->setInstantResponseActive(false);
517 $this->showCmd();
518 return;
519 }
520
521 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
522
523 $this->ctrl->redirectByClass(
524 'ilAssQuestionHintRequestGUI',
526 );
527 }

References ilAssQuestionHintRequestGUI\CMD_CONFIRM_REQUEST, saveQuestionSolution(), and showCmd().

+ Here is the call graph for this function:

◆ gatewayShowHintListCmd()

ilAssQuestionPreviewGUI::gatewayShowHintListCmd ( )

Definition at line 529 of file class.ilAssQuestionPreviewGUI.php.

530 {
531 if (!$this->saveQuestionSolution()) {
532 $this->previewSession->setInstantResponseActive(false);
533 $this->showCmd();
534 return;
535 }
536
537 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
538
539 $this->ctrl->redirectByClass(
540 'ilAssQuestionHintRequestGUI',
542 );
543 }

References ilAssQuestionHintRequestGUI\CMD_SHOW_LIST, saveQuestionSolution(), and showCmd().

+ Here is the call graph for this function:

◆ getQuestionAnswerShuffler()

ilAssQuestionPreviewGUI::getQuestionAnswerShuffler ( )
private
Returns
ilArrayElementShuffler

Definition at line 548 of file class.ilAssQuestionPreviewGUI.php.

549 {
550 require_once 'Services/Randomization/classes/class.ilArrayElementShuffler.php';
551 $shuffler = new ilArrayElementShuffler();
552
553 if (!$this->previewSession->randomizerSeedExists()) {
554 $this->previewSession->setRandomizerSeed($shuffler->buildRandomSeed());
555 }
556
557 $shuffler->setSeed($this->previewSession->getRandomizerSeed());
558
559 return $shuffler;
560 }

Referenced by populateQuestionOutput().

+ Here is the caller graph for this function:

◆ getQuestionNavigationHtml()

ilAssQuestionPreviewGUI::getQuestionNavigationHtml ( )
private

Definition at line 412 of file class.ilAssQuestionPreviewGUI.php.

413 {
414 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionRelatedNavigationBarGUI.php';
415 $navGUI = new ilAssQuestionRelatedNavigationBarGUI($this->ctrl, $this->lng);
416
417 $navGUI->setInstantResponseCmd(self::CMD_INSTANT_RESPONSE);
418 $navGUI->setHintRequestCmd(self::CMD_GATEWAY_CONFIRM_HINT_REQUEST);
419 $navGUI->setHintListCmd(self::CMD_GATEWAY_SHOW_HINT_LIST);
420
421 $navGUI->setInstantResponseEnabled($this->previewSettings->isInstantFeedbackNavigationRequired());
422 $navGUI->setHintProvidingEnabled($this->previewSettings->isHintProvidingEnabled());
423
424 $navGUI->setHintRequestsPossible($this->hintTracking->requestsPossible());
425 $navGUI->setHintRequestsExist($this->hintTracking->requestsExist());
426
427 return $this->ctrl->getHTML($navGUI);
428 }

Referenced by populateQuestionOutput().

+ Here is the caller graph for this function:

◆ handleInstantResponseRendering()

ilAssQuestionPreviewGUI::handleInstantResponseRendering ( ilTemplate  $tpl)
protected

Definition at line 238 of file class.ilAssQuestionPreviewGUI.php.

239 {
240 $renderHeader = false;
241 $renderAnchor = false;
242
243 if ($this->isShowReachedPointsRequired()) {
244 $this->populateReachedPointsOutput($tpl);
245 $renderAnchor = true;
246 $renderHeader = true;
247 }
248
249 if ($this->isShowBestSolutionRequired()) {
250 $this->populateSolutionOutput($tpl);
251 $renderAnchor = true;
252 $renderHeader = true;
253 }
254
257 $renderAnchor = true;
258 $renderHeader = true;
259 }
260
262 $renderHeader = true;
263
264 if ($this->questionGUI->hasInlineFeedback()) {
265 $renderAnchor = false;
266 } else {
268 $renderAnchor = true;
269 }
270 }
271
272 if ($renderHeader) {
273 $this->populateInstantResponseHeader($tpl, $renderAnchor);
274 }
275 }
populateInstantResponseHeader(ilTemplate $tpl, $withFocusAnchor)

References isShowBestSolutionRequired(), isShowGenericQuestionFeedbackRequired(), isShowReachedPointsRequired(), isShowSpecificQuestionFeedbackRequired(), populateGenericQuestionFeedback(), populateInstantResponseHeader(), populateReachedPointsOutput(), populateSolutionOutput(), and populateSpecificQuestionFeedback().

Referenced by showCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleQuestionActionCmd()

ilAssQuestionPreviewGUI::handleQuestionActionCmd ( )
private

Definition at line 300 of file class.ilAssQuestionPreviewGUI.php.

301 {
302 $this->questionOBJ->persistPreviewState($this->previewSession);
303 $this->ctrl->redirect($this, self::CMD_SHOW);
304 }

◆ initHintTracking()

ilAssQuestionPreviewGUI::initHintTracking ( )

Definition at line 133 of file class.ilAssQuestionPreviewGUI.php.

134 {
135 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewHintTracking.php';
136 $this->hintTracking = new ilAssQuestionPreviewHintTracking($this->db, $this->previewSession);
137 }

◆ initPreviewSession()

ilAssQuestionPreviewGUI::initPreviewSession (   $userId,
  $questionId 
)

Definition at line 125 of file class.ilAssQuestionPreviewGUI.php.

126 {
127 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSession.php';
128 $this->previewSession = new ilAssQuestionPreviewSession($userId, $questionId);
129
130 $this->previewSession->init();
131 }

◆ initPreviewSettings()

ilAssQuestionPreviewGUI::initPreviewSettings (   $parentRefId)

Definition at line 117 of file class.ilAssQuestionPreviewGUI.php.

118 {
119 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewSettings.php';
120 $this->previewSettings = new ilAssQuestionPreviewSettings($parentRefId);
121
122 $this->previewSettings->init();
123 }

◆ initQuestion()

ilAssQuestionPreviewGUI::initQuestion (   $questionId,
  $parentObjId 
)

Definition at line 96 of file class.ilAssQuestionPreviewGUI.php.

97 {
98 require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
99
100 $this->questionGUI = assQuestion::instantiateQuestionGUI($questionId);
101 $this->questionOBJ = $this->questionGUI->object;
102
103 $this->questionOBJ->setObjId($parentObjId);
104
105 $this->questionGUI->setQuestionTabs();
106 $this->questionGUI->outAdditionalOutput();
107
108 $this->questionGUI->populateJavascriptFilesRequiredForWorkForm($this->tpl);
109 $this->questionOBJ->setOutputType(OUTPUT_JAVASCRIPT); // TODO: remove including depending stuff
110
111 $this->questionGUI->setTargetGui($this);
112 $this->questionGUI->setQuestionActionCmd(self::CMD_HANDLE_QUESTION_ACTION);
113
114 $this->questionGUI->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_DEMOPLAY);
115 }
static instantiateQuestionGUI($a_question_id)
Creates an instance of a question gui with a given question id.
const OUTPUT_JAVASCRIPT

References assQuestion\instantiateQuestionGUI(), OUTPUT_JAVASCRIPT, and assQuestionGUI\RENDER_PURPOSE_DEMOPLAY.

+ Here is the call graph for this function:

◆ initStyleSheets()

ilAssQuestionPreviewGUI::initStyleSheets ( )

Definition at line 139 of file class.ilAssQuestionPreviewGUI.php.

140 {
141 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
142
143 $this->tpl->setCurrentBlock("ContentStyle");
144 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
145 $this->tpl->parseCurrentBlock();
146
147 $this->tpl->setCurrentBlock("SyntaxStyle");
148 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
149 $this->tpl->parseCurrentBlock();
150 }
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path

References ilObjStyleSheet\getContentStylePath(), and ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ instantResponseCmd()

ilAssQuestionPreviewGUI::instantResponseCmd ( )
private

Definition at line 289 of file class.ilAssQuestionPreviewGUI.php.

290 {
291 if ($this->saveQuestionSolution()) {
292 $this->previewSession->setInstantResponseActive(true);
293 } else {
294 $this->previewSession->setInstantResponseActive(false);
295 }
296
297 $this->ctrl->redirect($this, self::CMD_SHOW);
298 }

References saveQuestionSolution().

+ Here is the call graph for this function:

◆ isCommentingRequired()

ilAssQuestionPreviewGUI::isCommentingRequired ( )
protected

Definition at line 207 of file class.ilAssQuestionPreviewGUI.php.

208 {
209 global $DIC; /* @var ILIAS\DI\Container $DIC */
210
211 if ($this->previewSettings->isTestRefId()) {
212 return false;
213 }
214
215 return (bool) $DIC->rbac()->system()->checkAccess('write', (int) $_GET['ref_id']);
216 }
$_GET["client_id"]

References $_GET, and $DIC.

Referenced by showCmd().

+ Here is the caller graph for this function:

◆ isShowBestSolutionRequired()

ilAssQuestionPreviewGUI::isShowBestSolutionRequired ( )
private

Definition at line 472 of file class.ilAssQuestionPreviewGUI.php.

473 {
474 if (!$this->previewSettings->isBestSolutionEnabled()) {
475 return false;
476 }
477
478 return $this->previewSession->isInstantResponseActive();
479 }

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ isShowGenericQuestionFeedbackRequired()

ilAssQuestionPreviewGUI::isShowGenericQuestionFeedbackRequired ( )
private

Definition at line 481 of file class.ilAssQuestionPreviewGUI.php.

482 {
483 if (!$this->previewSettings->isGenericFeedbackEnabled()) {
484 return false;
485 }
486
487 return $this->previewSession->isInstantResponseActive();
488 }

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ isShowReachedPointsRequired()

ilAssQuestionPreviewGUI::isShowReachedPointsRequired ( )
private

Definition at line 499 of file class.ilAssQuestionPreviewGUI.php.

500 {
501 if (!$this->previewSettings->isReachedPointsEnabled()) {
502 return false;
503 }
504
505 return $this->previewSession->isInstantResponseActive();
506 }

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ isShowSpecificQuestionFeedbackRequired()

ilAssQuestionPreviewGUI::isShowSpecificQuestionFeedbackRequired ( )
private

Definition at line 490 of file class.ilAssQuestionPreviewGUI.php.

491 {
492 if (!$this->previewSettings->isSpecificFeedbackEnabled()) {
493 return false;
494 }
495
496 return $this->previewSession->isInstantResponseActive();
497 }

Referenced by handleInstantResponseRendering(), and populateQuestionOutput().

+ Here is the caller graph for this function:

◆ populateGenericQuestionFeedback()

ilAssQuestionPreviewGUI::populateGenericQuestionFeedback ( ilTemplate  $tpl)
private

Definition at line 430 of file class.ilAssQuestionPreviewGUI.php.

431 {
432 if ($this->questionOBJ->isPreviewSolutionCorrect($this->previewSession)) {
433 $feedback = $this->questionGUI->getGenericFeedbackOutputForCorrectSolution();
435 } else {
436 $feedback = $this->questionGUI->getGenericFeedbackOutputForIncorrectSolution();
438 }
439
440 if (strlen($feedback)) {
441 $tpl->setCurrentBlock('instant_feedback_generic');
442 $tpl->setVariable('GENERIC_FEEDBACK', $feedback);
443 $tpl->setVariable('ILC_FB_CSS_CLASS', $cssClass);
444 $tpl->parseCurrentBlock();
445 }
446 }

References $tpl, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, and ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG.

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ populateInstantResponseHeader()

ilAssQuestionPreviewGUI::populateInstantResponseHeader ( ilTemplate  $tpl,
  $withFocusAnchor 
)
protected

Definition at line 459 of file class.ilAssQuestionPreviewGUI.php.

460 {
461 if ($withFocusAnchor) {
462 $tpl->setCurrentBlock('inst_resp_id');
463 $tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', self::FEEDBACK_FOCUS_ANCHOR);
464 $tpl->parseCurrentBlock();
465 }
466
467 $tpl->setCurrentBlock('instant_response_header');
468 $tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
469 $tpl->parseCurrentBlock();
470 }

References $tpl.

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ populateNotesPanel()

ilAssQuestionPreviewGUI::populateNotesPanel ( ilTemplate  $tpl,
  $notesPanelHTML 
)
protected

Definition at line 562 of file class.ilAssQuestionPreviewGUI.php.

563 {
564 if (!strlen($notesPanelHTML)) {
565 $notesPanelHTML = $this->questionGUI->getNotesHTML();
566 }
567
568 $tpl->setCurrentBlock('notes_panel');
569 $tpl->setVariable('NOTES_PANEL', $notesPanelHTML);
570 $tpl->parseCurrentBlock();
571 }

References $tpl.

Referenced by showCmd().

+ Here is the caller graph for this function:

◆ populatePreviewToolbar()

ilAssQuestionPreviewGUI::populatePreviewToolbar ( ilTemplate  $tpl)
private

Definition at line 306 of file class.ilAssQuestionPreviewGUI.php.

307 {
308 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
309 $toolbarGUI = new ilAssQuestionPreviewToolbarGUI($this->lng);
310
311 $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
312 $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
313
314 $toolbarGUI->build();
315
316 $tpl->setVariable('PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
317 }

References $tpl.

Referenced by showCmd().

+ Here is the caller graph for this function:

◆ populateQuestionOutput()

ilAssQuestionPreviewGUI::populateQuestionOutput ( ilTemplate  $tpl)
private

Definition at line 319 of file class.ilAssQuestionPreviewGUI.php.

320 {
321 // FOR WHAT EXACTLY IS THIS USEFUL?
322 $this->ctrl->setReturnByClass('ilAssQuestionPageGUI', 'view');
323 $this->ctrl->setReturnByClass('ilObjQuestionPoolGUI', 'questions');
324
325 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
326 $pageGUI = new ilAssQuestionPageGUI($this->questionOBJ->getId());
327 $pageGUI->setRenderPageContainer(false);
328 $pageGUI->setEditPreview(true);
329 $pageGUI->setEnabledTabs(false);
330
331 // FOR WHICH SITUATION IS THIS WORKAROUND NECCESSARY? (sure .. imagemaps, but where this can be done?)
332 if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST['editImagemapForward_x'])) { // workaround for page edit imagemaps, keep in mind
333 $this->ctrl->setCmdClass(get_class($pageGUI));
334 $this->ctrl->setCmd('preview');
335 }
336
337 $this->questionGUI->setPreviewSession($this->previewSession);
338 $this->questionGUI->object->setShuffler($this->getQuestionAnswerShuffler());
339
340 $questionHtml = $this->questionGUI->getPreview(true, $this->isShowSpecificQuestionFeedbackRequired());
341 $this->questionGUI->magicAfterTestOutput();
342
343 if ($this->isShowSpecificQuestionFeedbackRequired() && $this->questionGUI->hasInlineFeedback()) {
344 $questionHtml = $this->questionGUI->buildFocusAnchorHtml() . $questionHtml;
345 }
346
347 $questionHtml .= $this->getQuestionNavigationHtml();
348
349 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $questionHtml));
350
351 //$pageGUI->setHeader($this->questionOBJ->getTitle()); // NO ADDITIONAL HEADER
352 $pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
353
354 //$pageGUI->setTemplateTargetVar("ADM_CONTENT"); // NOT REQUIRED, OR IS?
355
356 $tpl->setVariable('QUESTION_OUTPUT', $pageGUI->preview());
357 }
$_POST["username"]
Question page GUI class.

References $_POST, $tpl, getQuestionAnswerShuffler(), getQuestionNavigationHtml(), and isShowSpecificQuestionFeedbackRequired().

Referenced by showCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateReachedPointsOutput()

ilAssQuestionPreviewGUI::populateReachedPointsOutput ( ilTemplate  $tpl)
protected

Definition at line 359 of file class.ilAssQuestionPreviewGUI.php.

360 {
361 $reachedPoints = $this->questionOBJ->calculateReachedPointsFromPreviewSession($this->previewSession);
362 $maxPoints = $this->questionOBJ->getMaximumPoints();
363
364 $scoreInformation = sprintf(
365 $this->lng->txt("you_received_a_of_b_points"),
366 $reachedPoints,
367 $maxPoints
368 );
369
370 $tpl->setCurrentBlock("reached_points_feedback");
371 $tpl->setVariable("REACHED_POINTS_FEEDBACK", $scoreInformation);
372 $tpl->parseCurrentBlock();
373 }

References $tpl.

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ populateSolutionOutput()

ilAssQuestionPreviewGUI::populateSolutionOutput ( ilTemplate  $tpl)
private

Definition at line 375 of file class.ilAssQuestionPreviewGUI.php.

376 {
377 // FOR WHAT EXACTLY IS THIS USEFUL?
378 $this->ctrl->setReturnByClass('ilAssQuestionPageGUI', 'view');
379 $this->ctrl->setReturnByClass('ilObjQuestionPoolGUI', 'questions');
380
381 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
382 $pageGUI = new ilAssQuestionPageGUI($this->questionOBJ->getId());
383
384 $pageGUI->setEditPreview(true);
385 $pageGUI->setEnabledTabs(false);
386
387 // FOR WHICH SITUATION IS THIS WORKAROUND NECCESSARY? (sure .. imagemaps, but where this can be done?)
388 if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST['editImagemapForward_x'])) { // workaround for page edit imagemaps, keep in mind
389 $this->ctrl->setCmdClass(get_class($pageGUI));
390 $this->ctrl->setCmd('preview');
391 }
392
393 $this->questionGUI->setPreviewSession($this->previewSession);
394
395 $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(0, null, false, false, true, false, true, false, false)));
396
397 //$pageGUI->setHeader($this->questionOBJ->getTitle()); // NO ADDITIONAL HEADER
398 //$pageGUI->setPresentationTitle($this->questionOBJ->getTitle());
399
400 //$pageGUI->setTemplateTargetVar("ADM_CONTENT"); // NOT REQUIRED, OR IS?
401
402 $output = $this->questionGUI->getSolutionOutput(0, null, false, false, true, false, true, false, false);
403 //$output = $pageGUI->preview();
404 //$output = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $output);
405
406 $tpl->setCurrentBlock('solution_output');
407 $tpl->setVariable('TXT_CORRECT_SOLUTION', $this->lng->txt('tst_best_solution_is'));
408 $tpl->setVariable('SOLUTION_OUTPUT', $output);
409 $tpl->parseCurrentBlock();
410 }

References $_POST, and $tpl.

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ populateSpecificQuestionFeedback()

ilAssQuestionPreviewGUI::populateSpecificQuestionFeedback ( ilTemplate  $tpl)
private

Definition at line 448 of file class.ilAssQuestionPreviewGUI.php.

449 {
450 $fb = $this->questionGUI->getSpecificFeedbackOutput(
451 (array) $this->previewSession->getParticipantsSolution()
452 );
453
454 $tpl->setCurrentBlock('instant_feedback_specific');
455 $tpl->setVariable('ANSWER_FEEDBACK', $fb);
456 $tpl->parseCurrentBlock();
457 }

References $tpl.

Referenced by handleInstantResponseRendering().

+ Here is the caller graph for this function:

◆ resetCmd()

ilAssQuestionPreviewGUI::resetCmd ( )
private

Definition at line 277 of file class.ilAssQuestionPreviewGUI.php.

278 {
279 $this->previewSession->setRandomizerSeed(null);
280 $this->previewSession->setParticipantsSolution(null);
281 $this->previewSession->resetRequestedHints();
282 $this->previewSession->setInstantResponseActive(false);
283
284 ilUtil::sendInfo($this->lng->txt('qst_preview_reset_msg'), true);
285
286 $this->ctrl->redirect($this, self::CMD_SHOW);
287 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveQuestionSolution()

ilAssQuestionPreviewGUI::saveQuestionSolution ( )

Definition at line 508 of file class.ilAssQuestionPreviewGUI.php.

509 {
510 return $this->questionOBJ->persistPreviewState($this->previewSession);
511 }

Referenced by gatewayConfirmHintRequestCmd(), gatewayShowHintListCmd(), and instantResponseCmd().

+ Here is the caller graph for this function:

◆ showCmd()

ilAssQuestionPreviewGUI::showCmd (   $notesPanelHTML = '')
private

Definition at line 218 of file class.ilAssQuestionPreviewGUI.php.

219 {
220 $tpl = new ilTemplate('tpl.qpl_question_preview.html', true, true, 'Modules/TestQuestionPool');
221
222 $tpl->setVariable('PREVIEW_FORMACTION', $this->buildPreviewFormAction());
223
225
227
229
230 if ($this->isCommentingRequired()) {
231 $this->questionGUI->addHeaderAction();
232 $this->populateNotesPanel($tpl, $notesPanelHTML);
233 }
234
235 $this->tpl->setContent($tpl->get());
236 }
populateNotesPanel(ilTemplate $tpl, $notesPanelHTML)
special template class to simplify handling of ITX/PEAR

References $tpl, buildPreviewFormAction(), handleInstantResponseRendering(), isCommentingRequired(), populateNotesPanel(), populatePreviewToolbar(), and populateQuestionOutput().

Referenced by executeCommand(), gatewayConfirmHintRequestCmd(), and gatewayShowHintListCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilAssQuestionPreviewGUI::$ctrl
protected

Definition at line 34 of file class.ilAssQuestionPreviewGUI.php.

Referenced by __construct().

◆ $db

ilAssQuestionPreviewGUI::$db
protected

Definition at line 54 of file class.ilAssQuestionPreviewGUI.php.

Referenced by __construct().

◆ $hintTracking

ilAssQuestionPreviewGUI::$hintTracking
protected

Definition at line 84 of file class.ilAssQuestionPreviewGUI.php.

◆ $lng

ilAssQuestionPreviewGUI::$lng
protected

Definition at line 49 of file class.ilAssQuestionPreviewGUI.php.

Referenced by __construct().

◆ $previewSession

ilAssQuestionPreviewGUI::$previewSession
protected

Definition at line 79 of file class.ilAssQuestionPreviewGUI.php.

◆ $previewSettings

ilAssQuestionPreviewGUI::$previewSettings
protected

Definition at line 74 of file class.ilAssQuestionPreviewGUI.php.

◆ $questionGUI

ilAssQuestionPreviewGUI::$questionGUI
protected

Definition at line 64 of file class.ilAssQuestionPreviewGUI.php.

◆ $questionOBJ

ilAssQuestionPreviewGUI::$questionOBJ
protected

Definition at line 69 of file class.ilAssQuestionPreviewGUI.php.

◆ $tabs

ilAssQuestionPreviewGUI::$tabs
protected

Definition at line 39 of file class.ilAssQuestionPreviewGUI.php.

Referenced by __construct().

◆ $tpl

◆ $user

ilAssQuestionPreviewGUI::$user
protected

Definition at line 59 of file class.ilAssQuestionPreviewGUI.php.

Referenced by __construct().

◆ CMD_GATEWAY_CONFIRM_HINT_REQUEST

const ilAssQuestionPreviewGUI::CMD_GATEWAY_CONFIRM_HINT_REQUEST = 'gatewayConfirmHintRequest'

Definition at line 24 of file class.ilAssQuestionPreviewGUI.php.

◆ CMD_GATEWAY_SHOW_HINT_LIST

const ilAssQuestionPreviewGUI::CMD_GATEWAY_SHOW_HINT_LIST = 'gatewayShowHintList'

Definition at line 25 of file class.ilAssQuestionPreviewGUI.php.

◆ CMD_HANDLE_QUESTION_ACTION

const ilAssQuestionPreviewGUI::CMD_HANDLE_QUESTION_ACTION = 'handleQuestionAction'

Definition at line 23 of file class.ilAssQuestionPreviewGUI.php.

◆ CMD_INSTANT_RESPONSE

const ilAssQuestionPreviewGUI::CMD_INSTANT_RESPONSE = 'instantResponse'

Definition at line 22 of file class.ilAssQuestionPreviewGUI.php.

◆ CMD_RESET

const ilAssQuestionPreviewGUI::CMD_RESET = 'reset'

Definition at line 21 of file class.ilAssQuestionPreviewGUI.php.

◆ CMD_SHOW

const ilAssQuestionPreviewGUI::CMD_SHOW = 'show'

◆ FEEDBACK_FOCUS_ANCHOR

const ilAssQuestionPreviewGUI::FEEDBACK_FOCUS_ANCHOR = 'focus'

Definition at line 29 of file class.ilAssQuestionPreviewGUI.php.

Referenced by buildPreviewFormAction().

◆ TAB_ID_QUESTION_PREVIEW

const ilAssQuestionPreviewGUI::TAB_ID_QUESTION_PREVIEW = 'preview'

The documentation for this class was generated from the following file: