5 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
6 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
7 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
45 $this->ref_id =
$_GET[
"ref_id"];
56 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
58 $tagging_gui->setObject($this->object->getId(), $this->
object->getType());
59 $tagging_gui->saveInput();
60 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
70 $cmd = $this->ctrl->getCmd();
71 $next_class = $this->ctrl->getNextClass($this);
73 $this->ctrl->saveParameter($this,
"sequence");
74 $this->ctrl->saveParameter($this,
"active_id");
76 if (preg_match(
"/^gotoquestion_(\\d+)$/",
$cmd, $matches))
78 $cmd =
"gotoquestion";
79 if (strlen($matches[1]))
81 $this->ctrl->setParameter($this,
'gotosequence', $matches[1]);
86 if (
$_GET[
"active_id"])
88 $this->
object->setTestSession(
$_GET[
"active_id"]);
92 $this->
object->setTestSession();
95 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
97 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
104 case 'ilassquestionhintrequestgui':
106 $questionGUI = $this->
object->createQuestionGUI(
107 "", $this->object->getTestSequence()->getQuestionForSequence( $this->
calculateSequence() )
110 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
113 $ret = $this->ctrl->forwardCommand($gui);
119 $ret =& $this->
$cmd();
132 $ilCtrl->redirectByClass(
'ilTestToplistGUI',
'outResultsToplist');
134 #require_once 'Modules/Test/classes/class.ilTestToplistGUI.php';
135 #$gui = new ilTestToplistGUI($this);
136 #return $this->ctrl->forwardCommand($gui);
147 $this->
object->updateWorkingTime(
$_SESSION[
"active_time_id"]);
157 $this->saveResult = FALSE;
160 $formtimestamp =
$_POST[
"formtimestamp"];
161 if (strlen($formtimestamp) == 0) $formtimestamp =
$_GET[
"formtimestamp"];
162 if ($formtimestamp !=
$_SESSION[
"formtimestamp"])
164 $_SESSION[
"formtimestamp"] = $formtimestamp;
175 $q_id = $this->
object->getTestSequence()->getQuestionForSequence(
$_GET[
"sequence"]);
176 if (is_numeric($q_id) && (
int)$q_id)
180 $question_gui = $this->
object->createQuestionGUI(
"", $q_id);
181 if ($this->object->getJavaScriptOutput())
186 $active_id = $this->
object->getTestSession()->getActiveId();
187 if ($this->object->isRandomTest())
189 $pass = $this->
object->_getPass($active_id);
191 $this->saveResult = $question_gui->object->persistWorkingState(
192 $active_id,
$pass, $this->object->areObligationsEnabled()
200 if ($this->saveResult == FALSE)
202 $this->ctrl->setParameter($this,
"save_error",
"1");
230 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
244 $active_id = $this->
object->getTestSession()->getActiveId();
245 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
246 if ($starting_time === FALSE)
252 return $this->
object->isMaxProcessingTimeReached($starting_time);
265 $_SESSION[
"active_time_id"]= $this->
object->startWorkingTime($this->object->getTestSession()->getActiveId(),
266 $this->
object->getTestSession()->getPass()
272 if ($this->object->getListOfQuestions())
277 $question_gui = $this->
object->createQuestionGUI(
"", $this->object->getTestSequence()->getQuestionForSequence(
$sequence));
279 if ($this->object->getJavaScriptOutput())
284 $is_postponed = $this->
object->getTestSequence()->isPostponedQuestion($question_gui->object->getId());
285 $this->ctrl->setParameter($this,
"sequence",
"$sequence");
286 $formaction = $this->ctrl->getFormAction($this,
"gotoQuestion");
288 $question_gui->setSequenceNumber($this->object->getTestSequence()->getPositionOfSequence(
$sequence));
289 $question_gui->setQuestionCount($this->object->getTestSequence()->getUserQuestionCount());
293 $user_post_solution = FALSE;
294 if (array_key_exists(
"previouspost",
$_SESSION))
296 $user_post_solution =
$_SESSION[
"previouspost"];
300 global $ilNavigationHistory;
301 $ilNavigationHistory->addItem(
$_GET[
"ref_id"], $this->ctrl->getLinkTarget($this,
"resume"),
"tst");
306 $answer_feedback = FALSE;
307 if (($directfeedback) && ($this->
object->getSpecificAnswerFeedback()))
309 $answer_feedback = TRUE;
314 $question_gui->outQuestionForTest(
315 $formaction, #form_action
316 $this->object->getTestSession()->getActiveId(), #active_id
318 $is_postponed, #is_postponed
319 $user_post_solution, #user_post_solution
320 $answer_feedback #answer_feedback == inline_specific_feedback
333 if ($this->object->getInstantFeedbackSolution())
338 $solutionoutput = $question_gui->getSolutionOutput(
339 $this->object->getTestSession()->getActiveId(), #active_id
341 FALSE, #graphical_output
342 $show_question_inline_score, #result_output
343 FALSE, #show_question_only
344 FALSE, #show_feedback
345 TRUE, #show_correct_solution
346 FALSE, #show_manual_scoring
347 FALSE #show_question_text
354 if ($this->object->getAnswerFeedbackPoints())
356 $reachedPoints = $question_gui->object->getAdjustedReachedPoints($this->object->getTestSession()->getActiveId(), NULL);
357 $maxPoints = $question_gui->object->getMaximumPoints();
364 if ($this->object->getGenericAnswerFeedback())
371 if ($this->object->getSpecificAnswerFeedback())
379 if ($postpone_allowed && !$is_postponed)
384 if ($this->object->getListOfQuestions())
386 if (!(($finish) && ($this->object->getListOfQuestionsEnd())))
392 if ($this->object->getShowCancel())
399 if ($this->object->getListOfQuestionsEnd())
413 if ($this->object->getShowMarker())
415 include_once
"./Modules/Test/classes/class.ilObjTest.php";
419 if (count ($solved_array) > 0)
421 $solved = array_pop($solved_array);
422 $solved = $solved[
"solved"];
435 if ($this->object->getJavaScriptOutput())
438 $this->tpl->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"disable_javascript"));
439 $this->tpl->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"disable_javascript"));
440 $this->ctrl->setParameter($this,
"tst_javascript",
"0");
441 $this->tpl->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this,
"gotoQuestion"));
446 $this->tpl->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"enable_javascript"));
447 $this->tpl->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"enable_javascript"));
448 $this->ctrl->setParameter($this,
"tst_javascript",
"1");
449 $this->tpl->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this,
"gotoQuestion"));
452 if ($question_gui->object->supportsJavascriptOutput() && !$this->
object->getForceJS())
454 $this->tpl->touchBlock(
"jsswitch");
459 $this->tpl->setVariable(
"AUTOSAVE_URL", $this->ctrl->getFormAction($this,
"autosave",
"",
true));
461 if ($question_gui->isAutosaveable()&& $this->
object->getAutosave())
463 $this->tpl->touchBlock(
'autosave');
467 $this->tpl->setVariable(
"AUTOSAVEFORMACTION", str_replace(
"&",
"&", $this->ctrl->getLinkTarget($this,
"autosave")));
468 $this->tpl->setVariable(
"AUTOSAVEINTERVAL", $this->object->getAutosaveIval());
473 $this->tpl->touchBlock(
'question_obligatory');
474 $this->tpl->setVariable(
'QUESTION_OBLIGATORY', $this->lng->txt(
'required_field'));
480 $show_question_inline_score = FALSE;
481 if ($this->object->getAnswerFeedbackPoints())
483 $show_question_inline_score = TRUE;
484 return $show_question_inline_score;
486 return $show_question_inline_score;
503 $this->tpl->setCurrentBlock(
"isnotmarked" );
505 $this->tpl->setVariable(
"TEXT_UNSET", $this->lng->txt(
"tst_question_mark" ) );
506 $this->tpl->parseCurrentBlock();
511 $this->tpl->setCurrentBlock(
"ismarked" );
513 $this->tpl->setVariable(
"TEXT_SET", $this->lng->txt(
"tst_remove_mark" ) );
514 $this->tpl->parseCurrentBlock();
525 $this->tpl->setCurrentBlock(
"next_bottom" );
526 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"save_next" ) .
" >>" );
527 $this->tpl->parseCurrentBlock();
532 $this->tpl->setCurrentBlock(
"next" );
533 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"save_next" ) .
" >>" );
534 $this->tpl->parseCurrentBlock();
539 return $this->
object->getTestSequence()->getQuestionForSequence( $this->object->getTestSequence()
541 ) == $question_gui->object->getId();
552 $this->tpl->setCurrentBlock(
"next_bottom" );
553 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"save_finish" ) .
" >>" );
554 $this->tpl->parseCurrentBlock();
559 $this->tpl->setCurrentBlock(
"next" );
560 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"save_finish" ) .
" >>" );
561 $this->tpl->parseCurrentBlock();
572 $this->tpl->setCurrentBlock(
"next_bottom" );
573 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"question_summary" ) .
" >>" );
574 $this->tpl->parseCurrentBlock();
579 $this->tpl->setCurrentBlock(
"next" );
580 $this->tpl->setVariable(
"BTN_NEXT", $this->lng->txt(
"question_summary" ) .
" >>" );
581 $this->tpl->parseCurrentBlock();
586 $this->tpl->setCurrentBlock(
"cancel_test" );
587 $this->tpl->setVariable(
"TEXT_CANCELTEST", $this->lng->txt(
"cancel_test" ) );
588 $this->tpl->setVariable(
"TEXT_ALTCANCELTEXT", $this->lng->txt(
"cancel_test" ) );
589 $this->tpl->setVariable(
"TEXT_TITLECANCELTEXT", $this->lng->txt(
"cancel_test" ) );
590 $this->tpl->setVariable(
"HREF_IMGCANCELTEST",
591 $this->ctrl->getLinkTargetByClass( get_class( $this ),
"outIntroductionPage"
592 ) .
"&cancelTest=true"
594 $this->tpl->setVariable(
"HREF_CANCELTEXT",
595 $this->ctrl->getLinkTargetByClass( get_class( $this ),
"outIntroductionPage"
596 ) .
"&cancelTest=true"
599 $this->tpl->parseCurrentBlock();
610 $this->tpl->setCurrentBlock(
"summary_bottom" );
611 $this->tpl->setVariable(
"BTN_SUMMARY", $this->lng->txt(
"question_summary" ) );
612 $this->tpl->parseCurrentBlock();
617 $this->tpl->setCurrentBlock(
"summary" );
618 $this->tpl->setVariable(
"BTN_SUMMARY", $this->lng->txt(
"question_summary" ) );
619 $this->tpl->parseCurrentBlock();
630 $this->tpl->setCurrentBlock(
"postpone_bottom" );
631 $this->tpl->setVariable(
"BTN_POSTPONE", $this->lng->txt(
"postpone" ) );
632 $this->tpl->parseCurrentBlock();
637 $this->tpl->setCurrentBlock(
"postpone" );
638 $this->tpl->setVariable(
"BTN_POSTPONE", $this->lng->txt(
"postpone" ) );
639 $this->tpl->parseCurrentBlock();
644 return $sequence == $this->
object->getTestSequence()->getFirstSequence();
655 $this->tpl->setCurrentBlock(
"prev_bottom" );
656 $this->tpl->setVariable(
"BTN_PREV",
"<< " . $this->lng->txt(
"save_previous" ) );
657 $this->tpl->parseCurrentBlock();
662 $this->tpl->setCurrentBlock(
"prev" );
663 $this->tpl->setVariable(
"BTN_PREV",
"<< " . $this->lng->txt(
"save_previous" ) );
664 $this->tpl->parseCurrentBlock();
675 $this->tpl->setCurrentBlock(
"prev_bottom" );
676 $this->tpl->setVariable(
"BTN_PREV",
"<< " . $this->lng->txt(
"save_introduction" ) );
677 $this->tpl->parseCurrentBlock();
682 $this->tpl->setCurrentBlock(
"prev" );
683 $this->tpl->setVariable(
"BTN_PREV",
"<< " . $this->lng->txt(
"save_introduction" ) );
684 $this->tpl->parseCurrentBlock();
689 $this->tpl->setCurrentBlock(
"specific_feedback" );
690 $this->tpl->setVariable(
"SPECIFIC_FEEDBACK",
691 $question_gui->getSpecificFeedbackOutput(
692 $this->object->getTestSession()->getActiveId(),
696 $this->tpl->parseCurrentBlock();
701 $this->tpl->setCurrentBlock(
"answer_feedback" );
702 $this->tpl->setVariable(
"ANSWER_FEEDBACK",
703 $question_gui->getAnswerFeedbackOutput( $this->object->getTestSession()->getActiveId(),
707 $this->tpl->parseCurrentBlock();
712 $this->tpl->setCurrentBlock(
"solution_output" );
713 $this->tpl->setVariable(
"RECEIVED_POINTS_INFORMATION",
714 sprintf( $this->lng->txt(
"you_received_a_of_b_points" ), $reachedPoints, $maxPoints )
716 $this->tpl->parseCurrentBlock();
721 $this->tpl->setCurrentBlock(
"solution_output" );
722 $this->tpl->setVariable(
"CORRECT_SOLUTION", $this->lng->txt(
"tst_best_solution_is" ) );
723 $this->tpl->setVariable(
"QUESTION_FEEDBACK", $solutionoutput );
724 $this->tpl->parseCurrentBlock();
730 $show_side_list = $ilUser->getPref(
'side_list_of_questions' );
731 $this->tpl->setCurrentBlock(
'view_sidelist' );
732 $this->tpl->setVariable(
'IMAGE_SIDELIST',
736 $this->tpl->setVariable(
'TEXT_SIDELIST',
737 ($show_side_list) ? $this->lng->txt(
'tst_hide_side_list'
738 ) : $this->lng->txt(
'tst_show_side_list' )
740 $this->tpl->parseCurrentBlock();
750 $this->tpl->setCurrentBlock(
"SyntaxStyle" );
751 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
754 $this->tpl->parseCurrentBlock();
759 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
760 $this->tpl->setCurrentBlock(
"ContentStyle" );
761 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
764 $this->tpl->parseCurrentBlock();
774 $template =
new ilTemplate(
"tpl.il_as_tst_password_protection.html", TRUE, TRUE,
"Modules/Test");
775 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"checkPassword"));
776 $template->setVariable(
"PASSWORD_INTRODUCTION", $this->lng->txt(
"tst_password_introduction"));
777 $template->setVariable(
"TEXT_PASSWORD", $this->lng->txt(
"tst_password"));
778 $template->setVariable(
"SUBMIT", $this->lng->txt(
"submit"));
789 if (strcmp($this->object->getPassword(),
$_POST[
"password"]) == 0)
792 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
794 $ilUser->setPref(
"tst_password_".$this->object->getTestId(), $this->
object->getPassword());
795 $ilUser->writePref(
"tst_password_".$this->object->getTestId(), $this->
object->getPassword());
799 $_SESSION[
'tst_password_'.$this->object->getTestId()] = $this->
object->getPassword();
801 $this->ctrl->redirect($this,
"start");
806 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
819 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
821 $this->
object->setAccessCodeSession(
$_POST[
"anonymous_id"]);
823 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
840 $this->ctrl->redirect($this,
"startTest");
844 $this->ctrl->redirectByClass(
"ilobjtestgui",
"redirectToInfoScreen");
855 if ($this->object->checkMaximumAllowedUsers() == FALSE)
859 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
861 $this->
object->setAccessCodeSession($this->object->createNewAccessCode());
865 $this->
object->unsetAccessCodeSession();
867 if (strlen($this->object->getPassword()))
873 if(
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID )
875 $pwd = $ilUser->getPref(
"tst_password_".$this->object->getTestId());
877 elseif( isset(
$_SESSION[
'tst_password_'.$this->object->getTestId()]) )
879 $pwd =
$_SESSION[
'tst_password_'.$this->object->getTestId()];
882 if ((strcmp($pwd, $this->object->getPassword()) != 0) && (!$rbacsystem->checkAccess(
"write", $this->object->getRefId())))
887 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
889 $this->ctrl->redirect($this,
"displayCode");
893 $this->ctrl->setParameter($this,
"activecommand",
"start");
894 $this->ctrl->redirect($this,
"redirectQuestion");
900 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_anonymous_code_presentation.html",
"Modules/Test");
901 $this->tpl->setCurrentBlock(
"adm_content");
902 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt(
"tst_access_code_created"));
903 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE", $this->object->getAccessCodeSession());
904 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
905 $this->tpl->setVariable(
"CONTINUE", $this->lng->txt(
"continue_work"));
906 $this->tpl->parseCurrentBlock();
911 $this->ctrl->setParameter($this,
"activecommand",
"start");
912 $this->ctrl->redirect($this,
"redirectQuestion");
924 if ($this->object->checkMaximumAllowedUsers() == FALSE)
929 $this->ctrl->setParameter($this,
"activecommand",
"resume");
930 $this->ctrl->redirect($this,
"redirectQuestion");
940 if (
$_POST[
"chb_javascript"])
942 $ilUser->writePref(
"tst_javascript", 1);
946 $ilUser->writePref(
"tst_javascript", 0);
950 if ($this->object->getNrOfTries() != 1)
952 if ($this->object->getUsePreviousAnswers() == 1)
954 if (
$_POST[
"chb_use_previous_answers"])
956 $ilUser->writePref(
"tst_use_previous_answers", 1);
960 $ilUser->writePref(
"tst_use_previous_answers", 0);
984 $executable = $this->
object->isExecutable($ilUser->getId());
985 if (!$executable[
"executable"])
988 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
990 switch (
$_GET[
"activecommand"])
994 if ($this->sequence === FALSE)
996 if ($this->object->getListOfQuestionsEnd())
1000 $this->object->getTestSession()->getTestId(),
1001 $this->
object->getTestSession()->getActiveId(),
1002 $this->
object->getTestSession()->getPass()
1005 if( $this->object->areObligationsEnabled() && !$allObligationsAnswered )
1007 $this->ctrl->redirect($this,
"outQuestionSummaryWithObligationsInfo");
1014 $this->ctrl->redirect($this,
"finishTest");
1019 $this->
object->getTestSession()->setLastSequence($this->sequence);
1020 $this->
object->getTestSession()->saveToDb();
1026 $this->
object->getTestSession()->setLastSequence($this->sequence);
1027 $this->
object->getTestSession()->saveToDb();
1028 if ($this->sequence === FALSE)
1030 $this->ctrl->redirect($this,
"outIntroductionPage");
1039 $nextSequence = $this->
object->getTestSequence()->getNextSequence($this->sequence);
1040 $this->
object->getTestSequence()->postponeSequence($this->sequence);
1041 $this->
object->getTestSequence()->saveToDb();
1042 $this->
object->getTestSession()->setLastSequence($nextSequence);
1043 $this->
object->getTestSession()->saveToDb();
1044 $this->sequence = $nextSequence;
1049 $this->
object->getTestSession()->setLastSequence($this->sequence);
1050 $this->
object->getTestSession()->saveToDb();
1051 $q_id = $this->
object->getTestSequence()->getQuestionForSequence(
$_GET[
"sequence"]);
1052 $this->
object->setQuestionSetSolved(1, $q_id, $ilUser->getId());
1057 $this->
object->getTestSession()->setLastSequence($this->sequence);
1058 $this->
object->getTestSession()->saveToDb();
1059 $q_id = $this->
object->getTestSequence()->getQuestionForSequence(
$_GET[
"sequence"]);
1060 $this->
object->setQuestionSetSolved(0, $q_id, $ilUser->getId());
1063 case "directfeedback":
1065 $this->
object->getTestSession()->setLastSequence($this->sequence);
1066 $this->
object->getTestSession()->saveToDb();
1069 case "selectImagemapRegion":
1071 $this->
object->getTestSession()->setLastSequence($this->sequence);
1072 $this->
object->getTestSession()->saveToDb();
1076 $this->ctrl->redirect($this,
"outQuestionSummary");
1078 case "summary_obligations":
1079 $this->ctrl->redirect($this,
"outQuestionSummaryWithObligationsInfo");
1081 case "summary_obligations_only":
1082 $this->ctrl->redirect($this,
"outObligationsOnlySummary");
1086 $this->
object->createTestSession();
1087 $active_id = $this->
object->getTestSession()->getActiveId();
1088 $this->ctrl->setParameter($this,
"active_id", $active_id);
1089 $shuffle = $this->
object->getShuffleQuestions();
1090 if ($this->object->isRandomTest())
1092 $this->
object->generateRandomQuestions($this->object->getTestSession()->getActiveId());
1093 $this->
object->loadQuestions();
1098 $active_id, $this->object->getTestSession()->getPass(), $this->
object->areObligationsEnabled()
1101 $this->
object->createTestSequence($active_id, 0, $shuffle);
1102 $active_time_id = $this->
object->startWorkingTime($this->object->getTestSession()->getActiveId(), $this->
object->getTestSession()->getPass());
1103 $_SESSION[
"active_time_id"] = $active_time_id;
1104 if ($this->object->getListOfQuestionsStart())
1106 $this->ctrl->setParameter($this,
"activecommand",
"summary");
1107 $this->ctrl->redirect($this,
"redirectQuestion");
1111 $this->ctrl->setParameter($this,
"sequence", $this->sequence);
1112 $this->ctrl->setParameter($this,
"activecommand",
"gotoquestion");
1113 $this->ctrl->saveParameter($this,
"tst_javascript");
1114 $this->ctrl->redirect($this,
"redirectQuestion");
1119 $active_id = $this->
object->getTestSession()->getActiveId();
1120 $this->ctrl->setParameter($this,
"active_id", $active_id);
1122 if ($this->object->isRandomTest())
1124 if (!$this->object->hasRandomQuestionsForPass($active_id, $this->object->getTestSession()->getPass()))
1127 $this->
object->generateRandomQuestions($active_id, $this->object->getTestSession()->getPass());
1130 $shuffle = $this->
object->getShuffleQuestions();
1131 if ($this->object->isRandomTest())
1137 $active_id, $this->object->getTestSession()->getPass(), $this->
object->areObligationsEnabled()
1140 $this->
object->createTestSequence($active_id, $this->object->getTestSession()->getPass(), $shuffle);
1142 $this->sequence = $this->
object->getTestSession()->getLastSequence();
1143 $active_time_id = $this->
object->startWorkingTime($active_id, $this->object->getTestSession()->getPass());
1144 $_SESSION[
"active_time_id"] = $active_time_id;
1145 if ($this->object->getListOfQuestionsStart())
1147 $this->ctrl->setParameter($this,
"activecommand",
"summary");
1148 $this->ctrl->redirect($this,
"redirectQuestion");
1152 $this->ctrl->setParameter($this,
"sequence", $this->sequence);
1153 $this->ctrl->setParameter($this,
"activecommand",
"gotoquestion");
1154 $this->ctrl->saveParameter($this,
"tst_javascript");
1155 $this->ctrl->redirect($this,
"redirectQuestion");
1160 case "gotoquestion":
1163 if (array_key_exists(
"tst_javascript",
$_GET))
1165 $ilUser->writePref(
"tst_javascript",
$_GET[
"tst_javascript"]);
1168 if (strlen(
$_GET[
'gotosequence'])) $this->sequence =
$_GET[
'gotosequence'];
1169 $this->
object->getTestSession()->setLastSequence($this->sequence);
1170 $this->
object->getTestSession()->saveToDb();
1185 if (array_key_exists(
"save_error",
$_GET))
1187 if (
$_GET[
"save_error"] == 1)
1192 switch (
$_GET[
"activecommand"])
1206 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_redirect_autosave.html",
"Modules/Test");
1207 $this->tpl->setVariable(
"TEXT_REDIRECT", $this->lng->txt(
"redirectAfterSave"));
1208 $this->tpl->setCurrentBlock(
"HeadContent");
1209 $this->tpl->setVariable(
"CONTENT_BLOCK",
"<meta http-equiv=\"refresh\" content=\"5; url=" . $this->ctrl->getLinkTarget($this,
"redirectBack") .
"\">");
1210 $this->tpl->parseCurrentBlock();
1222 $this->
object->getTestSession()->saveToDb();
1223 $result = $this->lng->txt(
"autosave_success");
1227 $result = $this->lng->txt(
"autosave_failed");
1233 $result = $this->ctrl->getLinkTarget($this,
"redirectAfterAutosave",
"",
true);
1246 $show_side_list = $ilUser->getPref(
'side_list_of_questions');
1247 $ilUser->writePref(
'side_list_of_questions', !$show_side_list);
1249 $this->ctrl->redirect($this,
"redirectQuestion");
1262 $this->ctrl->setParameter($this,
"activecommand",
"next");
1263 $this->ctrl->redirect($this,
"redirectQuestion");
1276 $this->ctrl->setParameter($this,
"activecommand",
"previous");
1277 $this->ctrl->redirect($this,
"redirectQuestion");
1290 $this->ctrl->setParameter($this,
"activecommand",
"postpone");
1291 $this->ctrl->redirect($this,
"redirectQuestion");
1304 if ($this->saveResult == FALSE)
1306 $this->ctrl->setParameter($this,
"activecommand",
"");
1307 $this->ctrl->redirect($this,
"redirectQuestion");
1311 $this->ctrl->setParameter($this,
"activecommand",
"summary");
1312 $this->ctrl->redirect($this,
"redirectQuestion");
1318 $this->ctrl->setParameter($this,
"activecommand",
"summary");
1319 $this->ctrl->redirect($this,
"redirectQuestion");
1332 $this->ctrl->setParameter($this,
"activecommand",
"setmarked");
1333 $this->ctrl->redirect($this,
"redirectQuestion");
1346 $this->ctrl->setParameter($this,
"activecommand",
"resetmarked");
1347 $this->ctrl->redirect($this,
"redirectQuestion");
1360 $this->ctrl->setParameter($this,
"activecommand",
"directfeedback");
1361 $this->ctrl->redirect($this,
"redirectQuestion");
1374 $activecommand =
"selectImagemapRegion";
1375 if (array_key_exists(
'cmd',
$_POST))
1377 $activecommand = key(
$_POST[
"cmd"]);
1379 if (preg_match(
"/^gotoquestion_(\\d+)$/", $activecommand, $matches))
1381 $activecommand =
"gotoquestion";
1382 if (strlen($matches[1]))
1384 $this->ctrl->setParameter($this,
'gotosequence', $matches[1]);
1387 if (strcmp($activecommand,
"togglesidelist") == 0)
1393 $this->ctrl->setParameter($this,
"activecommand", $activecommand);
1394 $this->ctrl->redirect($this,
"redirectQuestion");
1408 $this->ctrl->setParameter($this,
"sequence",
$_GET[
"sequence"]);
1409 $this->ctrl->setParameter($this,
"activecommand",
"gotoquestion");
1410 $this->ctrl->saveParameter($this,
"tst_javascript");
1412 $this->ctrl->redirect($this,
"redirectQuestion");
1424 $this->ctrl->setParameter($this,
"activecommand",
"back");
1425 $this->ctrl->redirect($this,
"redirectQuestion");
1447 function confirmFinishTest()
1454 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1456 $confirmation->setFormAction($this->ctrl->getFormAction($this,
'confirmFinish'));
1457 $confirmation->setHeaderText($this->lng->txt(
"tst_finish_confirmation_question"));
1458 $confirmation->setConfirm($this->lng->txt(
"tst_finish_confirm_button"),
'confirmFinish');
1459 if($this->object->canShowSolutionPrintview($ilUser->getId()))
1461 $confirmation->setCancel($this->lng->txt(
"tst_finish_confirm_list_of_answers_button"),
'backConfirmFinish');
1465 $confirmation->setCancel($this->lng->txt(
"tst_finish_confirm_cancel_button"),
'backConfirmFinish');
1467 if($this->object->getKioskMode())
1469 $this->tpl->addBlockfile($this->
getContentBlockName(),
'content',
"tpl.il_as_tst_kiosk_mode_content.html",
"Modules/Test");
1470 $this->tpl->setContent($confirmation->getHtml());
1493 $active_id = $this->
object->getTestSession()->getActiveId();
1494 $actualpass = $this->
object->_getPass($active_id);
1498 if( $this->object->areObligationsEnabled() && !$allObligationsAnswered )
1500 if( $this->object->getListOfQuestions() )
1502 $_GET[
'activecommand'] =
'summary_obligations';
1506 $_GET[
'activecommand'] =
'summary_obligations_only';
1513 if (($actualpass == $this->object->getNrOfTries() - 1) && (!$confirm))
1516 $ilAuth->setExpire(0);
1517 switch ($this->object->getMailNotification())
1520 $this->
object->sendSimpleNotification($active_id);
1523 $this->
object->sendAdvancedNotification($active_id);
1528 if (($confirm) && ($actualpass == $this->object->getNrOfTries() - 1))
1530 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
1532 $template =
new ilTemplate(
"tpl.il_as_tst_finish_navigation.html", TRUE, TRUE,
"Modules/Test");
1533 $template->setVariable(
"BUTTON_FINISH", $this->lng->txt(
"btn_next"));
1534 $template->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"btn_previous"));
1536 $template_top =
new ilTemplate(
"tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE,
"Modules/Test");
1537 $template_top->setCurrentBlock(
"button_print");
1538 $template_top->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
1539 $template_top->parseCurrentBlock();
1541 $this->
showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
1547 return $this->confirmFinishTest();
1554 if ($this->object->getMailNotificationType() == 1)
1556 switch ($this->object->getMailNotification())
1559 $this->
object->sendSimpleNotification($active_id);
1562 $this->
object->sendAdvancedNotification($active_id);
1566 if( !$this->object->getTestSession()->isSubmitted() )
1568 $this->
object->setActiveTestSubmitted($ilUser->getId());
1570 $this->
object->getTestSession()->increaseTestPass();
1577 if (!
$_GET[
"skipfinalstatement"])
1579 if ($this->object->getShowFinalStatement())
1581 $this->ctrl->redirect($this,
"showFinalStatement");
1584 if(
$_GET[
'crs_show_result'])
1586 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToCourse");
1589 if (!$this->object->canViewResults())
1595 $this->ctrl->redirectByClass(
"ilTestEvaluationGUI",
"outUserResultsOverview");
1604 $template =
new ilTemplate(
"tpl.il_as_tst_final_statement.html", TRUE, TRUE,
"Modules/Test");
1605 $this->ctrl->setParameter($this,
"crs_show_result",
$_GET[
'crs_show_result']);
1606 $this->ctrl->setParameter($this,
"skipfinalstatement", 1);
1607 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"redirectBack"));
1608 $template->setVariable(
"FINALSTATEMENT", $this->object->getFinalStatement());
1609 $template->setVariable(
"BUTTON_CONTINUE", $this->lng->txt(
"btn_next"));
1617 $template =
new ilTemplate(
'tpl.il_as_tst_kiosk_head.html',
true,
true,
'Modules/Test');
1618 if ($this->object->getShowKioskModeTitle())
1620 $template->setCurrentBlock(
"kiosk_show_title");
1621 $template->setVariable(
"TEST_TITLE", $this->object->getTitle());
1622 $template->parseCurrentBlock();
1624 if ($this->object->getShowKioskModeParticipant())
1626 $template->setCurrentBlock(
"kiosk_show_participant");
1627 $template->setVariable(
"PARTICIPANT_NAME", $this->lng->txt(
"login_as") .
" " . $ilUser->getFullname());
1628 $template->parseCurrentBlock();
1630 return $template->get();
1640 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_output.html",
"Modules/Test");
1641 if (!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1644 $this->ilias->raiseError($this->lng->txt(
"cannot_execute_test"),$this->ilias->error_obj->MESSAGE);
1653 if ($this->object->endingTimeReached())
1659 if ($this->object->getKioskMode())
1665 $this->tpl->setCurrentBlock(
"kiosk_options");
1666 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1667 $this->tpl->parseCurrentBlock();
1671 if ($this->object->getEnableProcessingTime())
1676 $this->tpl->setVariable(
"FORM_TIMESTAMP", time());
1678 $this->tpl->setVariable(
"PAGETITLE",
"- " . $this->object->getTitle());
1685 $directfeedback = 0;
1686 if (strcmp(
$_GET[
"activecommand"],
"directfeedback") == 0)
1688 $directfeedback = 1;
1691 $this->
outWorkingForm($this->sequence, $this->object->getTestId(), $postpone, $directfeedback, $show_summary);
1706 $user = $this->
object->getInvitedUsers($ilUser->getId());
1707 if (!is_array ($user) || count($user)!=1)
1710 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1713 $user = array_pop($user);
1715 if (strcmp($user[
"clientip"],
"")!=0 && strcmp($user[
"clientip"],$_SERVER[
"REMOTE_ADDR"])!=0)
1718 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1730 and $this->
object->startingTimeReached()
1731 and !$this->
object->endingTimeReached();
1739 return $this->
object->hasNrOfTriesRestriction() && $this->
object->isNrOfTriesReached($this->object->getTestSession()->getPass());
1751 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1753 $this->ctrl->saveParameter($this,
"pass");
1754 $this->ctrl->saveParameter($this,
"active_id");
1755 $this->outTestResults(
false,
$_GET[
"pass"]);
1759 $this->outTestResults(
false);
1771 $this->
object->getTestSession()->increasePass();
1772 $this->
object->getTestSession()->setLastSequence(0);
1773 $this->
object->getTestSession()->saveToDb();
1774 if (!$this->object->canViewResults())
1780 $this->ctrl->redirectByClass(
"ilTestEvaluationGUI",
"outUserResultsOverview");
1803 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_submit_answers_confirm.html",
"Modules/Test");
1804 $this->tpl->setCurrentBlock(
"adm_content");
1805 if ($this->object->isTestFinished($this->object->getTestSession()->getActiveId()))
1807 $this->tpl->setCurrentBlock(
"not_submit_allowed");
1808 $this->tpl->setVariable(
"TEXT_ALREADY_SUBMITTED", $this->lng->txt(
"tst_already_submitted"));
1809 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_show_answer_sheet"));
1812 $this->tpl->setCurrentBlock(
"submit_allowed");
1813 $this->tpl->setVariable(
"TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt(
"tst_confirm_submit_answers"));
1814 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_submit_results"));
1816 $this->tpl->setVariable(
"BTN_BACK", $this->lng->txt(
"back"));
1817 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"finalSubmission"));
1818 $this->tpl->parseCurrentBlock();
1825 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
1826 $processing_time = $this->
object->getProcessingTimeInSeconds();
1827 $processing_time_minutes = floor($processing_time / 60);
1828 $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1829 $str_processing_time =
"";
1830 if ($processing_time_minutes > 0)
1832 $str_processing_time = $processing_time_minutes .
" " . ($processing_time_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1834 if ($processing_time_seconds > 0)
1836 if (strlen($str_processing_time) > 0) $str_processing_time .=
" " . $this->lng->txt(
"and") .
" ";
1837 $str_processing_time .= $processing_time_seconds .
" " . ($processing_time_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1839 $time_left = $starting_time + $processing_time - mktime();
1840 $time_left_minutes = floor($time_left / 60);
1841 $time_left_seconds = $time_left - $time_left_minutes * 60;
1842 $str_time_left =
"";
1843 if ($time_left_minutes > 0)
1845 $str_time_left = $time_left_minutes .
" " . ($time_left_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1847 if ($time_left < 300)
1849 if ($time_left_seconds > 0)
1851 if (strlen($str_time_left) > 0) $str_time_left .=
" " . $this->lng->txt(
"and") .
" ";
1852 $str_time_left .= $time_left_seconds .
" " . ($time_left_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1855 $date = getdate($starting_time);
1867 $datenow = getdate();
1868 $this->tpl->setCurrentBlock(
"enableprocessingtime");
1869 $this->tpl->setVariable(
"USER_WORKING_TIME",
1871 $this->lng->txt(
"tst_time_already_spent"),
1872 $formattedStartingTime,
1873 $str_processing_time
1876 $this->tpl->setVariable(
"USER_REMAINING_TIME", sprintf($this->lng->txt(
"tst_time_already_spent_left"), $str_time_left));
1877 $this->tpl->parseCurrentBlock();
1878 $template =
new ilTemplate(
"tpl.workingtime.js.html", TRUE, TRUE, TRUE);
1879 $template->setVariable(
"STRING_MINUTE", $this->lng->txt(
"minute"));
1880 $template->setVariable(
"STRING_MINUTES", $this->lng->txt(
"minutes"));
1881 $template->setVariable(
"STRING_SECOND", $this->lng->txt(
"second"));
1882 $template->setVariable(
"STRING_SECONDS", $this->lng->txt(
"seconds"));
1883 $template->setVariable(
"STRING_TIMELEFT", $this->lng->txt(
"tst_time_already_spent_left"));
1884 $template->setVariable(
"AND", strtolower($this->lng->txt(
"and")));
1885 $template->setVariable(
"YEAR", $date[
"year"]);
1886 $template->setVariable(
"MONTH", $date[
"mon"]-1);
1887 $template->setVariable(
"DAY", $date[
"mday"]);
1888 $template->setVariable(
"HOUR", $date[
"hours"]);
1889 $template->setVariable(
"MINUTE", $date[
"minutes"]);
1890 $template->setVariable(
"SECOND", $date[
"seconds"]);
1891 if (preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->object->getEndingTime(), $matches))
1893 $template->setVariable(
"ENDYEAR", $matches[1]);
1894 $template->setVariable(
"ENDMONTH", $matches[2]-1);
1895 $template->setVariable(
"ENDDAY", $matches[3]);
1896 $template->setVariable(
"ENDHOUR", $matches[4]);
1897 $template->setVariable(
"ENDMINUTE", $matches[5]);
1898 $template->setVariable(
"ENDSECOND", $matches[6]);
1900 $template->setVariable(
"YEARNOW", $datenow[
"year"]);
1901 $template->setVariable(
"MONTHNOW", $datenow[
"mon"]-1);
1902 $template->setVariable(
"DAYNOW", $datenow[
"mday"]);
1903 $template->setVariable(
"HOURNOW", $datenow[
"hours"]);
1904 $template->setVariable(
"MINUTENOW", $datenow[
"minutes"]);
1905 $template->setVariable(
"SECONDNOW", $datenow[
"seconds"]);
1906 $template->setVariable(
"PTIME_M", $processing_time_minutes);
1907 $template->setVariable(
"PTIME_S", $processing_time_seconds);
1909 $this->tpl->setCurrentBlock(
"HeadContent");
1910 $this->tpl->setVariable(
"CONTENT_BLOCK", $template->get());
1911 $this->tpl->parseCurrentBlock();
1917 public function outQuestionSummary($fullpage =
true, $contextFinishTest =
false, $obligationsNotAnswered =
false, $obligationsFilter =
false)
1921 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_question_summary.html",
"Modules/Test");
1924 if( $obligationsNotAnswered )
1929 $active_id = $this->
object->getTestSession()->getActiveId();
1930 $result_array = & $this->
object->getTestSequence()->getSequenceSummary($obligationsFilter);
1931 $marked_questions = array();
1933 if( $this->object->getKioskMode() && $fullpage )
1938 $this->tpl->setCurrentBlock(
"kiosk_options");
1939 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1940 $this->tpl->parseCurrentBlock();
1944 if( $this->object->getShowMarker() )
1946 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1952 foreach( $result_array as $key => $value )
1954 $this->ctrl->setParameter($this,
"sequence", $value[
"sequence"]);
1956 $href = $this->ctrl->getLinkTargetByClass(get_class($this),
"gotoQuestion");
1958 $this->tpl->setVariable(
"VALUE_QUESTION_TITLE",
"<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this),
"gotoQuestion").
"\">" . $this->
object->getQuestionTitle($value[
"title"]) .
"</a>");
1960 $this->ctrl->setParameter($this,
"sequence",
$_GET[
"sequence"]);
1963 if( $this->object->getListOfQuestionsDescription() )
1965 $description = $value[
"description"];
1969 if( !$this->object->getTitleOutput() )
1971 $points = $value[
"points"].
" ".$this->lng->txt(
"points_short");
1975 if( count($marked_questions) )
1977 if( array_key_exists($value[
"qid"], $marked_questions) )
1979 $obj = $marked_questions[$value[
"qid"]];
1980 if( $obj[
"solved"] == 1 )
1987 array_push(
$data, array(
1988 'order' => $value[
"nr"],
1990 'title' => $this->object->getQuestionTitle($value[
"title"]),
1991 'description' => $description,
1992 'worked_through' => ($value[
"worked_through"]) ?
true :
false,
1993 'postponed' => ($value[
"postponed"]) ? $this->lng->txt(
"postponed") :
'',
1994 'points' => $points,
1995 'marked' => $marked,
1996 'sequence' => $value[
"sequence"],
1997 'obligatory' => $value[
'obligatory']
2001 $this->ctrl->setParameter($this,
"sequence",
$_GET[
"sequence"]);
2005 include_once
"./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
2007 $this,
'backFromSummary', !$this->object->getTitleOutput(), $this->
object->getShowMarker(),
2008 $obligationsNotAnswered, $obligationsFilter
2013 $this->tpl->setVariable(
'TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
2015 if( $this->object->getEnableProcessingTime() )
2022 $template =
new ilTemplate(
'tpl.il_as_tst_list_of_questions_short.html',
true,
true,
'Modules/Test');
2026 if( strlen($row[
'description']) )
2028 $template->setCurrentBlock(
'description');
2029 $template->setVariable(
"DESCRIPTION", $row[
'description']);
2030 $template->parseCurrentBlock();
2035 $template->setCurrentBlock(
'item');
2036 $template->setVariable(
'CLASS', ($row[
'walked_through']) ? (
'answered'.$active) : (
'unanswered'.$active));
2038 $template->setVariable(
'SEQUENCE', $row[
'sequence']);
2039 $template->parseCurrentBlock();
2042 $template->setVariable(
'LIST_OF_QUESTIONS', $this->lng->txt(
'list_of_questions'));
2044 $this->tpl->setVariable(
'LIST_OF_QUESTIONS', $template->get());
2060 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_max_allowed_users_reached.html",
"Modules/Test");
2061 $this->tpl->setCurrentBlock(
"adm_content");
2062 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt(
"tst_max_allowed_users_message"), $this->
object->getAllowedUsersTimeGap()));
2063 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt(
"tst_max_allowed_users_heading"), $this->
object->getAllowedUsersTimeGap()));
2064 $this->tpl->setVariable(
"BACK_TO_INTRODUCTION", $this->lng->txt(
"tst_results_back_introduction"));
2065 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2066 $this->tpl->parseCurrentBlock();
2072 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
2074 $template =
new ilTemplate(
"tpl.il_as_tst_finish_navigation.html", TRUE, TRUE,
"Modules/Test");
2075 $template->setVariable(
"BUTTON_FINISH", $this->lng->txt(
"btn_next"));
2076 $template->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"btn_previous"));
2078 $template_top =
new ilTemplate(
"tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE,
"Modules/Test");
2079 $template_top->setCurrentBlock(
"button_print");
2080 $template_top->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
2081 $template_top->parseCurrentBlock();
2082 $active_id = $this->
object->getTestSession()->getActiveId();
2083 return $this->
showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
2087 $this->ctrl->redirect($this,
'gotoQuestion');
2093 $this->confirmFinishTest();
2103 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
2105 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2106 $this->tpl->setCurrentBlock(
"ContentStyle");
2108 $this->tpl->parseCurrentBlock();
2110 $this->tpl->setCurrentBlock(
"SyntaxStyle");
2112 $this->tpl->parseCurrentBlock();
2115 if ($this->object->getShowSolutionAnswersOnly())
2120 $this->tpl->setCurrentBlock(
"adm_content");
2122 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
2123 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
2124 $this->ctrl->saveParameter($this,
"pass");
2125 $this->ctrl->saveParameter($this,
"active_id");
2126 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
2127 $this->tpl->parseCurrentBlock();
2143 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_finish_list_of_answers.html",
"Modules/Test");
2145 $result_array =& $this->
object->getTestResult($active_id,
$pass);
2149 foreach ($result_array as $question_data)
2151 $question = $question_data[
"qid"];
2152 if (is_numeric($question))
2154 $this->tpl->setCurrentBlock(
"printview_question");
2155 $question_gui = $this->
object->createQuestionGUI(
"", $question);
2156 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
2157 $template->setVariable(
"COUNTER_QUESTION", $counter.
". ");
2158 $template->setVariable(
"QUESTION_TITLE", $question_gui->object->getTitle());
2160 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
2161 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback());
2162 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
2163 $this->tpl->setVariable(
"QUESTION_OUTPUT", $template->get());
2164 $this->tpl->parseCurrentBlock();
2170 if ($this->object->getShowSolutionAnswersOnly())
2174 if (strlen($top_data))
2176 $this->tpl->setCurrentBlock(
"top_data");
2177 $this->tpl->setVariable(
"TOP_DATA", $top_data);
2178 $this->tpl->parseCurrentBlock();
2181 if (strlen($bottom_data))
2183 $this->tpl->setCurrentBlock(
"bottom_data");
2184 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2185 $this->tpl->setVariable(
"BOTTOM_DATA", $bottom_data);
2186 $this->tpl->parseCurrentBlock();
2189 $this->tpl->setCurrentBlock(
"adm_content");
2190 $this->tpl->setVariable(
"TXT_ANSWER_SHEET", $this->lng->txt(
"tst_list_of_answers"));
2193 $this->tpl->setVariable(
"USER_DETAILS", $user_data);
2194 $this->tpl->setVariable(
"SIGNATURE", $signature);
2195 $this->tpl->setVariable(
"TITLE", $this->object->getTitle());
2196 $this->tpl->setVariable(
"TXT_TEST_PROLOG", $this->lng->txt(
"tst_your_answers"));
2197 $invited_user =& $this->
object->getInvitedUsers($ilUser->getId());
2198 $pagetitle = $this->
object->getTitle() .
" - " . $this->lng->txt(
"clientip") .
2199 ": " . $invited_user[$ilUser->getId()][
"clientip"] .
" - " .
2200 $this->lng->txt(
"matriculation") .
": " .
2201 $invited_user[$ilUser->getId()][
"matriculation"];
2202 $this->tpl->setVariable(
"PAGETITLE", $pagetitle);
2203 $this->tpl->parseCurrentBlock();
2214 if ($this->object->getKioskMode())
2216 $this->tpl->setBodyClass(
"kiosk");
2217 $this->tpl->setAddFooter(FALSE);
2222 return "ADM_CONTENT";
2228 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outUserResultsOverview");
2233 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outUserListOfAnswerPasses");
2245 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
2258 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
2274 $parseQuestionRelatedNavigation =
false;
2278 case $this->
object->getSpecificAnswerFeedback():
2279 case $this->
object->getGenericAnswerFeedback():
2280 case $this->
object->getAnswerFeedbackPoints():
2281 case $this->
object->getInstantFeedbackSolution():
2283 $tpl->setCurrentBlock(
"direct_feedback");
2284 $tpl->setVariable(
"TEXT_DIRECT_FEEDBACK", $lng->txt(
"check"));
2285 $tpl->parseCurrentBlock();
2287 $parseQuestionRelatedNavigation =
true;
2290 if( $this->object->isOfferingQuestionHintsEnabled() )
2292 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
2294 $questionId = $questionGUI->object->getId();
2295 $activeId = $this->
object->getTestSession()->getActiveId();
2296 $pass = $this->
object->getTestSession()->getPass();
2301 if( $requestsPossible )
2303 if( $requestsExist )
2305 $buttonText = $lng->txt(
"button_request_next_question_hint");
2309 $buttonText = $lng->txt(
"button_request_question_hint");
2312 $tpl->setCurrentBlock(
"button_request_next_question_hint");
2313 $tpl->setVariable(
"CMD_REQUEST_NEXT_QUESTION_HINT",
'confirmHintRequest');
2314 $tpl->setVariable(
"TEXT_REQUEST_NEXT_QUESTION_HINT", $buttonText);
2315 $tpl->parseCurrentBlock();
2317 $parseQuestionRelatedNavigation =
true;
2320 if( $requestsExist )
2322 $tpl->setCurrentBlock(
"button_show_requested_question_hints");
2323 $tpl->setVariable(
"CMD_SHOW_REQUESTED_QUESTION_HINTS",
'showRequestedHintList');
2324 $tpl->setVariable(
"TEXT_SHOW_REQUESTED_QUESTION_HINTS", $lng->txt(
"button_show_requested_question_hints"));
2325 $tpl->parseCurrentBlock();
2327 $parseQuestionRelatedNavigation =
true;
2331 if( $parseQuestionRelatedNavigation )
2333 $tpl->setCurrentBlock(
"question_related_navigation");
2334 $tpl->parseCurrentBlock();