ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestOutputGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
6 include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
7 
21 {
22  var $ref_id;
23 
25  var $sequence;
26  var $cmdCtrl;
29 
38  function ilTestOutputGUI($a_object)
39  {
40  parent::ilTestServiceGUI($a_object);
41  $this->ref_id = $_GET["ref_id"];
42  }
43 
44  /*
45  * Save tags for tagging gui
46  *
47  * Needed this function here because the test info page
48  * uses another class to send its form results
49  */
50  function saveTags()
51  {
52  include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
53  $tagging_gui = new ilTaggingGUI();
54  $tagging_gui->setObject($this->object->getId(), $this->object->getType());
55  $tagging_gui->saveInput();
56  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
57  }
58 
62  function &executeCommand()
63  {
64  global $ilUser;
65  /* Change Sn */
66  $a_safe_commands = array("printTest","saveTest","resetTest","savePDF","showPaperVersion");
67  $cmd = $this->ctrl->getCmd("",$a_safe_commands);
68 
69  $next_class = $this->ctrl->getNextClass($this);
70  $this->ctrl->saveParameter($this, "sequence");
71  $this->ctrl->saveParameter($this, "active_id");
72  if (preg_match("/^gotoquestion_(\\d+)$/", $cmd, $matches))
73  {
74  $cmd = "gotoquestion";
75  if (strlen($matches[1]))
76  {
77  $this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
78  }
79 
80  }
81  if ($_GET["active_id"])
82  {
83  $this->object->setTestSession($_GET["active_id"]);
84  }
85  else
86  {
87  $this->object->setTestSession();
88  }
89  include_once "./Services/YUI/classes/class.ilYuiUtil.php";
91  $cmd = $this->getCommand($cmd);
92  switch($next_class)
93  {
94  default:
95  $ret =& $this->$cmd();
96  break;
97  }
98  return $ret;
99  }
100 
105  function updateWorkingTime()
106  {
107  if ($_SESSION["active_time_id"])
108  {
109  $this->object->updateWorkingTime($_SESSION["active_time_id"]);
110  }
111  }
112 
116  function saveQuestionSolution($force = FALSE)
117  {
118  $this->updateWorkingTime();
119  $this->saveResult = FALSE;
120  if (!$force)
121  {
122  $formtimestamp = $_POST["formtimestamp"];
123  if (strlen($formtimestamp) == 0) $formtimestamp = $_GET["formtimestamp"];
124  if ($formtimestamp != $_SESSION["formtimestamp"])
125  {
126  $_SESSION["formtimestamp"] = $formtimestamp;
127  }
128  else
129  {
130  return FALSE;
131  }
132  }
133  // save question solution
134  if ($this->canSaveResult() || $force)
135  {
136  // but only if the ending time is not reached
137  $q_id = $this->object->getTestSequence()->getQuestionForSequence($_GET["sequence"]);
138  if (is_numeric($q_id))
139  {
140  global $ilUser;
141 
142  $question_gui = $this->object->createQuestionGUI("", $q_id);
143  if ($this->object->getJavaScriptOutput())
144  {
145  $question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
146  }
147  $pass = NULL;
148  $active_id = $this->object->getTestSession()->getActiveId();
149  if ($this->object->isRandomTest())
150  {
151  $pass = $this->object->_getPass($active_id);
152  }
153  $this->saveResult = $question_gui->object->saveWorkingData($active_id, $pass);
154 
155  // update learning progress (is done in ilTestSession)
156  //include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
157  //ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
158  }
159  }
160  if ($this->saveResult == FALSE)
161  {
162  $this->ctrl->setParameter($this, "save_error", "1");
163  $_SESSION["previouspost"] = $_POST;
164  }
165  return $this->saveResult;
166  }
167 
176  function canSaveResult()
177  {
178  return !$this->object->endingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
179  }
180 
189  {
190  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
191  }
192 
202  {
203  global $ilUser;
204  $active_id = $this->object->getTestSession()->getActiveId();
205  $starting_time = $this->object->getStartingTimeOfUser($active_id);
206  if ($starting_time === FALSE)
207  {
208  return FALSE;
209  }
210  else
211  {
212  return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
213  }
214  }
215 
219  public function outWorkingForm($sequence = "", $test_id, $postpone_allowed, $directfeedback = 0)
220  {
221  global $ilUser;
222 
223  if ($sequence < 1) $sequence = $this->object->getTestSequence()->getFirstSequence();
224  $question_id = $this->object->getTestSequence()->getQuestionForSequence($sequence);
225  $active_time_id = $this->object->startWorkingTime($this->object->getTestSession()->getActiveId(), $question_id, $this->object->getTestSession()->getPass());
226  $_SESSION["active_time_id"] = $active_time_id;
227 
228  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
229  $this->tpl->setCurrentBlock("ContentStyle");
230  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
232  $this->tpl->parseCurrentBlock();
233 
234  // syntax style
235  $this->tpl->setCurrentBlock("SyntaxStyle");
236  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
238  $this->tpl->parseCurrentBlock();
239 
240  if ($this->object->getListOfQuestions())
241  {
242  $show_side_list = $ilUser->getPref('side_list_of_questions');
243  $this->tpl->setCurrentBlock('view_sidelist');
244  $this->tpl->setVariable('IMAGE_SIDELIST', ($show_side_list) ? ilUtil::getImagePath('view_remove.png') : ilUtil::getImagePath('view_choose.png'));
245  $this->tpl->setVariable('TEXT_SIDELIST', ($show_side_list) ? $this->lng->txt('tst_hide_side_list') : $this->lng->txt('tst_show_side_list'));
246  $this->tpl->parseCurrentBlock();
247  if ($show_side_list)
248  {
249  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta_split.css", "Modules/Test"), "screen");
250  $this->outQuestionSummary(false);
251  }
252  }
253 
254  $question_gui = $this->object->createQuestionGUI("", $question_id);
255  if ($this->object->getJavaScriptOutput())
256  {
257  $question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
258  }
259 
260  $is_postponed = $this->object->getTestSequence()->isPostponedQuestion($question_gui->object->getId());
261  $this->ctrl->setParameter($this, "sequence", "$sequence");
262  $formaction = $this->ctrl->getFormAction($this, "gotoQuestion");
263 
264  $question_gui->setSequenceNumber($this->object->getTestSequence()->getPositionOfSequence($sequence));
265  $question_gui->setQuestionCount($this->object->getTestSequence()->getUserQuestionCount());
266  // output question
267  $user_post_solution = FALSE;
268  if (array_key_exists("previouspost", $_SESSION))
269  {
270  $user_post_solution = $_SESSION["previouspost"];
271  unset($_SESSION["previouspost"]);
272  }
273  $answer_feedback = FALSE;
274  if (($directfeedback) && ($this->object->getAnswerFeedback()))
275  {
276  $answer_feedback = TRUE;
277  }
278  global $ilNavigationHistory;
279  $ilNavigationHistory->addItem($_GET["ref_id"], $this->ctrl->getLinkTarget($this, "resume"), "tst");
280  $question_gui->outQuestionForTest($formaction, $this->object->getTestSession()->getActiveId(), NULL, $is_postponed, $user_post_solution, $answer_feedback);
281  if ($directfeedback)
282  {
283  if ($this->object->getInstantFeedbackSolution())
284  {
285  $solutionoutput = $question_gui->getSolutionOutput($this->object->getTestSession()->getActiveId(), NULL, FALSE, FALSE, FALSE, FALSE, TRUE);
286  $this->tpl->setCurrentBlock("solution_output");
287  $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
288  $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
289  $this->tpl->parseCurrentBlock();
290  }
291  if ($this->object->getAnswerFeedbackPoints())
292  {
293  $this->tpl->setCurrentBlock("solution_output");
294  $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", sprintf($this->lng->txt("you_received_a_of_b_points"), $question_gui->object->calculateReachedPoints($this->object->getTestSession()->getActiveId(), NULL), $question_gui->object->getMaximumPoints()));
295  $this->tpl->parseCurrentBlock();
296  }
297  if ($this->object->getAnswerFeedback())
298  {
299  $this->tpl->setCurrentBlock("answer_feedback");
300  $this->tpl->setVariable("ANSWER_FEEDBACK", $question_gui->getAnswerFeedbackOutput($this->object->getTestSession()->getActiveId(), NULL));
301  $this->tpl->parseCurrentBlock();
302  }
303  }
304 
305  if ($sequence == $this->object->getTestSequence()->getFirstSequence())
306  {
307  /*$this->tpl->setCurrentBlock("prev");
308  $this->tpl->setVariable("BTN_PREV", "&lt;&lt; " . $this->lng->txt("save_introduction"));
309  $this->tpl->parseCurrentBlock();
310  $this->tpl->setCurrentBlock("prev_bottom");
311  $this->tpl->setVariable("BTN_PREV", "&lt;&lt; " . $this->lng->txt("save_introduction"));
312  $this->tpl->parseCurrentBlock();*/
313  // DS 201105, Ticket 0007116
314  }
315  else
316  {
317  $this->tpl->setCurrentBlock("prev");
318  $this->tpl->setVariable("BTN_PREV", "&lt;&lt; " . $this->lng->txt("save_previous"));
319  $this->tpl->parseCurrentBlock();
320  $this->tpl->setCurrentBlock("prev_bottom");
321  $this->tpl->setVariable("BTN_PREV", "&lt;&lt; " . $this->lng->txt("save_previous"));
322  $this->tpl->parseCurrentBlock();
323  }
324 
325  if ($postpone_allowed)
326  {
327  if (!$is_postponed)
328  {
329  if (!$finish)
330  {
331  $this->tpl->setCurrentBlock("postpone");
332  $this->tpl->setVariable("BTN_POSTPONE", $this->lng->txt("postpone"));
333  $this->tpl->parseCurrentBlock();
334  $this->tpl->setCurrentBlock("postpone_bottom");
335  $this->tpl->setVariable("BTN_POSTPONE", $this->lng->txt("postpone"));
336  $this->tpl->parseCurrentBlock();
337  }
338  }
339  }
340 
341  if ($this->object->getListOfQuestions())
342  {
343  if (!(($finish) && ($this->object->getListOfQuestionsEnd())))
344  {
345  $this->tpl->setCurrentBlock("summary");
346  $this->tpl->setVariable("BTN_SUMMARY", $this->lng->txt("question_summary"));
347  $this->tpl->parseCurrentBlock();
348  $this->tpl->setCurrentBlock("summary_bottom");
349  $this->tpl->setVariable("BTN_SUMMARY", $this->lng->txt("question_summary"));
350  $this->tpl->parseCurrentBlock();
351  }
352  }
353 
354  if ($this->object->getShowCancel())
355  {
356  $this->tpl->setCurrentBlock("cancel_test");
357  $this->tpl->setVariable("TEXT_CANCELTEST", $this->lng->txt("cancel_test"));
358  $this->tpl->setVariable("TEXT_ALTCANCELTEXT", $this->lng->txt("cancel_test"));
359  $this->tpl->setVariable("TEXT_TITLECANCELTEXT", $this->lng->txt("cancel_test"));
360  $this->tpl->setVariable("HREF_IMGCANCELTEST", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
361  $this->tpl->setVariable("HREF_CANCELTEXT", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
362  $this->tpl->setVariable("IMAGE_CANCEL", ilUtil::getImagePath("cancel.gif"));
363  $this->tpl->parseCurrentBlock();
364  }
365 
366  if ($this->object->getTestSequence()->getQuestionForSequence($this->object->getTestSequence()->getLastSequence()) == $question_gui->object->getId())
367  {
368  if ($this->object->getListOfQuestionsEnd())
369  {
370  $this->tpl->setCurrentBlock("next");
371  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("question_summary") . " &gt;&gt;");
372  $this->tpl->parseCurrentBlock();
373  $this->tpl->setCurrentBlock("next_bottom");
374  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("question_summary") . " &gt;&gt;");
375  $this->tpl->parseCurrentBlock();
376  }
377  else
378  {
379  $this->tpl->setCurrentBlock("next");
380  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_finish") . " &gt;&gt;");
381  $this->tpl->parseCurrentBlock();
382  $this->tpl->setCurrentBlock("next_bottom");
383  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_finish") . " &gt;&gt;");
384  $this->tpl->parseCurrentBlock();
385  }
386  }
387  else
388  {
389  $this->tpl->setCurrentBlock("next");
390  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_next") . " &gt;&gt;");
391  $this->tpl->parseCurrentBlock();
392  $this->tpl->setCurrentBlock("next_bottom");
393  $this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_next") . " &gt;&gt;");
394  $this->tpl->parseCurrentBlock();
395  }
396 
397  if ($this->object->getShowMarker())
398  {
399  include_once "./Modules/Test/classes/class.ilObjTest.php";
400  $solved_array = ilObjTest::_getSolvedQuestions($this->object->getTestSession()->getActiveId(), $question_gui->object->getId());
401  $solved = 0;
402 
403  if (count ($solved_array) > 0)
404  {
405  $solved = array_pop($solved_array);
406  $solved = $solved["solved"];
407  }
408 
409  if ($solved==1)
410  {
411  $this->tpl->setCurrentBlock("ismarked");
412  $this->tpl->setVariable("IMAGE_SET", ilUtil::getImagePath("marked.png"));
413  $this->tpl->setVariable("TEXT_SET", $this->lng->txt("tst_remove_mark"));
414  $this->tpl->parseCurrentBlock();
415  }
416  else
417  {
418  $this->tpl->setCurrentBlock("isnotmarked");
419  $this->tpl->setVariable("IMAGE_UNSET", ilUtil::getImagePath("marked_.png"));
420  $this->tpl->setVariable("TEXT_UNSET", $this->lng->txt("tst_question_mark"));
421  $this->tpl->parseCurrentBlock();
422  }
423  }
424 
425  if ($this->object->getShowSerial() && !($this->object->getKioskMode() && $this->object->getShowKioskModeParticipant()))
426  {
427  $this->tpl->setCurrentBlock("tst_serial");
428  $this->tpl->setVariable("VALUE_SERIAL", $this->object->getSerial());
429  $this->tpl->setVariable("TXT_SERIAL", $this->lng->txt('tst_serial'));
430  $this->tpl->parseCurrentBlock();
431  }
432 
433  if ($this->object->getJavaScriptOutput())
434  {
435  $this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript_disable.png"));
436  $this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("disable_javascript"));
437  $this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("disable_javascript"));
438  $this->ctrl->setParameter($this, "tst_javascript", "0");
439  $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
440  }
441  else
442  {
443  $this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript.png"));
444  $this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("enable_javascript"));
445  $this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("enable_javascript"));
446  $this->ctrl->setParameter($this, "tst_javascript", "1");
447  $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
448  }
449 
450  if ($question_gui->object->supportsJavascriptOutput())
451  {
452  $this->tpl->touchBlock("jsswitch");
453  }
454 
455  $this->tpl->addJavaScript(ilUtil::getJSLocation("autosave.js", "Modules/Test"));
456  $this->tpl->setVariable("AUTOSAVE_URL", $this->ctrl->getFormAction($this, "autosave", "", true));//str_replace("&amp;", "&", $this->ctrl->getLinkTarget($this, "autosave")));//$this->ctrl->getLinkTarget($this, "autosave"));
457 
458  if ($this->object->getAutosave())
459  {
460  $this->tpl->setCurrentBlock("autosave");
461  // awag autosave
462  // $this->tpl->setVariable("BTN_SAVE", "Zwischenspeichern");
463  // $this->tpl->setVariable("CMD_SAVE", "gotoquestion_{$sequence}");
464  $this->tpl->setVariable("AUTOSAVEFORMACTION", $this->ctrl->getFormAction($this, "autosave", "", true));
465  $this->tpl->parseCurrentBlock();
466  }
467  }
468 
475  {
476  $template = new ilTemplate("tpl.il_as_tst_password_protection.html", TRUE, TRUE, "Modules/Test");
477  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "checkPassword"));
478  $template->setVariable("PASSWORD_INTRODUCTION", $this->lng->txt("tst_password_introduction"));
479  $template->setVariable("TEXT_PASSWORD", $this->lng->txt("tst_password"));
480  $template->setVariable("SUBMIT", $this->lng->txt("submit"));
481  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
482  }
483 
489  function checkPassword()
490  {
491  if (strcmp($this->object->getPassword(), $_POST["password"]) == 0)
492  {
493  global $ilUser;
494  if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
495  {
496  $ilUser->setPref("tst_password_".$this->object->getTestId(), $this->object->getPassword());
497  $ilUser->writePref("tst_password_".$this->object->getTestId(), $this->object->getPassword());
498  }
499  $this->ctrl->redirect($this, "start");
500  }
501  else
502  {
503  ilUtil::sendFailure($this->lng->txt("tst_password_entered_wrong_password"), true);
504  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
505  }
506  }
507 
515  function setAnonymousId()
516  {
517  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
518  {
519  $this->object->setAccessCodeSession($_POST["anonymous_id"]);
520  }
521  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
522  }
523 
532  function start()
533  {
534  if (strcmp($_SESSION["lock"], $_POST["lock"]) != 0)
535  {
536  $_SESSION["lock"] = $_POST["lock"];
537  $this->handleStartCommands();
538  $this->ctrl->redirect($this, "startTest");
539  }
540  else
541  {
542  $this->ctrl->redirectByClass("ilobjtestgui", "redirectToInfoScreen");
543  }
544  }
545 
551  function startTest()
552  {
553  if ($this->object->checkMaximumAllowedUsers() == FALSE)
554  {
556  }
557  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
558  {
559  $this->object->setAccessCodeSession($this->object->createNewAccessCode());
560  }
561  else
562  {
563  $this->object->unsetAccessCodeSession();
564  }
565  if (strlen($this->object->getPassword()))
566  {
567  global $ilUser;
568  global $rbacsystem;
569 
570  $pwd = $ilUser->getPref("tst_password_".$this->object->getTestId());
571  if ((strcmp($pwd, $this->object->getPassword()) != 0) && (!$rbacsystem->checkAccess("write", $this->object->getRefId())))
572  {
573  return $this->showPasswordProtectionPage();
574  }
575  }
576  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
577  {
578  $this->ctrl->redirect($this, "displayCode");
579  }
580  else
581  {
582  $this->ctrl->setParameter($this, "activecommand", "start");
583  $this->ctrl->redirect($this, "redirectQuestion");
584  }
585  }
586 
587  function displayCode()
588  {
589  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "Modules/Test");
590  $this->tpl->setCurrentBlock("adm_content");
591  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
592  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->object->getAccessCodeSession());
593  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
594  $this->tpl->setVariable("CONTINUE", $this->lng->txt("continue_work"));
595  $this->tpl->parseCurrentBlock();
596  }
597 
598  function codeConfirmed()
599  {
600  $this->ctrl->setParameter($this, "activecommand", "start");
601  $this->ctrl->redirect($this, "redirectQuestion");
602  }
603 
611  function resume()
612  {
613  if ($this->object->checkMaximumAllowedUsers() == FALSE)
614  {
616  }
617  $this->handleStartCommands();
618  $this->ctrl->setParameter($this, "activecommand", "resume");
619  $this->ctrl->redirect($this, "redirectQuestion");
620  }
621 
625  public function handleStartCommands()
626  {
627  global $ilUser;
628 
629  if ($_POST["chb_javascript"])
630  {
631  $ilUser->writePref("tst_javascript", 1);
632  }
633  else
634  {
635  $ilUser->writePref("tst_javascript", 0);
636  }
637 
638  // hide previous results
639  if ($this->object->getNrOfTries() != 1)
640  {
641  if ($this->object->getUsePreviousAnswers() == 1)
642  {
643  if ($_POST["chb_use_previous_answers"])
644  {
645  $ilUser->writePref("tst_use_previous_answers", 1);
646  }
647  else
648  {
649  $ilUser->writePref("tst_use_previous_answers", 0);
650  }
651  }
652  }
653 /* if ($this->object->getTestType() == TYPE_ONLINE_TEST)
654  {
655  global $ilias;
656  $ilias->auth->setIdle(0, false);
657  }*/
658  }
659 
666  function redirectQuestion()
667  {
668  global $ilUser;
669 
670  // check the test restrictions to access the test in case one
671  // of the test navigation commands was called by an external script
672  // e.g. $ilNavigationHistory
673  $executable = $this->object->isExecutable($ilUser->getId());
674  if (!$executable["executable"])
675  {
676  ilUtil::sendInfo($executable["errormessage"], TRUE);
677  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
678  }
679  switch ($_GET["activecommand"])
680  {
681  case "next":
682  $this->sequence = $this->calculateSequence();
683  if ($this->sequence === FALSE)
684  {
685  if ($this->object->getListOfQuestionsEnd())
686  {
687  $this->outQuestionSummary();
688  }
689  else
690  {
691  $this->ctrl->redirect($this, "finishTest");
692  }
693  }
694  else
695  {
696  $this->object->getTestSession()->setLastSequence($this->sequence);
697  $this->object->getTestSession()->saveToDb();
698  $this->outTestPage();
699  }
700  break;
701  case "previous":
702  $this->sequence = $this->calculateSequence();
703  $this->object->getTestSession()->setLastSequence($this->sequence);
704  $this->object->getTestSession()->saveToDb();
705  if ($this->sequence === FALSE)
706  {
707  $this->ctrl->redirect($this, "outIntroductionPage");
708  }
709  else
710  {
711  $this->outTestPage();
712  }
713  break;
714  case "postpone":
715  $this->sequence = $this->calculateSequence();
716  $nextSequence = $this->object->getTestSequence()->getNextSequence($this->sequence);
717  $this->object->getTestSequence()->postponeSequence($this->sequence);
718  $this->object->getTestSequence()->saveToDb();
719  $this->object->getTestSession()->setLastSequence($nextSequence);
720  $this->object->getTestSession()->saveToDb();
721  $this->sequence = $nextSequence;
722  $this->outTestPage();
723  break;
724  case "setmarked":
725  $this->sequence = $this->calculateSequence();
726  $this->object->getTestSession()->setLastSequence($this->sequence);
727  $this->object->getTestSession()->saveToDb();
728  $q_id = $this->object->getTestSequence()->getQuestionForSequence($_GET["sequence"]);
729  $this->object->setQuestionSetSolved(1, $q_id, $ilUser->getId());
730  $this->outTestPage();
731  break;
732  case "resetmarked":
733  $this->sequence = $this->calculateSequence();
734  $this->object->getTestSession()->setLastSequence($this->sequence);
735  $this->object->getTestSession()->saveToDb();
736  $q_id = $this->object->getTestSequence()->getQuestionForSequence($_GET["sequence"]);
737  $this->object->setQuestionSetSolved(0, $q_id, $ilUser->getId());
738  $this->outTestPage();
739  break;
740  case "directfeedback":
741  $this->sequence = $this->calculateSequence();
742  $this->object->getTestSession()->setLastSequence($this->sequence);
743  $this->object->getTestSession()->saveToDb();
744  $this->outTestPage();
745  break;
746  case "selectImagemapRegion":
747  $this->sequence = $this->calculateSequence();
748  $this->object->getTestSession()->setLastSequence($this->sequence);
749  $this->object->getTestSession()->saveToDb();
750  $this->outTestPage();
751  break;
752  case "summary":
753  $this->ctrl->redirect($this, "outQuestionSummary");
754  break;
755  case "start":
756  $_SESSION['tst_pass_finish'] = 0;
757  $this->object->createTestSession();
758  $active_id = $this->object->getTestSession()->getActiveId();
759  $this->ctrl->setParameter($this, "active_id", $active_id);
760  $shuffle = $this->object->getShuffleQuestions();
761  if ($this->object->isRandomTest())
762  {
763  $this->object->generateRandomQuestions($this->object->getTestSession()->getActiveId());
764  $this->object->loadQuestions();
765  $shuffle = FALSE; // shuffle is already done during the creation of the random questions
766  }
767  $this->object->createTestSequence($active_id, 0, $shuffle);
768  $question_id = $this->object->getTestSequence()->getQuestionForSequence($this->sequence);
769  $active_time_id = $this->object->startWorkingTime($this->object->getTestSession()->getActiveId(), $question_id, $this->object->getTestSession()->getPass());
770  $_SESSION["active_time_id"] = $active_time_id;
771  if ($this->object->getListOfQuestionsStart())
772  {
773  $this->ctrl->setParameter($this, "activecommand", "summary");
774  $this->ctrl->redirect($this, "redirectQuestion");
775  }
776  else
777  {
778  $this->ctrl->setParameter($this, "sequence", $this->sequence);
779  $this->ctrl->setParameter($this, "activecommand", "gotoquestion");
780  $this->ctrl->saveParameter($this, "tst_javascript");
781  $this->ctrl->redirect($this, "redirectQuestion");
782  }
783  break;
784  case "resume":
785  $_SESSION['tst_pass_finish'] = 0;
786  $active_id = $this->object->getTestSession()->getActiveId();
787  $this->ctrl->setParameter($this, "active_id", $active_id);
788 
789  if ($this->object->isRandomTest())
790  {
791  if (!$this->object->hasRandomQuestionsForPass($active_id, $this->object->getTestSession()->getPass()))
792  {
793  // create a new set of random questions
794  $this->object->generateRandomQuestions($active_id, $this->object->getTestSession()->getPass());
795  }
796  }
797  $shuffle = $this->object->getShuffleQuestions();
798  if ($this->object->isRandomTest())
799  {
800  $shuffle = FALSE;
801  }
802  $this->object->createTestSequence($active_id, $this->object->getTestSession()->getPass(), $shuffle);
803 
804  $this->sequence = $this->object->getTestSession()->getLastSequence();
805  $question_id = $this->object->getTestSequence()->getQuestionForSequence($sequence);
806  $active_time_id = $this->object->startWorkingTime($active_id, $question_id, $this->object->getTestSession()->getPass());
807  $_SESSION["active_time_id"] = $active_time_id;
808  if ($this->object->getListOfQuestionsStart())
809  {
810  $this->ctrl->setParameter($this, "activecommand", "summary");
811  $this->ctrl->redirect($this, "redirectQuestion");
812  }
813  else
814  {
815  $this->ctrl->setParameter($this, "sequence", $this->sequence);
816  $this->ctrl->setParameter($this, "activecommand", "gotoquestion");
817  $this->ctrl->saveParameter($this, "tst_javascript");
818  $this->ctrl->redirect($this, "redirectQuestion");
819  }
820  break;
821  case "back":
822  case "gotoquestion":
823  default:
824  $_SESSION['tst_pass_finish'] = 0;
825  if (array_key_exists("tst_javascript", $_GET))
826  {
827  $ilUser->writePref("tst_javascript", $_GET["tst_javascript"]);
828  }
829  $this->sequence = $this->calculateSequence();
830  if (strlen($_GET['gotosequence'])) $this->sequence = $_GET['gotosequence'];
831  $this->object->getTestSession()->setLastSequence($this->sequence);
832  $this->object->getTestSession()->saveToDb();
833  $this->outTestPage();
834  break;
835  }
836  }
837 
843  function calculateSequence()
844  {
845  $sequence = $_GET["sequence"];
846  if (!$sequence) $sequence = $this->object->getTestSequence()->getFirstSequence();
847  if (array_key_exists("save_error", $_GET))
848  {
849  if ($_GET["save_error"] == 1)
850  {
851  return $sequence;
852  }
853  }
854  switch ($_GET["activecommand"])
855  {
856  case "next":
857  $sequence = $this->object->getTestSequence()->getNextSequence($sequence);
858  break;
859  case "previous":
860  $sequence = $this->object->getTestSequence()->getPreviousSequence($sequence);
861  break;
862  }
863  return $sequence;
864  }
865 
867  {
868  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
869  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
870  $this->tpl->setCurrentBlock("HeadContent");
871  $this->tpl->setVariable("CONTENT_BLOCK", "<meta http-equiv=\"refresh\" content=\"5; url=" . $this->ctrl->getLinkTarget($this, "redirectBack") . "\">");
872  $this->tpl->parseCurrentBlock();
873  }
874 
875  function autosave()
876  {
877  global $ilLog;
878  $result = "";
879  if (is_array($_POST) && count($_POST) > 0)
880  {
881  $res = $this->saveQuestionSolution(TRUE);
882  if ($res)
883  {
884  $result = $this->lng->txt("autosave_success");
885  }
886  else
887  {
888  $result = $this->lng->txt("autosave_failed");
889  }
890  }
891  if (!$this->canSaveResult())
892  {
893  // this was the last action in the test, saving is no longer allowed
894  $result = $this->ctrl->getLinkTarget($this, "redirectAfterAutosave", "", true);
895  }
896  echo $result;
897  exit;
898  }
899 
903  public function togglesidelist()
904  {
905  global $ilUser;
906 
907  $show_side_list = $ilUser->getPref('side_list_of_questions');
908  $ilUser->writePref('side_list_of_questions', !$show_side_list);
909  $this->saveQuestionSolution();
910  $this->ctrl->redirect($this, "redirectQuestion");
911  }
912 
920  function next()
921  {
922  $this->saveQuestionSolution();
923  $this->ctrl->setParameter($this, "activecommand", "next");
924  $this->ctrl->redirect($this, "redirectQuestion");
925  }
926 
934  function previous()
935  {
936  $this->saveQuestionSolution();
937  $this->ctrl->setParameter($this, "activecommand", "previous");
938  $this->ctrl->redirect($this, "redirectQuestion");
939  }
940 
948  function postpone()
949  {
950  $this->saveQuestionSolution();
951  $this->ctrl->setParameter($this, "activecommand", "postpone");
952  $this->ctrl->redirect($this, "redirectQuestion");
953  }
954 
962  function summary()
963  {
964  $this->saveQuestionSolution();
965  if ($this->saveResult == FALSE)
966  {
967  $this->ctrl->setParameter($this, "activecommand", "");
968  $this->ctrl->redirect($this, "redirectQuestion");
969  }
970  else
971  {
972  $this->ctrl->setParameter($this, "activecommand", "summary");
973  $this->ctrl->redirect($this, "redirectQuestion");
974  }
975  }
976 
984  function setmarked()
985  {
986  $this->saveQuestionSolution();
987  $this->ctrl->setParameter($this, "activecommand", "setmarked");
988  $this->ctrl->redirect($this, "redirectQuestion");
989  }
990 
998  function resetmarked()
999  {
1000  $this->saveQuestionSolution();
1001  $this->ctrl->setParameter($this, "activecommand", "resetmarked");
1002  $this->ctrl->redirect($this, "redirectQuestion");
1003  }
1004 
1012  function directfeedback()
1013  {
1014  $this->saveQuestionSolution();
1015  $this->ctrl->setParameter($this, "activecommand", "directfeedback");
1016  $this->ctrl->redirect($this, "redirectQuestion");
1017  }
1018 
1027  {
1028  $this->saveQuestionSolution();
1029  $activecommand = "selectImagemapRegion";
1030  if (array_key_exists('cmd', $_POST))
1031  {
1032  $activecommand = key($_POST["cmd"]);
1033  }
1034  if (preg_match("/^gotoquestion_(\\d+)$/", $activecommand, $matches))
1035  {
1036  $activecommand = "gotoquestion";
1037  if (strlen($matches[1]))
1038  {
1039  $this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
1040  }
1041  }
1042  if (strcmp($activecommand, "togglesidelist") == 0)
1043  {
1044  $this->togglesidelist();
1045  }
1046  else
1047  {
1048  $this->ctrl->setParameter($this, "activecommand", $activecommand);
1049  $this->ctrl->redirect($this, "redirectQuestion");
1050  }
1051  }
1052 
1053  function invalidToken()
1054  {
1055  ilUtil::sendFailure($this->lng->txt('invalid_token'), true);
1056  $this->gotoQuestion();
1057  }
1058 
1066  function gotoQuestion()
1067  {
1068  if (is_array($_POST) && count($_POST) > 0) $this->saveQuestionSolution();
1069  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1070  $this->ctrl->setParameter($this, "activecommand", "gotoquestion");
1071  $this->ctrl->saveParameter($this, "tst_javascript");
1072  if (strlen($_GET['qst_selection'])) $_SESSION['qst_selection'] = $_GET['qst_selection'];
1073  $this->ctrl->redirect($this, "redirectQuestion");
1074  }
1075 
1083  function backFromSummary()
1084  {
1085  $this->ctrl->setParameter($this, "activecommand", "back");
1086  $this->ctrl->redirect($this, "redirectQuestion");
1087  }
1088 
1096  function confirmFinish()
1097  {
1098  $this->finishTest(false);
1099  }
1100 
1109  {
1110  global $ilUser;
1111 
1112  $template = new ilTemplate("tpl.il_as_tst_finish_confirmation.html", TRUE, TRUE, "Modules/Test");
1113  $template->setVariable("FINISH_QUESTION", $this->lng->txt("tst_finish_confirmation_question"));
1114  $template->setVariable("BUTTON_CONFIRM", $this->lng->txt("tst_finish_confirm_button"));
1115  if ($this->object->getShowSolutionAnwersBeforeFinish())
1116  {
1117  $template->setVariable("BUTTON_CANCEL", $this->lng->txt("tst_finish_confirm_list_of_answers_button"));
1118  }
1119  else
1120  {
1121  $template->setVariable("BUTTON_CANCEL", $this->lng->txt("tst_finish_confirm_cancel_button"));
1122  }
1123  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1124  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
1125  }
1126 
1134  function finishTest($confirm = true)
1135  {
1136  global $ilUser;
1137  global $ilias;
1138  global $ilAuth;
1139 
1140  unset($_SESSION["tst_next"]);
1141 
1142  $active_id = $this->object->getTestSession()->getActiveId();
1143  $actualpass = $this->object->_getPass($active_id);
1144  if (($actualpass == $this->object->getNrOfTries() - 1) && (!$confirm))
1145  {
1146  $this->object->setActiveTestSubmitted($ilUser->getId());
1147  $ilAuth->setIdle($ilias->ini->readVariable("session","expire"), false);
1148  $ilAuth->setExpire(0);
1149  switch ($this->object->getMailNotification())
1150  {
1151  case 1:
1152  $this->object->sendSimpleNotification($active_id);
1153  break;
1154  case 2:
1155  $this->object->sendAdvancedNotification($active_id);
1156  break;
1157  }
1158  }
1159 
1160  if (($confirm) && ($actualpass == $this->object->getNrOfTries() - 1))
1161  {
1162  if ($this->object->getShowSolutionAnwersBeforeFinish())
1163  {
1164  $template = new ilTemplate("tpl.il_as_tst_finish_navigation.html", TRUE, TRUE, "Modules/Test");
1165  $template->setVariable("BUTTON_FINISH", $this->lng->txt("btn_next"));
1166  $template->setVariable("BUTTON_CANCEL", $this->lng->txt("btn_previous"));
1167 
1168  $template_top = new ilTemplate("tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE, "Modules/Test");
1169  $template_top->setCurrentBlock("button_print");
1170  $template_top->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
1171  $template_top->parseCurrentBlock();
1172 
1173  $this->showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
1174  return;
1175  }
1176  else
1177  {
1178  // show confirmation page
1179  return $this->confirmFinishTest();
1180  }
1181  }
1182 
1183  if (!$_SESSION['tst_pass_finish'])
1184  {
1185  if (!$_SESSION['tst_pass_finish']) $_SESSION['tst_pass_finish'] = 1;
1186  if ($this->object->getMailNotificationType() == 1)
1187  {
1188  switch ($this->object->getMailNotification())
1189  {
1190  case 1:
1191  $this->object->sendSimpleNotification($active_id);
1192  break;
1193  case 2:
1194  $this->object->sendAdvancedNotification($active_id);
1195  break;
1196  }
1197  }
1198  $this->object->getTestSession()->increaseTestPass();
1199  }
1200 
1201  /* Change Sn */
1202 
1203  $exam_pdf = $this->object->getExamPdf();
1204 
1205  $active = $this->object->getTestSession($active_id);
1206  $ra_date = date("Y-m-d");
1207 
1208  $ra_test_filename = $ra_date."_".$active->test_id."_".$ilUser->login;
1209  $ra_test_file = "resarchiver/output_html/".$ra_test_filename;
1210 
1211  if ($exam_pdf)
1212  {
1213  $ra_meta_data =
1214  $active->test_id.";"
1215  .$this->object->getTitle().";"
1216  .$active->user_id.";"
1217  .$ilUser->login.";"
1218  .$ilUser->fullname.";"
1219  .$ilUser->matriculation.";"
1220  .$ilUser->email.";"
1221  .$ra_test_filename.".pdf\r\n";
1222 
1223  $ra_metafile = fopen("resarchiver/output_html/".$ra_date."_".$active->test_id.".metafile","a");
1224 
1225  fwrite ( $ra_metafile, $ra_meta_data);
1226 
1227  fclose($ra_metafile);
1228 
1229 
1230  $result_output_stream .= "
1231  <html>
1232  <head>
1233  <title>Online-Klausur-System</title>
1234  <!--<link rel=\"stylesheet\" type=\"text/css\" href=\"./templates/default/delos.css\" />-->
1235  <!--<link rel=\"stylesheet\" type=\"text/css\" href=\"./templates/default/delos_cont.css\" />-->
1236  <!--<link rel=\"stylesheet\" type=\"text/css\" href=\"../../Modules/Test/templates/default/test_print.css\" media=\"print\"/>-->
1237  <link rel=\"stylesheet\" type=\"text/css\" href=\"" .
1238  ilUtil::getStyleSheetLocation("output", "test.css", "Modules/Test") . "\"/>
1239  <link rel=\"stylesheet\" type=\"text/css\" href=\"" .
1240  ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test") . "media=\"print\"/>
1241  <script type=\"text/javascript\" src=\"./templates/default/functions.js\"></script>
1242  </head>
1243  <body>
1244  ";
1245 
1246  // one would think there'd be a more elegant solution with getSubmittedTimestamp(),
1247  // but that's broken as setSubmittedTimestamp() is never called - warkusm, 2010-05-26
1248  $result_output_stream .= "<p>Test: "
1249  .iconv("UTF-8", "ISO-8859-1", $this->object->getTitle())
1250  ." (Test-ID = ".$active->test_id.")"
1251  ."<br>Name: ".iconv("UTF-8", "ISO-8859-1", $ilUser->fullname)
1252  ."<br>Loginname: ".$ilUser->login." (User-ID = ".$active->user_id.")"
1253  ."<br>Matrikelnummer: ".$ilUser->matriculation
1254  ."<br>E-Mail: ".$ilUser->email
1255  ."<br>Abgabezeitpunkt: ".date('c (=U)') // ISO human-readable timestamp plus Unix time
1256  ."</p>"
1257  ;
1258 
1259  $cache_file = $ra_test_file.".cache";
1260  if (file_exists($cache_file))
1261  {
1262  $cache_handle = fopen($cache_file,"r");
1263  $content = fread($cache_handle,filesize($cache_file));
1264  fclose($cache_handle);
1265 
1266  $result_output_stream .= $content;
1267  $result_output_stream .= "</body></html>";
1268  $filehandle = fopen($ra_test_file . ".html","w");
1269  fwrite($filehandle,$result_output_stream);
1270  fclose($filehandle);
1271  unlink($cache_file);
1272  }
1273  }
1274 
1275  $redirect_after_exam = $this->object->getRedirectAfterExam();//(isset($udf_id)) ? $ilUser->user_defined_data[$udf_id] : "";
1276 
1277  if ($redirect_after_exam != "" && !$this->object->canViewResults())
1278  {
1279  if (!$this->object->getRedirectOnlyKioskMode())
1280  {
1281  ilUtil::redirect($redirect_after_exam);
1282  }
1283  else {
1284  if (KIOSK_MODE)
1285  {
1286  ilUtil::redirect($redirect_after_exam);
1287  }
1288  }
1289  }
1290 
1291  /* Change Sn End */
1292 
1293  $this->redirectBack();
1294  }
1295 
1296  public function redirectBack()
1297  {
1298  if (!$_GET["skipfinalstatement"])
1299  {
1300  if ($this->object->getShowFinalStatement())
1301  {
1302  $this->ctrl->redirect($this, "showFinalStatement");
1303  }
1304  }
1305  if($_GET['crs_show_result'])
1306  {
1307  $this->ctrl->redirectByClass("ilobjtestgui", "backToCourse");
1308  }
1309 
1310  if (!$this->object->canViewResults())
1311  {
1312  $this->outIntroductionPage();
1313  }
1314  else
1315  {
1316  $this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
1317  }
1318  }
1319 
1320  /*
1321  * Presents the final statement of a test
1322  */
1323  public function showFinalStatement()
1324  {
1325  $template = new ilTemplate("tpl.il_as_tst_final_statement.html", TRUE, TRUE, "Modules/Test");
1326  $this->ctrl->setParameter($this, "crs_show_result", $_GET['crs_show_result']);
1327  $this->ctrl->setParameter($this, "skipfinalstatement", 1);
1328  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "redirectBack"));
1329  $template->setVariable("FINALSTATEMENT", $this->object->getFinalStatement());
1330  $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
1331  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
1332  }
1333 
1334  private function getKioskHead()
1335  {
1336  global $ilUser;
1337 
1338  $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test');
1339  if ($this->object->getShowKioskModeTitle())
1340  {
1341  $template->setCurrentBlock("kiosk_show_title");
1342  $template->setVariable("TEST_TITLE", $this->object->getTitle());
1343  $template->parseCurrentBlock();
1344  }
1345  if ($this->object->getShowKioskModeParticipant())
1346  {
1347  if ($this->object->getShowSerial())
1348  {
1349  $template->setCurrentBlock("tst_serial");
1350  $template->setVariable("TXT_SERIAL", $this->lng->txt("tst_serial"));
1351  $template->setVariable("VALUE_SERIAL", $this->object->getSerial());
1352  $template->parseCurrentBlock();
1353  }
1354  $template->setCurrentBlock("kiosk_show_participant");
1355  $template->setVariable("TXT_PARTICIPANT_NAME", $this->lng->txt("login_as"));
1356  $template->setVariable("PARTICIPANT_NAME", $ilUser->getFullname());
1357  $template->setVariable("TXT_PARTICIPANT_LOGIN", $this->lng->txt("login"));
1358  $template->setVariable("PARTICIPANT_LOGIN", $ilUser->getLogin());
1359  $template->setVariable("PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1360  $template->parseCurrentBlock();
1361  }
1362  return $template->get();
1363  }
1364 
1368  function outTestPage()
1369  {
1370  global $rbacsystem, $ilUser;
1371 
1372  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_output.html", "Modules/Test");
1373  if (!$rbacsystem->checkAccess("read", $this->object->getRefId()))
1374  {
1375  // only with read access it is possible to run the test
1376  $this->ilias->raiseError($this->lng->txt("cannot_execute_test"),$this->ilias->error_obj->MESSAGE);
1377  }
1378 
1379  if ($this->isMaxProcessingTimeReached())
1380  {
1381  $this->maxProcessingTimeReached();
1382  return;
1383  }
1384 
1385  if ($this->object->endingTimeReached())
1386  {
1387  $this->endingTimeReached();
1388  return;
1389  }
1390 
1391  if ($this->object->getKioskMode())
1392  {
1393  ilUtil::sendInfo();
1394  $head = $this->getKioskHead();
1395  if (strlen($head))
1396  {
1397  $this->tpl->setCurrentBlock("kiosk_options");
1398  $this->tpl->setVariable("KIOSK_HEAD", $head);
1399  $this->tpl->parseCurrentBlock();
1400  }
1401  }
1402 
1403  if (($this->object->getInstantFeedbackSolution() == 1) || ($this->object->getAnswerFeedback() == 1) || ($this->object->getAnswerFeedbackPoints() == 1))
1404  {
1405  $this->tpl->setCurrentBlock("direct_feedback");
1406  $this->tpl->setVariable("TEXT_DIRECT_FEEDBACK", $this->lng->txt("check"));
1407  $this->tpl->parseCurrentBlock();
1408  }
1409 
1410  $postpone = false;
1411  if ($this->object->getSequenceSettings() == TEST_POSTPONE)
1412  {
1413  $postpone = true;
1414  }
1415 
1416  if ($this->object->getEnableProcessingTime())
1417  {
1418  $this->outProcessingTime($this->object->getTestSession()->getActiveId());
1419  }
1420 
1421  $this->tpl->setVariable("FORM_TIMESTAMP", time());
1422  $directfeedback = 0;
1423  if (strcmp($_GET["activecommand"], "directfeedback") == 0) $directfeedback = 1;
1424  $this->outWorkingForm($this->sequence, $this->object->getTestId(), $postpone, $directfeedback, $show_summary);
1425  $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1426  }
1427 
1436  {
1437  global $ilUser;
1438 
1439  // check if user is invited to participate
1440  $user = $this->object->getInvitedUsers($ilUser->getId());
1441  if (!is_array ($user) || count($user)!=1)
1442  {
1443  ilUtil::sendInfo($this->lng->txt("user_not_invited"), true);
1444  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1445  }
1446 
1447  $user = array_pop($user);
1448  // check if client ip is set and if current remote addr is equal to stored client-ip
1449  if (strcmp($user["clientip"],"")!=0 && strcmp($user["clientip"],$_SERVER["REMOTE_ADDR"])!=0)
1450  {
1451  ilUtil::sendInfo($this->lng->txt("user_wrong_clientip"), true);
1452  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1453  }
1454  }
1455 
1456 
1460  function isTestAccessible()
1461  {
1462  return !$this->isNrOfTriesReached()
1463  and !$this->isMaxProcessingTimeReached()
1464  and $this->object->startingTimeReached()
1465  and !$this->object->endingTimeReached();
1466  }
1467 
1472  {
1473  return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->object->getTestSession()->getPass());
1474  }
1475 
1483  function passDetails()
1484  {
1485  if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1486  {
1487  $this->ctrl->saveParameter($this, "pass");
1488  $this->ctrl->saveParameter($this, "active_id");
1489  $this->outTestResults(false, $_GET["pass"]);
1490  }
1491  else
1492  {
1493  $this->outTestResults(false);
1494  }
1495  }
1496 
1502  function endingTimeReached()
1503  {
1504  ilUtil::sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->object->getEndingTime())));
1505  $this->object->getTestSession()->increasePass();
1506  $this->object->getTestSession()->setLastSequence(0);
1507  $this->object->getTestSession()->saveToDb();
1508  if (!$this->object->canViewResults())
1509  {
1510  $this->outIntroductionPage();
1511  }
1512  else
1513  {
1514  $this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
1515  }
1516  }
1517 
1526  {
1527  $this->outIntroductionPage();
1528  }
1529 
1536  {
1537  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "Modules/Test");
1538  $this->tpl->setCurrentBlock("adm_content");
1539  if ($this->object->isTestFinished($this->object->getTestSession()->getActiveId()))
1540  {
1541  $this->tpl->setCurrentBlock("not_submit_allowed");
1542  $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1543  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1544  } else
1545  {
1546  $this->tpl->setCurrentBlock("submit_allowed");
1547  $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1548  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1549  }
1550  $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1551  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1552  $this->tpl->parseCurrentBlock();
1553  }
1554 
1555  function outProcessingTime($active_id)
1556  {
1557  global $ilUser;
1558 
1559  $starting_time = $this->object->getStartingTimeOfUser($active_id);
1560  $processing_time = $this->object->getProcessingTimeInSeconds($active_id);
1561  $processing_time_minutes = floor($processing_time / 60);
1562  $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1563  $str_processing_time = "";
1564  if ($processing_time_minutes > 0)
1565  {
1566  $str_processing_time = $processing_time_minutes . " " . $this->lng->txt("minutes");
1567  }
1568  if ($processing_time_seconds > 0)
1569  {
1570  if (strlen($str_processing_time) > 0) $str_processing_time .= " " . $this->lng->txt("and") . " ";
1571  $str_processing_time .= $processing_time_seconds . " " . $this->lng->txt("seconds");
1572  }
1573  $time_left = $starting_time + $processing_time - mktime();
1574  $time_left_minutes = floor($time_left / 60);
1575  $time_left_seconds = $time_left - $time_left_minutes * 60;
1576  $str_time_left = "";
1577  if ($time_left_minutes > 0)
1578  {
1579  $str_time_left = $time_left_minutes . " " . $this->lng->txt("minutes");
1580  }
1581  if ($time_left < 300)
1582  {
1583  if ($time_left_seconds > 0)
1584  {
1585  if (strlen($str_time_left) > 0) $str_time_left .= " " . $this->lng->txt("and") . " ";
1586  $str_time_left .= $time_left_seconds . " " . $this->lng->txt("seconds");
1587  }
1588  }
1589  $date = getdate($starting_time);
1590  $formattedStartingTime = ilDatePresentation::formatDate(new ilDateTime($date,IL_CAL_FKT_GETDATE));
1591  /*
1592  $formattedStartingTime = ilFormat::formatDate(
1593  $date["year"]."-".
1594  sprintf("%02d", $date["mon"])."-".
1595  sprintf("%02d", $date["mday"])." ".
1596  sprintf("%02d", $date["hours"]).":".
1597  sprintf("%02d", $date["minutes"]).":".
1598  sprintf("%02d", $date["seconds"])
1599  );
1600  */
1601  $datenow = getdate();
1602  $this->tpl->setCurrentBlock("enableprocessingtime");
1603  $this->tpl->setVariable("USER_WORKING_TIME",
1604  sprintf(
1605  $this->lng->txt("tst_time_already_spent"),
1606  $formattedStartingTime,
1607  $str_processing_time
1608  )
1609  );
1610  $this->tpl->setVariable("USER_REMAINING_TIME", sprintf($this->lng->txt("tst_time_already_spent_left"), $str_time_left));
1611  $this->tpl->parseCurrentBlock();
1612  $template = new ilTemplate("tpl.workingtime.js.html", TRUE, TRUE, TRUE);
1613  $template->setVariable("STRING_MINUTE", $this->lng->txt("minute"));
1614  $template->setVariable("STRING_MINUTES", $this->lng->txt("minutes"));
1615  $template->setVariable("STRING_SECOND", $this->lng->txt("second"));
1616  $template->setVariable("STRING_SECONDS", $this->lng->txt("seconds"));
1617  $template->setVariable("STRING_TIMELEFT", $this->lng->txt("tst_time_already_spent_left"));
1618  $template->setVariable("AND", strtolower($this->lng->txt("and")));
1619  $template->setVariable("YEAR", $date["year"]);
1620  $template->setVariable("MONTH", $date["mon"]-1);
1621  $template->setVariable("DAY", $date["mday"]);
1622  $template->setVariable("HOUR", $date["hours"]);
1623  $template->setVariable("MINUTE", $date["minutes"]);
1624  $template->setVariable("SECOND", $date["seconds"]);
1625  if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->object->getEndingTime(), $matches))
1626  {
1627  $template->setVariable("ENDYEAR", $matches[1]);
1628  $template->setVariable("ENDMONTH", $matches[2]-1);
1629  $template->setVariable("ENDDAY", $matches[3]);
1630  $template->setVariable("ENDHOUR", $matches[4]);
1631  $template->setVariable("ENDMINUTE", $matches[5]);
1632  $template->setVariable("ENDSECOND", $matches[6]);
1633  }
1634  $template->setVariable("YEARNOW", $datenow["year"]);
1635  $template->setVariable("MONTHNOW", $datenow["mon"]-1);
1636  $template->setVariable("DAYNOW", $datenow["mday"]);
1637  $template->setVariable("HOURNOW", $datenow["hours"]);
1638  $template->setVariable("MINUTENOW", $datenow["minutes"]);
1639  $template->setVariable("SECONDNOW", $datenow["seconds"]);
1640  $template->setVariable("PTIME_M", $processing_time_minutes);
1641  $template->setVariable("PTIME_S", $processing_time_seconds);
1642 
1643  $this->tpl->setCurrentBlock("HeadContent");
1644  $this->tpl->setVariable("CONTENT_BLOCK", $template->get());
1645  $this->tpl->parseCurrentBlock();
1646  }
1647 
1651  public function outQuestionSummary($fullpage = true)
1652  {
1653  if ($fullpage) $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_question_summary.html", "Modules/Test");
1654  $active_id = $this->object->getTestSession()->getActiveId();
1655  $result_array = & $this->object->getTestSequence()->getSequenceSummary();
1656  $marked_questions = array();
1657  if ($this->object->getKioskMode() && $fullpage)
1658  {
1659  $head = $this->getKioskHead();
1660  if (strlen($head))
1661  {
1662  $this->tpl->setCurrentBlock("kiosk_options");
1663  $this->tpl->setVariable("KIOSK_HEAD", $head);
1664  $this->tpl->parseCurrentBlock();
1665  }
1666  }
1667  if ($this->object->getShowMarker())
1668  {
1669  include_once "./Modules/Test/classes/class.ilObjTest.php";
1670  $marked_questions = ilObjTest::_getSolvedQuestions($active_id);
1671  }
1672  $data = array();
1673  foreach ($result_array as $key => $value)
1674  {
1675  $this->ctrl->setParameter($this, "sequence", $value["sequence"]);
1676  $href = $this->ctrl->getLinkTargetByClass(get_class($this), "gotoQuestion");
1677  $this->tpl->setVariable("VALUE_QUESTION_TITLE", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "gotoQuestion")."\">" . $this->object->getQuestionTitle($value["title"]) . "</a>");
1678  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1679  $description = "";
1680  if ($this->object->getListOfQuestionsDescription())
1681  {
1682  $description = $value["description"];
1683  }
1684  $points = "";
1685  if (!$this->object->getTitleOutput())
1686  {
1687  $points = $value["points"]."&nbsp;".$this->lng->txt("points_short");
1688  }
1689  $marked = false;
1690  if (count($marked_questions))
1691  {
1692  if (array_key_exists($value["qid"], $marked_questions))
1693  {
1694  $obj = $marked_questions[$value["qid"]];
1695  if ($obj["solved"] == 1)
1696  {
1697  $marked = true;
1698  }
1699  }
1700  }
1701  array_push($data, array(
1702  'order' => $value["nr"],
1703  'href' => $href,
1704  'title' => $this->object->getQuestionTitle($value["title"]),
1705  'description' => $description,
1706  'worked_through' => ($value["worked_through"]) ? true : false,
1707  'postponed' => ($value["postponed"]) ? $this->lng->txt("postponed") : '',
1708  'points' => $points,
1709  'marked' => $marked,
1710  'sequence' => $value["sequence"]
1711  ));
1712  }
1713  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1714  if ($fullpage)
1715  {
1716  include_once "./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
1717  $table_gui = new ilListOfQuestionsTableGUI($this, 'backFromSummary', !$this->object->getTitleOutput(), $this->object->getShowMarker());
1718  $table_gui->setData($data);
1719  $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1720  if ($this->object->getEnableProcessingTime()) $this->outProcessingTime($active_id);
1721  }
1722  else
1723  {
1724  $template = new ilTemplate('tpl.il_as_tst_list_of_questions_short.html', true, true, 'Modules/Test');
1725  foreach ($data as $row)
1726  {
1727  if (strlen($row['description']))
1728  {
1729  $template->setCurrentBlock('description');
1730  $template->setVariable("DESCRIPTION", $row['description']);
1731  $template->parseCurrentBlock();
1732  }
1733  $template->setCurrentBlock('item');
1734  $active = ($row['sequence'] == $this->sequence) ? ' active' : '';
1735  $template->setVariable('CLASS', ($row['walked_through']) ? ('answered'.$active) : ('unanswered'.$active));
1736  $template->setVariable('ITEM', ilUtil::prepareFormOutput($row['title']));
1737  $template->setVariable('SEQUENCE', $row['sequence']);
1738  $template->parseCurrentBlock();
1739  }
1740  $template->setVariable('LIST_OF_QUESTIONS', $this->lng->txt('list_of_questions'));
1741  $this->tpl->setVariable('LIST_OF_QUESTIONS', $template->get());
1742  }
1743  }
1744 
1746  {
1747  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_max_allowed_users_reached.html", "Modules/Test");
1748  $this->tpl->setCurrentBlock("adm_content");
1749  $this->tpl->setVariable("MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt("tst_max_allowed_users_message"), $this->object->getAllowedUsersTimeGap()));
1750  $this->tpl->setVariable("MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt("tst_max_allowed_users_heading"), $this->object->getAllowedUsersTimeGap()));
1751  $this->tpl->setVariable("BACK_TO_INTRODUCTION", $this->lng->txt("tst_results_back_introduction"));
1752  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1753  $this->tpl->parseCurrentBlock();
1754  }
1755 
1757  {
1758  global $ilUser;
1759  if ($this->object->getShowSolutionAnwersBeforeFinish())
1760  {
1761  $template = new ilTemplate("tpl.il_as_tst_finish_navigation.html", TRUE, TRUE, "Modules/Test");
1762  $template->setVariable("BUTTON_FINISH", $this->lng->txt("btn_next"));
1763  $template->setVariable("BUTTON_CANCEL", $this->lng->txt("btn_previous"));
1764 
1765  $template_top = new ilTemplate("tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE, "Modules/Test");
1766  $template_top->setCurrentBlock("button_print");
1767  $template_top->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
1768  $template_top->parseCurrentBlock();
1769  $active_id = $this->object->getTestSession()->getActiveId();
1770  return $this->showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
1771  }
1772  else
1773  {
1774  $this->ctrl->redirect($this, 'gotoQuestion');
1775  }
1776  }
1777 
1779  {
1780  $this->confirmFinishTest();
1781  }
1782 
1789  {
1790  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1791 
1792  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1793  $this->tpl->setCurrentBlock("ContentStyle");
1794  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1795  $this->tpl->parseCurrentBlock();
1796 
1797  $this->tpl->setCurrentBlock("SyntaxStyle");
1798  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1799  $this->tpl->parseCurrentBlock();
1800 
1801  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1802  if ($this->object->getShowSolutionAnswersOnly())
1803  {
1804  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1805  }
1806 
1807  $this->tpl->setCurrentBlock("adm_content");
1808  $solution = $this->getCorrectSolutionOutput($_GET["evaluation"], $_GET["active_id"], $_GET["pass"]);
1809  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1810  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1811  $this->ctrl->saveParameter($this, "pass");
1812  $this->ctrl->saveParameter($this, "active_id");
1813  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1814  $this->tpl->parseCurrentBlock();
1815  }
1816 
1826  function showListOfAnswers($active_id, $pass = NULL, $top_data = "", $bottom_data = "")
1827  {
1828  global $ilUser;
1829 
1830  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "Modules/Test");
1831 
1832  $result_array =& $this->object->getTestResult($active_id, $pass, FALSE);
1833 
1834  $counter = 1;
1835  // output of questions with solutions
1836 
1837  $exam_pdf = $this->object->getExamPdf();
1838 
1852  $active = $this->object->getTestSession();
1853 
1854  if ($exam_pdf)
1855  {
1856  $ra_date = date("Y-m-d");
1857  $ra_test_filename = $ra_date."_".$active->test_id."_".$ilUser->login;
1858  $ra_test_file = "resarchiver/output_html/".$ra_test_filename;
1859  $result_output_file = fopen ($ra_test_file.".cache", "w");
1860  }
1861 
1862  foreach ($result_array as $question_data)
1863  {
1864  $question = $question_data["qid"];
1865  if (is_numeric($question))
1866  {
1867  $this->tpl->setCurrentBlock("printview_question");
1868  $question_gui = $this->object->createQuestionGUI("", $question);
1869 
1870  $this->tpl->setVariable("COUNTER_QUESTION", $counter.". ");
1871  if ($exam_pdf)
1872  {
1873  $result_output_stream .= "<br><hr><div class=\"questionMetadata\"><br>Titel: " . htmlentities($question_gui->object->getTitle(), ENT_QUOTES, "UTF-8") . "<br>Frage Nr. ".$counter. "<br>QID " .($question) . "</div>";
1874  }
1875 
1876  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
1877  $template->setVariable("COUNTER_QUESTION", $counter.". ");
1878  $template->setVariable("QUESTION_ID", $question);
1879  $template->setVariable("QUESTION_TITLE", $this->object->getTitleOutput()== 2 ? $this->lng->txt("ass_question") :$question_gui->object->getTitle());
1880 
1881  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
1882  $result_output = $question_gui->getSolutionOutput($active_id, $pass, FALSE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback());
1883  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1884  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1885  $this->tpl->parseCurrentBlock();
1886  $counter++;
1887 
1888  if ($exam_pdf)
1889  {
1890  // Images with full http paths (grr...)
1891  $result_output_clean = $result_output;
1892  //$result_output_clean = preg_replace('/src=\"http.*?\/data\//i','src="./data/',$result_output);
1893  $result_output_clean = preg_replace('/xmlns:xhtml=\".*?\"/i','',$result_output_clean);
1894  //$result_output_clean = preg_replace('/src=\"http.*?\/templates\//i','src="./templates/',$result_output_clean);
1895  //$result_output_clean = preg_replace('/src=\"http.*?\/Customizing\//i','src="./Customizing/',$result_output_clean);
1896 
1897  // rap : UTF-Cleaner, strips out quotes and other horrible stuff
1898  $result_output_clean = preg_replace(
1899  '/([\xc0-\xdf].)/se',
1900  "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'",
1901  $result_output_clean
1902  );
1903  $result_output_clean = preg_replace(
1904  '/([\xe0-\xef]..)/se',
1905  "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'",
1906  $result_output_clean
1907  );
1908  $result_output_stream .= iconv("UTF-8", "ISO-8859-1", $result_output_clean);
1909  }
1910  }
1911  }
1912  if ($exam_pdf)
1913  {
1914  fwrite($result_output_file, $result_output_stream);
1915  fclose($result_output_file);
1916  }
1917 
1918  /*
1919  foreach ($result_array as $question_data)
1920  {
1921  $question = $question_data["qid"];
1922  if (is_numeric($question))
1923  {
1924  $this->tpl->setCurrentBlock("printview_question");
1925  $question_gui = $this->object->createQuestionGUI("", $question);
1926  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
1927  $template->setVariable("COUNTER_QUESTION", $counter.". ");
1928  $template->setVariable("QUESTION_TITLE", $question_gui->object->getTitle());
1929 
1930  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
1931  $result_output = $question_gui->getSolutionOutput($active_id, $pass, FALSE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback());
1932  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1933  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1934  $this->tpl->parseCurrentBlock();
1935  $counter ++;
1936  }
1937  }
1938  */
1939 
1940  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1941  if ($this->object->getShowSolutionAnswersOnly())
1942  {
1943  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1944  }
1945  if (strlen($top_data))
1946  {
1947  $this->tpl->setCurrentBlock("top_data");
1948  $this->tpl->setVariable("TOP_DATA", $top_data);
1949  $this->tpl->parseCurrentBlock();
1950  }
1951 
1952  if (strlen($bottom_data))
1953  {
1954  $this->tpl->setCurrentBlock("bottom_data");
1955  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1956  $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
1957  $this->tpl->parseCurrentBlock();
1958  }
1959 
1960  $this->tpl->setCurrentBlock("adm_content");
1961  $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
1962  $user_data = $this->getResultsUserdata($active_id, TRUE);
1963  $signature = $this->getResultsSignature();
1964  $this->tpl->setVariable("USER_DETAILS", $user_data);
1965  $this->tpl->setVariable("SIGNATURE", $signature);
1966  $this->tpl->setVariable("TITLE", $this->object->getTitle());
1967  $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
1968  $invited_user =& $this->object->getInvitedUsers($ilUser->getId());
1969  $pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
1970  ": " . $invited_user[$ilUser->getId()]["clientip"] . " - " .
1971  $this->lng->txt("matriculation") . ": " .
1972  $invited_user[$ilUser->getId()]["matriculation"];
1973  $this->tpl->setVariable("PAGETITLE", $pagetitle);
1974  $this->tpl->parseCurrentBlock();
1975  }
1976 
1983  private function getContentBlockName()
1984  {
1985  if ($this->object->getKioskMode())
1986  {
1987  $this->tpl->setBodyClass("kiosk");
1988  $this->tpl->setAddFooter(FALSE);
1989  return "CONTENT";
1990  }
1991  else
1992  {
1993  return "ADM_CONTENT";
1994  }
1995  }
1996 
1998  {
1999  $this->ctrl->redirectByClass("iltestevaluationgui", "outUserResultsOverview");
2000  }
2001 
2003  {
2004  $this->ctrl->redirectByClass("iltestevaluationgui", "outUserListOfAnswerPasses");
2005  }
2006 
2007 }
2008 ?>