4 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once
'./Modules/Test/classes/class.ilTestPlayerCommands.php';
6 require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
7 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
8 require_once
'./Services/UIComponent/Button/classes/class.ilSubmitButton.php';
9 require_once
'Modules/Test/classes/class.ilTestPlayerNavButton.php';
69 parent::ilTestServiceGUI($a_object);
70 $this->ref_id =
$_GET[
"ref_id"];
73 require_once
'Modules/Test/classes/class.ilTestPasswordChecker.php';
76 $this->processLocker = null;
77 $this->testSession = null;
78 $this->assSettings = null;
85 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
88 $this->
ilias->raiseError($this->lng->txt(
"cannot_execute_test"), $this->
ilias->error_obj->MESSAGE);
94 $executable = $this->
object->isExecutable($this->testSession, $this->testSession->getUserId());
96 if( !$executable[
'executable'] )
99 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
112 $testSession->
setUserId($ilUser->getId());
131 require_once
'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
134 $processLockerFactory->setActiveId($activeId);
136 $this->processLocker = $processLockerFactory->getLocker();
147 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
149 $tagging_gui->setObject($this->object->getId(), $this->
object->getType());
150 $tagging_gui->saveInput();
151 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
161 $this->
object->updateWorkingTime(
$_SESSION[
"active_time_id"]);
164 $_SESSION[
"active_time_id"] = $this->
object->startWorkingTime(
165 $this->testSession->getActiveId(), $this->testSession->getPass()
178 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
191 $active_id = $this->testSession->getActiveId();
192 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
193 if ($starting_time === FALSE)
199 return $this->
object->isMaxProcessingTimeReached($starting_time, $active_id);
205 $show_question_inline_score = FALSE;
206 if ($this->object->getAnswerFeedbackPoints())
208 $show_question_inline_score = TRUE;
209 return $show_question_inline_score;
211 return $show_question_inline_score;
216 $this->tpl->setCurrentBlock(
'test_nav_toolbar');
217 $this->tpl->setVariable(
'TEST_NAV_TOOLBAR', $toolbarGUI->getHTML());
218 $this->tpl->parseCurrentBlock();
249 $button->setId(
'bottomnextbutton');
251 $this->tpl->setCurrentBlock(
"next_bottom" );
252 $this->tpl->setVariable(
"BTN_NEXT", $button->render());
253 $this->tpl->parseCurrentBlock();
259 $button->setId(
'nextbutton');
261 $this->tpl->setCurrentBlock(
"next" );
262 $this->tpl->setVariable(
"BTN_NEXT", $button->render());
263 $this->tpl->parseCurrentBlock();
269 $button->setId(
'bottomprevbutton');
271 $this->tpl->setCurrentBlock(
"prev_bottom" );
272 $this->tpl->setVariable(
"BTN_PREV", $button->render());
273 $this->tpl->parseCurrentBlock();
279 $button->setId(
'prevbutton');
281 $this->tpl->setCurrentBlock(
"prev" );
282 $this->tpl->setVariable(
"BTN_PREV", $button->render());
283 $this->tpl->parseCurrentBlock();
293 $button->setPrimary(
false);
296 $button->setCaption(
'next_question');
297 $button->addCSSClass(
'ilTstNavElem');
311 $button->setCaption(
'previous_question');
312 $button->addCSSClass(
'ilTstNavElem');
319 $this->tpl->setCurrentBlock(
"specific_feedback" );
320 $this->tpl->setVariable(
"SPECIFIC_FEEDBACK",
321 $question_gui->getSpecificFeedbackOutput(
322 $this->testSession->getActiveId(),
323 $this->testSequence->getPass()
326 $this->tpl->parseCurrentBlock();
332 $this->testSession->getActiveId(),$this->testSequence->getPass()
335 if( strlen($feedback) )
337 $cssClass = ( $solutionCorrect ?
341 $this->tpl->setCurrentBlock(
"answer_feedback" );
342 $this->tpl->setVariable(
"ANSWER_FEEDBACK", $feedback);
343 $this->tpl->setVariable(
"ILC_FB_CSS_CLASS", $cssClass);
344 $this->tpl->parseCurrentBlock();
350 $scoreInformation = sprintf(
351 $this->lng->txt(
"you_received_a_of_b_points" ), $reachedPoints, $maxPoints
354 $this->tpl->setCurrentBlock(
"received_points_information" );
355 $this->tpl->setVariable(
"RECEIVED_POINTS_INFORMATION", $scoreInformation);
356 $this->tpl->parseCurrentBlock();
361 $this->tpl->setCurrentBlock(
"solution_output" );
362 $this->tpl->setVariable(
"CORRECT_SOLUTION", $this->lng->txt(
"tst_best_solution_is" ) );
363 $this->tpl->setVariable(
"QUESTION_FEEDBACK", $solutionoutput );
364 $this->tpl->parseCurrentBlock();
369 $this->tpl->setCurrentBlock(
"SyntaxStyle" );
370 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
373 $this->tpl->parseCurrentBlock();
378 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
379 $this->tpl->setCurrentBlock(
"ContentStyle" );
380 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
383 $this->tpl->parseCurrentBlock();
393 if( $this->testSession->isAnonymousUser() )
395 $this->testSession->setAccessCodeToSession(
$_POST[
'anonymous_id']);
398 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
410 $isFirstTestStartRequest =
false;
412 $this->processLocker->requestTestStartLockCheckLock();
414 if( $this->testSession->lookupTestStartLock() != $testStartLock )
416 $this->testSession->persistTestStartLock($testStartLock);
417 $isFirstTestStartRequest =
true;
420 $this->processLocker->releaseTestStartLockCheckLock();
422 if( $isFirstTestStartRequest )
428 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'lock', $testStartLock);
429 $this->ctrl->redirectByClass(
"ilobjtestgui",
"redirectToInfoScreen");
438 elseif( isset(
$_GET[
'lock']) && strlen(
$_GET[
'lock']) )
440 return $_GET[
'lock'];
456 if ($this->object->checkMaximumAllowedUsers() == FALSE)
461 if( $this->testSession->isAnonymousUser() && !$this->testSession->getActiveId() )
463 $accessCode = $this->testSession->createNewAccessCode();
465 $this->testSession->setAccessCodeToSession($accessCode);
466 $this->testSession->setAnonymousId($accessCode);
467 $this->testSession->saveToDb();
472 $this->testSession->unsetAccessCodeInSession();
478 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_anonymous_code_presentation.html",
"Modules/Test");
479 $this->tpl->setCurrentBlock(
"adm_content");
480 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt(
"tst_access_code_created"));
481 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE", $this->testSession->getAccessCodeFromSession());
482 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
484 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"continue_work"));
485 $this->tpl->parseCurrentBlock();
500 if (
$_POST[
"chb_javascript"])
502 $ilUser->writePref(
"tst_javascript", 1);
506 $ilUser->writePref(
"tst_javascript", 0);
510 if ($this->object->getNrOfTries() != 1)
512 if ($this->object->getUsePreviousAnswers() == 1)
514 if (
$_POST[
"chb_use_previous_answers"])
516 $ilUser->writePref(
"tst_use_previous_answers", 1);
520 $ilUser->writePref(
"tst_use_previous_answers", 0);
528 $active_id = $this->testSession->getActiveId();
529 $actualpass = $this->
object->_getPass($active_id);
533 $this->testSession->setLastFinishedPass($this->testSession->getPass());
534 $this->testSession->increaseTestPass();
538 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_redirect_autosave.html",
"Modules/Test");
539 $this->tpl->setVariable(
"TEXT_REDIRECT", $this->lng->txt(
"redirectAfterSave"));
540 $this->tpl->setCurrentBlock(
"HeadContent");
541 $this->tpl->setVariable(
"CONTENT_BLOCK",
"<meta http-equiv=\"refresh\" content=\"5; url=" .
$url .
"\">");
542 $this->tpl->parseCurrentBlock();
550 $authorizedSolution = !$canSaveResult;
564 $result = $this->lng->txt(
"autosave_success");
568 $result = $this->lng->txt(
"autosave_failed");
594 $show_side_list = $ilUser->getPref(
'side_list_of_questions');
595 $ilUser->writePref(
'side_list_of_questions', !$show_side_list);
610 $questionId = $this->testSequence->getQuestionForSequence(
614 $this->
object->setQuestionSetSolved(1, $questionId, $this->testSession->getUserId());
630 $questionId = $this->testSequence->getQuestionForSequence(
634 $this->
object->setQuestionSetSolved(0, $questionId, $this->testSession->getUserId());
650 protected function confirmFinishTestCmd()
657 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
659 $confirmation->setFormAction($this->ctrl->getFormAction($this,
'confirmFinish'));
660 $confirmation->setHeaderText($this->lng->txt(
"tst_finish_confirmation_question"));
661 $confirmation->setConfirm($this->lng->txt(
"tst_finish_confirm_button"),
'confirmFinish');
673 $active_id = $this->testSession->getActiveId();
674 $actualpass = $this->
object->_getPass($active_id);
691 if( $this->object->areObligationsEnabled() && !$allObligationsAnswered )
693 if( $this->object->getListOfQuestions() )
706 if ($this->object->getEnableExamview() && !isset(
$_GET[
'reviewed']) && $requires_confirmation)
708 $this->ctrl->redirectByClass(
'ilTestSubmissionReviewGUI',
"show");
713 if (($requires_confirmation) && ($actualpass == $this->object->getNrOfTries() - 1))
716 return $this->confirmFinishTestCmd();
720 if(($actualpass == $this->object->getNrOfTries() - 1) && (!$requires_confirmation))
723 $ilAuth->setExpire(0);
724 switch($this->object->getMailNotification())
727 $this->
object->sendSimpleNotification($active_id);
730 $this->
object->sendAdvancedNotification($active_id);
739 if($this->object->getMailNotificationType() == 1)
741 switch($this->object->getMailNotification())
744 $this->
object->sendSimpleNotification($active_id);
747 $this->
object->sendAdvancedNotification($active_id);
757 $this->testSession->setLastFinishedPass($this->testSession->getPass());
758 $this->testSession->increaseTestPass();
765 if( !$this->testSession->isSubmitted() )
767 $this->testSession->setSubmitted(1);
768 $this->testSession->setSubmittedTimestamp(date(
'Y-m-d H:i:s'));
769 $this->testSession->saveToDb();
775 $activeId = $this->testSession->getActiveId();
776 $lastFinishedPass = $this->testSession->getLastFinishedPass();
781 $this->ctrl->redirectByClass(
'ilTestSignatureGUI',
'invokeSignaturePlugin');
785 if(!
$_GET[
'skipfinalstatement'])
787 if ($this->object->getShowFinalStatement())
794 $redirection_mode = $this->
object->getRedirectionMode();
795 $redirection_url = $this->
object->getRedirectionUrl();
796 if( $redirection_url && $redirection_mode && !$this->object->canViewResults() )
800 if( $this->object->getKioskMode() )
817 if( !$this->object->getSignSubmission() )
822 if( !is_null(
ilSession::get(
"signed_{$activeId}_{$lastFinishedPass}")) )
827 global $ilPluginAdmin;
829 $activePlugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
'Test',
'tsig');
831 if( !count($activePlugins) )
846 global $ilObjDataCache;
848 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
851 $objectivesList = null;
855 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
859 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
863 $objectivesList->loadObjectivesTitles();
865 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
866 $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
867 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
868 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
869 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
872 $results = $this->
object->getTestResult(
876 require_once
'class.ilTestEvaluationGUI.php';
878 $results_output = $testevaluationgui->getPassListOfAnswers(
879 $results, $active,
$pass,
false,
false,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder
882 require_once
'./Modules/Test/classes/class.ilTestArchiver.php';
884 $inst_id = $ilSetting->get(
'inst_id', null);
892 $filename = realpath($path) .
'/exam_N' . $inst_id .
'-' . $this->
object->getId()
893 .
'-' . $active .
'-' .
$pass .
'.pdf';
895 require_once
'class.ilTestPDFGenerator.php';
899 $archiver->handInParticipantSubmission( $active,
$pass,
$filename, $results_output );
904 $questions = $this->
object->getQuestions();
905 foreach ($questions as $question_id)
907 $question_object = $this->
object->getQuestionDataset( $question_id );
908 if ($question_object->type_tag ==
'assFileUpload')
928 $handle = opendir( $candidate_path );
929 while ($handle !==
false && (
$file = readdir( $handle )) !==
false)
933 $filename_start =
'file_' . $active .
'_' .
$pass .
'_';
935 if (strpos(
$file, $filename_start ) === 0)
937 $archiver->handInParticipantQuestionMaterial( $active,
$pass, $question_id,
$file,
$file );
943 $passdata = $this->
object->getTestResult(
946 $overview = $testevaluationgui->getPassListOfAnswers(
947 $passdata, $active,
$pass,
true,
false,
false,
true,
false, $objectivesList, $testResultHeaderLabelBuilder
959 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
961 $testPassesSelector->setActiveId($this->testSession->getActiveId());
962 $testPassesSelector->setLastFinishedPass($this->testSession->getLastFinishedPass());
964 if( count($testPassesSelector->getReportablePasses()) )
966 $this->ctrl->redirectByClass(
"ilTestEvaluationGUI",
"outUserResultsOverview");
974 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'redirectToInfoScreen');
982 $template =
new ilTemplate(
"tpl.il_as_tst_final_statement.html", TRUE, TRUE,
"Modules/Test");
983 $this->ctrl->setParameter($this,
"skipfinalstatement", 1);
985 $template->setVariable(
"FINALSTATEMENT", $this->object->prepareTextareaOutput($this->object->getFinalStatement(),
true));
986 $template->setVariable(
"BUTTON_CONTINUE", $this->lng->txt(
"btn_next"));
994 $template =
new ilTemplate(
'tpl.il_as_tst_kiosk_head.html',
true,
true,
'Modules/Test');
995 if ($this->object->getShowKioskModeTitle())
997 $template->setCurrentBlock(
"kiosk_show_title");
998 $template->setVariable(
"TEST_TITLE", $this->object->getTitle());
999 $template->parseCurrentBlock();
1001 if ($this->object->getShowKioskModeParticipant())
1003 $template->setCurrentBlock(
"kiosk_show_participant");
1004 $template->setVariable(
"PARTICIPANT_NAME_TXT", $this->lng->txt(
"login_as"));
1005 $template->setVariable(
"PARTICIPANT_NAME", $ilUser->getFullname());
1006 $template->setVariable(
"PARTICIPANT_LOGIN", $ilUser->getLogin());
1007 $template->setVariable(
"PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1008 $template->setVariable(
"PARTICIPANT_EMAIL", $ilUser->getEmail());
1009 $template->parseCurrentBlock();
1011 if ($this->object->isShowExamIdInTestPassEnabled())
1014 $this->testSession->getActiveId() , $this->testSession->getPass(), $this->
object->getId()
1017 $template->setCurrentBlock(
"kiosk_show_exam_id");
1018 $template->setVariable(
"EXAM_ID_TXT", $this->lng->txt(
"exam_id"));
1019 $template->setVariable(
"EXAM_ID", $exam_id);
1020 $template->parseCurrentBlock();
1022 return $template->get();
1030 global
$ilUser, $ilNavigationHistory;
1032 $ilNavigationHistory->addItem($this->testSession->getRefId(),
1046 if ($this->object->endingTimeReached())
1054 $this->ctrl->setParameter($this,
"sequence", $sequenceElement);
1059 if ($this->object->getKioskMode())
1064 $this->tpl->setVariable(
"TEST_ID", $this->object->getTestId());
1065 $this->tpl->setVariable(
"LOGIN", $ilUser->getLogin());
1066 $this->tpl->setVariable(
"SEQ_ID", $sequenceElement);
1067 $this->tpl->setVariable(
"QUEST_ID", $questionId);
1069 if ($this->object->getEnableProcessingTime())
1074 $this->tpl->setVariable(
"PAGETITLE",
"- " . $this->object->getTitle());
1076 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->
object->getKioskMode())
1078 $this->tpl->setCurrentBlock(
'exam_id_footer');
1080 $this->testSession->getActiveId(), $this->testSession->getPass(), $this->
object->getId()
1082 $this->tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1083 $this->tpl->parseCurrentBlock();
1086 if ($this->object->getListOfQuestions())
1088 $this->
showSideList($presentationMode, $sequenceElement);
1099 $questionNavigationGUI->setQuestionWorkedThrough($isQuestionWorkedThrough);
1102 $answerFeedbackEnabled = (
1103 $instantResponse && $this->
object->getSpecificAnswerFeedback()
1107 $this->testSession->getActiveId(), #active_id
1108 $this->testSession->getPass(), #pass
1109 false, #graphical_output
1110 false, #result_output
1111 true, #show_question_only
1112 $answerFeedbackEnabled, #show_feedback
1113 false, #show_correct_solution
1114 false, #show_manual_scoring
1115 true #show_question_text
1121 $this->testSession->getActiveId(),
1125 $this->tpl->setCurrentBlock(
'readonly_css_class');
1126 $this->tpl->touchBlock(
'readonly_css_class');
1127 $this->tpl->parseCurrentBlock();
1129 $this->tpl->setVariable(
'QUESTION_OUTPUT', $pageoutput);
1131 $this->tpl->setVariable(
"FORMACTION", $formAction);
1133 $this->tpl->setVariable(
"FORM_TIMESTAMP", time());
1141 if( $isQuestionWorkedThrough )
1143 $questionNavigationGUI->setDiscardSolutionButtonEnabled(
true);
1147 $questionNavigationGUI->setSkipQuestionLinkTarget(
1155 $answerFeedbackEnabled = (
1156 $instantResponse && $this->
object->getSpecificAnswerFeedback()
1159 if( isset(
$_GET[
'save_error']) &&
$_GET[
'save_error'] == 1 && isset(
$_SESSION[
'previouspost']) )
1161 $userPostSolution =
$_SESSION[
'previouspost'];
1166 $userPostSolution =
false;
1177 $formAction, #form_action
1178 $this->testSession->getActiveId(), #active_id
1180 $solutionPassIndex, #pass
1182 $isPostponed, #is_postponed
1183 $userPostSolution, #user_post_solution
1184 $answerFeedbackEnabled #answer_feedback == inline_specific_feedback
1200 require_once
'./Modules/Test/classes/class.ilObjTest.php';
1204 $currentSolutionAvailable = $questionGui->object->authorizedOrIntermediateSolutionExists(
1205 $this->testSession->getActiveId(), $this->testSession->getPass()
1208 if( !$currentSolutionAvailable )
1210 $previousPass = $questionGui->object->getSolutionMaxPass(
1211 $this->testSession->getActiveId()
1214 $previousSolutionAvailable = $questionGui->object->authorizedSolutionExists(
1215 $this->testSession->getActiveId(), $previousPass
1218 if( $previousSolutionAvailable )
1220 return $previousPass;
1225 return $this->testSession->getPass();
1252 $user = $this->
object->getInvitedUsers($ilUser->getId());
1253 if (!is_array ($user) || count($user)!=1)
1256 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1259 $user = array_pop($user);
1261 if (strcmp($user[
"clientip"],
"")!=0 && strcmp($user[
"clientip"],
$_SERVER[
"REMOTE_ADDR"])!=0)
1264 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1276 and $this->
object->startingTimeReached()
1277 and !$this->
object->endingTimeReached();
1285 return $this->
object->hasNrOfTriesRestriction() && $this->
object->isNrOfTriesReached($this->testSession->getPass());
1296 $this->testSession->increasePass();
1297 $this->testSession->setLastSequence(0);
1298 $this->testSession->saveToDb();
1322 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_submit_answers_confirm.html",
"Modules/Test");
1323 $this->tpl->setCurrentBlock(
"adm_content");
1324 if ($this->object->isTestFinished($this->testSession->getActiveId()))
1326 $this->tpl->setCurrentBlock(
"not_submit_allowed");
1327 $this->tpl->setVariable(
"TEXT_ALREADY_SUBMITTED", $this->lng->txt(
"tst_already_submitted"));
1328 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_show_answer_sheet"));
1331 $this->tpl->setCurrentBlock(
"submit_allowed");
1332 $this->tpl->setVariable(
"TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt(
"tst_confirm_submit_answers"));
1333 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_submit_results"));
1335 $this->tpl->setVariable(
"BTN_BACK", $this->lng->txt(
"back"));
1336 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"finalSubmission"));
1337 $this->tpl->parseCurrentBlock();
1344 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
1345 $processing_time = $this->
object->getProcessingTimeInSeconds($active_id);
1346 $processing_time_minutes = floor($processing_time / 60);
1347 $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1348 $str_processing_time =
"";
1349 if ($processing_time_minutes > 0)
1351 $str_processing_time = $processing_time_minutes .
" " . ($processing_time_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1353 if ($processing_time_seconds > 0)
1355 if (strlen($str_processing_time) > 0) $str_processing_time .=
" " . $this->lng->txt(
"and") .
" ";
1356 $str_processing_time .= $processing_time_seconds .
" " . ($processing_time_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1358 $time_left = $starting_time + $processing_time - mktime();
1359 $time_left_minutes = floor($time_left / 60);
1360 $time_left_seconds = $time_left - $time_left_minutes * 60;
1361 $str_time_left =
"";
1362 if ($time_left_minutes > 0)
1364 $str_time_left = $time_left_minutes .
" " . ($time_left_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1366 if ($time_left < 300)
1368 if ($time_left_seconds > 0)
1370 if (strlen($str_time_left) > 0) $str_time_left .=
" " . $this->lng->txt(
"and") .
" ";
1371 $str_time_left .= $time_left_seconds .
" " . ($time_left_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1374 $date = getdate($starting_time);
1386 $datenow = getdate();
1387 $this->tpl->setCurrentBlock(
"enableprocessingtime");
1388 $this->tpl->setVariable(
"USER_WORKING_TIME",
1390 $this->lng->txt(
"tst_time_already_spent"),
1391 $formattedStartingTime,
1392 $str_processing_time
1395 $this->tpl->setVariable(
"USER_REMAINING_TIME", sprintf($this->lng->txt(
"tst_time_already_spent_left"), $str_time_left));
1396 $this->tpl->parseCurrentBlock();
1397 $template =
new ilTemplate(
"tpl.workingtime.js.html", TRUE, TRUE,
'Modules/Test');
1398 $template->setVariable(
"STRING_MINUTE", $this->lng->txt(
"minute"));
1399 $template->setVariable(
"STRING_MINUTES", $this->lng->txt(
"minutes"));
1400 $template->setVariable(
"STRING_SECOND", $this->lng->txt(
"second"));
1401 $template->setVariable(
"STRING_SECONDS", $this->lng->txt(
"seconds"));
1402 $template->setVariable(
"STRING_TIMELEFT", $this->lng->txt(
"tst_time_already_spent_left"));
1403 $template->setVariable(
"AND", strtolower($this->lng->txt(
"and")));
1404 $template->setVariable(
"YEAR", $date[
"year"]);
1405 $template->setVariable(
"MONTH", $date[
"mon"]-1);
1406 $template->setVariable(
"DAY", $date[
"mday"]);
1407 $template->setVariable(
"HOUR", $date[
"hours"]);
1408 $template->setVariable(
"MINUTE", $date[
"minutes"]);
1409 $template->setVariable(
"SECOND", $date[
"seconds"]);
1410 if ($this->object->isEndingTimeEnabled() && preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->object->getEndingTime(), $matches))
1412 $template->setVariable(
"ENDYEAR", $matches[1]);
1413 $template->setVariable(
"ENDMONTH", $matches[2]-1);
1414 $template->setVariable(
"ENDDAY", $matches[3]);
1415 $template->setVariable(
"ENDHOUR", $matches[4]);
1416 $template->setVariable(
"ENDMINUTE", $matches[5]);
1417 $template->setVariable(
"ENDSECOND", $matches[6]);
1419 $template->setVariable(
"YEARNOW", $datenow[
"year"]);
1420 $template->setVariable(
"MONTHNOW", $datenow[
"mon"]-1);
1421 $template->setVariable(
"DAYNOW", $datenow[
"mday"]);
1422 $template->setVariable(
"HOURNOW", $datenow[
"hours"]);
1423 $template->setVariable(
"MINUTENOW", $datenow[
"minutes"]);
1424 $template->setVariable(
"SECONDNOW", $datenow[
"seconds"]);
1425 $template->setVariable(
"PTIME_M", $processing_time_minutes);
1426 $template->setVariable(
"PTIME_S", $processing_time_seconds);
1428 $this->tpl->setCurrentBlock(
"HeadContent");
1429 $this->tpl->setVariable(
"CONTENT_BLOCK", $template->get());
1430 $this->tpl->parseCurrentBlock();
1433 protected function showSideList($presentationMode, $currentSequenceElement)
1437 $sideListActive = $ilUser->getPref(
'side_list_of_questions');
1445 $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence,
false);
1447 require_once
'Modules/Test/classes/class.ilTestQuestionSideListGUI.php';
1449 $questionSideListGUI->setTargetGUI($this);
1450 $questionSideListGUI->setQuestionSummaryData($questionSummaryData);
1451 $questionSideListGUI->setCurrentSequenceElement($currentSequenceElement);
1452 $questionSideListGUI->setCurrentPresentationMode($presentationMode);
1453 $questionSideListGUI->setDisabled($presentationMode == self::PRESENTATION_MODE_EDIT);
1454 $this->tpl->setVariable(
'LIST_OF_QUESTIONS', $questionSideListGUI->getHTML());
1463 public function outQuestionSummaryCmd($fullpage =
true, $contextFinishTest =
false, $obligationsNotAnswered =
false, $obligationsFilter =
false)
1467 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_question_summary.html",
"Modules/Test");
1470 if( $obligationsNotAnswered )
1475 if( $this->object->getKioskMode() && $fullpage )
1480 $this->tpl->setCurrentBlock(
"kiosk_options");
1481 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1482 $this->tpl->parseCurrentBlock();
1487 $active_id = $this->testSession->getActiveId();
1488 $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, $obligationsFilter);
1490 $this->ctrl->setParameter($this,
"sequence",
$_GET[
"sequence"]);
1494 include_once
"./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
1497 $table_gui->setShowPointsEnabled( !$this->object->getTitleOutput() );
1498 $table_gui->setShowMarkerEnabled( $this->object->getShowMarker() );
1499 $table_gui->setObligationsNotAnswered( $obligationsNotAnswered );
1500 $table_gui->setShowObligationsEnabled( $this->object->areObligationsEnabled() );
1501 $table_gui->setObligationsFilterEnabled( $obligationsFilter );
1506 $table_gui->setData($questionSummaryData);
1508 $this->tpl->setVariable(
'TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1510 if( $this->object->getEnableProcessingTime() )
1529 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_max_allowed_users_reached.html",
"Modules/Test");
1530 $this->tpl->setCurrentBlock(
"adm_content");
1531 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt(
"tst_max_allowed_users_message"), $this->
object->getAllowedUsersTimeGap()));
1532 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt(
"tst_max_allowed_users_heading"), $this->
object->getAllowedUsersTimeGap()));
1534 $this->tpl->setVariable(
"TXT_BACK_TO_INFOSCREEN", $this->lng->txt(
"tst_results_back_introduction"));
1535 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1536 $this->tpl->parseCurrentBlock();
1551 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1553 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1554 $this->tpl->setCurrentBlock(
"ContentStyle");
1556 $this->tpl->parseCurrentBlock();
1558 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1560 $this->tpl->parseCurrentBlock();
1563 if ($this->object->getShowSolutionAnswersOnly())
1568 $this->tpl->setCurrentBlock(
"adm_content");
1570 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1571 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1572 $this->ctrl->saveParameter($this,
"pass");
1573 $this->ctrl->saveParameter($this,
"active_id");
1574 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1575 $this->tpl->parseCurrentBlock();
1591 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_finish_list_of_answers.html",
"Modules/Test");
1593 $result_array =& $this->
object->getTestResult(
1599 foreach ($result_array as $question_data)
1601 $question = $question_data[
"qid"];
1602 if (is_numeric($question))
1604 $this->tpl->setCurrentBlock(
"printview_question");
1605 $question_gui = $this->
object->createQuestionGUI(
"", $question);
1606 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
1607 $template->setVariable(
"COUNTER_QUESTION", $counter.
". ");
1608 $template->setVariable(
"QUESTION_TITLE", $question_gui->object->getTitle());
1610 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
1611 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback());
1612 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
1613 $this->tpl->setVariable(
"QUESTION_OUTPUT", $template->get());
1614 $this->tpl->parseCurrentBlock();
1620 if ($this->object->getShowSolutionAnswersOnly())
1624 if (strlen($top_data))
1626 $this->tpl->setCurrentBlock(
"top_data");
1627 $this->tpl->setVariable(
"TOP_DATA", $top_data);
1628 $this->tpl->parseCurrentBlock();
1631 if (strlen($bottom_data))
1633 $this->tpl->setCurrentBlock(
"bottom_data");
1634 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1635 $this->tpl->setVariable(
"BOTTOM_DATA", $bottom_data);
1636 $this->tpl->parseCurrentBlock();
1639 $this->tpl->setCurrentBlock(
"adm_content");
1640 $this->tpl->setVariable(
"TXT_ANSWER_SHEET", $this->lng->txt(
"tst_list_of_answers"));
1643 $this->tpl->setVariable(
"USER_DETAILS", $user_data);
1644 $this->tpl->setVariable(
"SIGNATURE", $signature);
1645 $this->tpl->setVariable(
"TITLE", $this->object->getTitle());
1646 $this->tpl->setVariable(
"TXT_TEST_PROLOG", $this->lng->txt(
"tst_your_answers"));
1647 $invited_user =& $this->
object->getInvitedUsers($ilUser->getId());
1648 $pagetitle = $this->
object->getTitle() .
" - " . $this->lng->txt(
"clientip") .
1649 ": " . $invited_user[$ilUser->getId()][
"clientip"] .
" - " .
1650 $this->lng->txt(
"matriculation") .
": " .
1651 $invited_user[$ilUser->getId()][
"matriculation"];
1652 $this->tpl->setVariable(
"PAGETITLE", $pagetitle);
1653 $this->tpl->parseCurrentBlock();
1663 if ($this->object->getKioskMode())
1665 $this->tpl->setBodyClass(
"kiosk");
1666 $this->tpl->setAddFooter(FALSE);
1671 return "ADM_CONTENT";
1677 $this->ctrl->redirectByClass(
1678 array(
'ilRepositoryGUI',
'ilObjTestGUI',
'ilTestEvaluationGUI'),
"outUserResultsOverview" 1689 $this->ctrl->setParameter($this,
'pmode', self::PRESENTATION_MODE_EDIT);
1691 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1702 $this->ctrl->setParameter($this,
'pmode', self::PRESENTATION_MODE_EDIT);
1704 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1723 $this->tpl->addBlockFile(
1724 $this->
getContentBlockName(),
'adm_content',
'tpl.il_as_tst_question_summary.html',
'Modules/Test' 1727 if ($this->object->getKioskMode())
1735 $this->tpl->addBlockFile(
1748 $this->tpl->setCurrentBlock(
"kiosk_options");
1749 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1750 $this->tpl->parseCurrentBlock();
1756 if( $this->ctrl->getNextClass() ==
'iltestpasswordprotectiongui' )
1761 if( !$this->passwordChecker->isPasswordProtectionPageRedirectRequired() )
1768 $nextCommand = $this->ctrl->getCmdClass().
'::'.$this->ctrl->getCmd();
1769 $this->ctrl->setParameterByClass(
'ilTestPasswordProtectionGUI',
'nextCommand', $nextCommand);
1770 $this->ctrl->redirectByClass(
'ilTestPasswordProtectionGUI',
'showPasswordForm');
1775 if( !$this->object->isInstantFeedbackAnswerFixationEnabled() )
1780 if( !$this->testSequence->isQuestionChecked($questionId) )
1793 return $this->lng->txt(
"save_introduction");
1798 $this->assSettings =
new ilSetting(
'assessment');
1807 $questionList->load();
1809 $testResults = $this->
object->getTestResult($testSession->
getActiveId(), $testSession->
getPass(),
true);
1811 require_once
'Modules/Test/classes/class.ilTestSkillEvaluation.php';
1812 $skillEvaluation =
new ilTestSkillEvaluation($this->db, $this->object->getTestId(), $this->
object->getRefId());
1815 $skillEvaluation->setActiveId($testSession->
getActiveId());
1816 $skillEvaluation->setPass($testSession->
getPass());
1818 $skillEvaluation->setNumRequiredBookingsForSkillTriggering($this->assSettings->get(
1823 $skillEvaluation->init($questionList);
1824 $skillEvaluation->evaluate($testResults);
1826 $skillEvaluation->handleSkillTriggering();
1833 require_once
'Modules/Test/classes/confirmations/class.ilTestAnswerOptionalQuestionsConfirmationGUI.php';
1836 $confirmation->setFormAction($this->ctrl->getFormAction($this));
1837 $confirmation->setCancelCmd(
'cancelAnswerOptionalQuestions');
1838 $confirmation->setConfirmCmd(
'confirmAnswerOptionalQuestions');
1840 $confirmation->build($this->object->isFixedTest());
1847 $this->testSequence->setAnsweringOptionalQuestionsConfirmed(
true);
1848 $this->testSequence->saveToDb();
1850 $this->ctrl->setParameter($this,
'activecommand',
'gotoquestion');
1851 $this->ctrl->redirect($this,
'redirectQuestion');
1856 if( $this->object->getListOfQuestions() )
1858 $this->ctrl->setParameter($this,
'activecommand',
'summary');
1862 $this->ctrl->setParameter($this,
'activecommand',
'previous');
1865 $this->ctrl->redirect($this,
'redirectQuestion');
1873 if($this->object->getKioskMode())
1875 $this->tpl->addBlockfile($this->
getContentBlockName(),
'content',
"tpl.il_as_tst_kiosk_mode_content.html",
"Modules/Test");
1876 $this->tpl->setContent($this->ctrl->getHTML($helperGui));
1891 if ($ilSetting->get(
'char_selector_availability') > 0)
1893 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1897 $char_selector->addToPage();
1898 $this->tpl->setCurrentBlock(
'char_selector');
1899 $this->tpl->setVariable(
"CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
1900 $this->tpl->parseCurrentBlock();
1913 require_once
'Modules/Test/classes/class.ilTestNavigationToolbarGUI.php';
1916 $navigationToolbarGUI->setSuspendTestButtonEnabled($this->object->getShowCancel());
1917 $navigationToolbarGUI->setQuestionTreeButtonEnabled($this->object->getListOfQuestions());
1918 $navigationToolbarGUI->setQuestionTreeVisible($ilUser->getPref(
'side_list_of_questions'));
1919 $navigationToolbarGUI->setQuestionListButtonEnabled($this->object->getListOfQuestions());
1922 return $navigationToolbarGUI;
1927 require_once
'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
1935 if($this->object->getShowMarker())
1937 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1941 if(count($solved_array) > 0)
1943 $solved = array_pop($solved_array);
1944 $solved = $solved[
"solved"];
1950 $navigationGUI->setQuestionMarked(
true);
1955 $navigationGUI->setQuestionMarked(
false);
1959 return $navigationGUI;
1964 require_once
'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
1967 if( $this->object->isForceInstantFeedbackEnabled() )
1980 case $this->
object->getSpecificAnswerFeedback():
1981 case $this->
object->getGenericAnswerFeedback():
1982 case $this->
object->getAnswerFeedbackPoints():
1983 case $this->
object->getInstantFeedbackSolution():
1985 $navigationGUI->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
1987 if( $this->object->isForceInstantFeedbackEnabled() )
1989 $navigationGUI->setForceInstantResponseEnabled(
true);
1999 if( $this->object->isOfferingQuestionHintsEnabled() )
2001 $activeId = $this->testSession->getActiveId();
2002 $pass = $this->testSession->getPass();
2004 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
2007 if( $questionHintTracking->requestsPossible() )
2012 if( $questionHintTracking->requestsExist() )
2018 $navigationGUI->setCharSelectorEnabled($charSelectorAvailable);
2020 if($this->object->getShowMarker())
2022 include_once
"./Modules/Test/classes/class.ilObjTest.php";
2026 if(count($solved_array) > 0)
2028 $solved = array_pop($solved_array);
2029 $solved = $solved[
"solved"];
2035 $navigationGUI->setQuestionMarked(
true);
2040 $navigationGUI->setQuestionMarked(
false);
2044 return $navigationGUI;
2052 if( !$this->object->getListOfQuestionsEnd() )
2054 return 'finishTest';
2057 if( $this->object->areObligationsEnabled() )
2060 $this->testSession->getTestId(), $this->testSession->getActiveId(), $this->testSession->getPass()
2063 if( !$allObligationsAnswered )
2065 return 'outQuestionSummaryWithObligationsInfo';
2069 return 'outQuestionSummary';
2079 $this->tpl->setVariable(
"AUTOSAVE_URL", $this->ctrl->getFormAction(
2083 if( $questionGui->
isAutosaveable() && $this->
object->getAutosave() )
2087 $this->tpl->touchBlock(
'autosave');
2088 $this->tpl->setVariable(
"AUTOSAVEFORMACTION", $formAction);
2089 $this->tpl->setVariable(
"AUTOSAVEINTERVAL", $this->object->getAutosaveIval());
2100 if($this->object->getInstantFeedbackSolution())
2105 $solutionoutput = $questionGui->
getSolutionOutput($this->testSession->getActiveId(), #active_id
2106 $this->testSession->getPass(), #pass
2107 FALSE, #graphical_output
2108 $show_question_inline_score, #result_output
2109 FALSE, #show_question_only
2110 FALSE, #show_feedback
2111 TRUE, #show_correct_solution
2112 FALSE, #show_manual_scoring
2113 FALSE #show_question_text
2118 $reachedPoints = $questionGui->object->getAdjustedReachedPoints(
2119 $this->testSession->getActiveId(), NULL, $authorizedSolution
2122 $maxPoints = $questionGui->object->getMaximumPoints();
2124 $solutionCorrect = ($reachedPoints == $maxPoints);
2128 if($this->object->getAnswerFeedbackPoints())
2135 if($this->object->getGenericAnswerFeedback())
2142 if($this->object->getSpecificAnswerFeedback())
2155 return $this->testSession->getLastSequence();
2160 if( isset(
$_GET[
'sequence']) )
2162 return $_GET[
'sequence'];
2170 if( isset(
$_GET[
'pmode']) )
2172 return $_GET[
'pmode'];
2180 if( isset(
$_GET[
'instresp']) )
2182 return $_GET[
'instresp'];
2190 if( isset(
$_POST[
'nextcmd']) && strlen(
$_POST[
'nextcmd']) )
2192 return $_POST[
'nextcmd'];
2200 if( isset(
$_POST[
'nextseq']) && is_numeric(
$_POST[
'nextseq']) )
2202 return (
int)
$_POST[
'nextseq'];
2220 if( !$fromCache || !isset($this->cachedQuestionGuis[$questionId]) )
2222 $questionGui = $this->
object->createQuestionGUI(
"", $questionId);
2223 $questionGui->setTargetGui($this);
2225 $questionGui->object->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2229 $this->cachedQuestionGuis[$questionId] = $questionGui;
2232 return $this->cachedQuestionGuis[$questionId];
2248 if( !$fromCache || !isset($this->cachedQuestionObjects[$questionId]) )
2253 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
2255 $processLockerFactory->setQuestionId($questionOBJ->getId());
2256 $processLockerFactory->setUserId($ilUser->getId());
2257 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
2259 $questionOBJ->setProcessLocker($processLockerFactory->getLocker());
2261 $questionOBJ->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2264 $this->cachedQuestionObjects[$questionId] = $questionOBJ;
2267 return $this->cachedQuestionObjects[$questionId];
2276 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
2280 $questionId.$this->testSession->getActiveId().$this->testSession->getPass()
2295 $ilLog->write(
"INV SEQ:" 2296 .
"active={$this->testSession->getActiveId()} " 2297 .
"qId=$questionId seq=$sequenceElement " 2298 . serialize($this->testSequence)
2301 $ilLog->logStack(
'INV SEQ');
2303 $this->ctrl->setParameter($this,
'sequence', $this->testSequence->getFirstSequence());
2312 if($this->object->getKioskMode())
2314 $this->tpl->addBlockfile($this->
getContentBlockName(),
'content',
"tpl.il_as_tst_kiosk_mode_content.html",
"Modules/Test");
2315 $this->tpl->setContent($contentHTML);
2325 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
2326 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
2327 require_once
'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
2332 if( $this->object->getKioskMode() )
2334 $this->tpl->addJavaScript(
'Services/UICore/lib/bootstrap-3.2.0/dist/js/bootstrap.min.js',
true);
2340 $tpl =
new ilTemplate(
'tpl.tst_player_confirmation_modal.html',
true,
true,
'Modules/Test');
2342 $tpl->setVariable(
'CONFIRMATION_TEXT', $this->lng->txt(
'discard_answer_confirmation'));
2346 $button->setCaption(
'yes');
2347 $tpl->setCurrentBlock(
'buttons');
2348 $tpl->setVariable(
'BUTTON', $button->render());
2349 $tpl->parseCurrentBlock();
2352 $button->setId(
'tst_cancel_discard_button');
2353 $button->setCaption(
'no');
2354 $button->setPrimary(
true);
2355 $tpl->setCurrentBlock(
'buttons');
2356 $tpl->setVariable(
'BUTTON', $button->render());
2357 $tpl->parseCurrentBlock();
2360 $modal->setId(
'tst_discard_solution_modal');
2361 $modal->setHeading($this->lng->txt(
'discard_answer'));
2362 $modal->setBody(
$tpl->get());
2364 $this->tpl->setCurrentBlock(
'discard_solution_modal');
2365 $this->tpl->setVariable(
'DISCARD_SOLUTION_MODAL', $modal->getHTML());
2366 $this->tpl->parseCurrentBlock();
2368 $this->tpl->addJavaScript(
'Modules/Test/js/ilTestPlayerDiscardSolutionModal.js',
true);
2373 require_once
'Services/Form/classes/class.ilFormPropertyGUI.php';
2374 require_once
'Services/Form/classes/class.ilHiddenInputGUI.php';
2376 $tpl =
new ilTemplate(
'tpl.tst_player_confirmation_modal.html',
true,
true,
'Modules/Test');
2378 $tpl->setVariable(
'CONFIRMATION_TEXT', $this->lng->txt(
'tst_nav_while_edit_modal_text'));
2382 $button->setCaption(
'tst_nav_while_edit_modal_save_btn');
2383 $button->setPrimary(
true);
2384 $tpl->setCurrentBlock(
'buttons');
2385 $tpl->setVariable(
'BUTTON', $button->render());
2386 $tpl->parseCurrentBlock();
2388 foreach(array(
'nextcmd',
'nextseq') as $hiddenPostVar)
2391 $nextCmdInp->setValue(
'');
2392 $tpl->setCurrentBlock(
'hidden_inputs');
2393 $tpl->setVariable(
'HIDDEN_INPUT', $nextCmdInp->getToolbarHTML());
2394 $tpl->parseCurrentBlock();
2398 $this->ctrl->setParameter($this,
'pmode', self::PRESENTATION_MODE_VIEW);
2399 $button->setId(
'nextCmdLink');
2400 $button->setUrl(
'#');
2402 $button->setCaption(
'tst_nav_while_edit_modal_nosave_btn');
2403 $tpl->setCurrentBlock(
'buttons');
2404 $tpl->setVariable(
'BUTTON', $button->render());
2405 $tpl->parseCurrentBlock();
2408 $button->setId(
'tst_cancel_nav_while_edit_button');
2409 $button->setCaption(
'tst_nav_while_edit_modal_cancel_btn');
2410 $tpl->setCurrentBlock(
'buttons');
2411 $tpl->setVariable(
'BUTTON', $button->render());
2412 $tpl->parseCurrentBlock();
2415 $modal->setId(
'tst_nav_while_edit_modal');
2416 $modal->setHeading($this->lng->txt(
'tst_nav_while_edit_modal_header'));
2417 $modal->setBody(
$tpl->get());
2419 $this->tpl->setCurrentBlock(
'nav_while_edit_modal');
2420 $this->tpl->setVariable(
'NAV_WHILE_EDIT_MODAL', $modal->getHTML());
2421 $this->tpl->parseCurrentBlock();
2423 $this->tpl->addJavaScript(
'Modules/Test/js/ilTestPlayerNavWhileEditModal.js',
true);
2428 if( $isQuestionWorkedThrough )
2430 return self::PRESENTATION_MODE_VIEW;
2433 return self::PRESENTATION_MODE_EDIT;
static makeDirParents($a_dir)
Create a new directory and all parent directories.
populateSyntaxStyleBlock()
redirectAfterAutosaveCmd()
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
submitIntermediateSolutionCmd()
startPlayerCmd()
Start a test for the first time.
getSolutionOutput( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
const AFTER_TEST_PASS_FINISHED
populateDiscardSolutionModal()
performTestPassFinishedTasks($finishedPass)
const CMD_CONFIRM_REQUEST
isQuestionSummaryFinishTestButtonRequired()
outObligationsOnlySummaryCmd()
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
showAnswerOptionalQuestionsConfirmation()
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
const SHOW_REQUESTED_HINTS_LIST
isFirstQuestionInSequence($sequenceElement)
populateSpecificFeedbackBlock($question_gui)
populateContentStyleBlock()
handleQuestionActionCmd()
getAccessCodeFromSession()
markQuestionAndSaveIntermediateCmd()
checkOnlineTestAccess()
check access restrictions like client ip, partipating user etc.
setAnonymousIdCmd()
Sets a session variable with the test access code for an anonymous test user.
determineSolutionPassIndex(assQuestionGUI $questionGui)
const QUESTION_SUMMARY_INC_OBLIGATIONS
const SHOW_FINAL_STATMENT
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
showQuestionEditable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
getPresentationModeParameter()
outUserResultsOverviewCmd()
isLastQuestionInSequence($sequenceElement)
getObjectiveOrientedContainer()
confirmSubmitAnswers()
confirm submit results if confirm then results are submitted and the screen will be redirected to the...
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not ...
setPreviousSolutionPrefilled($previousSolutionPrefilled)
saveTagsCmd()
Save tags for tagging gui.
isTestSignRedirectRequired($activeId, $lastFinishedPass)
static get($a_var)
Get a value.
populateHelperGuiContent($helperGui)
const BACK_FROM_FINISHING
getNextCommandParameter()
doesAccessCodeInSessionExists()
populateLowerPreviousButtonBlock($disabled)
toggleSideListCmd()
Toggle side list.
getResultsSignature()
Returns HTML code for a signature field.
cancelAnswerOptionalQuestionsCmd()
setAnonymousId($anonymous_id)
buildNextButtonInstance($disabled)
const CSS_CLASS_FEEDBACK_CORRECT
_getSolvedQuestions($active_id, $question_fi=null)
get solved questions
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
handleUserSettings()
Handles some form parameters on starting and resuming a test.
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
const BACK_TO_INFO_SCREEN
showListOfAnswers($active_id, $pass=NULL, $top_data="", $bottom_data="")
Creates an output of the list of answers for a test participant during the test (only the actual pass...
afterTestPassFinishedCmd()
buildReadOnlyStateQuestionNavigationGUI($questionId)
const SUBMIT_SOLUTION_AND_NEXT
populateCharSelectorIfRequired()
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
confirmHintRequestCmd()
Go to hint request confirmation.
populateUpperNextButtonBlock($disabled)
getSyntaxStylePath()
get syntax style path
__construct($a_object)
ilTestOutputGUI constructor
maxProcessingTimeReached()
Outputs a message when the maximum processing time is reached.
populateLowerNextButtonBlock($disabled)
showRequestedHintListCmd()
Go to requested hint list.
prepareTestPage($presentationMode, $sequenceElement, $questionId)
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
populateInstantResponseBlocks(assQuestionGUI $questionGui, $authorizedSolution)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
isNrOfTriesReached()
nr of tries exceeded
ensureExistingTestSession(ilTestSession $testSession)
static getInstance(ilTestSession $a_test_session)
confirmFinishCmd()
The final submission of a test was confirmed.
markQuestionCmd()
Set a question solved.
getInstantResponseParameter()
handleSkillTriggering(ilTestSession $testSession)
buildEditableStateQuestionNavigationGUI($questionId, $charSelectorAvailable)
buildTestPassQuestionList()
$maxProcessingTimeReached
showSideList($presentationMode, $currentSequenceElement)
populateGenericFeedbackBlock(assQuestionGUI $question_gui, $solutionCorrect)
static getJSLocation($a_js_name, $a_js_location="", $add_version=FALSE)
get full javascript file name (path inclusive) of current user
populatePreviousButtons($disabled)
outQuestionSummaryWithObligationsInfoCmd()
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
const CONFIRM_HINT_REQUEST
getIntroductionPageButtonLabel()
special template class to simplify handling of ITX/PEAR
const PRESENTATION_MODE_EDIT
resumePlayerCmd()
Resume a test at the last position.
endingTimeReached()
handle endingTimeReached
const ACCESS_CODE_CONFIRMED
const REDIRECT_ON_TIME_LIMIT
static formatDate(ilDateTime $date)
Format a date public.
Output class for assessment test evaluation.
populateTestNavigationToolbar(ilTestNavigationToolbarGUI $toolbarGUI)
lookupExamId($active_id, $pass)
redirection script todo: (a better solution should control the processing via a xml file) ...
const SHOW_INSTANT_RESPONSE
static _getCurrentGUI(ilObjTest $a_test_obj=null)
Get the GUI that is used for the currently available selector (other GUI instances may exist for conf...
populateNextButtons($disabled)
const CSS_CLASS_FEEDBACK_WRONG
getSequenceElementParameter()
Basic GUI class for assessment questions.
_getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
static getIdleValue($fixedMode=false)
Returns the idle time in seconds.
const PRESENTATION_MODE_VIEW
const PRESENTATION_CONTEXT_TEST
archiveParticipantSubmission( $active, $pass)
initProcessLocker($activeId)
static _instantiateQuestion($question_id)
outQuestionForTest( $formaction, $active_id, $pass, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
isShowingPostponeStatusReguired($questionId)
outQuestionSummaryCmd($fullpage=true, $contextFinishTest=false, $obligationsNotAnswered=false, $obligationsFilter=false)
Output of a summary of all test questions for test participants.
unmarkQuestionCmd()
Set a question unsolved.
handlePasswordProtectionRedirect()
const UNMARK_QUESTION_SAVE
const QUESTION_SUMMARY_OBLIGATIONS_ONLY
static getInstance()
Get instance.
isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)
const CMD_SHOW_LIST
command constants
showQuestionViewable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
isTestAccessible()
test accessible returns true if the user can perform the test
populateMessageContent($contentHTML)
populateUpperPreviousButtonBlock($disabled)
const DISPLAY_ACCESS_CODE
buildQuestionAnswerShuffler($questionId)
showMaximumAllowedUsersReachedMessage()
getContentStylePath($a_style_id)
get content style path
populateQuestionNavigation($sequenceElement, $disabled)
outProcessingTime($active_id)
getNextSequenceParameter()
determineInlineScoreDisplay()
static generatePDF($pdf_output, $output_mode, $filename=null)
getQuestionGuiInstance($questionId, $fromCache=true)
static buildExamId($active_id, $pass, $test_obj_id=null)
getQuestionInstance($questionId, $fromCache=true)
getQuestionsDefaultPresentationMode($isQuestionWorkedThrough)
unmarkQuestionAndSaveIntermediateCmd()
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
Service GUI class for tests.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
initTestCmd()
Start a test for the first time after a redirect.
buildPreviousButtonInstance($disabled)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
finishTestCmd($requires_confirmation=true)
handleTearsAndAngerQuestionIsNull($questionId, $sequenceElement)
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
getCurrentSequenceElement()
static redirect($a_script)
http redirect to other script
confirmAnswerOptionalQuestionsCmd()
static getWebspaceDir($mode="filesystem")
get webspace directory
populateNavWhileEditModal()
getTestNavigationToolbarGUI()
populateIntermediateSolutionSaver(assQuestionGUI $questionGui)
populateSolutionBlock($solutionoutput)
populateScoreBlock($reachedPoints, $maxPoints)
isParticipantsAnswerFixed($questionId)
Output class for assessment test execution.
Confirmation screen class.
setNavigationGUI($navigationGUI)