ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestPlayerAbstractGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once './Modules/Test/classes/class.ilTestServiceGUI.php';
6 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
7 require_once './Services/UIComponent/Button/classes/class.ilSubmitButton.php';
8 
26 {
27  var $ref_id;
29  var $sequence;
30  var $cmdCtrl;
33 
37  protected $passwordChecker;
38 
42  protected $processLocker;
43 
47  protected $testSession;
48 
54  public function __construct($a_object)
55  {
56  parent::ilTestServiceGUI($a_object);
57  $this->ref_id = $_GET["ref_id"];
58 
59  global $rbacsystem, $ilUser;
60  require_once 'Modules/Test/classes/class.ilTestPasswordChecker.php';
61  $this->passwordChecker = new ilTestPasswordChecker($rbacsystem, $ilUser, $this->object);
62 
63  $this->processLocker = null;
64  $this->testSession = null;
65  }
66 
68  {
69  if( $testSession->getActiveId() )
70  {
71  return;
72  }
73 
74  global $ilUser;
75 
76  $testSession->setUserId($ilUser->getId());
77 
78  if( $testSession->isAnonymousUser() )
79  {
80  if( !$testSession->doesAccessCodeInSessionExists() )
81  {
82  return;
83  }
84 
85  $testSession->setAnonymousId($testSession->getAccessCodeFromSession());
86  }
87 
88  $testSession->saveToDb();
89  }
90 
91  protected function initProcessLocker($activeId)
92  {
93  global $ilDB;
94 
95  $settings = new ilSetting('assessment');
96 
97  require_once 'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
98  $processLockerFactory = new ilTestProcessLockerFactory($settings, $ilDB);
99 
100  $processLockerFactory->setActiveId($activeId);
101 
102  $this->processLocker = $processLockerFactory->getLocker();
103  }
104 
111  function saveTagsCmd()
112  {
113  include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
114  $tagging_gui = new ilTaggingGUI();
115  $tagging_gui->setObject($this->object->getId(), $this->object->getType());
116  $tagging_gui->saveInput();
117  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
118  }
119 
120  public function outResultsToplistCmd()
121  {
122  global $ilCtrl;
123  $ilCtrl->redirectByClass('ilTestToplistGUI', 'outResultsToplist');
124  }
125 
129  function updateWorkingTime()
130  {
131  if ($_SESSION["active_time_id"])
132  {
133  $this->object->updateWorkingTime($_SESSION["active_time_id"]);
134  }
135  }
136 
140  abstract public function saveQuestionSolution($force = FALSE);
141 
142  abstract protected function canSaveResult();
143 
144  abstract protected function outWorkingForm($sequence = "", $test_id, $postpone_allowed, $directfeedback = false);
145 
151  public function outIntroductionPageCmd()
152  {
153  if( $this->customRedirectRequired() )
154  {
155  $this->performCustomRedirect();
156  }
157 
158  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
159  }
160 
168  public function isMaxProcessingTimeReached()
169  {
170  global $ilUser;
171  $active_id = $this->testSession->getActiveId();
172  $starting_time = $this->object->getStartingTimeOfUser($active_id);
173  if ($starting_time === FALSE)
174  {
175  return FALSE;
176  }
177  else
178  {
179  return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
180  }
181  }
182 
183  protected function determineInlineScoreDisplay()
184  {
185  $show_question_inline_score = FALSE;
186  if ($this->object->getAnswerFeedbackPoints())
187  {
188  $show_question_inline_score = TRUE;
189  return $show_question_inline_score;
190  }
191  return $show_question_inline_score;
192  }
193 
194  protected function populatePreviousButtons($sequence)
195  {
196  if ($this->isFirstPageInSequence( $sequence ))
197  {
199  }
200  else
201  {
203  }
204  }
205 
207  {
208  $this->tpl->setCurrentBlock( "isnotmarked" );
209  $this->tpl->setVariable( "CMD_UNMARKED", 'markQuestion' );
210  $this->tpl->setVariable( "IMAGE_UNMARKED", ilUtil::getImagePath( "marked_.svg" ) );
211  $this->tpl->setVariable( "TEXT_UNMARKED", $this->lng->txt( "tst_question_mark" ) );
212  $this->tpl->parseCurrentBlock();
213  }
214 
216  {
217  $this->tpl->setCurrentBlock( "ismarked" );
218  $this->tpl->setVariable( "CMD_MARKED", 'unmarkQuestion' );
219  $this->tpl->setVariable( "IMAGE_MARKED", ilUtil::getImagePath( "marked.svg" ) );
220  $this->tpl->setVariable( "TEXT_MARKED", $this->lng->txt( "tst_remove_mark" ) );
221  $this->tpl->parseCurrentBlock();
222  }
223 
225  {
228  }
229 
231  {
232  $button = ilSubmitButton::getInstance();
233  $button->setPrimary( true );
234  $button->setCommand( 'nextQuestion' );
235  $button->setCaption( 'save_next' );
236  $button->setId( 'bottomnextbutton' );
237 
238  $this->tpl->setCurrentBlock( "next_bottom" );
239  $this->tpl->setVariable( "BTN_NEXT", $button->render());
240  $this->tpl->parseCurrentBlock();
241  }
242 
244  {
245  $button = ilSubmitButton::getInstance();
246  $button->setPrimary( true );
247  $button->setCommand( 'nextQuestion' );
248  $button->setCaption( 'save_next' );
249  $button->setId( 'nextbutton' );
250 
251  $this->tpl->setCurrentBlock( "next" );
252  $this->tpl->setVariable( "BTN_NEXT", $button->render());
253  $this->tpl->parseCurrentBlock();
254  }
255 
257  {
260  }
261 
263  {
264  $button = ilSubmitButton::getInstance();
265  $button->setPrimary( true );
266  $button->setCommand( 'nextQuestion' );
267  $button->setCaption( 'save_finish' );
268  $button->setId( 'bottomnextbutton' );
269 
270  $this->tpl->setCurrentBlock( "next_bottom" );
271  $this->tpl->setVariable( "BTN_NEXT", $button->render());
272  $this->tpl->parseCurrentBlock();
273  }
274 
276  {
277  $button = ilSubmitButton::getInstance();
278  $button->setPrimary( true );
279  $button->setCommand( 'nextQuestion' );
280  $button->setCaption( 'save_finish' );
281  $button->setId( 'nextbutton' );
282 
283  $this->tpl->setCurrentBlock( "next" );
284  $this->tpl->setVariable( "BTN_NEXT", $button->render());
285  $this->tpl->parseCurrentBlock();
286  }
287 
289  {
292  }
293 
295  {
296  $button = ilSubmitButton::getInstance();
297  $button->setPrimary( true );
298  $button->setCommand( 'nextQuestion' );
299  $button->setCaption( 'question_summary' );
300  $button->setId( 'bottomnextbutton' );
301 
302  $this->tpl->setCurrentBlock( "next_bottom" );
303  $this->tpl->setVariable( "BTN_NEXT", $button->render());
304  $this->tpl->parseCurrentBlock();
305  }
306 
308  {
309  $button = ilSubmitButton::getInstance();
310  $button->setPrimary( true );
311  $button->setCommand( 'nextQuestion' );
312  $button->setCaption( 'question_summary' );
313  $button->setId( 'nextbutton' );
314 
315  $this->tpl->setCurrentBlock( "next" );
316  $this->tpl->setVariable( "BTN_NEXT", $button->render());
317  $this->tpl->parseCurrentBlock();
318  }
319 
320  protected function populateCancelButtonBlock()
321  {
322  $this->tpl->setCurrentBlock('cancel_test');
323  $this->tpl->setVariable('TEXT_CANCELTEST', $this->lng->txt('cancel_test'));
324  $this->ctrl->setParameterByClass(get_class($this), 'cancelTest', 'true');
325  $this->tpl->setVariable('HREF_CANCELTEXT', $this->ctrl->getLinkTargetByClass(get_class($this), 'outIntroductionPage'));
326  $this->ctrl->setParameterByClass(get_class($this), 'cancelTest', null);
327  $this->tpl->parseCurrentBlock();
328  }
329 
330  protected function populateSummaryButtons()
331  {
334  }
335 
336  protected function populateLowerSummaryButtonBlock()
337  {
338  $this->tpl->setCurrentBlock( "summary_bottom" );
339  $this->tpl->setVariable( "CMD_SUMMARY", 'showQuestionList' );
340  $this->tpl->setVariable( "BTN_SUMMARY", $this->lng->txt( "question_summary" ) );
341  $this->tpl->parseCurrentBlock();
342  }
343 
344  protected function populateUpperSummaryButtonBlock()
345  {
346  $this->tpl->setCurrentBlock( "summary" );
347  $this->tpl->setVariable( "CMD_SUMMARY", 'showQuestionList' );
348  $this->tpl->setVariable( "BTN_SUMMARY", $this->lng->txt( "question_summary" ) );
349  $this->tpl->parseCurrentBlock();
350  }
351 
352  protected function populateQuestionSelectionButtons()
353  {
356  }
357 
359  {
360  $this->tpl->setCurrentBlock( "summary_bottom" );
361  $this->tpl->setVariable( "CMD_SUMMARY", 'showQuestionSelection' );
362  $this->tpl->setVariable( "BTN_SUMMARY", $this->lng->txt( "tst_change_dyn_test_question_selection" ) );
363  $this->tpl->parseCurrentBlock();
364  }
365 
367  {
368  $this->tpl->setCurrentBlock( "summary" );
369  $this->tpl->setVariable( "CMD_SUMMARY", 'showQuestionSelection' );
370  $this->tpl->setVariable( "BTN_SUMMARY", $this->lng->txt( "tst_change_dyn_test_question_selection" ) );
371  $this->tpl->parseCurrentBlock();
372  }
373 
374  protected function populatePostponeButtons()
375  {
378  }
379 
380  protected function populateLowerPostponeButtonBlock()
381  {
382  $this->tpl->setCurrentBlock( "postpone_bottom" );
383  $this->tpl->setVariable( "CMD_POSTPONE", 'postponeQuestion' );
384  $this->tpl->setVariable( "BTN_POSTPONE", $this->lng->txt( "postpone" ) );
385  $this->tpl->parseCurrentBlock();
386  }
387 
388  protected function populateUpperPostponeButtonBlock()
389  {
390  $this->tpl->setCurrentBlock( "postpone" );
391  $this->tpl->setVariable( "CMD_POSTPONE", 'postponeQuestion' );
392  $this->tpl->setVariable( "BTN_POSTPONE", $this->lng->txt( "postpone" ) );
393  $this->tpl->parseCurrentBlock();
394  }
395 
397  {
399  'previousQuestion', $this->lng->txt( "save_previous" )
400  );
402  'previousQuestion', $this->lng->txt( "save_previous" )
403  );
404  }
405 
407  {
409  'previousQuestion', $this->getIntroductionPageButtonLabel()
410  );
412  'previousQuestion', $this->getIntroductionPageButtonLabel()
413  );
414  }
415 
416  protected function populateLowerPreviousButtonBlock($cmd, $label)
417  {
418  $this->tpl->setCurrentBlock( "prev_bottom" );
419  $this->tpl->setVariable("CMD_PREV", $cmd);
420  $this->tpl->setVariable("BTN_PREV", $label);
421  $this->tpl->parseCurrentBlock();
422  }
423 
424  protected function populateUpperPreviousButtonBlock($cmd, $label)
425  {
426  $this->tpl->setCurrentBlock( "prev" );
427  $this->tpl->setVariable("CMD_PREV", $cmd);
428  $this->tpl->setVariable("BTN_PREV", $label);
429  $this->tpl->parseCurrentBlock();
430  }
431 
432  protected function populateSpecificFeedbackBlock($question_gui)
433  {
434  $this->tpl->setCurrentBlock( "specific_feedback" );
435  $this->tpl->setVariable( "SPECIFIC_FEEDBACK",
436  $question_gui->getSpecificFeedbackOutput(
437  $this->testSession->getActiveId(),
438  NULL
439  )
440  );
441  $this->tpl->parseCurrentBlock();
442  }
443 
444  protected function populateGenericFeedbackBlock($question_gui)
445  {
446  $this->tpl->setCurrentBlock( "answer_feedback" );
447  $this->tpl->setVariable( "ANSWER_FEEDBACK",
448  $question_gui->getAnswerFeedbackOutput( $this->testSession->getActiveId(),
449  NULL
450  )
451  );
452  $this->tpl->parseCurrentBlock();
453  }
454 
455  protected function populateScoreBlock($reachedPoints, $maxPoints)
456  {
457  $scoreInformation = sprintf(
458  $this->lng->txt( "you_received_a_of_b_points" ), $reachedPoints, $maxPoints
459  );
460 
461  $this->tpl->setCurrentBlock( "received_points_information" );
462  $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
463  $this->tpl->parseCurrentBlock();
464  }
465 
466  protected function populateSolutionBlock($solutionoutput)
467  {
468  $this->tpl->setCurrentBlock( "solution_output" );
469  $this->tpl->setVariable( "CORRECT_SOLUTION", $this->lng->txt( "tst_best_solution_is" ) );
470  $this->tpl->setVariable( "QUESTION_FEEDBACK", $solutionoutput );
471  $this->tpl->parseCurrentBlock();
472  }
473 
474  protected function populateCharSelector()
475  {
476  global $ilSetting;
477  if ($ilSetting->get('char_selector_availability') > 0)
478  {
479  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
480  $char_selector = ilCharSelectorGUI::_getCurrentGUI($this->object);
481  if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED)
482  {
483  $char_selector->addToPage();
484  $this->tpl->setCurrentBlock('char_selector');
485  $this->tpl->setVariable("CHAR_SELECTOR_IMAGE", ilUtil::getImagePath('icon_omega_test.svg','Services/UIComponent/CharSelector'));
486  $this->tpl->setVariable("CHAR_SELECTOR_TEXT", $this->lng->txt('char_selector'));
487  $this->tpl->setVariable("CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
488  $this->tpl->parseCurrentBlock();
489  }
490  }
491  }
492 
493  protected function showSideList()
494  {
495  global $ilUser;
496 
497  $show_side_list = $ilUser->getPref('side_list_of_questions');
498  $this->tpl->setCurrentBlock('view_sidelist');
499  $this->tpl->setVariable('IMAGE_SIDELIST',
500  ($show_side_list) ? ilUtil::getImagePath('view_remove.png'
501  ) : ilUtil::getImagePath('view_choose.png')
502  );
503  $this->tpl->setVariable('TEXT_SIDELIST',
504  ($show_side_list) ? $this->lng->txt('tst_hide_side_list'
505  ) : $this->lng->txt('tst_show_side_list')
506  );
507  $this->tpl->parseCurrentBlock();
508  if($show_side_list)
509  {
510  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta_split.css", "Modules/Test"), "screen");
511  $this->outQuestionSummaryCmd(false);
512  }
513  }
514 
515  protected function populateSyntaxStyleBlock()
516  {
517  $this->tpl->setCurrentBlock( "SyntaxStyle" );
518  $this->tpl->setVariable( "LOCATION_SYNTAX_STYLESHEET",
520  );
521  $this->tpl->parseCurrentBlock();
522  }
523 
524  protected function populateContentStyleBlock()
525  {
526  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
527  $this->tpl->setCurrentBlock( "ContentStyle" );
528  $this->tpl->setVariable( "LOCATION_CONTENT_STYLESHEET",
530  );
531  $this->tpl->parseCurrentBlock();
532  }
533 
539  public function setAnonymousIdCmd()
540  {
541  if( $this->testSession->isAnonymousUser() )
542  {
543  $this->testSession->setAccessCodeToSession($_POST['anonymous_id']);
544  }
545 
546  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
547  }
548 
555  protected function startPlayerCmd()
556  {
557  $testStartLock = $this->getLockParameter();
558  $isFirstTestStartRequest = false;
559 
560  $this->processLocker->requestTestStartLockCheckLock();
561 
562  if( $this->testSession->lookupTestStartLock() != $testStartLock )
563  {
564  $this->testSession->persistTestStartLock($testStartLock);
565  $isFirstTestStartRequest = true;
566  }
567 
568  $this->processLocker->releaseTestStartLockCheckLock();
569 
570  if( $isFirstTestStartRequest )
571  {
572  $this->handleUserSettings();
573  $this->ctrl->redirect($this, "initTest");
574  }
575 
576  $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
577  $this->ctrl->redirectByClass("ilobjtestgui", "redirectToInfoScreen");
578  }
579 
580  public function getLockParameter()
581  {
582  if( isset($_POST['lock']) && strlen($_POST['lock']) )
583  {
584  return $_POST['lock'];
585  }
586  elseif( isset($_GET['lock']) && strlen($_GET['lock']) )
587  {
588  return $_GET['lock'];
589  }
590 
591  return null;
592  }
593 
597  protected function resumePlayerCmd()
598  {
599  $this->handleUserSettings();
600 
601  $this->ctrl->setParameter($this, "activecommand", "resume");
602  $this->ctrl->redirect($this, "redirectQuestion");
603  }
604 
608  protected function initTestCmd()
609  {
610  if ($this->object->checkMaximumAllowedUsers() == FALSE)
611  {
613  }
614 
615  if( $this->testSession->isAnonymousUser() && !$this->testSession->getActiveId() )
616  {
617  $accessCode = $this->testSession->createNewAccessCode();
618 
619  $this->testSession->setAccessCodeToSession($accessCode);
620  $this->testSession->setAnonymousId($accessCode);
621  $this->testSession->saveToDb();
622 
623  $this->ctrl->redirect($this, 'displayCode');
624  }
625 
626  $this->ctrl->redirect($this, 'startTest');
627  }
628 
629  function displayCodeCmd()
630  {
631  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "Modules/Test");
632  $this->tpl->setCurrentBlock("adm_content");
633  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
634  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->testSession->getAccessCodeFromSession());
635  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
636  $this->tpl->setVariable("CONTINUE", $this->lng->txt("continue_work"));
637  $this->tpl->parseCurrentBlock();
638  }
639 
640  function codeConfirmedCmd()
641  {
642  $this->ctrl->setParameter($this, "activecommand", "start");
643  $this->ctrl->redirect($this, "redirectQuestion");
644  }
645 
649  public function handleUserSettings()
650  {
651  global $ilUser;
652 
653  if ($_POST["chb_javascript"])
654  {
655  $ilUser->writePref("tst_javascript", 1);
656  }
657  else
658  {
659  $ilUser->writePref("tst_javascript", 0);
660  }
661 
662  // hide previous results
663  if ($this->object->getNrOfTries() != 1)
664  {
665  if ($this->object->getUsePreviousAnswers() == 1)
666  {
667  if ($_POST["chb_use_previous_answers"])
668  {
669  $ilUser->writePref("tst_use_previous_answers", 1);
670  }
671  else
672  {
673  $ilUser->writePref("tst_use_previous_answers", 0);
674  }
675  }
676  }
677  }
678 
682  public function calculateSequence()
683  {
684  $sequence = $_GET["sequence"];
685  if (!$sequence) $sequence = $this->testSequence->getFirstSequence();
686  if (array_key_exists("save_error", $_GET))
687  {
688  if ($_GET["save_error"] == 1)
689  {
690  return $sequence;
691  }
692  }
693  switch ($_GET["activecommand"])
694  {
695  case "next":
696  $sequence = $this->testSequence->getNextSequence($sequence);
697  break;
698  case "previous":
699  $sequence = $this->testSequence->getPreviousSequence($sequence);
700  break;
701  }
702  return $sequence;
703  }
704 
706  {
707  $active_id = $this->testSession->getActiveId();
708  $actualpass = $this->object->_getPass($active_id);
709 
710  $this->performTestPassFinishedTasks($actualpass);
711 
712  $this->testSession->setLastFinishedPass($this->testSession->getPass());
713  $this->testSession->increaseTestPass();
714 
715  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
716  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
717  $this->tpl->setCurrentBlock("HeadContent");
718  $this->tpl->setVariable("CONTENT_BLOCK", "<meta http-equiv=\"refresh\" content=\"5; url=" . $this->ctrl->getLinkTarget($this, "afterTestPassFinished") . "\">");
719  $this->tpl->parseCurrentBlock();
720  }
721 
722  abstract protected function getCurrentQuestionId();
723 
724  function autosaveCmd()
725  {
726  $result = "";
727  if (is_array($_POST) && count($_POST) > 0)
728  {
729  if( $this->isParticipantsAnswerFixed($this->getCurrentQuestionId()) )
730  {
731  $result = '-IGNORE-';
732  }
733  else
734  {
735  $res = $this->saveQuestionSolution(TRUE);
736  if ($res)
737  {
738  $result = $this->lng->txt("autosave_success");
739  }
740  else
741  {
742  $result = $this->lng->txt("autosave_failed");
743  }
744  }
745  }
746  if (!$this->canSaveResult())
747  {
748  // this was the last action in the test, saving is no longer allowed
749  $result = $this->ctrl->getLinkTarget($this, "redirectAfterAutosave", "", true);
750  }
751  echo $result;
752  exit;
753  }
754 
758  public function togglesidelistCmd()
759  {
760  global $ilUser;
761 
762  $show_side_list = $ilUser->getPref('side_list_of_questions');
763  $ilUser->writePref('side_list_of_questions', !$show_side_list);
764  $this->saveQuestionSolution();
765  $this->ctrl->redirect($this, "redirectQuestion");
766  }
767 
771  protected function markQuestionCmd()
772  {
773  $this->saveQuestionSolution();
774  $this->ctrl->setParameter($this, "activecommand", "setmarked");
775  $this->ctrl->redirect($this, "redirectQuestion");
776  }
777 
781  protected function unmarkQuestionCmd()
782  {
783  $this->saveQuestionSolution();
784  $this->ctrl->setParameter($this, "activecommand", "resetmarked");
785  $this->ctrl->redirect($this, "redirectQuestion");
786  }
787 
791  protected function gotoQuestionCmd()
792  {
793  if (is_array($_POST) && count($_POST) > 0) $this->saveQuestionSolution();
794  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
795  $this->ctrl->setParameter($this, "activecommand", "gotoquestion");
796  $this->ctrl->saveParameter($this, "tst_javascript");
797  if (strlen($_GET['qst_selection'])) $_SESSION['qst_selection'] = $_GET['qst_selection'];
798  $this->ctrl->redirect($this, "redirectQuestion");
799  }
800 
806  public function backFromSummaryCmd()
807  {
808  $this->ctrl->setParameter($this, "activecommand", "back");
809  $this->ctrl->redirect($this, "redirectQuestion");
810  }
811 
815  protected function confirmFinishCmd()
816  {
817  $this->finishTestCmd(false);
818  }
819 
823  protected function confirmFinishTestCmd()
824  {
828  global $ilUser;
829 
830  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
831  $confirmation = new ilConfirmationGUI();
832  $confirmation->setFormAction($this->ctrl->getFormAction($this, 'confirmFinish'));
833  $confirmation->setHeaderText($this->lng->txt("tst_finish_confirmation_question"));
834  $confirmation->setConfirm($this->lng->txt("tst_finish_confirm_button"), 'confirmFinish');
835  $confirmation->setCancel($this->lng->txt("tst_finish_confirm_cancel_button"), 'backConfirmFinish');
836 
837  if($this->object->getKioskMode())
838  {
839  $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
840  $this->tpl->setContent($confirmation->getHtml());
841  }
842  else
843  {
844  $this->tpl->setVariable($this->getContentBlockName(), $confirmation->getHtml());
845  }
846  }
847 
848  function finishTestCmd($requires_confirmation = true)
849  {
850  global $ilUser, $ilAuth;
851 
852  unset($_SESSION["tst_next"]);
853 
854  $active_id = $this->testSession->getActiveId();
855  $actualpass = $this->object->_getPass($active_id);
856 
857  $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass);
858 
859  /*
860  * The following "endgames" are possible prior to actually finishing the test:
861  * - Obligations (Ability to finish the test.)
862  * If not all obligatory questions are answered, the user is presented a list
863  * showing the deficits.
864  * - Examview (Will to finish the test.)
865  * With the examview, the participant can review all answers given in ILIAS or a PDF prior to
866  * commencing to the finished test.
867  * - Last pass allowed (Reassuring the will to finish the test.)
868  * If passes are limited, on the last pass, an additional confirmation is to be displayed.
869  */
870 
871  // Obligations fulfilled? redirectQuestion : one or the other summary -> no finish
872  if( $this->object->areObligationsEnabled() && !$allObligationsAnswered )
873  {
874  if( $this->object->getListOfQuestions() )
875  {
876  $_GET['activecommand'] = 'summary_obligations';
877  }
878  else
879  {
880  $_GET['activecommand'] = 'summary_obligations_only';
881  }
882 
883  $this->redirectQuestionCmd();
884  return;
885  }
886 
887  // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui)
888  if ($this->object->getEnableExamview() && !isset($_GET['reviewed']) && $requires_confirmation)
889  {
890  $_GET['activecommand'] = 'test_submission_overview';
891  $this->redirectQuestionCmd();
892  return;
893  }
894 
895  // Last try in limited tries & !confirmed
896  if (($requires_confirmation) && ($actualpass == $this->object->getNrOfTries() - 1))
897  {
898  // show confirmation page
899  return $this->confirmFinishTestCmd();
900  }
901 
902  // Last try in limited tries & confirmed?
903  if(($actualpass == $this->object->getNrOfTries() - 1) && (!$requires_confirmation))
904  {
905  $ilAuth->setIdle(ilSession::getIdleValue(), false);
906  $ilAuth->setExpire(0);
907  switch($this->object->getMailNotification())
908  {
909  case 1:
910  $this->object->sendSimpleNotification($active_id);
911  break;
912  case 2:
913  $this->object->sendAdvancedNotification($active_id);
914  break;
915  }
916  }
917 
918  // Non-last try finish
919  if(!$_SESSION['tst_pass_finish'])
920  {
921  if(!$_SESSION['tst_pass_finish']) $_SESSION['tst_pass_finish'] = 1;
922  if($this->object->getMailNotificationType() == 1)
923  {
924  switch($this->object->getMailNotification())
925  {
926  case 1:
927  $this->object->sendSimpleNotification($active_id);
928  break;
929  case 2:
930  $this->object->sendAdvancedNotification($active_id);
931  break;
932  }
933  }
934  }
935 
936  // no redirect request loops after test pass finished tasks has been performed
937 
938  $this->performTestPassFinishedTasks($actualpass);
939 
940  $this->testSession->setLastFinishedPass($this->testSession->getPass());
941  $this->testSession->increaseTestPass();
942 
943  $this->ctrl->redirect($this, 'afterTestPassFinished');
944  }
945 
946  protected function performTestPassFinishedTasks($finishedPass)
947  {
948  if( !$this->testSession->isSubmitted() )
949  {
950  $this->testSession->setSubmitted(1);
951  $this->testSession->setSubmittedTimestamp(date('Y-m-d H:i:s'));
952  $this->testSession->saveToDb();
953  }
954  }
955 
956  protected function afterTestPassFinishedCmd()
957  {
958  $activeId = $this->testSession->getActiveId();
959  $lastFinishedPass = $this->testSession->getLastFinishedPass();
960 
961  // handle test signature
962 
963  if ( $this->isTestSignRedirectRequired($activeId, $lastFinishedPass) )
964  {
965  $this->ctrl->redirectByClass('ilTestSignatureGUI', 'invokeSignaturePlugin');
966  }
967 
968  if(!$_GET['skipfinalstatement'])
969  {
970  if ($this->object->getShowFinalStatement())
971  {
972  $this->ctrl->redirect($this, 'showFinalStatement');
973  }
974  }
975 
976  // redirect after test
977  $redirection_mode = $this->object->getRedirectionMode();
978  $redirection_url = $this->object->getRedirectionUrl();
979  if( $redirection_url && $redirection_mode && !$this->object->canViewResults() )
980  {
981  if( $redirection_mode == REDIRECT_KIOSK )
982  {
983  if( $this->object->getKioskMode() )
984  {
985  ilUtil::redirect($redirection_url);
986  }
987  }
988  else
989  {
990  ilUtil::redirect($redirection_url);
991  }
992  }
993 
994  // custom after test redirect (ilTestOutput - objective oriented sessions)
995  if( $this->customRedirectRequired() )
996  {
997  $this->performCustomRedirect();
998  }
999 
1000  // default redirect (pass results)
1001  $this->redirectBackCmd();
1002  }
1003 
1004  protected function isTestSignRedirectRequired($activeId, $lastFinishedPass)
1005  {
1006  if( !$this->object->getSignSubmission() )
1007  {
1008  return false;
1009  }
1010 
1011  if( !is_null(ilSession::get("signed_{$activeId}_{$lastFinishedPass}")) )
1012  {
1013  return false;
1014  }
1015 
1016  global $ilPluginAdmin;
1017 
1018  $activePlugins = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig');
1019 
1020  if( !count($activePlugins) )
1021  {
1022  return false;
1023  }
1024 
1025  return true;
1026  }
1027 
1033  protected function archiveParticipantSubmission( $active, $pass )
1034  {
1035  require_once 'class.ilTestEvaluationGUI.php';
1036  $testevaluationgui = new ilTestEvaluationGUI($this->object);
1037  $results = $this->object->getTestResult($active,$pass);
1038  $results_output = $testevaluationgui->getPassListOfAnswers($results, $active, $pass, false, false, false, false);
1039 
1040  require_once './Modules/Test/classes/class.ilTestArchiver.php';
1041  global $ilSetting;
1042  $inst_id = $ilSetting->get('inst_id', null);
1043  $archiver = new ilTestArchiver($this->object->getId());
1044 
1045  $path = ilUtil::getWebspaceDir() . '/assessment/'. $this->object->getId() . '/exam_pdf';
1046  if (!is_dir($path))
1047  {
1048  ilUtil::makeDirParents($path);
1049  }
1050  $filename = $path . '/exam_N' . $inst_id . '-' . $this->object->getId()
1051  . '-' . $active . '-' . $pass . '.pdf';
1052 
1053  require_once 'class.ilTestPDFGenerator.php';
1055  //$template->setVariable("PDF_FILE_LOCATION", $filename);
1056  // Participant submission
1057  $archiver->handInParticipantSubmission( $active, $pass, $filename, $results_output );
1058  //$archiver->handInParticipantMisc( $active, $pass, 'signature_gedoens.sig', $filename );
1059  //$archiver->handInParticipantQuestionMaterial( $active, $pass, 123, 'file_upload.pdf', $filename );
1060 
1061  global $ilias;
1062  $questions = $this->object->getQuestions();
1063  foreach ($questions as $question_id)
1064  {
1065  $question_object = $this->object->getQuestionDataset( $question_id );
1066  if ($question_object->type_tag == 'assFileUpload')
1067  {
1068  // Pfad: /data/default/assessment/tst_2/14/21/files/file_14_4_1370417414.png
1069  // /data/ - klar
1070  // /assessment/ - Konvention
1071  // /tst_2/ = /tst_<test_id> (ilObjTest)
1072  // /14/ = /<active_fi>/
1073  // /21/ = /<question_id>/ (question_object)
1074  // /files/ - Konvention
1075  // file_14_4_1370417414.png = file_<active_fi>_<pass>_<some timestamp>.<ext>
1076 
1077  $candidate_path =
1078  $ilias->ini_ilias->readVariable( 'server', 'absolute_path' ) . ilTestArchiver::DIR_SEP
1079  . $ilias->ini_ilias->readVariable( 'clients', 'path' ) . ilTestArchiver::DIR_SEP
1080  . $ilias->client_id . ilTestArchiver::DIR_SEP
1081  . 'assessment' . ilTestArchiver::DIR_SEP
1082  . 'tst_' . $this->object->test_id . ilTestArchiver::DIR_SEP
1083  . $active . ilTestArchiver::DIR_SEP
1084  . $question_id . ilTestArchiver::DIR_SEP
1085  . 'files' . ilTestArchiver::DIR_SEP;
1086  $handle = opendir( $candidate_path );
1087  while ($handle !== false && ($file = readdir( $handle )) !== false)
1088  {
1089  if ($file != null)
1090  {
1091  $filename_start = 'file_' . $active . '_' . $pass . '_';
1092 
1093  if (strpos( $file, $filename_start ) === 0)
1094  {
1095  $archiver->handInParticipantQuestionMaterial( $active, $pass, $question_id, $file, $file );
1096  }
1097  }
1098  }
1099  }
1100  }
1101  $passdata = $this->object->getTestResult($active, $pass);
1102  $overview = $testevaluationgui->getPassListOfAnswers($passdata, $active, $pass, true, false, false, true);
1103  $filename = ilUtil::getWebspaceDir() . '/assessment/scores-'.$this->object->getId() . '-' . $active . '-' . $pass . '.pdf';
1105  $archiver->handInTestResult($active, $pass, $filename);
1106  unlink($filename);
1107 
1108  return;
1109  }
1110 
1111  public function redirectBackCmd()
1112  {
1113  if(!$this->object->canViewResults())
1114  {
1115  $this->outIntroductionPageCmd();
1116  }
1117  else
1118  {
1119  $this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
1120  }
1121  }
1122 
1123  /*
1124  * Presents the final statement of a test
1125  */
1126  public function showFinalStatementCmd()
1127  {
1128  $template = new ilTemplate("tpl.il_as_tst_final_statement.html", TRUE, TRUE, "Modules/Test");
1129  $this->ctrl->setParameter($this, "skipfinalstatement", 1);
1130  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "afterTestPassFinished"));
1131  $template->setVariable("FINALSTATEMENT", $this->object->prepareTextareaOutput($this->object->getFinalStatement(), true));
1132  $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
1133  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
1134  }
1135 
1136  public function getKioskHead()
1137  {
1138  global $ilUser;
1139 
1140  $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test');
1141  if ($this->object->getShowKioskModeTitle())
1142  {
1143  $template->setCurrentBlock("kiosk_show_title");
1144  $template->setVariable("TEST_TITLE", $this->object->getTitle());
1145  $template->parseCurrentBlock();
1146  }
1147  if ($this->object->getShowKioskModeParticipant())
1148  {
1149  $template->setCurrentBlock("kiosk_show_participant");
1150  $template->setVariable("PARTICIPANT_NAME_TXT", $this->lng->txt("login_as"));
1151  $template->setVariable("PARTICIPANT_NAME", $ilUser->getFullname());
1152  $template->setVariable("PARTICIPANT_LOGIN", $ilUser->getLogin());
1153  $template->setVariable("PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1154  $template->setVariable("PARTICIPANT_EMAIL", $ilUser->getEmail());
1155  $template->parseCurrentBlock();
1156  }
1157  if ($this->object->isShowExamIdInTestPassEnabled())
1158  {
1159  $exam_id = ilObjTest::buildExamId(
1160  $this->testSession->getActiveId() , $this->testSession->getPass(), $this->object->getId()
1161  );
1162 
1163  $template->setCurrentBlock("kiosk_show_exam_id");
1164  $template->setVariable("EXAM_ID_TXT", $this->lng->txt("exam_id"));
1165  $template->setVariable( "EXAM_ID", $exam_id);
1166  $template->parseCurrentBlock();
1167  }
1168  return $template->get();
1169  }
1170 
1174  function outTestPage($directfeedback)
1175  {
1176  global $rbacsystem, $ilUser;
1177 
1178  $this->prepareTestPageOutput();
1179 
1180  if (!$rbacsystem->checkAccess("read", $this->object->getRefId()))
1181  {
1182  // only with read access it is possible to run the test
1183  $this->ilias->raiseError($this->lng->txt("cannot_execute_test"),$this->ilias->error_obj->MESSAGE);
1184  }
1185 
1186  if ($this->isMaxProcessingTimeReached())
1187  {
1188  $this->maxProcessingTimeReached();
1189  return;
1190  }
1191 
1192  if ($this->object->endingTimeReached())
1193  {
1194  $this->endingTimeReached();
1195  return;
1196  }
1197 
1198  if ($this->object->getKioskMode())
1199  {
1200  $this->populateKioskHead();
1201  }
1202 
1203  $this->tpl->setVariable("TEST_ID", $this->object->getTestId());
1204  $this->tpl->setVariable("LOGIN", $ilUser->getLogin());
1205  $this->tpl->setVariable("SEQ_ID", $this->sequence);
1206  $this->tpl->setVariable("QUEST_ID", $this->testSequence->questions[$this->sequence]);
1207 
1208  if ($this->object->getEnableProcessingTime())
1209  {
1210  $this->outProcessingTime($this->testSession->getActiveId());
1211  }
1212 
1213  $this->tpl->setVariable("FORM_TIMESTAMP", time());
1214 
1215  $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1216 
1217  $postpone = ( $this->object->getSequenceSettings() == TEST_POSTPONE );
1218 
1219  if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode())
1220  {
1221  $this->tpl->setCurrentBlock('exam_id_footer');
1222  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1223  $this->testSession->getActiveId(), $this->testSession->getPass(), $this->object->getId()
1224  ));
1225  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1226  $this->tpl->parseCurrentBlock();
1227  }
1228 
1229  $this->outWorkingForm($this->sequence, $this->object->getTestId(), $postpone, $directfeedback);
1230  }
1231 
1240  {
1241  global $ilUser;
1242 
1243  // check if user is invited to participate
1244  $user = $this->object->getInvitedUsers($ilUser->getId());
1245  if (!is_array ($user) || count($user)!=1)
1246  {
1247  ilUtil::sendInfo($this->lng->txt("user_not_invited"), true);
1248  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1249  }
1250 
1251  $user = array_pop($user);
1252  // check if client ip is set and if current remote addr is equal to stored client-ip
1253  if (strcmp($user["clientip"],"")!=0 && strcmp($user["clientip"],$_SERVER["REMOTE_ADDR"])!=0)
1254  {
1255  ilUtil::sendInfo($this->lng->txt("user_wrong_clientip"), true);
1256  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1257  }
1258  }
1259 
1260 
1264  function isTestAccessible()
1265  {
1266  return !$this->isNrOfTriesReached()
1267  and !$this->isMaxProcessingTimeReached()
1268  and $this->object->startingTimeReached()
1269  and !$this->object->endingTimeReached();
1270  }
1271 
1276  {
1277  return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->testSession->getPass());
1278  }
1279 
1287  function passDetails()
1288  {
1289  if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1290  {
1291  $this->ctrl->saveParameter($this, "pass");
1292  $this->ctrl->saveParameter($this, "active_id");
1293  $this->outTestResults(false, $_GET["pass"]);
1294  }
1295  else
1296  {
1297  $this->outTestResults(false);
1298  }
1299  }
1300 
1306  function endingTimeReached()
1307  {
1308  ilUtil::sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->object->getEndingTime())));
1309  $this->testSession->increasePass();
1310  $this->testSession->setLastSequence(0);
1311  $this->testSession->saveToDb();
1312  if (!$this->object->canViewResults())
1313  {
1314  $this->outIntroductionPage();
1315  }
1316  else
1317  {
1318  $this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
1319  }
1320  }
1321 
1330  {
1331  $this->outIntroductionPage();
1332  }
1333 
1340  {
1341  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "Modules/Test");
1342  $this->tpl->setCurrentBlock("adm_content");
1343  if ($this->object->isTestFinished($this->testSession->getActiveId()))
1344  {
1345  $this->tpl->setCurrentBlock("not_submit_allowed");
1346  $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1347  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1348  } else
1349  {
1350  $this->tpl->setCurrentBlock("submit_allowed");
1351  $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1352  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1353  }
1354  $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1355  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1356  $this->tpl->parseCurrentBlock();
1357  }
1358 
1359  function outProcessingTime($active_id)
1360  {
1361  global $ilUser;
1362 
1363  $starting_time = $this->object->getStartingTimeOfUser($active_id);
1364  $processing_time = $this->object->getProcessingTimeInSeconds($active_id);
1365  $processing_time_minutes = floor($processing_time / 60);
1366  $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1367  $str_processing_time = "";
1368  if ($processing_time_minutes > 0)
1369  {
1370  $str_processing_time = $processing_time_minutes . " " . ($processing_time_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1371  }
1372  if ($processing_time_seconds > 0)
1373  {
1374  if (strlen($str_processing_time) > 0) $str_processing_time .= " " . $this->lng->txt("and") . " ";
1375  $str_processing_time .= $processing_time_seconds . " " . ($processing_time_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1376  }
1377  $time_left = $starting_time + $processing_time - mktime();
1378  $time_left_minutes = floor($time_left / 60);
1379  $time_left_seconds = $time_left - $time_left_minutes * 60;
1380  $str_time_left = "";
1381  if ($time_left_minutes > 0)
1382  {
1383  $str_time_left = $time_left_minutes . " " . ($time_left_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1384  }
1385  if ($time_left < 300)
1386  {
1387  if ($time_left_seconds > 0)
1388  {
1389  if (strlen($str_time_left) > 0) $str_time_left .= " " . $this->lng->txt("and") . " ";
1390  $str_time_left .= $time_left_seconds . " " . ($time_left_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1391  }
1392  }
1393  $date = getdate($starting_time);
1394  $formattedStartingTime = ilDatePresentation::formatDate(new ilDateTime($date,IL_CAL_FKT_GETDATE));
1395  /*
1396  $formattedStartingTime = ilFormat::formatDate(
1397  $date["year"]."-".
1398  sprintf("%02d", $date["mon"])."-".
1399  sprintf("%02d", $date["mday"])." ".
1400  sprintf("%02d", $date["hours"]).":".
1401  sprintf("%02d", $date["minutes"]).":".
1402  sprintf("%02d", $date["seconds"])
1403  );
1404  */
1405  $datenow = getdate();
1406  $this->tpl->setCurrentBlock("enableprocessingtime");
1407  $this->tpl->setVariable("USER_WORKING_TIME",
1408  sprintf(
1409  $this->lng->txt("tst_time_already_spent"),
1410  $formattedStartingTime,
1411  $str_processing_time
1412  )
1413  );
1414  $this->tpl->setVariable("USER_REMAINING_TIME", sprintf($this->lng->txt("tst_time_already_spent_left"), $str_time_left));
1415  $this->tpl->parseCurrentBlock();
1416  $template = new ilTemplate("tpl.workingtime.js.html", TRUE, TRUE, 'Modules/Test');
1417  $template->setVariable("STRING_MINUTE", $this->lng->txt("minute"));
1418  $template->setVariable("STRING_MINUTES", $this->lng->txt("minutes"));
1419  $template->setVariable("STRING_SECOND", $this->lng->txt("second"));
1420  $template->setVariable("STRING_SECONDS", $this->lng->txt("seconds"));
1421  $template->setVariable("STRING_TIMELEFT", $this->lng->txt("tst_time_already_spent_left"));
1422  $template->setVariable("AND", strtolower($this->lng->txt("and")));
1423  $template->setVariable("YEAR", $date["year"]);
1424  $template->setVariable("MONTH", $date["mon"]-1);
1425  $template->setVariable("DAY", $date["mday"]);
1426  $template->setVariable("HOUR", $date["hours"]);
1427  $template->setVariable("MINUTE", $date["minutes"]);
1428  $template->setVariable("SECOND", $date["seconds"]);
1429  if ($this->object->isEndingTimeEnabled() && preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->object->getEndingTime(), $matches))
1430  {
1431  $template->setVariable("ENDYEAR", $matches[1]);
1432  $template->setVariable("ENDMONTH", $matches[2]-1);
1433  $template->setVariable("ENDDAY", $matches[3]);
1434  $template->setVariable("ENDHOUR", $matches[4]);
1435  $template->setVariable("ENDMINUTE", $matches[5]);
1436  $template->setVariable("ENDSECOND", $matches[6]);
1437  }
1438  $template->setVariable("YEARNOW", $datenow["year"]);
1439  $template->setVariable("MONTHNOW", $datenow["mon"]-1);
1440  $template->setVariable("DAYNOW", $datenow["mday"]);
1441  $template->setVariable("HOURNOW", $datenow["hours"]);
1442  $template->setVariable("MINUTENOW", $datenow["minutes"]);
1443  $template->setVariable("SECONDNOW", $datenow["seconds"]);
1444  $template->setVariable("PTIME_M", $processing_time_minutes);
1445  $template->setVariable("PTIME_S", $processing_time_seconds);
1446 
1447  $this->tpl->setCurrentBlock("HeadContent");
1448  $this->tpl->setVariable("CONTENT_BLOCK", $template->get());
1449  $this->tpl->parseCurrentBlock();
1450  }
1451 
1455  public function outQuestionSummaryCmd($fullpage = true, $contextFinishTest = false, $obligationsNotAnswered = false, $obligationsFilter = false)
1456  {
1457  if( $fullpage )
1458  {
1459  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_question_summary.html", "Modules/Test");
1460  }
1461 
1462  if( $obligationsNotAnswered )
1463  {
1464  ilUtil::sendFailure($this->lng->txt('not_all_obligations_answered'));
1465  }
1466 
1467  $active_id = $this->testSession->getActiveId();
1468  $result_array = & $this->testSequence->getSequenceSummary($obligationsFilter);
1469 
1470  $marked_questions = array();
1471 
1472  if( $this->object->getKioskMode() && $fullpage )
1473  {
1474  $head = $this->getKioskHead();
1475  if( strlen($head) )
1476  {
1477  $this->tpl->setCurrentBlock("kiosk_options");
1478  $this->tpl->setVariable("KIOSK_HEAD", $head);
1479  $this->tpl->parseCurrentBlock();
1480  }
1481  }
1482 
1483  if( $this->object->getShowMarker() )
1484  {
1485  include_once "./Modules/Test/classes/class.ilObjTest.php";
1486  $marked_questions = ilObjTest::_getSolvedQuestions($active_id);
1487  }
1488 
1489  $data = array();
1490 
1491  foreach( $result_array as $key => $value )
1492  {
1493  $this->ctrl->setParameter($this, "sequence", $value["sequence"]);
1494 
1495  $href = $this->ctrl->getLinkTargetByClass(get_class($this), "gotoQuestion");
1496 
1497  $this->tpl->setVariable("VALUE_QUESTION_TITLE", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "gotoQuestion")."\">" . $this->object->getQuestionTitle($value["title"]) . "</a>");
1498 
1499  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1500 
1501  $description = "";
1502  if( $this->object->getListOfQuestionsDescription() )
1503  {
1504  $description = $value["description"];
1505  }
1506 
1507  $points = "";
1508  if( !$this->object->getTitleOutput() )
1509  {
1510  $points = $value["points"]."&nbsp;".$this->lng->txt("points_short");
1511  }
1512 
1513  $marked = false;
1514  if( count($marked_questions) )
1515  {
1516  if( array_key_exists($value["qid"], $marked_questions) )
1517  {
1518  $obj = $marked_questions[$value["qid"]];
1519  if( $obj["solved"] == 1 )
1520  {
1521  $marked = true;
1522  }
1523  }
1524  }
1525 
1526  array_push($data, array(
1527  'order' => $value["nr"],
1528  'href' => $href,
1529  'title' => $this->object->getQuestionTitle($value["title"]),
1530  'description' => $description,
1531  'worked_through' => ($value["worked_through"]) ? true : false,
1532  'postponed' => ($value["postponed"]) ? $this->lng->txt("postponed") : '',
1533  'points' => $points,
1534  'marked' => $marked,
1535  'sequence' => $value["sequence"],
1536  'obligatory' => $value['obligatory'],
1537  'isAnswered' => $value['isAnswered']
1538  ));
1539  }
1540 
1541  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1542 
1543  if( $fullpage )
1544  {
1545  include_once "./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
1546  $table_gui = new ilListOfQuestionsTableGUI($this, 'backFromSummary');
1547 
1548  $table_gui->setShowPointsEnabled( !$this->object->getTitleOutput() );
1549  $table_gui->setShowMarkerEnabled( $this->object->getShowMarker() );
1550  $table_gui->setObligationsNotAnswered( $obligationsNotAnswered );
1551  $table_gui->setShowObligationsEnabled( $this->object->areObligationsEnabled() );
1552  $table_gui->setObligationsFilterEnabled( $obligationsFilter );
1553 
1554  $table_gui->init();
1555 
1556  $table_gui->setData($data);
1557 
1558  $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1559 
1560  if( $this->object->getEnableProcessingTime() )
1561  {
1562  $this->outProcessingTime($active_id);
1563  }
1564  }
1565  else
1566  {
1567  $template = new ilTemplate('tpl.il_as_tst_list_of_questions_short.html', true, true, 'Modules/Test');
1568 
1569  foreach( $data as $row )
1570  {
1571  if( strlen($row['description']) )
1572  {
1573  $template->setCurrentBlock('description');
1574  $template->setVariable("DESCRIPTION", $row['description']);
1575  $template->parseCurrentBlock();
1576  }
1577 
1578  $active = ($row['sequence'] == $this->sequence) ? ' active' : '';
1579 
1580  $template->setCurrentBlock('item');
1581  $template->setVariable('CLASS', ($row['walked_through']) ? ('answered'.$active) : ('unanswered'.$active));
1582  $template->setVariable('ITEM', ilUtil::prepareFormOutput($row['title']));
1583  $template->setVariable('SEQUENCE', $row['sequence']);
1584  $template->parseCurrentBlock();
1585  }
1586 
1587  require_once 'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
1588  $panel = ilPanelGUI::getInstance();
1589  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_SUBHEADING);
1590  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
1591  $panel->setHeading($this->lng->txt('list_of_questions'));
1592  $panel->setBody($template->get());
1593 
1594  $this->tpl->setVariable('LIST_OF_QUESTIONS', $panel->getHTML());
1595  }
1596  }
1597 
1599  {
1600  return $this->outQuestionSummaryCmd(true, true, true, false);
1601  }
1602 
1604  {
1605  return $this->outQuestionSummaryCmd(true, true, true, true);
1606  }
1607 
1609  {
1610  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_max_allowed_users_reached.html", "Modules/Test");
1611  $this->tpl->setCurrentBlock("adm_content");
1612  $this->tpl->setVariable("MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt("tst_max_allowed_users_message"), $this->object->getAllowedUsersTimeGap()));
1613  $this->tpl->setVariable("MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt("tst_max_allowed_users_heading"), $this->object->getAllowedUsersTimeGap()));
1614  $this->tpl->setVariable("BACK_TO_INTRODUCTION", $this->lng->txt("tst_results_back_introduction"));
1615  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1616  $this->tpl->parseCurrentBlock();
1617  }
1618 
1620  {
1621  $this->ctrl->redirect($this, 'gotoQuestion');
1622  }
1623 
1630  {
1631  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1632 
1633  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1634  $this->tpl->setCurrentBlock("ContentStyle");
1635  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1636  $this->tpl->parseCurrentBlock();
1637 
1638  $this->tpl->setCurrentBlock("SyntaxStyle");
1639  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1640  $this->tpl->parseCurrentBlock();
1641 
1642  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1643  if ($this->object->getShowSolutionAnswersOnly())
1644  {
1645  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1646  }
1647 
1648  $this->tpl->setCurrentBlock("adm_content");
1649  $solution = $this->getCorrectSolutionOutput($_GET["evaluation"], $_GET["active_id"], $_GET["pass"]);
1650  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1651  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1652  $this->ctrl->saveParameter($this, "pass");
1653  $this->ctrl->saveParameter($this, "active_id");
1654  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1655  $this->tpl->parseCurrentBlock();
1656  }
1657 
1667  function showListOfAnswers($active_id, $pass = NULL, $top_data = "", $bottom_data = "")
1668  {
1669  global $ilUser;
1670 
1671  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "Modules/Test");
1672 
1673  $result_array =& $this->object->getTestResult($active_id, $pass);
1674 
1675  $counter = 1;
1676  // output of questions with solutions
1677  foreach ($result_array as $question_data)
1678  {
1679  $question = $question_data["qid"];
1680  if (is_numeric($question))
1681  {
1682  $this->tpl->setCurrentBlock("printview_question");
1683  $question_gui = $this->object->createQuestionGUI("", $question);
1684  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
1685  $template->setVariable("COUNTER_QUESTION", $counter.". ");
1686  $template->setVariable("QUESTION_TITLE", $question_gui->object->getTitle());
1687 
1688  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
1689  $result_output = $question_gui->getSolutionOutput($active_id, $pass, FALSE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback());
1690  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1691  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1692  $this->tpl->parseCurrentBlock();
1693  $counter ++;
1694  }
1695  }
1696 
1697  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1698  if ($this->object->getShowSolutionAnswersOnly())
1699  {
1700  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1701  }
1702  if (strlen($top_data))
1703  {
1704  $this->tpl->setCurrentBlock("top_data");
1705  $this->tpl->setVariable("TOP_DATA", $top_data);
1706  $this->tpl->parseCurrentBlock();
1707  }
1708 
1709  if (strlen($bottom_data))
1710  {
1711  $this->tpl->setCurrentBlock("bottom_data");
1712  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1713  $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
1714  $this->tpl->parseCurrentBlock();
1715  }
1716 
1717  $this->tpl->setCurrentBlock("adm_content");
1718  $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
1719  $user_data = $this->getResultsUserdata($this->testSession, $active_id, TRUE);
1720  $signature = $this->getResultsSignature();
1721  $this->tpl->setVariable("USER_DETAILS", $user_data);
1722  $this->tpl->setVariable("SIGNATURE", $signature);
1723  $this->tpl->setVariable("TITLE", $this->object->getTitle());
1724  $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
1725  $invited_user =& $this->object->getInvitedUsers($ilUser->getId());
1726  $pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
1727  ": " . $invited_user[$ilUser->getId()]["clientip"] . " - " .
1728  $this->lng->txt("matriculation") . ": " .
1729  $invited_user[$ilUser->getId()]["matriculation"];
1730  $this->tpl->setVariable("PAGETITLE", $pagetitle);
1731  $this->tpl->parseCurrentBlock();
1732  }
1733 
1739  public function getContentBlockName()
1740  {
1741  if ($this->object->getKioskMode())
1742  {
1743  $this->tpl->setBodyClass("kiosk");
1744  $this->tpl->setAddFooter(FALSE);
1745  return "CONTENT";
1746  }
1747  else
1748  {
1749  return "ADM_CONTENT";
1750  }
1751  }
1752 
1754  {
1755  $this->ctrl->redirectByClass(
1756  array('ilRepositoryGUI', 'ilObjTestGUI', 'ilTestEvaluationGUI'), "outUserResultsOverview"
1757  );
1758  }
1759 
1761  {
1762  $this->ctrl->redirectByClass(
1763  array('ilRepositoryGUI', 'ilObjTestGUI', 'ilTestEvaluationGUI'), "outUserListOfAnswerPasses"
1764  );
1765  }
1766 
1770  protected function showRequestedHintListCmd()
1771  {
1772  $this->saveQuestionSolution();
1773 
1774  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1775  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST);
1776  }
1777 
1781  protected function confirmHintRequestCmd()
1782  {
1783  $this->saveQuestionSolution();
1784 
1785  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1786  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_CONFIRM_REQUEST);
1787  }
1788 
1797  protected function fillQuestionRelatedNavigation(assQuestionGUI $questionGUI)
1798  {
1799  global $tpl, $lng;
1800 
1801  $parseQuestionRelatedNavigation = false;
1802 
1803  switch( 1 )
1804  {
1805  case $this->object->getSpecificAnswerFeedback():
1806  case $this->object->getGenericAnswerFeedback():
1807  case $this->object->getAnswerFeedbackPoints():
1808  case $this->object->getInstantFeedbackSolution():
1809 
1810  $tpl->setCurrentBlock("direct_feedback");
1811  $tpl->setVariable("CMD_SHOW_INSTANT_RESPONSE", 'showInstantResponse');
1812  $tpl->setVariable("TEXT_SHOW_INSTANT_RESPONSE", $lng->txt("check"));
1813  $tpl->parseCurrentBlock();
1814 
1815  $parseQuestionRelatedNavigation = true;
1816  }
1817 
1818  if( $this->object->isOfferingQuestionHintsEnabled() )
1819  {
1820  $questionId = $questionGUI->object->getId();
1821  $activeId = $this->testSession->getActiveId();
1822  $pass = $this->testSession->getPass();
1823 
1824  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
1825  $questionHintTracking = new ilAssQuestionHintTracking($questionId, $activeId, $pass);
1826 
1827  $requestsExist = $questionHintTracking->requestsExist();
1828  $requestsPossible = $questionHintTracking->requestsPossible();
1829 
1830  if( $requestsPossible )
1831  {
1832  if( $requestsExist )
1833  {
1834  $buttonText = $lng->txt("button_request_next_question_hint");
1835  }
1836  else
1837  {
1838  $buttonText = $lng->txt("button_request_question_hint");
1839  }
1840 
1841  $tpl->setCurrentBlock("button_request_next_question_hint");
1842  $tpl->setVariable("CMD_REQUEST_NEXT_QUESTION_HINT", 'confirmHintRequest');
1843  $tpl->setVariable("TEXT_REQUEST_NEXT_QUESTION_HINT", $buttonText);
1844  $tpl->parseCurrentBlock();
1845 
1846  $parseQuestionRelatedNavigation = true;
1847  }
1848 
1849  if( $requestsExist )
1850  {
1851  $tpl->setCurrentBlock("button_show_requested_question_hints");
1852  $tpl->setVariable("CMD_SHOW_REQUESTED_QUESTION_HINTS", 'showRequestedHintList');
1853  $tpl->setVariable("TEXT_SHOW_REQUESTED_QUESTION_HINTS", $lng->txt("button_show_requested_question_hints"));
1854  $tpl->parseCurrentBlock();
1855 
1856  $parseQuestionRelatedNavigation = true;
1857  }
1858  }
1859 
1860  if( $parseQuestionRelatedNavigation )
1861  {
1862  $tpl->setCurrentBlock("question_related_navigation");
1863  $tpl->parseCurrentBlock();
1864  }
1865  }
1866 
1867  abstract protected function isFirstPageInSequence($sequence);
1868 
1869  abstract protected function isLastQuestionInSequence(assQuestionGUI $questionGUI);
1870 
1871 
1872  abstract protected function handleQuestionActionCmd();
1873 
1874  abstract protected function showInstantResponseCmd();
1875 
1876  abstract protected function nextQuestionCmd();
1877 
1878  abstract protected function previousQuestionCmd();
1879 
1880  abstract protected function postponeQuestionCmd();
1881 
1882 
1883 
1884  protected function getMarkedQuestions()
1885  {
1886  if( $this->object->getShowMarker() )
1887  {
1888  include_once "./Modules/Test/classes/class.ilObjTest.php";
1889  $marked_questions = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId());
1890  }
1891  else
1892  {
1893  $marked_questions = array();
1894  }
1895 
1896  return $marked_questions;
1897  }
1898 
1899  protected function prepareSummaryPage()
1900  {
1901  $this->tpl->addBlockFile(
1902  $this->getContentBlockName(), 'adm_content', 'tpl.il_as_tst_question_summary.html', 'Modules/Test'
1903  );
1904 
1905  if ($this->object->getShowCancel())
1906  {
1907  $this->populateCancelButtonBlock();
1908  }
1909 
1910  if ($this->object->getKioskMode())
1911  {
1912  $this->populateKioskHead();
1913  }
1914  }
1915 
1916  protected function prepareTestPageOutput()
1917  {
1918  $this->tpl->addBlockFile(
1919  $this->getContentBlockName(), 'adm_content', 'tpl.il_as_tst_output.html', 'Modules/Test'
1920  );
1921  }
1922 
1923  protected function populateKioskHead()
1924  {
1925  ilUtil::sendInfo(); // ???
1926 
1927  $head = $this->getKioskHead();
1928 
1929  if (strlen($head))
1930  {
1931  $this->tpl->setCurrentBlock("kiosk_options");
1932  $this->tpl->setVariable("KIOSK_HEAD", $head);
1933  $this->tpl->parseCurrentBlock();
1934  }
1935  }
1936 
1938  {
1939  if( $this->ctrl->getNextClass() == 'iltestpasswordprotectiongui' )
1940  {
1941  return;
1942  }
1943 
1944  if( !$this->passwordChecker->isPasswordProtectionPageRedirectRequired() )
1945  {
1946  return;
1947  }
1948 
1949  $this->ctrl->setParameter($this, 'lock', $this->getLockParameter());
1950 
1951  $nextCommand = $this->ctrl->getCmdClass().'::'.$this->ctrl->getCmd();
1952  $this->ctrl->setParameterByClass('ilTestPasswordProtectionGUI', 'nextCommand', $nextCommand);
1953  $this->ctrl->redirectByClass('ilTestPasswordProtectionGUI', 'showPasswordForm');
1954  }
1955 
1956  protected function isParticipantsAnswerFixed($questionId)
1957  {
1958  if( !$this->object->isInstantFeedbackAnswerFixationEnabled() )
1959  {
1960  return false;
1961  }
1962 
1963  if( !$this->testSequence->isQuestionChecked($questionId) )
1964  {
1965  return false;
1966  }
1967 
1968  return true;
1969  }
1970 
1971  protected function customRedirectRequired()
1972  {
1973  return false;
1974  }
1975 
1976  protected function performCustomRedirect()
1977  {
1978  return;
1979  }
1980 
1984  protected function getIntroductionPageButtonLabel()
1985  {
1986  if( $this->testSession->isObjectiveOriented() )
1987  {
1988  return $this->lng->txt("save_back_to_objective_container");
1989  }
1990 
1991  return $this->lng->txt("save_introduction");
1992  }
1993 }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
const TEST_POSTPONE
ftimestamp2datetimeDB($aTimestamp)
Timestamp to database datetime.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
ILIAS Setting Class.
startPlayerCmd()
Start a test for the first time.
print $file
getCorrectSolutionOutput($question_id, $active_id, $pass)
Returns an output of the solution to an answer compared to the correct solution.
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
exit
Definition: login.php:54
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
$_POST['username']
Definition: cron.php:12
outTestPage($directfeedback)
Outputs the question of the active sequence.
saveQuestionSolution($force=FALSE)
saves the user input of a question
passDetails()
Output of the learners view of an existing test pass.
$result
checkOnlineTestAccess()
check access restrictions like client ip, partipating user etc.
setAnonymousIdCmd()
Sets a session variable with the test access code for an anonymous test user.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
Class ilTaggingGUI.
confirmSubmitAnswers()
confirm submit results if confirm then results are submitted and the screen will be redirected to the...
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not ...
saveTagsCmd()
Save tags for tagging gui.
isTestSignRedirectRequired($activeId, $lastFinishedPass)
isFirstPageInSequence($sequence)
$cmd
Definition: sahs_server.php:35
static get($a_var)
Get a value.
getResultsSignature()
Returns HTML code for a signature field.
backFromSummaryCmd()
Go back to the last active question from the summary.
setAnonymousId($anonymous_id)
_getSolvedQuestions($active_id, $question_fi=null)
get solved questions
handleUserSettings()
Handles some form parameters on starting and resuming a test.
showListOfAnswers($active_id, $pass=NULL, $top_data="", $bottom_data="")
Creates an output of the list of answers for a test participant during the test (only the actual pass...
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
confirmHintRequestCmd()
Go to hint request confirmation.
getSyntaxStylePath()
get syntax style path
gotoQuestionCmd()
Go to the question with the active sequence.
__construct($a_object)
ilTestOutputGUI constructor
maxProcessingTimeReached()
Outputs a message when the maximum processing time is reached.
showRequestedHintListCmd()
Go to requested hint list.
global $ilCtrl
Definition: ilias.php:18
calculateSequence()
Calculates the sequence to determine the next question.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
ensureExistingTestSession(ilTestSession $testSession)
confirmFinishCmd()
The final submission of a test was confirmed.
markQuestionCmd()
Set a question solved.
fillQuestionRelatedNavigation(assQuestionGUI $questionGUI)
renders the elements for the question related navigation
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
isLastQuestionInSequence(assQuestionGUI $questionGUI)
special template class to simplify handling of ITX/PEAR
resumePlayerCmd()
Resume a test at the last position.
endingTimeReached()
handle endingTimeReached
static formatDate(ilDateTime $date)
Format a date public.
Output class for assessment test evaluation.
lookupExamId($active_id, $pass)
const IL_COMP_MODULE
Date and time handling
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getCurrentGUI(ilObjTest $a_test_obj=null)
Get the GUI that is used for the currently available selector (other GUI instances may exist for conf...
Test session handler.
$results
Basic GUI class for assessment questions.
static getIdleValue($fixedMode=false)
Returns the idle time in seconds.
const REDIRECT_KIOSK
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$filename
Definition: buildRTE.php:89
const HEADING_STYLE_SUBHEADING
outWorkingForm($sequence="", $test_id, $postpone_allowed, $directfeedback=false)
outQuestionSummaryCmd($fullpage=true, $contextFinishTest=false, $obligationsNotAnswered=false, $obligationsFilter=false)
Output of a summary of all test questions for test participants.
unmarkQuestionCmd()
Set a question unsolved.
const IL_CAL_FKT_GETDATE
Class ilTestArchiver.
static getInstance()
Get instance.
isTestAccessible()
test accessible returns true if the user can perform the test
global $ilUser
Definition: imgupload.php:15
getContentStylePath($a_style_id)
get content style path
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
static generatePDF($pdf_output, $output_mode, $filename=null)
global $ilDB
static buildExamId($active_id, $pass, $test_obj_id=null)
const PANEL_STYLE_SECONDARY
outIntroductionPageCmd()
Creates the introduction page for a test.
Service GUI class for tests.
initTestCmd()
Start a test for the first time after a redirect.
finishTestCmd($requires_confirmation=true)
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
static redirect($a_script)
http redirect to other script
static getWebspaceDir($mode="filesystem")
get webspace directory
populateScoreBlock($reachedPoints, $maxPoints)
Output class for assessment test execution.
Confirmation screen class.