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';
71 parent::__construct($a_object);
72 $this->ref_id =
$_GET[
"ref_id"];
75 require_once
'Modules/Test/classes/class.ilTestPasswordChecker.php';
78 $this->processLocker = null;
79 $this->testSession = null;
80 $this->assSettings = null;
87 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
90 $this->
ilias->raiseError($this->lng->txt(
"cannot_execute_test"), $this->
ilias->error_obj->MESSAGE);
96 $executable = $this->
object->isExecutable($this->testSession, $this->testSession->getUserId());
98 if( !$executable[
'executable'] )
101 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
109 if( $testSession->
getUserId() != $DIC->user()->getId() )
111 throw new ilTestException(
'active id given does not relate to current user!');
124 $testSession->
setUserId($ilUser->getId());
143 require_once
'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
146 $processLockerFactory->setActiveId($activeId);
148 $this->processLocker = $processLockerFactory->getLocker();
159 include_once(
"./Services/Tagging/classes/class.ilTaggingGUI.php");
161 $tagging_gui->setObject($this->
object->getId(), $this->
object->getType());
162 $tagging_gui->saveInput();
163 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
173 $this->
object->updateWorkingTime(
$_SESSION[
"active_time_id"]);
176 $_SESSION[
"active_time_id"] = $this->
object->startWorkingTime(
177 $this->testSession->getActiveId(), $this->testSession->getPass()
191 $this->testSession->getActiveId(), $this->testSession->getPass()
205 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
218 $active_id = $this->testSession->getActiveId();
219 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
220 if ($starting_time === FALSE)
226 return $this->
object->isMaxProcessingTimeReached($starting_time, $active_id);
232 $show_question_inline_score = FALSE;
233 if ($this->
object->getAnswerFeedbackPoints())
235 $show_question_inline_score = TRUE;
236 return $show_question_inline_score;
238 return $show_question_inline_score;
243 $this->tpl->setCurrentBlock(
'test_nav_toolbar');
244 $this->tpl->setVariable(
'TEST_NAV_TOOLBAR', $toolbarGUI->getHTML());
245 $this->tpl->parseCurrentBlock();
276 $button->setId(
'bottomnextbutton');
278 $this->tpl->setCurrentBlock(
"next_bottom" );
279 $this->tpl->setVariable(
"BTN_NEXT", $button->render());
280 $this->tpl->parseCurrentBlock();
286 $button->setId(
'nextbutton');
288 $this->tpl->setCurrentBlock(
"next" );
289 $this->tpl->setVariable(
"BTN_NEXT", $button->render());
290 $this->tpl->parseCurrentBlock();
296 $button->setId(
'bottomprevbutton');
298 $this->tpl->setCurrentBlock(
"prev_bottom" );
299 $this->tpl->setVariable(
"BTN_PREV", $button->render());
300 $this->tpl->parseCurrentBlock();
306 $button->setId(
'prevbutton');
308 $this->tpl->setCurrentBlock(
"prev" );
309 $this->tpl->setVariable(
"BTN_PREV", $button->render());
310 $this->tpl->parseCurrentBlock();
322 $button->setPrimary($primaryNext);
323 $button->setRightGlyph(
'glyphicon glyphicon-arrow-right');
327 $button->setCaption(
'next_question');
328 $button->addCSSClass(
'ilTstNavElem');
341 $button->setLeftGlyph(
'glyphicon glyphicon-arrow-left');
345 $button->setCaption(
'previous_question');
346 $button->addCSSClass(
'ilTstNavElem');
353 $this->tpl->setCurrentBlock(
"specific_feedback" );
354 $this->tpl->setVariable(
"SPECIFIC_FEEDBACK",
355 $question_gui->getSpecificFeedbackOutput(
356 $this->testSession->getActiveId(),
360 $this->tpl->parseCurrentBlock();
367 if( strlen($feedback) )
369 $cssClass = ( $solutionCorrect ?
373 $this->tpl->setCurrentBlock(
"answer_feedback" );
374 $this->tpl->setVariable(
"ANSWER_FEEDBACK", $feedback);
375 $this->tpl->setVariable(
"ILC_FB_CSS_CLASS", $cssClass);
376 $this->tpl->parseCurrentBlock();
382 $scoreInformation = sprintf(
383 $this->lng->txt(
"you_received_a_of_b_points" ), $reachedPoints, $maxPoints
386 $this->tpl->setCurrentBlock(
"received_points_information" );
387 $this->tpl->setVariable(
"RECEIVED_POINTS_INFORMATION", $scoreInformation);
388 $this->tpl->parseCurrentBlock();
393 if( strlen($solutionoutput) )
395 $this->tpl->setCurrentBlock(
"solution_output" );
396 $this->tpl->setVariable(
"CORRECT_SOLUTION", $this->lng->txt(
"tst_best_solution_is" ) );
397 $this->tpl->setVariable(
"QUESTION_FEEDBACK", $solutionoutput );
398 $this->tpl->parseCurrentBlock();
404 $this->tpl->setCurrentBlock(
"SyntaxStyle" );
405 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
408 $this->tpl->parseCurrentBlock();
413 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
414 $this->tpl->setCurrentBlock(
"ContentStyle" );
415 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
418 $this->tpl->parseCurrentBlock();
428 if( $this->testSession->isAnonymousUser() )
430 $this->testSession->setAccessCodeToSession(
$_POST[
'anonymous_id']);
433 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
445 $isFirstTestStartRequest =
false;
447 $this->processLocker->executeTestStartLockOperation(
function() use ($testStartLock, &$isFirstTestStartRequest) {
449 if($this->testSession->lookupTestStartLock() != $testStartLock)
451 $this->testSession->persistTestStartLock($testStartLock);
452 $isFirstTestStartRequest =
true;
457 if( $isFirstTestStartRequest )
463 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'lock', $testStartLock);
464 $this->ctrl->redirectByClass(
"ilobjtestgui",
"redirectToInfoScreen");
473 elseif( isset(
$_GET[
'lock']) && strlen(
$_GET[
'lock']) )
475 return $_GET[
'lock'];
491 if ($this->
object->checkMaximumAllowedUsers() == FALSE)
496 if( $this->testSession->isAnonymousUser() && !$this->testSession->getActiveId() )
498 $accessCode = $this->testSession->createNewAccessCode();
500 $this->testSession->setAccessCodeToSession($accessCode);
501 $this->testSession->setAnonymousId($accessCode);
502 $this->testSession->saveToDb();
507 $this->testSession->unsetAccessCodeInSession();
513 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_anonymous_code_presentation.html",
"Modules/Test");
514 $this->tpl->setCurrentBlock(
"adm_content");
515 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt(
"tst_access_code_created"));
516 $this->tpl->setVariable(
"TEXT_ANONYMOUS_CODE", $this->testSession->getAccessCodeFromSession());
517 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
519 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"continue_work"));
520 $this->tpl->parseCurrentBlock();
535 if (
$_POST[
"chb_javascript"])
537 $ilUser->writePref(
"tst_javascript", 1);
541 $ilUser->writePref(
"tst_javascript", 0);
545 if ($this->
object->getNrOfTries() != 1)
547 if ($this->
object->getUsePreviousAnswers() == 1)
549 if (
$_POST[
"chb_use_previous_answers"])
551 $ilUser->writePref(
"tst_use_previous_answers", 1);
555 $ilUser->writePref(
"tst_use_previous_answers", 0);
563 $active_id = $this->testSession->getActiveId();
568 $this->testSession->setLastFinishedPass($this->testSession->getPass());
569 $this->testSession->increaseTestPass();
573 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_redirect_autosave.html",
"Modules/Test");
574 $this->tpl->setVariable(
"TEXT_REDIRECT", $this->lng->txt(
"redirectAfterSave"));
575 $this->tpl->setCurrentBlock(
"HeadContent");
576 $this->tpl->setVariable(
"CONTENT_BLOCK",
"<meta http-equiv=\"refresh\" content=\"5; url=" .
$url .
"\">");
577 $this->tpl->parseCurrentBlock();
585 $authorizedSolution = !$canSaveResult;
606 $res = is_int($db_res);
611 $result = $this->lng->txt(
"autosave_success");
615 $result = $this->lng->txt(
"autosave_failed");
620 if (!$canSaveResult && !$this->ctrl->isAsynch())
642 $this->testSession->getActiveId(),
643 $this->testSession->getPass()
646 $result[
'isAnswered'] = $state[
'authorized'];
647 $result[
'isAnswerChanged'] = $state[
'intermediate'];
670 $show_side_list = $ilUser->getPref(
'side_list_of_questions');
671 $ilUser->writePref(
'side_list_of_questions', !$show_side_list);
688 $questionId = $this->testSequence->getQuestionForSequence(
692 $this->
object->setQuestionSetSolved(1, $questionId, $this->testSession->getUserId());
710 $questionId = $this->testSequence->getQuestionForSequence(
714 $this->
object->setQuestionSetSolved(0, $questionId, $this->testSession->getUserId());
730 protected function confirmFinishTestCmd()
737 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
739 $confirmation->setFormAction($this->ctrl->getFormAction($this,
'confirmFinish'));
740 $confirmation->setHeaderText($this->lng->txt(
"tst_finish_confirmation_question"));
741 $confirmation->setConfirm($this->lng->txt(
"tst_finish_confirm_button"),
'confirmFinish');
753 $active_id = $this->testSession->getActiveId();
771 if( $this->
object->areObligationsEnabled() && !$allObligationsAnswered )
773 if( $this->
object->getListOfQuestions() )
786 if ($this->
object->getEnableExamview() && !isset(
$_GET[
'reviewed']) && $requires_confirmation)
788 $this->ctrl->redirectByClass(
'ilTestSubmissionReviewGUI',
"show");
793 if (($requires_confirmation) && ($actualpass == $this->
object->getNrOfTries() - 1))
796 return $this->confirmFinishTestCmd();
800 if(($actualpass == $this->
object->getNrOfTries() - 1) && (!$requires_confirmation))
803 #$ilAuth->setIdle(ilSession::getIdleValue(), false); 804 #$ilAuth->setExpire(0); 805 switch($this->
object->getMailNotification())
808 $this->
object->sendSimpleNotification($active_id);
811 $this->
object->sendAdvancedNotification($active_id);
820 if($this->
object->getMailNotificationType() == 1)
822 switch($this->
object->getMailNotification())
825 $this->
object->sendSimpleNotification($active_id);
828 $this->
object->sendAdvancedNotification($active_id);
843 require_once
'Modules/Test/classes/class.ilTestPassFinishTasks.php';
851 $activeId = $this->testSession->getActiveId();
852 $lastFinishedPass = $this->testSession->getLastFinishedPass();
857 $this->ctrl->redirectByClass(
'ilTestSignatureGUI',
'invokeSignaturePlugin');
861 if(!
$_GET[
'skipfinalstatement'])
863 if ($this->
object->getShowFinalStatement())
870 $redirection_mode = $this->
object->getRedirectionMode();
871 $redirection_url = $this->
object->getRedirectionUrl();
872 if( $redirection_url && $redirection_mode && !$this->
object->canViewResults() )
876 if( $this->
object->getKioskMode() )
893 if( !$this->
object->getSignSubmission() )
898 if( !is_null(
ilSession::get(
"signed_{$activeId}_{$lastFinishedPass}")) )
903 global $ilPluginAdmin;
905 $activePlugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_MODULE,
'Test',
'tsig');
907 if( !count($activePlugins) )
922 global $ilObjDataCache;
924 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
927 $objectivesList = null;
931 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
935 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
939 $objectivesList->loadObjectivesTitles();
941 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
942 $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
943 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
944 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
945 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
948 $results = $this->
object->getTestResult(
952 require_once
'class.ilTestEvaluationGUI.php';
954 $results_output = $testevaluationgui->getPassListOfAnswers(
955 $results, $active,
$pass,
false,
false,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder
958 require_once
'./Modules/Test/classes/class.ilTestArchiver.php';
960 $inst_id = $ilSetting->get(
'inst_id', null);
968 $filename = realpath($path) .
'/exam_N' . $inst_id .
'-' . $this->
object->getId()
969 .
'-' . $active .
'-' .
$pass .
'.pdf';
971 require_once
'class.ilTestPDFGenerator.php';
975 $archiver->handInParticipantSubmission( $active,
$pass,
$filename, $results_output );
980 $questions = $this->
object->getQuestions();
981 foreach ($questions as $question_id)
983 $question_object = $this->
object->getQuestionDataset( $question_id );
984 if ($question_object->type_tag ==
'assFileUpload')
1004 $handle = opendir( $candidate_path );
1005 while ($handle !==
false && (
$file = readdir( $handle )) !==
false)
1009 $filename_start =
'file_' . $active .
'_' .
$pass .
'_';
1011 if (strpos(
$file, $filename_start ) === 0)
1013 $archiver->handInParticipantQuestionMaterial( $active,
$pass, $question_id,
$file,
$file );
1019 $passdata = $this->
object->getTestResult(
1022 $overview = $testevaluationgui->getPassListOfAnswers(
1023 $passdata, $active,
$pass,
true,
false,
false,
true,
false, $objectivesList, $testResultHeaderLabelBuilder
1035 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1037 $testPassesSelector->setActiveId($this->testSession->getActiveId());
1038 $testPassesSelector->setLastFinishedPass($this->testSession->getLastFinishedPass());
1040 if( count($testPassesSelector->getReportablePasses()) )
1042 $this->ctrl->redirectByClass(
"ilTestEvaluationGUI",
"outUserResultsOverview");
1050 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'redirectToInfoScreen');
1058 $template =
new ilTemplate(
"tpl.il_as_tst_final_statement.html", TRUE, TRUE,
"Modules/Test");
1059 $this->ctrl->setParameter($this,
"skipfinalstatement", 1);
1061 $template->setVariable(
"FINALSTATEMENT", $this->
object->prepareTextareaOutput($this->object->getFinalStatement(),
true));
1062 $template->setVariable(
"BUTTON_CONTINUE", $this->lng->txt(
"btn_next"));
1070 $template =
new ilTemplate(
'tpl.il_as_tst_kiosk_head.html',
true,
true,
'Modules/Test');
1071 if ($this->
object->getShowKioskModeTitle())
1073 $template->setCurrentBlock(
"kiosk_show_title");
1074 $template->setVariable(
"TEST_TITLE", $this->
object->getTitle());
1075 $template->parseCurrentBlock();
1077 if ($this->
object->getShowKioskModeParticipant())
1079 $template->setCurrentBlock(
"kiosk_show_participant");
1080 $template->setVariable(
"PARTICIPANT_NAME_TXT", $this->lng->txt(
"login_as"));
1081 $template->setVariable(
"PARTICIPANT_NAME", $ilUser->getFullname());
1082 $template->setVariable(
"PARTICIPANT_LOGIN", $ilUser->getLogin());
1083 $template->setVariable(
"PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1084 $template->setVariable(
"PARTICIPANT_EMAIL", $ilUser->getEmail());
1085 $template->parseCurrentBlock();
1087 if ($this->
object->isShowExamIdInTestPassEnabled())
1090 $this->testSession->getActiveId() , $this->testSession->getPass(), $this->
object->getId()
1093 $template->setCurrentBlock(
"kiosk_show_exam_id");
1094 $template->setVariable(
"EXAM_ID_TXT", $this->lng->txt(
"exam_id"));
1095 $template->setVariable(
"EXAM_ID", $exam_id);
1096 $template->parseCurrentBlock();
1098 return $template->get();
1106 global
$ilUser, $ilNavigationHistory;
1108 $ilNavigationHistory->addItem($this->testSession->getRefId(),
1122 if ($this->
object->endingTimeReached())
1130 $this->ctrl->setParameter($this,
"sequence", $sequenceElement);
1135 if ($this->
object->getKioskMode())
1140 $this->tpl->setVariable(
"TEST_ID", $this->
object->getTestId());
1141 $this->tpl->setVariable(
"LOGIN", $ilUser->getLogin());
1142 $this->tpl->setVariable(
"SEQ_ID", $sequenceElement);
1143 $this->tpl->setVariable(
"QUEST_ID", $questionId);
1145 if ($this->
object->getEnableProcessingTime())
1150 $this->tpl->setVariable(
"PAGETITLE",
"- " . $this->
object->getTitle());
1152 if ($this->
object->isShowExamIdInTestPassEnabled() && !$this->
object->getKioskMode())
1154 $this->tpl->setCurrentBlock(
'exam_id_footer');
1156 $this->testSession->getActiveId(), $this->testSession->getPass(), $this->
object->getId()
1158 $this->tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1159 $this->tpl->parseCurrentBlock();
1162 if ($this->
object->getListOfQuestions())
1164 $this->
showSideList($presentationMode, $sequenceElement);
1175 $questionNavigationGUI->setQuestionWorkedThrough($isQuestionWorkedThrough);
1182 $answerFeedbackEnabled = (
1183 $instantResponse && $this->
object->getSpecificAnswerFeedback()
1187 $this->testSession->getActiveId(), #active_id
1188 $this->testSession->getPass(), #pass
1189 false, #graphical_output
1190 false, #result_output
1191 true, #show_question_only
1192 $answerFeedbackEnabled, #show_feedback
1193 false, #show_correct_solution
1194 false, #show_manual_scoring
1195 true #show_question_text
1201 $this->testSession->getActiveId(),
1205 $this->tpl->setCurrentBlock(
'readonly_css_class');
1206 $this->tpl->touchBlock(
'readonly_css_class');
1207 $this->tpl->parseCurrentBlock();
1209 $this->tpl->setVariable(
'QUESTION_OUTPUT', $pageoutput);
1211 $this->tpl->setVariable(
"FORMACTION", $formAction);
1213 $this->tpl->setVariable(
"FORM_TIMESTAMP",
time());
1221 if( $isQuestionWorkedThrough )
1223 $questionNavigationGUI->setDiscardSolutionButtonEnabled(
true);
1228 elseif( $this->
object->isPostponingEnabled() )
1230 $questionNavigationGUI->setSkipQuestionLinkTarget(
1238 $answerFeedbackEnabled = (
1239 $instantResponse && $this->
object->getSpecificAnswerFeedback()
1242 if( isset(
$_GET[
'save_error']) &&
$_GET[
'save_error'] == 1 && isset(
$_SESSION[
'previouspost']) )
1244 $userPostSolution =
$_SESSION[
'previouspost'];
1249 $userPostSolution =
false;
1255 $questionGui->setWithNoneAbove($this->
object->getMCScoring());
1256 $questionGui->setIsAnswered($isQuestionWorkedThrough);
1261 $qstConfig = $questionGui->object->getTestPresentationConfig();
1262 if( $qstConfig->isPreviousPassSolutionReuseAllowed() )
1265 if( $passIndex < $this->testSession->getPass() )
1267 $qstConfig->setSolutionInitiallyPrefilled(
true);
1272 $passIndex = $this->testSession->getPass();
1279 $formAction, #form_action
1280 $this->testSession->getActiveId(), #active_id
1284 $isPostponed, #is_postponed
1285 $userPostSolution, #user_post_solution
1286 $answerFeedbackEnabled #answer_feedback == inline_specific_feedback
1297 $this->populateQuestionEditControl($questionGui);
1304 require_once
'./Modules/Test/classes/class.ilObjTest.php';
1308 $currentSolutionAvailable = $questionGui->object->authorizedOrIntermediateSolutionExists(
1309 $this->testSession->getActiveId(), $this->testSession->getPass()
1312 if( !$currentSolutionAvailable )
1314 $previousPass = $questionGui->object->getSolutionMaxPass(
1315 $this->testSession->getActiveId()
1318 $previousSolutionAvailable = $questionGui->object->authorizedSolutionExists(
1319 $this->testSession->getActiveId(), $previousPass
1322 if( $previousSolutionAvailable )
1324 return $previousPass;
1329 return $this->testSession->getPass();
1344 $this->ctrl->saveParameter($this,
'sequence');
1366 $user = $this->
object->getInvitedUsers($ilUser->getId());
1367 if (!is_array ($user) || count($user)!=1)
1370 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1373 $user = array_pop($user);
1375 if (strcmp($user[
"clientip"],
"")!=0 && strcmp($user[
"clientip"],
$_SERVER[
"REMOTE_ADDR"])!=0)
1378 $this->ctrl->redirectByClass(
"ilobjtestgui",
"backToRepository");
1390 and $this->
object->startingTimeReached()
1391 and !$this->
object->endingTimeReached();
1399 return $this->
object->hasNrOfTriesRestriction() && $this->
object->isNrOfTriesReached($this->testSession->getPass());
1410 $this->testSession->increasePass();
1411 $this->testSession->setLastSequence(0);
1412 $this->testSession->saveToDb();
1436 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_submit_answers_confirm.html",
"Modules/Test");
1437 $this->tpl->setCurrentBlock(
"adm_content");
1438 if ($this->
object->isTestFinished($this->testSession->getActiveId()))
1440 $this->tpl->setCurrentBlock(
"not_submit_allowed");
1441 $this->tpl->setVariable(
"TEXT_ALREADY_SUBMITTED", $this->lng->txt(
"tst_already_submitted"));
1442 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_show_answer_sheet"));
1445 $this->tpl->setCurrentBlock(
"submit_allowed");
1446 $this->tpl->setVariable(
"TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt(
"tst_confirm_submit_answers"));
1447 $this->tpl->setVariable(
"BTN_OK", $this->lng->txt(
"tst_submit_results"));
1449 $this->tpl->setVariable(
"BTN_BACK", $this->lng->txt(
"back"));
1450 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"finalSubmission"));
1451 $this->tpl->parseCurrentBlock();
1458 $starting_time = $this->
object->getStartingTimeOfUser($active_id);
1459 $processing_time = $this->
object->getProcessingTimeInSeconds($active_id);
1460 $processing_time_minutes = floor($processing_time / 60);
1461 $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1462 $str_processing_time =
"";
1463 if ($processing_time_minutes > 0)
1465 $str_processing_time = $processing_time_minutes .
" " . ($processing_time_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1467 if ($processing_time_seconds > 0)
1469 if (strlen($str_processing_time) > 0) $str_processing_time .=
" " . $this->lng->txt(
"and") .
" ";
1470 $str_processing_time .= $processing_time_seconds .
" " . ($processing_time_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1472 $time_left = $starting_time + $processing_time -
time();
1473 $time_left_minutes = floor($time_left / 60);
1474 $time_left_seconds = $time_left - $time_left_minutes * 60;
1475 $str_time_left =
"";
1476 if ($time_left_minutes > 0)
1478 $str_time_left = $time_left_minutes .
" " . ($time_left_minutes == 1 ? $this->lng->txt(
"minute") : $this->lng->txt(
"minutes"));
1480 if ($time_left < 300)
1482 if ($time_left_seconds > 0)
1484 if (strlen($str_time_left) > 0) $str_time_left .=
" " . $this->lng->txt(
"and") .
" ";
1485 $str_time_left .= $time_left_seconds .
" " . ($time_left_seconds == 1 ? $this->lng->txt(
"second") : $this->lng->txt(
"seconds"));
1488 $date = getdate($starting_time);
1490 $datenow = getdate();
1491 $this->tpl->setCurrentBlock(
"enableprocessingtime");
1492 $this->tpl->setVariable(
"USER_WORKING_TIME",
1494 $this->lng->txt(
"tst_time_already_spent"),
1495 $formattedStartingTime,
1496 $str_processing_time
1499 $this->tpl->setVariable(
"USER_REMAINING_TIME", sprintf($this->lng->txt(
"tst_time_already_spent_left"), $str_time_left));
1500 $this->tpl->parseCurrentBlock();
1501 $template =
new ilTemplate(
"tpl.workingtime.js.html", TRUE, TRUE,
'Modules/Test');
1502 $template->setVariable(
"STRING_MINUTE", $this->lng->txt(
"minute"));
1503 $template->setVariable(
"STRING_MINUTES", $this->lng->txt(
"minutes"));
1504 $template->setVariable(
"STRING_SECOND", $this->lng->txt(
"second"));
1505 $template->setVariable(
"STRING_SECONDS", $this->lng->txt(
"seconds"));
1506 $template->setVariable(
"STRING_TIMELEFT", $this->lng->txt(
"tst_time_already_spent_left"));
1507 $template->setVariable(
"AND", strtolower($this->lng->txt(
"and")));
1508 $template->setVariable(
"YEAR", $date[
"year"]);
1509 $template->setVariable(
"MONTH", $date[
"mon"]-1);
1510 $template->setVariable(
"DAY", $date[
"mday"]);
1511 $template->setVariable(
"HOUR", $date[
"hours"]);
1512 $template->setVariable(
"MINUTE", $date[
"minutes"]);
1513 $template->setVariable(
"SECOND", $date[
"seconds"]);
1514 if ($this->
object->isEndingTimeEnabled() )
1517 preg_match(
"/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $date_time->get(
IL_CAL_TIMESTAMP), $matches);
1518 $template->setVariable(
"ENDYEAR", $matches[1]);
1519 $template->setVariable(
"ENDMONTH", $matches[2]-1);
1520 $template->setVariable(
"ENDDAY", $matches[3]);
1521 $template->setVariable(
"ENDHOUR", $matches[4]);
1522 $template->setVariable(
"ENDMINUTE", $matches[5]);
1523 $template->setVariable(
"ENDSECOND", $matches[6]);
1525 $template->setVariable(
"YEARNOW", $datenow[
"year"]);
1526 $template->setVariable(
"MONTHNOW", $datenow[
"mon"]-1);
1527 $template->setVariable(
"DAYNOW", $datenow[
"mday"]);
1528 $template->setVariable(
"HOURNOW", $datenow[
"hours"]);
1529 $template->setVariable(
"MINUTENOW", $datenow[
"minutes"]);
1530 $template->setVariable(
"SECONDNOW", $datenow[
"seconds"]);
1531 $template->setVariable(
"PTIME_M", $processing_time_minutes);
1532 $template->setVariable(
"PTIME_S", $processing_time_seconds);
1534 $this->tpl->setCurrentBlock(
"HeadContent");
1535 $this->tpl->setVariable(
"CONTENT_BLOCK", $template->get());
1536 $this->tpl->parseCurrentBlock();
1539 protected function showSideList($presentationMode, $currentSequenceElement)
1543 $sideListActive = $ilUser->getPref(
'side_list_of_questions');
1551 $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence,
false);
1553 require_once
'Modules/Test/classes/class.ilTestQuestionSideListGUI.php';
1555 $questionSideListGUI->setTargetGUI($this);
1556 $questionSideListGUI->setQuestionSummaryData($questionSummaryData);
1557 $questionSideListGUI->setCurrentSequenceElement($currentSequenceElement);
1560 $questionSideListGUI->setDisabled(
false);
1564 $this->tpl->setVariable(
'LIST_OF_QUESTIONS', $questionSideListGUI->getHTML());
1573 public function outQuestionSummaryCmd($fullpage =
true, $contextFinishTest =
false, $obligationsNotAnswered =
false, $obligationsFilter =
false)
1577 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_question_summary.html",
"Modules/Test");
1580 if( $obligationsNotAnswered )
1585 if( $this->
object->getKioskMode() && $fullpage )
1590 $this->tpl->setCurrentBlock(
"kiosk_options");
1591 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1592 $this->tpl->parseCurrentBlock();
1597 $active_id = $this->testSession->getActiveId();
1598 $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, $obligationsFilter);
1600 $this->ctrl->setParameter($this,
"sequence",
$_GET[
"sequence"]);
1604 include_once
"./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
1607 $table_gui->setShowPointsEnabled( !$this->
object->getTitleOutput() );
1608 $table_gui->setShowMarkerEnabled( $this->
object->getShowMarker() );
1609 $table_gui->setObligationsNotAnswered( $obligationsNotAnswered );
1610 $table_gui->setShowObligationsEnabled( $this->
object->areObligationsEnabled() );
1611 $table_gui->setObligationsFilterEnabled( $obligationsFilter );
1616 $table_gui->setData($questionSummaryData);
1618 $this->tpl->setVariable(
'TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1620 if( $this->
object->getEnableProcessingTime() )
1639 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_max_allowed_users_reached.html",
"Modules/Test");
1640 $this->tpl->setCurrentBlock(
"adm_content");
1641 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt(
"tst_max_allowed_users_message"), $this->
object->getAllowedUsersTimeGap()));
1642 $this->tpl->setVariable(
"MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt(
"tst_max_allowed_users_heading"), $this->
object->getAllowedUsersTimeGap()));
1644 $this->tpl->setVariable(
"TXT_BACK_TO_INFOSCREEN", $this->lng->txt(
"tst_results_back_introduction"));
1645 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1646 $this->tpl->parseCurrentBlock();
1661 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1663 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1664 $this->tpl->setCurrentBlock(
"ContentStyle");
1666 $this->tpl->parseCurrentBlock();
1668 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1670 $this->tpl->parseCurrentBlock();
1673 if ($this->
object->getShowSolutionAnswersOnly())
1678 $this->tpl->setCurrentBlock(
"adm_content");
1680 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1681 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1682 $this->ctrl->saveParameter($this,
"pass");
1683 $this->ctrl->saveParameter($this,
"active_id");
1684 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1685 $this->tpl->parseCurrentBlock();
1701 $this->tpl->addBlockFile($this->
getContentBlockName(),
"adm_content",
"tpl.il_as_tst_finish_list_of_answers.html",
"Modules/Test");
1703 $result_array =& $this->
object->getTestResult(
1709 foreach ($result_array as $question_data)
1711 $question = $question_data[
"qid"];
1712 if (is_numeric($question))
1714 $this->tpl->setCurrentBlock(
"printview_question");
1715 $question_gui = $this->
object->createQuestionGUI(
"", $question);
1716 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
1717 $template->setVariable(
"COUNTER_QUESTION",
$counter.
". ");
1718 $template->setVariable(
"QUESTION_TITLE", $question_gui->object->getTitle());
1720 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
1721 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, $this->
object->getShowSolutionFeedback());
1722 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
1723 $this->tpl->setVariable(
"QUESTION_OUTPUT", $template->get());
1724 $this->tpl->parseCurrentBlock();
1730 if ($this->
object->getShowSolutionAnswersOnly())
1734 if (strlen($top_data))
1736 $this->tpl->setCurrentBlock(
"top_data");
1737 $this->tpl->setVariable(
"TOP_DATA", $top_data);
1738 $this->tpl->parseCurrentBlock();
1741 if (strlen($bottom_data))
1743 $this->tpl->setCurrentBlock(
"bottom_data");
1744 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1745 $this->tpl->setVariable(
"BOTTOM_DATA", $bottom_data);
1746 $this->tpl->parseCurrentBlock();
1749 $this->tpl->setCurrentBlock(
"adm_content");
1750 $this->tpl->setVariable(
"TXT_ANSWER_SHEET", $this->lng->txt(
"tst_list_of_answers"));
1753 $this->tpl->setVariable(
"USER_DETAILS", $user_data);
1754 $this->tpl->setVariable(
"SIGNATURE", $signature);
1755 $this->tpl->setVariable(
"TITLE", $this->
object->getTitle());
1756 $this->tpl->setVariable(
"TXT_TEST_PROLOG", $this->lng->txt(
"tst_your_answers"));
1757 $invited_user =& $this->
object->getInvitedUsers($ilUser->getId());
1758 $pagetitle = $this->
object->getTitle() .
" - " . $this->lng->txt(
"clientip") .
1759 ": " . $invited_user[$ilUser->getId()][
"clientip"] .
" - " .
1760 $this->lng->txt(
"matriculation") .
": " .
1761 $invited_user[$ilUser->getId()][
"matriculation"];
1762 $this->tpl->setVariable(
"PAGETITLE", $pagetitle);
1763 $this->tpl->parseCurrentBlock();
1773 if ($this->
object->getKioskMode())
1775 $this->tpl->setBodyClass(
"kiosk");
1776 $this->tpl->setAddFooter(FALSE);
1781 return "ADM_CONTENT";
1787 $this->ctrl->redirectByClass(
1788 array(
'ilRepositoryGUI',
'ilObjTestGUI',
'ilTestEvaluationGUI'),
"outUserResultsOverview" 1801 $this->ctrl->setParameter($this,
'pmode', self::PRESENTATION_MODE_EDIT);
1803 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1816 $this->ctrl->setParameter($this,
'pmode', self::PRESENTATION_MODE_EDIT);
1818 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1837 $this->tpl->addBlockFile(
1838 $this->
getContentBlockName(),
'adm_content',
'tpl.il_as_tst_question_summary.html',
'Modules/Test' 1841 if ($this->
object->getKioskMode())
1849 $this->tpl->addBlockFile(
1862 $this->tpl->setCurrentBlock(
"kiosk_options");
1863 $this->tpl->setVariable(
"KIOSK_HEAD", $head);
1864 $this->tpl->parseCurrentBlock();
1870 if( $this->ctrl->getNextClass() ==
'iltestpasswordprotectiongui' )
1875 if( !$this->passwordChecker->isPasswordProtectionPageRedirectRequired() )
1882 $nextCommand = $this->ctrl->getCmdClass().
'::'.$this->ctrl->getCmd();
1883 $this->ctrl->setParameterByClass(
'ilTestPasswordProtectionGUI',
'nextCommand', $nextCommand);
1884 $this->ctrl->redirectByClass(
'ilTestPasswordProtectionGUI',
'showPasswordForm');
1889 if( !$this->
object->isInstantFeedbackAnswerFixationEnabled() )
1894 if( !$this->testSequence->isQuestionChecked($questionId) )
1907 return $this->lng->txt(
"save_introduction");
1912 $this->assSettings =
new ilSetting(
'assessment');
1921 $questionList->load();
1923 $testResults = $this->
object->getTestResult($testSession->
getActiveId(), $testSession->
getPass(),
true);
1925 require_once
'Modules/Test/classes/class.ilTestSkillEvaluation.php';
1929 $skillEvaluation->setActiveId($testSession->
getActiveId());
1930 $skillEvaluation->setPass($testSession->
getPass());
1932 $skillEvaluation->setNumRequiredBookingsForSkillTriggering($this->assSettings->get(
1937 $skillEvaluation->init($questionList);
1938 $skillEvaluation->evaluate($testResults);
1940 $skillEvaluation->handleSkillTriggering();
1947 require_once
'Modules/Test/classes/confirmations/class.ilTestAnswerOptionalQuestionsConfirmationGUI.php';
1950 $confirmation->setFormAction($this->ctrl->getFormAction($this));
1951 $confirmation->setCancelCmd(
'cancelAnswerOptionalQuestions');
1952 $confirmation->setConfirmCmd(
'confirmAnswerOptionalQuestions');
1954 $confirmation->build($this->
object->isFixedTest());
1961 $this->testSequence->setAnsweringOptionalQuestionsConfirmed(
true);
1962 $this->testSequence->saveToDb();
1964 $this->ctrl->setParameter($this,
'activecommand',
'gotoquestion');
1965 $this->ctrl->redirect($this,
'redirectQuestion');
1970 if( $this->
object->getListOfQuestions() )
1972 $this->ctrl->setParameter($this,
'activecommand',
'summary');
1976 $this->ctrl->setParameter($this,
'activecommand',
'previous');
1979 $this->ctrl->redirect($this,
'redirectQuestion');
1987 if($this->
object->getKioskMode())
1989 $this->tpl->addBlockfile($this->
getContentBlockName(),
'content',
"tpl.il_as_tst_kiosk_mode_content.html",
"Modules/Test");
1990 $this->tpl->setContent($this->ctrl->getHTML($helperGui));
2005 if ($ilSetting->get(
'char_selector_availability') > 0)
2007 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
2011 $char_selector->addToPage();
2012 $this->tpl->setCurrentBlock(
'char_selector');
2013 $this->tpl->setVariable(
"CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
2014 $this->tpl->parseCurrentBlock();
2027 require_once
'Modules/Test/classes/class.ilTestNavigationToolbarGUI.php';
2030 $navigationToolbarGUI->setSuspendTestButtonEnabled($this->
object->getShowCancel());
2031 $navigationToolbarGUI->setQuestionTreeButtonEnabled($this->
object->getListOfQuestions());
2032 $navigationToolbarGUI->setQuestionTreeVisible($ilUser->getPref(
'side_list_of_questions'));
2033 $navigationToolbarGUI->setQuestionListButtonEnabled($this->
object->getListOfQuestions());
2036 return $navigationToolbarGUI;
2041 require_once
'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
2049 if($this->
object->getShowMarker())
2051 include_once
"./Modules/Test/classes/class.ilObjTest.php";
2055 if(count($solved_array) > 0)
2057 $solved = array_pop($solved_array);
2058 $solved = $solved[
"solved"];
2064 $navigationGUI->setQuestionMarked(
true);
2069 $navigationGUI->setQuestionMarked(
false);
2074 return $navigationGUI;
2079 require_once
'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
2082 if( $this->
object->isForceInstantFeedbackEnabled() )
2101 case $this->
object->getSpecificAnswerFeedback():
2102 case $this->
object->getGenericAnswerFeedback():
2103 case $this->
object->getAnswerFeedbackPoints():
2104 case $this->
object->getInstantFeedbackSolution():
2106 $navigationGUI->setAnswerFreezingEnabled($this->
object->isInstantFeedbackAnswerFixationEnabled());
2108 if( $this->
object->isForceInstantFeedbackEnabled() )
2110 $navigationGUI->setForceInstantResponseEnabled(
true);
2120 if( $this->
object->isOfferingQuestionHintsEnabled() )
2122 $activeId = $this->testSession->getActiveId();
2123 $pass = $this->testSession->getPass();
2125 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
2128 if( $questionHintTracking->requestsPossible() )
2133 if( $questionHintTracking->requestsExist() )
2139 $navigationGUI->setCharSelectorEnabled($charSelectorAvailable);
2141 if($this->
object->getShowMarker())
2143 include_once
"./Modules/Test/classes/class.ilObjTest.php";
2147 if(count($solved_array) > 0)
2149 $solved = array_pop($solved_array);
2150 $solved = $solved[
"solved"];
2157 $navigationGUI->setQuestionMarked(
true);
2162 $navigationGUI->setQuestionMarked(
false);
2166 return $navigationGUI;
2174 if( !$this->
object->getListOfQuestionsEnd() )
2176 return 'finishTest';
2179 if( $this->
object->areObligationsEnabled() )
2182 $this->testSession->getTestId(), $this->testSession->getActiveId(), $this->testSession->getPass()
2185 if( !$allObligationsAnswered )
2187 return 'outQuestionSummaryWithObligationsInfo';
2191 return 'outQuestionSummary';
2223 $answerFeedbackEnabled = $this->
object->getSpecificAnswerFeedback();
2226 $this->testSession->getActiveId(), #active_id
2227 $this->testSession->getPass(), #pass
2228 false, #graphical_output
2229 false, #result_output
2230 true, #show_question_only
2231 $answerFeedbackEnabled, #show_feedback
2232 false, #show_correct_solution
2233 false, #show_manual_scoring
2234 true #show_question_text
2240 $this->testSession->getActiveId(),
2244 $tpl =
new ilTemplate(
'tpl.tst_player_response_modal.html',
true,
true,
'Modules/Test');
2250 $this->tpl = $saved_tpl;
2252 $tpl->setVariable(
'QUESTION_OUTPUT', $pageoutput);
2255 $button->setId(
'tst_confirm_feedback');
2256 $button->setUrl($navUrl);
2257 $button->setCaption(
'proceed');
2258 $button->setPrimary(
true);
2259 $tpl->setVariable(
'BUTTON', $button->render());
2262 require_once(
'Services/UIComponent/Modal/classes/class.ilModalGUI.php');
2265 $modal->setId(
'tst_question_feedback_modal');
2266 $modal->setHeading($this->lng->txt(
'tst_instant_feedback'));
2267 $modal->setBody(
$tpl->get());
2269 $this->tpl->addOnLoadCode(
"$('#tst_question_feedback_modal').modal('show');");
2270 $this->tpl->setVariable(
'INSTANT_RESPONSE_MODAL', $modal->getHTML());
2282 if($this->
object->getInstantFeedbackSolution())
2287 $solutionoutput = $questionGui->
getSolutionOutput($this->testSession->getActiveId(), #active_id
2289 FALSE, #graphical_output
2290 $show_question_inline_score, #result_output
2291 FALSE, #show_question_only
2292 FALSE, #show_feedback
2293 TRUE, #show_correct_solution
2294 FALSE, #show_manual_scoring
2295 FALSE #show_question_text
2300 $reachedPoints = $questionGui->object->getAdjustedReachedPoints(
2301 $this->testSession->getActiveId(), NULL, $authorizedSolution
2304 $maxPoints = $questionGui->object->getMaximumPoints();
2306 $solutionCorrect = ($reachedPoints == $maxPoints);
2310 if($this->
object->getAnswerFeedbackPoints())
2317 if($this->
object->getGenericAnswerFeedback())
2324 if($this->
object->getSpecificAnswerFeedback())
2337 return $this->testSession->getLastSequence();
2342 unset(
$_GET[
'sequence']);
2343 $this->ctrl->setParameter($this,
'sequence', null);
2348 if( isset(
$_GET[
'sequence']) )
2350 return $_GET[
'sequence'];
2358 if( isset(
$_GET[
'pmode']) )
2360 return $_GET[
'pmode'];
2368 if( isset(
$_GET[
'instresp']) )
2370 return $_GET[
'instresp'];
2378 if( isset(
$_POST[
'nextcmd']) && strlen(
$_POST[
'nextcmd']) )
2380 return $_POST[
'nextcmd'];
2388 if( isset(
$_POST[
'nextseq']) && is_numeric(
$_POST[
'nextseq']) )
2390 return (
int)
$_POST[
'nextseq'];
2399 if (isset(
$_POST[
'test_player_navigation_url'])) {
2400 return $_POST[
'test_player_navigation_url'];
2414 return !empty(
$_GET[
'test_answer_changed']);
2423 $this->ctrl->setParameter($this,
'test_answer_changed',
$changed ?
'1' :
'0');
2452 if (!empty(
$_POST[
'save_on_navigation_prevent_confirmation']))
2454 $_SESSION[
'save_on_navigation_prevent_confirmation'] =
true;
2473 if( !$fromCache || !isset($this->cachedQuestionGuis[$questionId]) )
2475 $questionGui = $this->
object->createQuestionGUI(
"", $questionId);
2476 $questionGui->setTargetGui($this);
2478 $questionGui->object->setObligationsToBeConsidered($this->
object->areObligationsEnabled());
2479 $questionGui->populateJavascriptFilesRequiredForWorkForm($tpl);
2487 $this->cachedQuestionGuis[$questionId] = $questionGui;
2490 return $this->cachedQuestionGuis[$questionId];
2506 if( !$fromCache || !isset($this->cachedQuestionObjects[$questionId]) )
2511 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
2513 $processLockerFactory->setQuestionId($questionOBJ->getId());
2514 $processLockerFactory->setUserId($ilUser->getId());
2515 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
2517 $questionOBJ->setProcessLocker($processLockerFactory->getLocker());
2519 $questionOBJ->setObligationsToBeConsidered($this->
object->areObligationsEnabled());
2526 $this->cachedQuestionObjects[$questionId] = $questionOBJ;
2529 return $this->cachedQuestionObjects[$questionId];
2536 $this->
object->isPreviousSolutionReuseEnabled( $this->testSession->getActiveId() )
2547 require_once
'Services/Randomization/classes/class.ilArrayElementShuffler.php';
2551 $shuffler->setSeed($fixedSeed);
2565 $ilLog->write(
"INV SEQ:" 2566 .
"active={$this->testSession->getActiveId()} " 2567 .
"qId=$questionId seq=$sequenceElement " 2568 . serialize($this->testSequence)
2571 $ilLog->logStack(
'INV SEQ');
2573 $this->ctrl->setParameter($this,
'sequence', $this->testSequence->getFirstSequence());
2582 if($this->
object->getKioskMode())
2584 $this->tpl->addBlockfile($this->
getContentBlockName(),
'content',
"tpl.il_as_tst_kiosk_mode_content.html",
"Modules/Test");
2585 $this->tpl->setContent($contentHTML);
2595 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
2596 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
2597 require_once
'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
2604 if( $this->
object->getKioskMode() )
2606 $this->tpl->addJavaScript(
'Services/UICore/lib/bootstrap-3.2.0/dist/js/bootstrap.min.js',
true);
2612 $tpl =
new ilTemplate(
'tpl.tst_player_confirmation_modal.html',
true,
true,
'Modules/Test');
2614 $tpl->setVariable(
'CONFIRMATION_TEXT', $this->lng->txt(
'discard_answer_confirmation'));
2618 $button->setCaption(
'discard_answer');
2619 $tpl->setCurrentBlock(
'buttons');
2620 $tpl->setVariable(
'BUTTON', $button->render());
2621 $tpl->parseCurrentBlock();
2624 $button->setId(
'tst_cancel_discard_button');
2625 $button->setCaption(
'cancel');
2626 $button->setPrimary(
true);
2627 $tpl->setCurrentBlock(
'buttons');
2628 $tpl->setVariable(
'BUTTON', $button->render());
2629 $tpl->parseCurrentBlock();
2632 $modal->setId(
'tst_discard_solution_modal');
2633 $modal->setHeading($this->lng->txt(
'discard_answer'));
2634 $modal->setBody(
$tpl->get());
2636 $this->tpl->setCurrentBlock(
'discard_solution_modal');
2637 $this->tpl->setVariable(
'DISCARD_SOLUTION_MODAL', $modal->getHTML());
2638 $this->tpl->parseCurrentBlock();
2705 if (!empty(
$_SESSION[
'save_on_navigation_prevent_confirmation']))
2710 $tpl =
new ilTemplate(
'tpl.tst_player_confirmation_modal.html',
true,
true,
'Modules/Test');
2712 if ($this->
object->isInstantFeedbackAnswerFixationEnabled() && $this->
object->isForceInstantFeedbackEnabled())
2714 $text = $this->lng->txt(
'save_on_navigation_locked_confirmation');
2718 $text = $this->lng->txt(
'save_on_navigation_confirmation');
2720 if ($this->
object->isForceInstantFeedbackEnabled())
2722 $text .=
" ". $this->lng->txt(
'save_on_navigation_forced_feedback_hint');
2724 $tpl->setVariable(
'CONFIRMATION_TEXT',
$text);
2728 $button->setId(
'tst_save_on_navigation_button');
2729 $button->setUrl(
'#');
2730 $button->setCaption(
'tst_save_and_proceed');
2731 $button->setPrimary(
true);
2732 $tpl->setCurrentBlock(
'buttons');
2733 $tpl->setVariable(
'BUTTON', $button->render());
2734 $tpl->parseCurrentBlock();
2737 $button->setId(
'tst_cancel_on_navigation_button');
2738 $button->setUrl(
'#');
2739 $button->setCaption(
'cancel');
2740 $button->setPrimary(
false);
2741 $tpl->setCurrentBlock(
'buttons');
2742 $tpl->setVariable(
'BUTTON', $button->render());
2743 $tpl->parseCurrentBlock();
2745 $tpl->setCurrentBlock(
'checkbox');
2746 $tpl->setVariable(
'CONFIRMATION_CHECKBOX_NAME',
'save_on_navigation_prevent_confirmation');
2747 $tpl->setVariable(
'CONFIRMATION_CHECKBOX_LABEL',$this->lng->txt(
'save_on_navigation_prevent_confirmation'));
2748 $tpl->parseCurrentBlock();
2751 $modal->setId(
'tst_save_on_navigation_modal');
2752 $modal->setHeading($this->lng->txt(
'save_on_navigation'));
2753 $modal->setBody(
$tpl->get());
2755 $this->tpl->setCurrentBlock(
'nav_while_edit_modal');
2756 $this->tpl->setVariable(
'NAV_WHILE_EDIT_MODAL', $modal->getHTML());
2757 $this->tpl->parseCurrentBlock();
2767 protected function populateQuestionEditControl($questionGUI)
2773 $state = $questionGUI->object->lookupForExistingSolutions($this->testSession->getActiveId(), $this->testSession->getPass());
2774 $config[
'isAnswered'] = $state[
'authorized'];
2784 if( $questionGUI->isAutosaveable() && $this->
object->getAutosave() )
2787 $config[
'autosaveInterval'] = $this->
object->getAutosaveIval();
2792 $config[
'autosaveInterval'] = 0;
2797 $questionConfig = $questionGUI->object->getTestPresentationConfig();
2801 $config[
'withFormChangeDetection'] = $questionConfig->isFormChangeDetectionEnabled();
2804 $config[
'withBackgroundChangeDetection'] = $questionConfig->isBackgroundChangeDetectionEnabled();
2808 $config[
'forcedInstantFeedback'] = $this->
object->isForceInstantFeedbackEnabled();
2810 $this->tpl->addJavascript(
'./Modules/Test/js/ilTestPlayerQuestionEditControl.js');
2811 $this->tpl->addOnLoadCode(
'il.TestPlayerQuestionEditControl.init('.json_encode(
$config).
')');
2818 return self::PRESENTATION_MODE_EDIT;
2828 $fixedSeed = $questionId . $this->testSession->getActiveId() . $this->testSession->getPass();
2842 if( !isset(
$_SESSION[
'forced_feedback_navigation_url']) )
2847 $_SESSION[
'forced_feedback_navigation_url'][$this->testSession->getActiveId()] = $forcedFeedbackNavUrl;
2852 if( !isset(
$_SESSION[
'forced_feedback_navigation_url']) )
2857 if( !isset(
$_SESSION[
'forced_feedback_navigation_url'][$this->testSession->getActiveId()]) )
2862 return $_SESSION[
'forced_feedback_navigation_url'][$this->testSession->getActiveId()];
2872 if( isset(
$_SESSION[
'forced_feedback_navigation_url'][$this->testSession->getActiveId()]) )
2874 unset(
$_SESSION[
'forced_feedback_navigation_url'][$this->testSession->getActiveId()]);
checkTestSessionUser(ilTestSession $testSession)
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()
removeIntermediateSolution()
remove an auto-saved solution of the current question
performTestPassFinishedTasks($finishedPass)
const CMD_CONFIRM_REQUEST
isQuestionSummaryFinishTestButtonRequired()
outObligationsOnlySummaryCmd()
Class ilTestPassFinishTasks.
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
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
setAnswerChangedParameter($changed=true)
Set the 'answer changed' url parameter for generated links.
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()
Abstract basic class which is to be extended by the concrete assessment question type classes...
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 ...
saveTagsCmd()
Save tags for tagging gui.
isTestSignRedirectRequired($activeId, $lastFinishedPass)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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)
const CSS_CLASS_FEEDBACK_CORRECT
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
handleUserSettings()
Handles some form parameters on starting and resuming a test.
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)
populateCharSelectorIfRequired()
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
confirmHintRequestCmd()
Go to hint request confirmation.
__construct($a_object)
ilTestOutputGUI constructor
Base Exception for all Exceptions relating to Modules/Test.
maxProcessingTimeReached()
Outputs a message when the maximum processing time is reached.
populateLowerNextButtonBlock($disabled, $primaryNext)
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.
populateNavWhenChangedModal()
unregisterForcedFeedbackNavUrl()
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)
populateQuestionNavigation($sequenceElement, $disabled, $primaryNext)
static getInstance(ilTestSession $a_test_session)
initTestQuestionConfig(assQuestion $questionOBJ)
confirmFinishCmd()
The final submission of a test was confirmed.
markQuestionCmd()
Set a question solved.
handleIntermediateSubmit()
Check the 'answer changed' parameter when a question form is intermediately submitted.
isForcedFeedbackNavUrlRegistered()
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
getInstantResponseParameter()
handleSkillTriggering(ilTestSession $testSession)
buildEditableStateQuestionNavigationGUI($questionId, $charSelectorAvailable)
buildTestPassQuestionList()
$maxProcessingTimeReached
showSideList($presentationMode, $currentSequenceElement)
populateGenericFeedbackBlock(assQuestionGUI $question_gui, $solutionCorrect)
getRegisteredForcedFeedbackNavUrl()
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.
saveNavigationPreventConfirmation()
Save the save the switch to prevent the navigation confirmation.
endingTimeReached()
handle endingTimeReached
const ACCESS_CODE_CONFIRMED
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
const REDIRECT_ON_TIME_LIMIT
static formatDate(ilDateTime $date)
Format a date public.
Output class for assessment test evaluation.
populateTestNavigationToolbar(ilTestNavigationToolbarGUI $toolbarGUI)
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...
static getSyntaxStylePath()
get syntax style path
const CSS_CLASS_FEEDBACK_WRONG
getAnswerChangedParameter()
Get the 'answer changed' status from the current request It may be set by ilTestPlayerNavigationContr...
getSequenceElementParameter()
Basic GUI class for assessment questions.
detectChangesCmd()
Detect changes sent in the background to the server This is called by ajax from ilTestPlayerQuestionE...
const PRESENTATION_MODE_VIEW
Create styles array
The data for the language used.
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()
Multiple choice question GUI representation.
static getContentStylePath($a_style_id)
get content style path
const UNMARK_QUESTION_SAVE
registerForcedFeedbackNavUrl($forcedFeedbackNavUrl)
const QUESTION_SUMMARY_OBLIGATIONS_ONLY
static getInstance()
Get instance.
populateUpperNextButtonBlock($disabled, $primaryNext)
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
populateNextButtons($disabled, $primaryNext)
populateMessageContent($contentHTML)
populateUpperPreviousButtonBlock($disabled)
const DISPLAY_ACCESS_CODE
performFinishTasks(ilTestProcessLocker $processLocker)
buildQuestionAnswerShuffler($questionId)
showMaximumAllowedUsersReachedMessage()
Create new PHPExcel object
obj_idprivate
resetSequenceElementParameter()
populateInstantResponseModal(assQuestionGUI $questionGui, $navUrl)
outProcessingTime($active_id)
getNextSequenceParameter()
determineInlineScoreDisplay()
getTestPresentationConfig()
Get the test question configuration (initialised once)
static generatePDF($pdf_output, $output_mode, $filename=null)
getNavigationUrlParameter()
getQuestionHeaderBlockBuilder()
getQuestionGuiInstance($questionId, $fromCache=true)
static buildExamId($active_id, $pass, $test_obj_id=null)
const FIXED_SHUFFLER_SEED_MIN_LENGTH
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.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
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()
buildNextButtonInstance($disabled, $primaryNext)
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
static redirect($a_script)
http redirect to other script
confirmAnswerOptionalQuestionsCmd()
static getWebspaceDir($mode="filesystem")
get webspace directory
getTestNavigationToolbarGUI()
populateSolutionBlock($solutionoutput)
populateScoreBlock($reachedPoints, $maxPoints)
isParticipantsAnswerFixed($questionId)
Output class for assessment test execution.
Confirmation screen class.
static lookupExamId($active_id, $pass)
setNavigationGUI($navigationGUI)
buildFixedShufflerSeed($questionId)