ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilTestPlayerAbstractGUI Class Reference
+ Inheritance diagram for ilTestPlayerAbstractGUI:
+ Collaboration diagram for ilTestPlayerAbstractGUI:

Public Member Functions

 __construct (ilObjTest $object)
 
 executeCommand ()
 execute command More...
 
 saveTagsCmd ()
 Save tags for tagging gui. More...
 
 updateWorkingTime ()
 updates working time and stores state saveresult to see if question has to be stored or not More...
 
 removeIntermediateSolution ()
 
 saveQuestionSolution (bool $authorized=true, bool $force=false)
 
 suspendTestCmd ()
 
 isMaxProcessingTimeReached ()
 
 setAnonymousIdCmd ()
 Sets a session variable with the test access code for an anonymous test user. More...
 
 getLockParameter ()
 
 displayAccessCodeCmd ()
 
 accessCodeConfirmedCmd ()
 
 handleUserSettings ()
 Handles some form parameters on starting and resuming a test. More...
 
 redirectAfterAutosaveCmd ()
 Redirect the user after an automatic save when the time limit is reached. More...
 
 redirectAfterQuestionListCmd ()
 
 autosaveCmd ()
 Automatically save a user answer while working on the test (called repeatedly by asynchronous posts in configured autosave interval) More...
 
 autosaveOnTimeLimitCmd ()
 Automatically save a user answer when the limited duration of a test run is reached (called by synchronous form submit when the remaining time count down reaches zero) More...
 
 finishTestCmd ()
 
 buildFinishTestModal ()
 
 redirectBackCmd ()
 
 showFinalStatementCmd ()
 
 isTestAccessible ()
 test accessible returns true if the user can perform the test More...
 
 isNrOfTriesReached ()
 nr of tries exceeded More...
 
 endingTimeReached ()
 handle endingTimeReached More...
 
 max_processing_time_reached ()
 Outputs a message when the maximum processing time is reached. More...
 
 confirmSubmitAnswers ()
 confirm submit results if confirm then results are submitted and the screen will be redirected to the startpage of the test @access public More...
 
 checkWorkingTimeCmd ()
 This is asynchronously called by tpl.workingtime.js to check for changes in the user's processing time for a test. More...
 
 outQuestionSummaryCmd ()
 Output of a summary of all test questions for test participants. More...
 
 backFromFinishingCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 
 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 will be shown) More...
 
 getContentBlockName ()
 Returns the name of the current content block (depends on the kiosk mode setting) More...
 
 outUserResultsOverviewCmd ()
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation (bool $contextResultPresentation)
 
 setParticipantData (ilTestParticipantData $participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $test_session, array $passes, bool $with_results)
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objective_oriented_container)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 buildPassOverviewTableGUI (ilTestEvaluationGUI $target_gui)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ?ilTestQuestionRelatedObjectivesList $objectives_list=null, ?ResultsTitlesBuilder $testResultHeaderLabelBuilder=null)
 Returns the list of answers of a users test pass. More...
 
 getResultsSignature ()
 Returns HTML code for a signature field. More...
 
 getAdditionalUsrDataHtmlAndPopulateWindowTitle ($testSession, $active_id, $overwrite_anonymity=false)
 Returns the user data for a test results output. More...
 
 getCorrectSolutionOutput ($question_id, $active_id, $pass, ?ilTestQuestionRelatedObjectivesList $objectives_list=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getObject ()
 

Data Fields

const PRESENTATION_MODE_VIEW = 'view'
 
const PRESENTATION_MODE_EDIT = 'edit'
 
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
bool $max_processing_time_reached
 
bool $ending_time_reached
 
int $ref_id
 
const FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'
 

Protected Member Functions

 buildTestPassQuestionList ()
 
 populateQuestionOptionalMessage ()
 
 checkReadAccess ()
 
 checkTestExecutable ()
 
 checkTestSessionUser (ilTestSession $test_session)
 
 ensureExistingTestSession (ilTestSession $test_session)
 
 initProcessLocker ($activeId)
 
 canSaveResult ()
 
 determineInlineScoreDisplay ()
 
 populateTestNavigationToolbar (ilTestNavigationToolbarGUI $toolbar_gui)
 
 populateQuestionNavigation ($sequence_element, $primary_next)
 
 populatePreviousButtons ()
 
 populateNextButtons ($primary_next)
 
 populateLowerNextButtonBlock ($primary_next)
 
 populateUpperNextButtonBlock ($primaryNext)
 
 populateLowerPreviousButtonBlock ()
 
 populateUpperPreviousButtonBlock ()
 
 populateSpecificFeedbackBlock (assQuestionGUI $question_gui)
 
 populateGenericFeedbackBlock (assQuestionGUI $question_gui, $solutionCorrect)
 
 populateScoreBlock ($reachedPoints, $maxPoints)
 
 populateSolutionBlock ($solutionoutput)
 
 populateSyntaxStyleBlock ()
 
 populateContentStyleBlock ()
 
 startPlayerCmd ()
 Start a test for the first time. More...
 
 resumePlayerCmd ()
 
 initTestCmd ()
 Start a test for the first time after a redirect. More...
 
 redirectAfterFinish ()
 
 getCurrentQuestionId ()
 
 detectChangesCmd ()
 Detect changes sent in the background to the server This is called by ajax from ilTestPlayerQuestionEditControl.js It is needed by Java and Flash question and eventually plgin question vtypes. More...
 
 submitIntermediateSolutionCmd ()
 
 markQuestionAndSaveIntermediateCmd ()
 
 markQuestionCmd ()
 Set a question solved. More...
 
 unmarkQuestionAndSaveIntermediateCmd ()
 
 unmarkQuestionCmd ()
 Set a question unsolved. More...
 
 performTestPassFinishedTasks (StatusOfAttempt $status_of_attempt)
 
 afterTestPassFinishedCmd ()
 
 prepareTestPage ($presentationMode, $sequenceElement, $question_id)
 
 isOptionalQuestionAnsweringConfirmationRequired (int $sequence_key)
 
 isShowingPostponeStatusReguired (int $question_id)
 
 showQuestionViewable (assQuestionGUI $question_gui, string $form_action, bool $is_question_worked_through, bool $instant_response)
 
 showQuestionEditable (assQuestionGUI $question_gui, string $form_action, bool $is_question_worked_through, bool $instant_response)
 
 determineSolutionPassIndex (assQuestionGUI $question_gui)
 
 showQuestionCmd ()
 
 editSolutionCmd ()
 
 submitSolutionCmd ()
 
 revertChangesCmd ()
 
 discardSolutionCmd ()
 
 skipQuestionCmd ()
 
 startTestCmd ()
 
 showSideList ($current_sequence_element)
 
 isFirstQuestionInSequence ($sequence_element)
 
 isLastQuestionInSequence ($sequence_element)
 
 handleQuestionActionCmd ()
 
 showInstantResponseCmd ()
 
 nextQuestionCmd ()
 
 previousQuestionCmd ()
 
 prepareSummaryPage ()
 
 initTestPageTemplate ()
 
 handlePasswordProtectionRedirect ()
 
 isParticipantsAnswerFixed ($question_id)
 
 getIntroductionPageButtonLabel ()
 
 initAssessmentSettings ()
 
 handleSkillTriggering (ilTestSession $test_session)
 
 showAnswerOptionalQuestionsConfirmation ()
 
 confirmAnswerOptionalQuestionsCmd ()
 
 cancelAnswerOptionalQuestionsCmd ()
 
 populateHelperGuiContent ($helperGui)
 
 getTestNavigationToolbarGUI ()
 
 buildReadOnlyStateQuestionNavigationGUI ($question_id)
 
 buildEditableStateQuestionNavigationGUI ($question_id)
 
 getFinishTestCommand ()
 
 populateInstantResponseModal (assQuestionGUI $question_gui, $nav_url)
 
 populateInstantResponseBlocks (assQuestionGUI $question_gui, $authorizedSolution)
 
 populateFeedbackBlockHeader ($withFocusAnchor)
 
 populateFeedbackBlockMessage (string $a_message)
 
 getCurrentSequenceElement ()
 
 getSequenceElementParameter ()
 
 getPresentationModeParameter ()
 
 getInstantResponseParameter ()
 
 getNextCommandParameter ()
 
 getNextSequenceParameter ()
 
 getNavigationUrlParameter ()
 
 getAnswerChangedParameter ()
 
 setAnswerChangedParameter (bool $changed=true)
 
 handleIntermediateSubmit ()
 
 saveNavigationPreventConfirmation ()
 
 getQuestionGuiInstance (int $question_id, bool $from_cache=true)
 
 getQuestionInstance (int $question_id, bool $from_cache=true)
 
 initTestQuestionConfig (assQuestion $question_obj)
 
 handleTearsAndAngerQuestionIsNull (int $question_id, $sequence_element)
 
 populateMessageContent (string $content_html)
 
 populateModals ()
 
 populateDiscardSolutionModal ()
 
 populateNextLocksUnchangedModal ()
 
 populateNextLocksChangedModal ()
 
 setFollowUpQuestionLocksConfirmationPrevented ()
 
 isFollowUpQuestionLocksConfirmationPrevented ()
 
 populateQuestionEditControl (assQuestionGUI $question_gui)
 
 getQuestionsDefaultPresentationMode ()
 
 registerForcedFeedbackNavUrl (string $forced_feedback_nav_url)
 
 getRegisteredForcedFeedbackNavUrl ()
 
 isForcedFeedbackNavUrlRegistered ()
 
 unregisterForcedFeedbackNavUrl ()
 
 handleFileUploadCmd ()
 
 updateLearningProgressOnTestStart ()
 
 submitSolutionAndNextCmd ()
 
 handleQuestionPostponing (int $question_id)
 
 handleCheckTestPassValid (bool $with_redirect=false)
 
 performTearsAndAngerBrokenConfessionChecks ()
 
 generateRandomTestPassForActiveUser ()
 
 adoptUserSolutionsFromPreviousPass ()
 
 handleTearsAndAngerNoObjectiveOrientedQuestion ()
 
 handlePrimaryButton (ilTestNavigationToolbarGUI $navigation_toolbar_gui, int $current_question_id)
 
 getTestPlayerTitle ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 getPassDetailsOverviewTableGUI (array $result_array, int $active_id, int $pass, ilTestServiceGUI $target_gui, string $target_cmd, ?ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
 
 buildPassDetailsOverviewTableGUI (ilTestServiceGUI $target_gui, string $target_cmd)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder (int $active_id)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
 
 populateContent (string $content)
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 
 populatePassFinishDate (ilTemplate $tpl, ?int $pass_finish_date)
 
 populateExamId (ilTemplate $tpl, int $active_id, int $pass)
 

Protected Attributes

const FINISH_TEST_CMD = 'finishTest'
 
ilTestPasswordChecker $password_checker
 
ilTestProcessLocker $process_locker
 
ilTestSession $test_session = null
 
ilSetting $ass_settings = null
 
ilTestSequence $test_sequence = null
 
ilTestQuestionRelatedObjectivesList $question_related_objectives_list
 
InterruptiveModal $finish_test_modal = null
 
const DISCARD_MODAL = "discard_modal"
 
const LOCKS_CHANGED_MODAL = "locks_changed_modal"
 
const LOCKS_UNCHANGED_MODAL = "locks_unchanged_modal"
 
array $modal_signals = []
 
- Protected Attributes inherited from ilTestServiceGUI
readonly RequestDataCollector $testrequest
 
readonly GeneralQuestionPropertiesRepository $questionrepository
 
readonly TestQuestionsRepository $testquestionsrepository
 
ilTestService $service = null
 
readonly ilDBInterface $db
 
readonly ilLanguage $lng
 
readonly TestLogger $logger
 
readonly ilHelpGUI $help
 
readonly ilRbacSystem $rbac_system
 
ilGlobalTemplateInterface ilTemplate $tpl
 sk 2023-08-01: We need this union type, even if it is wrong! To change this More...
 
readonly ContentStyle $content_style
 
readonly ilErrorHandling $error
 
ilAccess $access
 
readonly HTTPServices $http
 
readonly ilCtrlInterface $ctrl
 
readonly ilToolbarGUI $toolbar
 
readonly ilTabsGUI $tabs
 
readonly ilObjectDataCache $obj_cache
 
readonly ilComponentRepository $component_repository
 
readonly ilObjUser $user
 
readonly ArrayBasedRequestWrapper $post_wrapper
 
readonly ilNavigationHistory $navigation_history
 
readonly Refinery $refinery
 
readonly UIFactory $ui_factory
 
readonly UIRenderer $ui_renderer
 
readonly SkillService $skills_service
 
readonly ilTestShuffler $shuffler
 
readonly ResultsDataFactory $results_data_factory
 
readonly ResultsPresentationFactory $results_presentation_factory
 
readonly ILIAS $ilias
 
readonly ilSetting $settings
 
readonly GlobalScreenServices $global_screen
 
readonly ilTree $tree
 
int $ref_id
 
ilTestSessionFactory $test_session_factory = null
 
ilTestSequenceFactory $test_sequence_factory = null
 
ilTestParticipantData $participantData = null
 
TestResultRepository $test_result_repository
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Private Member Functions

 checkAndUpdateSaveAllowedByFormTimestamp (bool $force)
 
 buildQuestionObject ()
 
 save (assQuestion $question_obj, bool $authorized)
 
 buildNextButtonInstance ($primaryNext)
 
 buildPreviousButtonInstance ()
 
 getOnLoadCodeForNavigationButtons (string $target, string $cmd)
 
 outProcessingTime (int $active_id, bool $verbose)
 
 getQuestionFeedbackModalHtml (ilTemplate $tpl, string $nav_url)
 
 isValidSequenceElement ($sequence_element)
 

Private Attributes

array $cached_question_guis = []
 
array $cached_question_objects = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerAbstractGUI::__construct ( ilObjTest  $object)

Definition at line 80 of file class.ilTestPlayerAbstractGUI.php.

81 {
82 parent::__construct($object);
83 $this->ref_id = $this->testrequest->getRefId();
84 $this->password_checker = new ilTestPasswordChecker($this->rbac_system, $this->user, $this->object, $this->lng);
85 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ accessCodeConfirmedCmd()

ilTestPlayerAbstractGUI::accessCodeConfirmedCmd ( )

Definition at line 813 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\START_TEST.

+ Here is the call graph for this function:

◆ adoptUserSolutionsFromPreviousPass()

ilTestPlayerAbstractGUI::adoptUserSolutionsFromPreviousPass ( )
protected

Definition at line 3083 of file class.ilTestPlayerAbstractGUI.php.

3083 : void
3084 {
3085 $ass_settings = new ilSetting('assessment');
3086
3087 $userSolutionAdopter = new ilAssQuestionUserSolutionAdopter($this->db, $ass_settings);
3088 $userSolutionAdopter->setUserId($this->user->getId());
3089 $userSolutionAdopter->setActiveId($this->test_session->getActiveId());
3090 $userSolutionAdopter->setTargetPass($this->test_sequence->getPass());
3091 $userSolutionAdopter->setQuestionIds($this->test_sequence->getOptionalQuestions());
3092
3093 $userSolutionAdopter->perform();
3094 }
ILIAS Setting Class.

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ afterTestPassFinishedCmd()

ilTestPlayerAbstractGUI::afterTestPassFinishedCmd ( )
protected

Definition at line 1033 of file class.ilTestPlayerAbstractGUI.php.

1034 {
1035 // show final statement
1036 if (!$this->testrequest->isset('skipfinalstatement')) {
1037 if ($this->object->getMainSettings()->getFinishingSettings()->getConcludingRemarksEnabled()) {
1038 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_FINAL_STATMENT);
1039 }
1040 }
1041
1042 // redirect after test
1043 $redirection_mode = $this->object->getMainSettings()->getFinishingSettings()->getRedirectionMode();
1044 $redirection_url = $this->object->getMainSettings()->getFinishingSettings()->getRedirectionUrl();
1045 if (empty($redirection_url)
1046 || $this->object->canShowTestResults($this->test_session)
1047 || $redirection_mode === RedirectionModes::NONE
1048 || $redirection_mode === RedirectionModes::IF_KIOSK_ACTIVATED && !$this->object->getKioskMode()) {
1049 $this->redirectBackCmd();
1050 }
1051
1052 if ($redirection_mode === RedirectionModes::ALWAYS_TO_LOGOUT) {
1053 $redirection_url = ilStartUpGUI::logoutUrl();
1054 }
1055
1056 ilUtil::redirect($redirection_url);
1057 }
static logoutUrl(array $parameters=[])
Return the logout URL with a valid CSRF token.
static redirect(string $a_script)

References ILIAS\Test\Settings\MainSettings\ALWAYS_TO_LOGOUT, ILIAS\Repository\ctrl(), ilStartUpGUI\logoutUrl(), ILIAS\Repository\object(), ilUtil\redirect(), and ilTestPlayerCommands\SHOW_FINAL_STATMENT.

+ Here is the call graph for this function:

◆ autosaveCmd()

ilTestPlayerAbstractGUI::autosaveCmd ( )

Automatically save a user answer while working on the test (called repeatedly by asynchronous posts in configured autosave interval)

Definition at line 873 of file class.ilTestPlayerAbstractGUI.php.

873 : void
874 {
875 if (!$this->access->checkAccess('read', '', $this->ref_id)) {
876 echo $this->lng->txt('autosave_failed') . ': ' . $this->lng->txt('msg_no_perm_read_item');
877 exit;
878 }
879 $test_can_run = $this->object->isExecutable($this->test_session, $this->test_session->getUserId());
880 if (!$test_can_run['executable']) {
881 echo $test_can_run['errormessage'];
882 exit;
883 }
884 if ($this->testrequest->getPostKeys() === []) {
885 echo '';
886 exit;
887 }
888
889 if (!$this->canSaveResult() || $this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
890 echo '-IGNORE-';
891 exit;
892 }
893
894 if ($this->saveQuestionSolution(!$this->getAnswerChangedParameter(), true)) {
895 echo $this->lng->txt('autosave_success');
896 exit;
897 }
898
899 echo $this->lng->txt('autosave_failed');
900 exit;
901 }
saveQuestionSolution(bool $authorized=true, bool $force=false)
exit

References ILIAS\Repository\access(), exit, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ autosaveOnTimeLimitCmd()

ilTestPlayerAbstractGUI::autosaveOnTimeLimitCmd ( )

Automatically save a user answer when the limited duration of a test run is reached (called by synchronous form submit when the remaining time count down reaches zero)

Definition at line 907 of file class.ilTestPlayerAbstractGUI.php.

908 {
909 if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
910 $this->saveQuestionSolution(false, true);
911 }
912 $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
913 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\REDIRECT_ON_TIME_LIMIT.

+ Here is the call graph for this function:

◆ backFromFinishingCmd()

ilTestPlayerAbstractGUI::backFromFinishingCmd ( )

Definition at line 1920 of file class.ilTestPlayerAbstractGUI.php.

1921 {
1922 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1923 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ buildEditableStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildEditableStateQuestionNavigationGUI (   $question_id)
protected

Definition at line 2393 of file class.ilTestPlayerAbstractGUI.php.

2394 {
2395 $navigation_gui = new ilTestQuestionNavigationGUI(
2396 $this->lng,
2397 $this->ui_factory,
2398 $this->ui_renderer
2399 );
2400
2401 // fau: testNav - add a 'revert changes' link for editable question
2402 $navigation_gui->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
2403
2404 if ($this->object->getSpecificAnswerFeedback()
2405 || $this->object->getGenericAnswerFeedback()
2406 || $this->object->getAnswerFeedbackPoints()
2407 || $this->object->getInstantFeedbackSolution()) {
2408 $navigation_gui->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
2409
2410 if ($this->object->isForceInstantFeedbackEnabled()) {
2411 $navigation_gui->setForceInstantResponseEnabled(true);
2412 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2413 } else {
2414 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
2415 }
2416 }
2417
2418 if ($this->object->getShowMarker()) {
2419 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2420 $solved = 0;
2421
2422 if (count($solved_array) > 0) {
2423 $solved = array_pop($solved_array);
2424 $solved = $solved['solved'];
2425 }
2426
2427 if ($solved === 1) {
2428 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
2429 $navigation_gui->setQuestionMarked(true);
2430 } else {
2431 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
2432 $navigation_gui->setQuestionMarked(false);
2433 }
2434 }
2435 return $navigation_gui;
2436 }
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions

References ilObjTest\_getSolvedQuestions(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTestPlayerCommands\MARK_QUESTION_SAVE, ILIAS\Repository\object(), ilTestPlayerCommands\REVERT_CHANGES, ilTestPlayerCommands\SHOW_INSTANT_RESPONSE, ilTestPlayerCommands\SUBMIT_SOLUTION, and ilTestPlayerCommands\UNMARK_QUESTION_SAVE.

+ Here is the call graph for this function:

◆ buildFinishTestModal()

ilTestPlayerAbstractGUI::buildFinishTestModal ( )

Definition at line 1059 of file class.ilTestPlayerAbstractGUI.php.

1059 : InterruptiveModal
1060 {
1061 $class = get_class($this);
1062 $this->ctrl->setParameterByClass($class, 'finalization_confirmed', 'confirmed');
1063 $next_url = $this->ctrl->getLinkTargetByClass($class, ilTestPlayerCommands::FINISH_TEST);
1064 $this->ctrl->clearParameterByClass($class, 'finalization_confirmed');
1065
1066 $message = $this->lng->txt('tst_finish_confirmation_question');
1067 if (($this->object->getNrOfTries() - 1) === $this->test_session->getPass()) {
1068 $message = $this->lng->txt('tst_finish_confirmation_question_no_attempts_left');
1069 }
1070
1071 return $this->ui_factory->modal()->interruptive(
1072 $this->lng->txt('finish_test'),
1073 $message,
1074 $next_url
1075 )->withActionButtonLabel($this->lng->txt('tst_finish_confirm_button'));
1076 }

References ILIAS\Repository\ctrl(), ilTestPlayerCommands\FINISH_TEST, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ buildNextButtonInstance()

ilTestPlayerAbstractGUI::buildNextButtonInstance (   $primaryNext)
private
Parameters
bool$primaryNext
Returns
\ILIAS\UI\Component\Button\Primary

Definition at line 551 of file class.ilTestPlayerAbstractGUI.php.

552 {
553 $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::NEXT_QUESTION);
554 if ($primaryNext) {
555 $button = $this->ui_factory->button()->primary(
556 $this->lng->txt('next_question') . $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->next()),
557 ''
558 )->withUnavailableAction(true)
560 } else {
561 $button = $this->ui_factory->button()->standard(
562 $this->lng->txt('next_question') . $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->next()),
563 ''
564 )->withUnavailableAction(true)
566 }
567 return $button;
568 }
getOnLoadCodeForNavigationButtons(string $target, string $cmd)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilTestPlayerCommands\NEXT_QUESTION.

+ Here is the call graph for this function:

◆ buildPreviousButtonInstance()

ilTestPlayerAbstractGUI::buildPreviousButtonInstance ( )
private
Parameters
$disabled
Returns
\ILIAS\UI\Component\Button\Primary

Definition at line 574 of file class.ilTestPlayerAbstractGUI.php.

575 {
576 $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::PREVIOUS_QUESTION);
577 $button = $this->ui_factory->button()->standard(
578 $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->back()) . $this->lng->txt('previous_question'),
579 ''
580 )->withUnavailableAction(true)
582 return $button;
583 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\PREVIOUS_QUESTION.

+ Here is the call graph for this function:

◆ buildQuestionObject()

ilTestPlayerAbstractGUI::buildQuestionObject ( )
private

Definition at line 384 of file class.ilTestPlayerAbstractGUI.php.

384 : ?assQuestion
385 {
386 $q_id = $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
387
388 if ($this->isParticipantsAnswerFixed($q_id)) {
389 // should only be reached by firebugging the disabled form in ui
390 $this->tpl->setOnScreenMessage(ilGlobalTemplateInterface::MESSAGE_TYPE_FAILURE, $this->lng->txt('tst_player_answer_saved_and_locked'), true);
391 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
392 }
393
394 if ($q_id === null) {
395 return null;
396 }
397
398 return $this->getQuestionInstance($q_id);
399 }
getQuestionInstance(int $question_id, bool $from_cache=true)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ buildReadOnlyStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildReadOnlyStateQuestionNavigationGUI (   $question_id)
protected

Definition at line 2359 of file class.ilTestPlayerAbstractGUI.php.

2360 {
2361 $navigationGUI = new ilTestQuestionNavigationGUI(
2362 $this->lng,
2363 $this->ui_factory,
2364 $this->ui_renderer
2365 );
2366
2367 if (!$this->isParticipantsAnswerFixed($question_id)) {
2368 $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
2369 }
2370
2371 if ($this->object->getShowMarker()) {
2372 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2373 $solved = 0;
2374
2375 if (count($solved_array) > 0) {
2376 $solved = array_pop($solved_array);
2377 $solved = $solved["solved"];
2378 }
2379 // fau: testNav - change question mark command to link target
2380 if ($solved == 1) {
2381 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
2382 $navigationGUI->setQuestionMarked(true);
2383 } else {
2384 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
2385 $navigationGUI->setQuestionMarked(false);
2386 }
2387 }
2388 // fau.
2389
2390 return $navigationGUI;
2391 }

References ilObjTest\_getSolvedQuestions(), ILIAS\Repository\ctrl(), ilTestPlayerCommands\EDIT_SOLUTION, ILIAS\Repository\lng(), ilTestPlayerCommands\MARK_QUESTION, ILIAS\Repository\object(), and ilTestPlayerCommands\UNMARK_QUESTION.

+ Here is the call graph for this function:

◆ buildTestPassQuestionList()

ilTestPlayerAbstractGUI::buildTestPassQuestionList ( )
abstractprotected

◆ cancelAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::cancelAnswerOptionalQuestionsCmd ( )
protected

Definition at line 2331 of file class.ilTestPlayerAbstractGUI.php.

2332 {
2333 if ($this->object->getListOfQuestions()) {
2334 $this->ctrl->setParameter($this, 'activecommand', 'summary');
2335 } else {
2336 $this->ctrl->setParameter($this, 'activecommand', 'previous');
2337 }
2338
2339 $this->ctrl->redirect($this, 'redirectQuestion');
2340 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ canSaveResult()

ilTestPlayerAbstractGUI::canSaveResult ( )
protected

Definition at line 437 of file class.ilTestPlayerAbstractGUI.php.

437 : bool
438 {
439 return !$this->object->endingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
440 }

◆ checkAndUpdateSaveAllowedByFormTimestamp()

ilTestPlayerAbstractGUI::checkAndUpdateSaveAllowedByFormTimestamp ( bool  $force)
private

Definition at line 368 of file class.ilTestPlayerAbstractGUI.php.

368 : bool
369 {
370 if ($force) {
371 return true;
372 }
373
374 $formtimestamp = $this->testrequest->int('formtimestamp');
375 if (ilSession::get('formtimestamp') !== null
376 && $formtimestamp === ilSession::get('formtimestamp')) {
377 return false;
378 }
379
380 ilSession::set('formtimestamp', $formtimestamp);
381 return true;
382 }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.

References ilSession\get(), and ilSession\set().

+ Here is the call graph for this function:

◆ checkReadAccess()

ilTestPlayerAbstractGUI::checkReadAccess ( )
protected

Definition at line 231 of file class.ilTestPlayerAbstractGUI.php.

231 : bool|string
232 {
233 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
234 return $this->lng->txt('cannot_execute_test');
235 }
236
237 $participant_access = (new ilTestAccess($this->object->getRefId()))->isParticipantAllowed(
238 $this->object->getId(),
239 $this->user->getId()
240 );
241 if ($participant_access !== ParticipantAccess::ALLOWED) {
242 return $participant_access->getAccessForbiddenMessage($this->lng);
243 }
244
245 return true;
246 }

References ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTestExecutable()

ilTestPlayerAbstractGUI::checkTestExecutable ( )
protected

Definition at line 248 of file class.ilTestPlayerAbstractGUI.php.

249 {
250 $executable = $this->object->isExecutable($this->test_session, $this->test_session->getUserId());
251
252 if (!$executable['executable']) {
253 $this->tpl->setOnScreenMessage('info', $executable['errormessage'], true);
254 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, TestScreenGUI::class]);
255 }
256 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTestSessionUser()

ilTestPlayerAbstractGUI::checkTestSessionUser ( ilTestSession  $test_session)
protected

Definition at line 258 of file class.ilTestPlayerAbstractGUI.php.

258 : void
259 {
260 if ($test_session->getUserId() != $this->user->getId()) {
261 throw new ilTestException('active id given does not relate to current user!');
262 }
263 }
Base Exception for all Exceptions relating to Modules/Test.

References $test_session, and ilTestSession\getUserId().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkWorkingTimeCmd()

ilTestPlayerAbstractGUI::checkWorkingTimeCmd ( )

This is asynchronously called by tpl.workingtime.js to check for changes in the user's processing time for a test.

This includes extra time added during the test, as this is checked by ilObjTest::getProcessingTimeInSeconds(). The Javascript side then updates the test timer without needing to reload the test page.

Definition at line 1809 of file class.ilTestPlayerAbstractGUI.php.

1809 : void
1810 {
1811 $active_id = $this->test_session->getActiveId();
1812 echo (string) $this->object->getProcessingTimeInSeconds($active_id);
1813 exit;
1814 }

References exit.

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

Definition at line 2322 of file class.ilTestPlayerAbstractGUI.php.

2323 {
2324 $this->test_sequence->setAnsweringOptionalQuestionsConfirmed(true);
2325 $this->test_sequence->saveToDb();
2326
2327 $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
2328 $this->ctrl->redirect($this, 'redirectQuestion');
2329 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmSubmitAnswers()

ilTestPlayerAbstractGUI::confirmSubmitAnswers ( )

confirm submit results if confirm then results are submitted and the screen will be redirected to the startpage of the test @access public

Definition at line 1759 of file class.ilTestPlayerAbstractGUI.php.

1760 {
1761 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "components/ILIAS/Test");
1762 $this->tpl->setCurrentBlock("adm_content");
1763 if ($this->object->isTestFinished($this->test_session->getActiveId())) {
1764 $this->tpl->setCurrentBlock("not_submit_allowed");
1765 $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1766 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1767 } else {
1768 $this->tpl->setCurrentBlock("submit_allowed");
1769 $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1770 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1771 }
1772 $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1773 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1774 $this->tpl->parseCurrentBlock();
1775 }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ detectChangesCmd()

ilTestPlayerAbstractGUI::detectChangesCmd ( )
protected

Detect changes sent in the background to the server This is called by ajax from ilTestPlayerQuestionEditControl.js It is needed by Java and Flash question and eventually plgin question vtypes.

Definition at line 922 of file class.ilTestPlayerAbstractGUI.php.

923 {
924 $question_id = $this->getCurrentQuestionId();
925 $state = $this->getQuestionInstance($question_id)->lookupForExistingSolutions(
926 $this->test_session->getActiveId(),
927 $this->test_session->getPass()
928 );
929 $result = [];
930 $result['isAnswered'] = $state['authorized'];
931 $result['isAnswerChanged'] = $state['intermediate'];
932
933 echo json_encode($result);
934 exit;
935 }

References exit.

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

Definition at line 458 of file class.ilTestPlayerAbstractGUI.php.

458 : bool
459 {
460 $show_question_inline_score = false;
461 if ($this->object->getAnswerFeedbackPoints()) {
462 $show_question_inline_score = true;
463 return $show_question_inline_score;
464 }
465 return $show_question_inline_score;
466 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ determineSolutionPassIndex()

ilTestPlayerAbstractGUI::determineSolutionPassIndex ( assQuestionGUI  $question_gui)
protected

Definition at line 1299 of file class.ilTestPlayerAbstractGUI.php.

1299 : int
1300 {
1301 if ($this->object->isPreviousSolutionReuseEnabled()) {
1302 $currentSolutionAvailable = $question_gui->getObject()->authorizedOrIntermediateSolutionExists(
1303 $this->test_session->getActiveId(),
1304 $this->test_session->getPass()
1305 );
1306
1307 if (!$currentSolutionAvailable) {
1308 $previousPass = $question_gui->getObject()->getSolutionMaxPass(
1309 $this->test_session->getActiveId()
1310 );
1311
1312 $previousSolutionAvailable = $question_gui->getObject()->authorizedSolutionExists(
1313 $this->test_session->getActiveId(),
1314 $previousPass
1315 );
1316
1317 if ($previousSolutionAvailable) {
1318 return $previousPass;
1319 }
1320
1321 }
1322 }
1323
1324 return $this->test_session->getPass();
1325 }

References assQuestionGUI\getObject(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ discardSolutionCmd()

ilTestPlayerAbstractGUI::discardSolutionCmd ( )
protected

Definition at line 1543 of file class.ilTestPlayerAbstractGUI.php.

1544 {
1545 $current_sequence_element = $this->getCurrentSequenceElement();
1546
1547 $current_question_obj = $this->getQuestionInstance(
1548 $this->test_sequence->getQuestionForSequence($current_sequence_element)
1549 );
1550 $current_question_obj->setTestId($this->object->getId());
1551
1552 $current_question_obj->resetUsersAnswer(
1553 $this->test_session->getActiveId(),
1554 $this->test_session->getPass()
1555 );
1556
1557 if ($this->logger->isLoggingEnabled()
1558 && !$this->getObject()->getAnonymity()) {
1559 $this->logger->logParticipantInteraction(
1560 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1561 $this->object->getRefId(),
1562 $this->test_sequence->getQuestionForSequence($current_sequence_element),
1563 $this->user->getId(),
1564 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1565 TestParticipantInteractionTypes::ANSWER_DELETED,
1566 []
1567 )
1568 );
1569 }
1570
1571 $this->ctrl->saveParameter($this, 'sequence');
1572
1573 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1574
1575 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1576 }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26

References $_SERVER, ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), ILIAS\Repository\object(), PRESENTATION_MODE_VIEW, and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ displayAccessCodeCmd()

ilTestPlayerAbstractGUI::displayAccessCodeCmd ( )

Definition at line 801 of file class.ilTestPlayerAbstractGUI.php.

802 {
803 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "components/ILIAS/Test");
804 $this->tpl->setCurrentBlock("adm_content");
805 $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
806 $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->test_session->getAccessCodeFromSession());
807 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
808 $this->tpl->setVariable("CMD_CONFIRM", ilTestPlayerCommands::ACCESS_CODE_CONFIRMED);
809 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("continue_work"));
810 $this->tpl->parseCurrentBlock();
811 }

References ilTestPlayerCommands\ACCESS_CODE_CONFIRMED, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ editSolutionCmd()

ilTestPlayerAbstractGUI::editSolutionCmd ( )
protected

Definition at line 1483 of file class.ilTestPlayerAbstractGUI.php.

1484 {
1485 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_EDIT);
1486 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1487 }

References ILIAS\Repository\ctrl(), PRESENTATION_MODE_EDIT, and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ endingTimeReached()

ilTestPlayerAbstractGUI::endingTimeReached ( )

handle endingTimeReached

Definition at line 1732 of file class.ilTestPlayerAbstractGUI.php.

1733 {
1734 $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1735 $this->test_session->increasePass();
1736 $this->test_session->setLastSequence(0);
1737 $this->test_session->saveToDb();
1738
1739 $this->redirectBackCmd();
1740 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling

References ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ ensureExistingTestSession()

ilTestPlayerAbstractGUI::ensureExistingTestSession ( ilTestSession  $test_session)
protected

Definition at line 265 of file class.ilTestPlayerAbstractGUI.php.

265 : void
266 {
267 if ($test_session->getActiveId()) {
268 return;
269 }
270
271 $test_session->setUserId($this->user->getId());
272
273 if ($test_session->isAnonymousUser()) {
275 return;
276 }
277
279 }
280
282 }
setAnonymousId(string $anonymous_id)
setUserId(int $user_id)

References $test_session, ilTestSession\doesAccessCodeInSessionExists(), ilTestSession\getAccessCodeFromSession(), ilTestSession\getActiveId(), ilTestSession\isAnonymousUser(), ilTestSession\saveToDb(), ilTestSession\setAnonymousId(), ilTestSession\setUserId(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestPlayerAbstractGUI::executeCommand ( )

execute command

Reimplemented from ilTestServiceGUI.

Definition at line 87 of file class.ilTestPlayerAbstractGUI.php.

88 {
89 $this->tabs->clearTargets();
90
91 $cmd = $this->ctrl->getCmd();
92 $next_class = $this->ctrl->getNextClass($this);
93
94 if (($read_access = $this->checkReadAccess()) !== true) {
95 if ($cmd === 'autosave') {
96 echo $this->lng->txt('autosave_failed') . ': ' . $read_access;
97 exit;
98 }
99 $this->tpl->setOnScreenMessage('failure', $read_access, true);
100 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, TestScreenGUI::class]);
101 }
102
103 $this->ctrl->saveParameter($this, "sequence");
104 $this->ctrl->saveParameter($this, "pmode");
105 $this->ctrl->saveParameter($this, "active_id");
106
107 $this->initAssessmentSettings();
108
109 $testSessionFactory = new ilTestSessionFactory($this->object, $this->db, $this->user);
110 $this->test_session = $testSessionFactory->getSession($this->testrequest->int('active_id'));
111
112 $this->ensureExistingTestSession($this->test_session);
113 $this->checkTestSessionUser($this->test_session);
114
115 $this->initProcessLocker($this->test_session->getActiveId());
116
117 $test_sequence_factory = new ilTestSequenceFactory($this->object, $this->db, $this->questionrepository);
118 $this->test_sequence = $test_sequence_factory->getSequenceByTestSession($this->test_session);
119 $this->test_sequence->loadFromDb();
120 $this->test_sequence->loadQuestions();
121
122 $this->question_related_objectives_list = new ilTestQuestionRelatedObjectivesList();
123
125
127
128 $instance_name = $this->settings->get('short_inst_name') ?? '';
129 if (trim($instance_name) === '') {
130 $instance_name = 'ILIAS';
131 }
132 $this->global_screen->tool()->context()->current()->addAdditionalData(
134 $instance_name
135 );
136 $this->global_screen->tool()->context()->current()->addAdditionalData(
138 $this->object->getKioskMode()
139 );
140 $this->global_screen->tool()->context()->current()->addAdditionalData(
142 $this->object->getTitle()
143 );
144 $this->global_screen->tool()->context()->current()->addAdditionalData(
146 $this->getTestPlayerTitle()
147 );
148
149 switch ($next_class) {
150 case 'ilassquestionpagegui':
151 $this->checkTestExecutable();
152
153 $question_id = $this->test_sequence->getQuestionForSequence($this->getCurrentSequenceElement());
154
155 $page_gui = new ilAssQuestionPageGUI($question_id);
156 $page_gui->setFileDownloadLink(
157 $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile')
158 );
159 $ret = $this->ctrl->forwardCommand($page_gui);
160 break;
161
162 case 'iltestsubmissionreviewgui':
163 $this->checkTestExecutable();
164 $this->handleCheckTestPassValid(true);
165
166 $gui = new ilTestSubmissionReviewGUI($this, $this->object, $this->test_session);
167 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
168 $ret = $this->ctrl->forwardCommand($gui);
169 break;
170
171 case 'ilassspecfeedbackpagegui':
172 case 'ilassgenfeedbackpagegui':
173 $id = $this->testrequest->int('pg_id');
174 if ($this->ctrl->getCmd() !== 'displayMediaFullscreen'
175 || $id === 0) {
176 break;
177 }
178
179 (new ilPageObjectGUI(
180 $next_class === 'ilassgenfeedbackpagegui' ? 'qfbg' : 'qfbs',
181 $id
182 ))->displayMediaFullscreen();
183 break;
184
185 case 'iltestpasswordprotectiongui':
186 $this->checkTestExecutable();
187
189 $this->ctrl,
190 $this->tpl,
191 $this->lng,
192 $this,
193 $this->password_checker,
194 $this->testrequest,
195 $this->global_screen
196 );
197 $ret = $this->ctrl->forwardCommand($gui);
198 break;
199
200 default:
201 if ($cmd !== 'autosave' && ilTestPlayerCommands::isTestExecutionCommand($cmd)) {
202 $this->checkTestExecutable();
203 }
204
205 if ($cmd === 'outQuestionSummary'
206 || $cmd === 'submitSolution') {
207 $this->handleCheckTestPassValid(true);
208 }
209
210 if ($cmd === 'showQuestion') {
211 $testPassesSelector = new ilTestPassesSelector($this->db, $this->object);
212 $testPassesSelector->setActiveId($this->test_session->getActiveId());
213 $testPassesSelector->setLastFinishedPass($this->test_session->getLastFinishedPass());
214
215 if (!$testPassesSelector->openPassExists()) {
216 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_pass_finished'), true);
217 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, TestScreenGUI::class]);
218 }
219 }
220
221 $cmd .= 'Cmd';
222 $ret = $this->$cmd();
223 break;
224 }
225 return $ret;
226 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Question page GUI class.
Class ilPageObjectGUI.
handleCheckTestPassValid(bool $with_redirect=false)
checkTestSessionUser(ilTestSession $test_session)
ensureExistingTestSession(ilTestSession $test_session)
getSequenceByTestSession($testSession)
creates and returns an instance of a test sequence that corresponds to the current test mode and the ...
ilTestSequenceFactory $test_sequence_factory
Class ilTestSubmissionReviewGUI.
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

References $id, ilTestServiceGUI\$test_sequence_factory, checkReadAccess(), checkTestExecutable(), checkTestSessionUser(), ILIAS\Repository\ctrl(), ensureExistingTestSession(), exit, getCurrentSequenceElement(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestSequenceFactory\getSequenceByTestSession(), getTestPlayerTitle(), handleCheckTestPassValid(), handlePasswordProtectionRedirect(), initAssessmentSettings(), iljQueryUtil\initjQuery(), initProcessLocker(), ilTestPlayerCommands\isTestExecutionCommand(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ilTestPlayerLayoutProvider\TEST_PLAYER_KIOSK_MODE_ENABLED, ilTestPlayerLayoutProvider\TEST_PLAYER_SHORT_TITLE, ilTestPlayerLayoutProvider\TEST_PLAYER_TITLE, ilTestPlayerLayoutProvider\TEST_PLAYER_VIEW_TITLE, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ finishTestCmd()

ilTestPlayerAbstractGUI::finishTestCmd ( )

Definition at line 989 of file class.ilTestPlayerAbstractGUI.php.

990 {
992 ilSession::clear('tst_next');
993
994 if ($this->testrequest->strVal('finalization_confirmed') !== 'confirmed') {
995 $this->finish_test_modal = $this->buildFinishTestModal();
996 $this->showQuestionCmd();
997 return;
998 }
999
1000 // Non-last try finish
1001 if (ilSession::get('tst_pass_finish') === null) {
1002 ilSession::set('tst_pass_finish', 1);
1003 }
1004
1005 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_PARTICIPANT);
1006
1007 if ($this->logger->isLoggingEnabled()
1008 && !$this->getObject()->getAnonymity()
1009 && ($interaction = $this->logger->getInteractionFactory()->buildParticipantInteraction(
1010 $this->ref_id,
1011 null,
1012 $this->user->getId(),
1013 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1015 []
1016 )) !== null) {
1017 $this->logger->logParticipantInteraction($interaction);
1018 }
1019
1021 }
static clear(string $a_var)
performTestPassFinishedTasks(StatusOfAttempt $status_of_attempt)

References $_SERVER, ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, ilSession\clear(), ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\logger(), ilSession\set(), and ILIAS\Test\Logging\TEST_RUN_FINISHED.

+ Here is the call graph for this function:

◆ generateRandomTestPassForActiveUser()

ilTestPlayerAbstractGUI::generateRandomTestPassForActiveUser ( )
protected

Definition at line 3046 of file class.ilTestPlayerAbstractGUI.php.

3046 : void
3047 {
3048 $questionSetConfig = new ilTestRandomQuestionSetConfig(
3049 $this->tree,
3050 $this->db,
3051 $this->lng,
3052 $this->logger,
3053 $this->component_repository,
3054 $this->object,
3055 $this->questionrepository
3056 );
3057 $questionSetConfig->loadFromDb();
3058
3059 $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($this->db, $this->object);
3060
3061 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList($this->db, $this->object, $sourcePoolDefinitionFactory);
3062 $sourcePoolDefinitionList->loadDefinitions();
3063
3064 $this->process_locker->executeRandomPassBuildOperation(function () use ($questionSetConfig, $sourcePoolDefinitionList) {
3066 $stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($this->db, $this->component_repository);
3067
3068 $questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance(
3069 $this->db,
3070 $this->lng,
3071 $this->logger,
3072 $this->object,
3073 $questionSetConfig,
3074 $sourcePoolDefinitionList,
3075 $stagingPoolQuestionList
3076 );
3077
3078 $questionSetBuilder->performBuild($this->test_session);
3079 }
3080 }, $sourcePoolDefinitionList->hasTaxonomyFilters());
3081 }
static getInstance(ilDBInterface $db, ilLanguage $lng, TestLogger $logger, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)

References ilTestRandomQuestionSetBuilder\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ getAnswerChangedParameter()

ilTestPlayerAbstractGUI::getAnswerChangedParameter ( )
protected

Definition at line 2663 of file class.ilTestPlayerAbstractGUI.php.

2663 : bool
2664 {
2665 return !empty($this->testrequest->raw('test_answer_changed'));
2666 }

◆ getContentBlockName()

ilTestPlayerAbstractGUI::getContentBlockName ( )

Returns the name of the current content block (depends on the kiosk mode setting)

Returns
string The name of the content block

Definition at line 2041 of file class.ilTestPlayerAbstractGUI.php.

2041 : string
2042 {
2043 return "ADM_CONTENT";
2044
2045 if ($this->object->getKioskMode()) {
2046 $this->tpl->setBodyClass("kiosk");
2047 $this->tpl->hideFooter();
2048 return "CONTENT";
2049 } else {
2050 return "ADM_CONTENT";
2051 }
2052 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getCurrentQuestionId()

ilTestPlayerAbstractGUI::getCurrentQuestionId ( )
protected

Definition at line 864 of file class.ilTestPlayerAbstractGUI.php.

864 : int
865 {
866 return $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
867 }

Referenced by removeIntermediateSolution().

+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestPlayerAbstractGUI::getCurrentSequenceElement ( )
protected

Definition at line 2602 of file class.ilTestPlayerAbstractGUI.php.

2602 : int
2603 {
2604 if ($this->getSequenceElementParameter()) {
2605 return $this->getSequenceElementParameter();
2606 }
2607
2608 return $this->test_session->getLastSequence();
2609 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestPlayerAbstractGUI::getFinishTestCommand ( )
protected

Definition at line 2438 of file class.ilTestPlayerAbstractGUI.php.

2438 : string
2439 {
2440 if (!$this->object->getListOfQuestionsEnd()) {
2442 }
2443
2445 }

References ilTestPlayerCommands\FINISH_TEST, ILIAS\Repository\object(), and ilTestPlayerCommands\QUESTION_SUMMARY.

+ Here is the call graph for this function:

◆ getInstantResponseParameter()

ilTestPlayerAbstractGUI::getInstantResponseParameter ( )
protected

Definition at line 2629 of file class.ilTestPlayerAbstractGUI.php.

2629 : bool
2630 {
2631 return $this->testrequest->isInstanceResponseRequested();
2632 }

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

Definition at line 2263 of file class.ilTestPlayerAbstractGUI.php.

2263 : string
2264 {
2265 return $this->lng->txt("save_introduction");
2266 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLockParameter()

ilTestPlayerAbstractGUI::getLockParameter ( )

Definition at line 725 of file class.ilTestPlayerAbstractGUI.php.

726 {
727 if ($this->testrequest->isset('lock') && strlen($this->testrequest->raw('lock'))) {
728 return $this->testrequest->raw('lock');
729 }
730
731 return null;
732 }

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

Definition at line 2649 of file class.ilTestPlayerAbstractGUI.php.

2649 : string
2650 {
2651 $navigation_url = $this->testrequest->strVal('test_player_navigation_url');
2652 if ($navigation_url !== '') {
2653 $navigation_url_parts = parse_url($navigation_url);
2654 $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2655
2656 if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2657 return $navigation_url;
2658 }
2659 }
2660 return '';
2661 }
static _getHttpPath()

References ilUtil\_getHttpPath().

+ Here is the call graph for this function:

◆ getNextCommandParameter()

ilTestPlayerAbstractGUI::getNextCommandParameter ( )
protected

Definition at line 2634 of file class.ilTestPlayerAbstractGUI.php.

2635 {
2636 $nextcmd = '';
2637 if ($this->testrequest->isset('nextcmd')) {
2638 $nextcmd = $this->testrequest->strVal('nextcmd');
2639 }
2640
2641 return $nextcmd !== '' ? $nextcmd : null;
2642 }

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

Definition at line 2644 of file class.ilTestPlayerAbstractGUI.php.

2644 : int
2645 {
2646 return $this->testrequest->int('nextseq');
2647 }

◆ getOnLoadCodeForNavigationButtons()

ilTestPlayerAbstractGUI::getOnLoadCodeForNavigationButtons ( string  $target,
string  $cmd 
)
private

Definition at line 585 of file class.ilTestPlayerAbstractGUI.php.

585 : Closure
586 {
587 return static function (string $id) use ($target, $cmd): string {
588 return "document.getElementById('{$id}').addEventListener('click', "
589 . "(e) => {il.TestPlayerQuestionEditControl.checkNavigation('{$target}', '{$cmd}', e);}"
590 . "); "
591 . "document.getElementById('{$id}').removeAttribute('disabled');";
592 };
593 }

References $id.

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

Definition at line 2620 of file class.ilTestPlayerAbstractGUI.php.

2621 {
2622 if ($this->testrequest->isset('pmode')) {
2623 return $this->testrequest->raw('pmode');
2624 }
2625
2626 return null;
2627 }

◆ getQuestionFeedbackModalHtml()

ilTestPlayerAbstractGUI::getQuestionFeedbackModalHtml ( ilTemplate  $tpl,
string  $nav_url 
)
private

Definition at line 2485 of file class.ilTestPlayerAbstractGUI.php.

2485 : string
2486 {
2487 $modal = $this->ui_factory->modal()->roundtrip(
2488 $this->lng->txt('tst_instant_feedback'),
2489 $this->ui_factory->legacy()->content($tpl->get()),
2490 []
2491 )->withActionButtons([
2492 $this->ui_factory->button()->standard($this->lng->txt('proceed'), $nav_url)
2493 ]);
2494
2495 return $this->ui_renderer->render([
2496 $modal->withOnLoad($modal->getShowSignal())
2497 ]);
2498 }
ilGlobalTemplateInterface ilTemplate $tpl
sk 2023-08-01: We need this union type, even if it is wrong! To change this
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ilTemplate\get(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getQuestionGuiInstance()

ilTestPlayerAbstractGUI::getQuestionGuiInstance ( int  $question_id,
bool  $from_cache = true 
)
protected

Definition at line 2694 of file class.ilTestPlayerAbstractGUI.php.

2694 : object
2695 {
2696 $tpl = $this->tpl;
2697
2698 if (!$from_cache || !isset($this->cached_question_guis[$question_id])) {
2699 $question_gui = $this->object->createQuestionGUI("", $question_id);
2700 $question_gui->setTargetGui($this);
2701 $question_gui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2702 $question = $question_gui->getObject();
2703 $question->setShuffler($this->shuffler->getAnswerShuffleFor(
2704 $question_id,
2705 $this->test_session->getActiveId(),
2706 $this->test_session->getPass()
2707 ));
2708 $question_gui->setObject($question);
2709 $question_gui->populateJavascriptFilesRequiredForWorkForm($tpl);
2710
2711 // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2712 $this->initTestQuestionConfig($question_gui->getObject());
2713 // hey.
2714
2715 $this->cached_question_guis[$question_id] = $question_gui;
2716 }
2717
2718 return $this->cached_question_guis[$question_id];
2719 }
initTestQuestionConfig(assQuestion $question_obj)

References assQuestionGUI\getObject(), assQuestionGUI\populateJavascriptFilesRequiredForWorkForm(), assQuestionGUI\PRESENTATION_CONTEXT_TEST, assQuestionGUI\setObject(), assQuestionGUI\setPresentationContext(), and assQuestionGUI\setTargetGui().

+ Here is the call graph for this function:

◆ getQuestionInstance()

ilTestPlayerAbstractGUI::getQuestionInstance ( int  $question_id,
bool  $from_cache = true 
)
protected

Definition at line 2721 of file class.ilTestPlayerAbstractGUI.php.

2721 : assQuestion
2722 {
2723 if ($from_cache && isset($this->cached_question_objects[$question_id])) {
2724 return $this->cached_question_objects[$question_id];
2725 }
2726 $question = assQuestion::instantiateQuestion($question_id);
2727 $ass_settings = new ilSetting('assessment');
2728
2729 $process_locker_factory = new ilAssQuestionProcessLockerFactory($ass_settings, $this->db, ilLoggerFactory::getLogger('tst'));
2730 $process_locker_factory->setQuestionId($question->getId());
2731 $process_locker_factory->setUserId($this->user->getId());
2732 $question->setProcessLocker($process_locker_factory->getLocker());
2733
2734 $this->initTestQuestionConfig($question);
2735
2736 $this->cached_question_objects[$question_id] = $question;
2737 return $question;
2738 }
static instantiateQuestion(int $question_id)
static getLogger(string $a_component_id)
Get component logger.

References ilLoggerFactory\getLogger(), assQuestion\instantiateQuestion(), and ILIAS\Repository\user().

Referenced by removeIntermediateSolution().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsDefaultPresentationMode()

ilTestPlayerAbstractGUI::getQuestionsDefaultPresentationMode ( )
protected

Definition at line 2895 of file class.ilTestPlayerAbstractGUI.php.

2895 : string
2896 {
2898 }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

Definition at line 2910 of file class.ilTestPlayerAbstractGUI.php.

2910 : ?string
2911 {
2912 if (ilSession::get('forced_feedback_navigation_url') === null) {
2913 return null;
2914 }
2915 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2916 if (!isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2917 return null;
2918 }
2919
2920 return $forced_feedback_navigation_url[$this->test_session->getActiveId()];
2921 }

References ilSession\get().

+ Here is the call graph for this function:

◆ getSequenceElementParameter()

ilTestPlayerAbstractGUI::getSequenceElementParameter ( )
protected

Definition at line 2611 of file class.ilTestPlayerAbstractGUI.php.

2611 : ?int
2612 {
2613 if ($this->testrequest->isset('sequence')) {
2614 return $this->testrequest->int('sequence');
2615 }
2616
2617 return null;
2618 }

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

Definition at line 2350 of file class.ilTestPlayerAbstractGUI.php.

2351 {
2352 $navigation_toolbar = new ilTestNavigationToolbarGUI($this->ctrl, $this);
2353 $navigation_toolbar->setSuspendTestButtonEnabled($this->object->getShowCancel());
2354 $navigation_toolbar->setUserPassOverviewEnabled($this->object->getUsrPassOverviewEnabled());
2355 $navigation_toolbar->setFinishTestCommand($this->getFinishTestCommand());
2356 return $navigation_toolbar;
2357 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getTestPlayerTitle()

ilTestPlayerAbstractGUI::getTestPlayerTitle ( )
protected

Definition at line 3130 of file class.ilTestPlayerAbstractGUI.php.

3130 : string
3131 {
3132 $title_content = $this->ui_factory->listing()->property();
3133
3134 if ($this->object->getShowKioskModeParticipant()) {
3135 $pax_name_label = $this->lng->txt("conf_user_name");
3136 // this is a placeholder solution with inline html tags to differentiate the different elements
3137 // should be removed when a title component with grouping and visual weighting is available
3138 // see: https://github.com/ILIAS-eLearning/ILIAS/pull/7311
3139 $pax_name_value = "<span class='il-test-kiosk-head__participant-name'>"
3140 . $this->user->getFullname() . "</span>";
3141 $title_content = $title_content->withProperty($pax_name_label, $pax_name_value, false);
3142 }
3143
3144 if ($this->object->isShowExamIdInTestPassEnabled()) {
3145 $exam_id_label = $this->lng->txt("exam_id_label");
3146 $exam_id_value = ilObjTest::buildExamId(
3147 $this->test_session->getActiveId(),
3148 $this->test_session->getPass(),
3149 $this->object->getId()
3150 );
3151 $title_content = $title_content->withProperty($exam_id_label, $exam_id_value);
3152 }
3153
3154 if ($this->object->getShowKioskModeTitle()) {
3155 $test_title_label = $this->lng->txt("test");
3156 $test_title_value = $this->object->getTitle();
3157 $title_content = $title_content->withProperty($test_title_label, $test_title_value, false);
3158 }
3159
3160 return $this->ui_renderer->render($title_content);
3161 }
static buildExamId($active_id, $pass, $test_obj_id=null)

References ilObjTest\buildExamId(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleCheckTestPassValid()

ilTestPlayerAbstractGUI::handleCheckTestPassValid ( bool  $with_redirect = false)
protected

Definition at line 3003 of file class.ilTestPlayerAbstractGUI.php.

3003 : void
3004 {
3005 $testObj = new ilObjTest($this->ref_id, true);
3006
3007 $participants = $testObj->getActiveParticipantList();
3008 $participant = $participants->getParticipantByActiveId($this->testrequest->getActiveId());
3009 if ($participant && $participant->hasUnfinishedPasses()) {
3010 return;
3011 }
3012 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_current_run_no_longer_valid'), true);
3013 if ($with_redirect) {
3014 $this->ctrl->redirectByClass([
3015 ilRepositoryGUI::class,
3016 ilObjTestGUI::class,
3017 TestScreenGUI::class
3018 ]);
3019 }
3020 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleFileUploadCmd()

ilTestPlayerAbstractGUI::handleFileUploadCmd ( )
protected

Definition at line 2937 of file class.ilTestPlayerAbstractGUI.php.

2937 : void
2938 {
2939 $this->updateWorkingTime();
2940 $this->saveQuestionSolution(false);
2941 $this->ctrl->redirect($this, ilTestPlayerCommands::SUBMIT_SOLUTION);
2942 }
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SUBMIT_SOLUTION.

+ Here is the call graph for this function:

◆ handleIntermediateSubmit()

ilTestPlayerAbstractGUI::handleIntermediateSubmit ( )
protected

Definition at line 2673 of file class.ilTestPlayerAbstractGUI.php.

2674 {
2675 if ($this->getAnswerChangedParameter()) {
2676 $this->saveQuestionSolution(false);
2677 } else {
2679 }
2681 }

◆ handlePasswordProtectionRedirect()

ilTestPlayerAbstractGUI::handlePasswordProtectionRedirect ( )
protected

The test password is only checked once per session to avoid errors during autosave if the password is changed during a running test. See Mantis #22536 for more details.

Definition at line 2219 of file class.ilTestPlayerAbstractGUI.php.

2220 {
2227 if ($this->test_session->isPasswordChecked() === true) {
2228 return;
2229 }
2230
2231 if ($this->ctrl->getNextClass() === 'iltestpasswordprotectiongui') {
2232 return;
2233 }
2234
2235 if (!$this->password_checker->isPasswordProtectionPageRedirectRequired()) {
2236 $this->test_session->setPasswordChecked(true);
2237 return;
2238 }
2239
2240 $this->ctrl->setParameterByClass(self::class, 'lock', $this->getLockParameter());
2241
2242 $next_command = $this->ctrl->getCmdClass() . '::' . ilTestPlayerCommands::START_TEST;
2243 $this->ctrl->setParameterByClass(ilTestPasswordProtectionGUI::class, 'nextCommand', $next_command);
2244 $this->ctrl->redirectByClass(ilTestPasswordProtectionGUI::class, 'showPasswordForm');
2245 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\START_TEST.

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlePrimaryButton()

ilTestPlayerAbstractGUI::handlePrimaryButton ( ilTestNavigationToolbarGUI  $navigation_toolbar_gui,
int  $current_question_id 
)
protected

Definition at line 3102 of file class.ilTestPlayerAbstractGUI.php.

3102 : bool
3103 {
3104 $is_next_primary = true;
3105
3106 if ($this->object->isForceInstantFeedbackEnabled()) {
3107 $is_next_primary = false;
3108 }
3109
3110 $questions_missing_result = $this->questionrepository->getQuestionsMissingResultRecord(
3111 $this->test_session->getActiveId(),
3112 $this->test_session->getPass(),
3113 $this->test_sequence->getOrderedSequenceQuestions()
3114 );
3115
3116 if ($questions_missing_result === []) {
3117 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3118 return false;
3119 }
3120
3121 if (count($questions_missing_result) === 1
3122 && $current_question_id === current($questions_missing_result)) {
3123 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3124 return false;
3125 }
3126
3127 return $is_next_primary;
3128 }
setFinishTestButtonPrimary($finishTestButtonPrimary)

References ILIAS\Repository\object(), and ilTestNavigationToolbarGUI\setFinishTestButtonPrimary().

+ Here is the call graph for this function:

◆ handleQuestionActionCmd()

ilTestPlayerAbstractGUI::handleQuestionActionCmd ( )
protected

Definition at line 2073 of file class.ilTestPlayerAbstractGUI.php.

2074 {
2075 $question_id = $this->test_sequence->getQuestionForSequence(
2077 );
2078
2079 if (!$this->isParticipantsAnswerFixed($question_id)) {
2080 $this->updateWorkingTime();
2081 $this->saveQuestionSolution(false);
2082 // fau: testNav - add changed status of the question
2083 $this->setAnswerChangedParameter(true);
2084 // fau.
2085 }
2086
2087 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2088 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ handleQuestionPostponing()

ilTestPlayerAbstractGUI::handleQuestionPostponing ( int  $question_id)
protected

Definition at line 2996 of file class.ilTestPlayerAbstractGUI.php.

2998 : void {
2999 $this->test_sequence->postponeQuestion($question_id);
3000 $this->test_sequence->saveToDb();
3001 }

◆ handleSkillTriggering()

ilTestPlayerAbstractGUI::handleSkillTriggering ( ilTestSession  $test_session)
protected
Parameters
ilTestSession$test_session

Definition at line 2276 of file class.ilTestPlayerAbstractGUI.php.

2276 : void
2277 {
2278 $skill_evaluation = new ilTestSkillEvaluation(
2279 $this->db,
2280 $this->logger,
2281 $this->object->getTestId(),
2282 $this->object->getRefId(),
2283 $this->skills_service->profile(),
2284 $this->skills_service->personal()
2285 );
2286
2287 $skill_evaluation->setUserId($test_session->getUserId());
2288 $skill_evaluation->setActiveId($test_session->getActiveId());
2289 $skill_evaluation->setPass($test_session->getPass());
2290
2291 $skill_evaluation->setNumRequiredBookingsForSkillTriggering(
2292 $this->object->getGlobalSettings()->getSkillTriggeringNumberOfAnswers()
2293 );
2294
2295 $question_list = $this->buildTestPassQuestionList();
2296 $question_list->load();
2297 $skill_evaluation->init($question_list);
2298 $skill_evaluation->evaluate(
2299 $this->object->getTestResult(
2300 $test_session->getActiveId(),
2302 true
2303 )
2304 );
2305
2306 $skill_evaluation->handleSkillTriggering();
2307 }

References ilTestSession\getActiveId(), ilTestSession\getPass(), ilTestSession\getUserId(), ILIAS\Repository\logger(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ handleTearsAndAngerNoObjectiveOrientedQuestion()

ilTestPlayerAbstractGUI::handleTearsAndAngerNoObjectiveOrientedQuestion ( )
protected

Definition at line 3096 of file class.ilTestPlayerAbstractGUI.php.

3096 : void
3097 {
3098 $this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_objective_oriented_test_pass_without_questions'), $this->object->getTitle()), true);
3099 $this->ctrl->redirectByClass(ilObjTestGUI::class);
3100 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ handleTearsAndAngerQuestionIsNull()

ilTestPlayerAbstractGUI::handleTearsAndAngerQuestionIsNull ( int  $question_id,
  $sequence_element 
)
protected

Definition at line 2747 of file class.ilTestPlayerAbstractGUI.php.

2747 : void
2748 {
2749 $this->logger->error(
2750 "INV SEQ:"
2751 . "active={$this->test_session->getActiveId()} "
2752 . "qId=$question_id seq=$sequence_element "
2753 . serialize($this->test_sequence)
2754 );
2755
2756 $this->ctrl->setParameter($this, 'sequence', $this->test_sequence->getFirstSequence());
2757 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2758 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ handleUserSettings()

ilTestPlayerAbstractGUI::handleUserSettings ( )

Handles some form parameters on starting and resuming a test.

Definition at line 821 of file class.ilTestPlayerAbstractGUI.php.

822 {
823 if ($this->object->getNrOfTries() != 1
824 && $this->object->getUsePreviousAnswers() == 1
825 ) {
826 $chb_use_previous_answers = 0;
827 if ($this->post_wrapper->has('chb_use_previous_answers')) {
828 $chb_use_previous_answers = $this->post_wrapper->retrieve(
829 'chb_use_previous_answers',
830 $this->refinery->kindlyTo()->int()
831 );
832 }
833 $this->user->writePref("tst_use_previous_answers", (string) $chb_use_previous_answers);
834 }
835 }

References ILIAS\Repository\object(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ initAssessmentSettings()

ilTestPlayerAbstractGUI::initAssessmentSettings ( )
protected

Definition at line 2268 of file class.ilTestPlayerAbstractGUI.php.

2269 {
2270 $this->ass_settings = new ilSetting('assessment');
2271 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

Definition at line 284 of file class.ilTestPlayerAbstractGUI.php.

285 {
287 $process_lockerFactory = new ilTestProcessLockerFactory($this->ass_settings, $ilDB, $this->logger);
288 $this->process_locker = $process_lockerFactory->withContextId((int) $activeId)->getLocker();
289 }
readonly ilDBInterface $db

References ilTestServiceGUI\$db, $ilDB, and ILIAS\Repository\logger().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTestCmd()

ilTestPlayerAbstractGUI::initTestCmd ( )
protected

Start a test for the first time after a redirect.

Definition at line 782 of file class.ilTestPlayerAbstractGUI.php.

783 {
784 if ($this->test_session->isAnonymousUser()
785 && !$this->test_session->doesAccessCodeInSessionExists()) {
786 $access_code = $this->test_session->createNewAccessCode();
787
788 $this->test_session->setAccessCodeToSession($access_code);
789 $this->test_session->setAnonymousId($access_code);
790 $this->test_session->saveToDb();
791
792 $this->ctrl->redirect($this, ilTestPlayerCommands::DISPLAY_ACCESS_CODE);
793 }
794
795 if (!$this->test_session->isAnonymousUser()) {
796 $this->test_session->unsetAccessCodeInSession();
797 }
798 $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
799 }

References ILIAS\Repository\ctrl(), ilTestPlayerCommands\DISPLAY_ACCESS_CODE, and ilTestPlayerCommands\START_TEST.

+ Here is the call graph for this function:

◆ initTestPageTemplate()

ilTestPlayerAbstractGUI::initTestPageTemplate ( )
protected

Definition at line 2191 of file class.ilTestPlayerAbstractGUI.php.

2192 {
2193 $onload_js = <<<JS
2194 let key_event = (event) => {
2195 if( event.key === 13 && event.target.tagName.toLowerCase() === "a" ) {
2196 return;
2197 }
2198 if (event.key === 13 &&
2199 event.target.tagName.toLowerCase() !== "textarea" &&
2200 (event.target.tagName.toLowerCase() !== "input" || event.target.type.toLowerCase() !== "submit")) {
2201 event.preventDefault();
2202 }
2203 };
2204
2205 let form = document.getElementById('taForm');
2206 form.onkeyup = key_event;
2207 form.onkeydown = key_event;
2208 form.onkeypress = key_event;
2209JS;
2210 $this->tpl->addOnLoadCode($onload_js);
2211 $this->tpl->addBlockFile(
2212 $this->getContentBlockName(),
2213 'adm_content',
2214 'tpl.il_as_tst_output.html',
2215 'components/ILIAS/Test'
2216 );
2217 }
form(?array $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\event(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ initTestQuestionConfig()

ilTestPlayerAbstractGUI::initTestQuestionConfig ( assQuestion  $question_obj)
protected

Definition at line 2740 of file class.ilTestPlayerAbstractGUI.php.

2741 {
2742 $question_obj->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2743 $this->object->isPreviousSolutionReuseEnabled()
2744 );
2745 }

References assQuestion\getTestPresentationConfig(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ isFirstQuestionInSequence()

ilTestPlayerAbstractGUI::isFirstQuestionInSequence (   $sequence_element)
protected

Definition at line 2063 of file class.ilTestPlayerAbstractGUI.php.

2063 : bool
2064 {
2065 return $sequence_element == $this->test_sequence->getFirstSequence();
2066 }

◆ isFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::isFollowUpQuestionLocksConfirmationPrevented ( )
protected

Definition at line 2847 of file class.ilTestPlayerAbstractGUI.php.

2848 {
2849 if (ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM) == null) {
2850 return false;
2851 }
2852
2853 return ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2854 }

References ilSession\get().

+ Here is the call graph for this function:

◆ isForcedFeedbackNavUrlRegistered()

ilTestPlayerAbstractGUI::isForcedFeedbackNavUrlRegistered ( )
protected

Definition at line 2923 of file class.ilTestPlayerAbstractGUI.php.

2923 : bool
2924 {
2925 return $this->getRegisteredForcedFeedbackNavUrl() !== null;
2926 }

◆ isLastQuestionInSequence()

ilTestPlayerAbstractGUI::isLastQuestionInSequence (   $sequence_element)
protected

Definition at line 2068 of file class.ilTestPlayerAbstractGUI.php.

2068 : bool
2069 {
2070 return $sequence_element == $this->test_sequence->getLastSequence();
2071 }

◆ isMaxProcessingTimeReached()

ilTestPlayerAbstractGUI::isMaxProcessingTimeReached ( )

Definition at line 447 of file class.ilTestPlayerAbstractGUI.php.

447 : bool
448 {
449 $active_id = $this->test_session->getActiveId();
450 $starting_time = $this->object->getStartingTimeOfUser($active_id);
451 if ($starting_time === false) {
452 return false;
453 } else {
454 return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
455 }
456 }

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

Definition at line 1722 of file class.ilTestPlayerAbstractGUI.php.

1722 : bool
1723 {
1724 return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->test_session->getPass());
1725 }

◆ isOptionalQuestionAnsweringConfirmationRequired()

ilTestPlayerAbstractGUI::isOptionalQuestionAnsweringConfirmationRequired ( int  $sequence_key)
protected

Definition at line 1178 of file class.ilTestPlayerAbstractGUI.php.

1178 : bool
1179 {
1180 if ($this->test_sequence->isAnsweringOptionalQuestionsConfirmed()) {
1181 return false;
1182 }
1183
1184 $question_id = $this->test_sequence->getQuestionForSequence($sequence_key);
1185
1186 if (!$this->test_sequence->isQuestionOptional($question_id)) {
1187 return false;
1188 }
1189
1190 return true;
1191 }

◆ isParticipantsAnswerFixed()

ilTestPlayerAbstractGUI::isParticipantsAnswerFixed (   $question_id)
protected

Definition at line 2247 of file class.ilTestPlayerAbstractGUI.php.

2247 : bool
2248 {
2249 if ($this->object->isInstantFeedbackAnswerFixationEnabled()) {
2250 return $this->test_sequence->isQuestionChecked($question_id);
2251 }
2252
2253 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2254 return $this->isForcedFeedbackNavUrlRegistered() || $this->test_sequence->isNextQuestionPresented($question_id);
2255 }
2256
2257 return false;
2258 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ isShowingPostponeStatusReguired()

ilTestPlayerAbstractGUI::isShowingPostponeStatusReguired ( int  $question_id)
protected

Definition at line 1193 of file class.ilTestPlayerAbstractGUI.php.

1193 : bool
1194 {
1195 return $this->test_sequence->isPostponedQuestion($question_id);
1196 }

◆ isTestAccessible()

ilTestPlayerAbstractGUI::isTestAccessible ( )

test accessible returns true if the user can perform the test

Definition at line 1711 of file class.ilTestPlayerAbstractGUI.php.

1711 : bool
1712 {
1713 return !$this->isNrOfTriesReached()
1714 and !$this->isMaxProcessingTimeReached()
1715 and $this->object->startingTimeReached()
1716 and !$this->object->endingTimeReached();
1717 }
endingTimeReached()
handle endingTimeReached

◆ isValidSequenceElement()

ilTestPlayerAbstractGUI::isValidSequenceElement (   $sequence_element)
private

Definition at line 2949 of file class.ilTestPlayerAbstractGUI.php.

2949 : bool
2950 {
2951 if ($sequence_element === false) {
2952 return false;
2953 }
2954
2955 if ($sequence_element < 1) {
2956 return false;
2957 }
2958
2959 if (!$this->test_sequence->getPositionOfSequence($sequence_element)) {
2960 return false;
2961 }
2962
2963 return true;
2964 }

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

Definition at line 947 of file class.ilTestPlayerAbstractGUI.php.

947 : void
948 {
950 $this->markQuestionCmd();
951 }
markQuestionCmd()
Set a question solved.

◆ markQuestionCmd()

ilTestPlayerAbstractGUI::markQuestionCmd ( )
protected

Set a question solved.

Definition at line 956 of file class.ilTestPlayerAbstractGUI.php.

956 : void
957 {
958 $question_id = $this->test_sequence->getQuestionForSequence(
960 );
961
962 $this->object->setQuestionSetSolved(1, $question_id, $this->test_session->getUserId());
963
964 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
965 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ max_processing_time_reached()

ilTestPlayerAbstractGUI::max_processing_time_reached ( )

Outputs a message when the maximum processing time is reached.

Outputs a message when the maximum processing time is reached

@access public

Definition at line 1749 of file class.ilTestPlayerAbstractGUI.php.

1750 {
1751 $this->suspendTestCmd();
1752 }

◆ nextQuestionCmd()

ilTestPlayerAbstractGUI::nextQuestionCmd ( )
protected

Definition at line 2121 of file class.ilTestPlayerAbstractGUI.php.

2122 {
2123 $this->handleCheckTestPassValid();
2124 $last_sequence_element = $this->getCurrentSequenceElement();
2125 $next_sequence_element = $this->test_sequence->getNextSequence($last_sequence_element);
2126
2127 $question_id = $this->test_sequence->getQuestionForSequence($last_sequence_element);
2128 $is_worked_through = $this->questionrepository->lookupResultRecordExist(
2129 $this->test_session->getActiveId(),
2130 $question_id,
2131 $this->test_session->getPass()
2132 );
2133
2134 if (!$is_worked_through) {
2135 if ($this->logger->isLoggingEnabled()
2136 && !$this->getObject()->getAnonymity()) {
2137 $this->logger->logParticipantInteraction(
2138 $this->logger->getInteractionFactory()->buildParticipantInteraction(
2139 $this->object->getRefId(),
2140 $question_id,
2141 $this->user->getId(),
2142 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
2143 TestParticipantInteractionTypes::QUESTION_SKIPPED,
2144 []
2145 )
2146 );
2147 }
2148 if ($this->object->isPostponingEnabled()) {
2149 $this->handleQuestionPostponing($question_id);
2150 }
2151 }
2152
2153 if (!$this->isValidSequenceElement($next_sequence_element)) {
2154 $next_sequence_element = $this->test_sequence->getFirstSequence();
2155 }
2156
2157 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
2158 $this->ctrl->setParameter($this, 'pmode', '');
2159
2160 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2161 }

References $_SERVER, ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), ILIAS\Repository\object(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ outCorrectSolution()

ilTestPlayerAbstractGUI::outCorrectSolution ( )

Creates an output of the solution of an answer compared to the correct solution.

Reimplemented from ilTestServiceGUI.

Definition at line 1928 of file class.ilTestPlayerAbstractGUI.php.

1928 : void
1929 {
1930 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "components/ILIAS/Test");
1931
1932 $this->tpl->setCurrentBlock("ContentStyle");
1933 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1934 $this->tpl->parseCurrentBlock();
1935
1936 $this->tpl->setCurrentBlock("SyntaxStyle");
1937 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1938 $this->tpl->parseCurrentBlock();
1939
1940 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css"), "print");
1941 if ($this->object->getShowSolutionAnswersOnly()) {
1942 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css"), "print");
1943 }
1944
1945 $this->tpl->setCurrentBlock("adm_content");
1946 $solution = $this->getCorrectSolutionOutput($this->testrequest->raw("evaluation"), $this->testrequest->raw("active_id"), $this->testrequest->raw("pass"));
1947 $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1948 $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1949 $this->ctrl->saveParameter($this, "pass");
1950 $this->ctrl->saveParameter($this, "active_id");
1951 $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1952 $this->tpl->parseCurrentBlock();
1953 }
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
getCorrectSolutionOutput($question_id, $active_id, $pass, ?ilTestQuestionRelatedObjectivesList $objectives_list=null)
Returns an output of the solution to an answer compared to the correct solution.
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user

References ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ outProcessingTime()

ilTestPlayerAbstractGUI::outProcessingTime ( int  $active_id,
bool  $verbose 
)
private

Definition at line 1777 of file class.ilTestPlayerAbstractGUI.php.

1777 : void
1778 {
1779 $starting_time = $this->object->getStartingTimeOfUser($active_id);
1780 $working_time = new WorkingTime(
1781 $this->lng,
1782 $this->ui_factory,
1783 $this->ui_renderer,
1784 $starting_time,
1785 $this->object->getProcessingTimeInSeconds($active_id)
1786 );
1787
1788 $this->tpl->setCurrentBlock('enableprocessingtime');
1789 $this->tpl->setVariable('USER_WORKING_TIME_MESSAGE_BOX', $working_time->getMessageBox($verbose));
1790 $this->tpl->parseCurrentBlock();
1791
1792 $working_time_js_template = $working_time->prepareWorkingTimeJsTemplate(
1793 $this->getObject(),
1794 getdate($starting_time),
1795 $this->ctrl->getLinkTarget($this, 'checkWorkingTime', '', true),
1796 $this->ctrl->getFormAction($this, ilTestPlayerCommands::REDIRECT_AFTER_QUESTION_LIST)
1797 );
1798
1799 $this->tpl->addOnLoadCode($working_time_js_template->get());
1800 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilTestPlayerCommands\REDIRECT_AFTER_QUESTION_LIST.

+ Here is the call graph for this function:

◆ outQuestionSummaryCmd()

ilTestPlayerAbstractGUI::outQuestionSummaryCmd ( )

Output of a summary of all test questions for test participants.

Definition at line 1867 of file class.ilTestPlayerAbstractGUI.php.

1868 {
1869 $this->help->setScreenIdComponent('tst');
1870 $this->help->setScreenId('assessment');
1871 $this->help->setSubScreenId('question_summary');
1872
1873 $is_first_page = $this->testrequest->strVal('first') === '1';
1874
1875 $this->tpl->addBlockFile(
1876 $this->getContentBlockName(),
1877 'adm_content',
1878 'tpl.il_as_tst_question_summary.html',
1879 'components/ILIAS/Test'
1880 );
1881
1882 $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
1884 $this->getObject()->getTitle() . ' - ' . $this->lng->txt('question_summary')
1885 );
1886
1887 $active_id = $this->test_session->getActiveId();
1888 $question_summary_data = $this->service->getQuestionSummaryData($this->test_sequence);
1889
1890 $this->ctrl->setParameter($this, 'sequence', $this->testrequest->raw('sequence'));
1891
1892 $table = new QuestionsOfAttemptTable(
1893 $this->lng,
1894 $this->ctrl,
1895 $this->ui_factory,
1896 new DataFactory(),
1897 $this->http,
1898 $this,
1899 $this->object,
1900 $question_summary_data
1901 );
1902 $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $this->ui_renderer->render($table->buildComponents($is_first_page)));
1903
1904 if ($this->object->getEnableProcessingTime()) {
1905 $this->outProcessingTime($active_id, true);
1906 }
1907
1908 if ($this->object->isShowExamIdInTestPassEnabled()) {
1909 $this->tpl->setCurrentBlock('exam_id_footer');
1910 $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1911 $this->test_session->getActiveId(),
1912 $this->test_session->getPass(),
1913 $this->object->getId()
1914 ));
1915 $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1916 $this->tpl->parseCurrentBlock();
1917 }
1918 }
static lookupExamId($active_id, $pass)
outProcessingTime(int $active_id, bool $verbose)
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), and ilTestPlayerLayoutProvider\TEST_PLAYER_VIEW_TITLE.

+ Here is the call graph for this function:

◆ outUserResultsOverviewCmd()

ilTestPlayerAbstractGUI::outUserResultsOverviewCmd ( )

Definition at line 2054 of file class.ilTestPlayerAbstractGUI.php.

2055 {
2056 $this->ctrl->redirectByClass(
2057 [ilRepositoryGUI::class, ilObjTestGUI::class, ilTestEvaluationGUI::class],
2058 "outUserResultsOverview"
2059 );
2060 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ performTearsAndAngerBrokenConfessionChecks()

ilTestPlayerAbstractGUI::performTearsAndAngerBrokenConfessionChecks ( )
protected

Definition at line 3022 of file class.ilTestPlayerAbstractGUI.php.

3022 : bool
3023 {
3024 if ($this->test_session->getActiveId() > 0) {
3025 if ($this->test_sequence->hasRandomQuestionsForPass($this->test_session->getActiveId(), $this->test_session->getPass()) > 0) {
3026 $this->logger->info(
3027 __METHOD__ . ' Random Questions allready exists for user ' .
3028 $this->user->getId() . ' in test ' . $this->object->getTestId()
3029 );
3030
3031 return true;
3032 }
3033 } else {
3034 $this->logger->info(__METHOD__ . ' ' . sprintf(
3035 $this->lng->txt("error_random_question_generation"),
3036 $this->user->getId(),
3037 $this->object->getTestId()
3038 ));
3039
3040 return true;
3041 };
3042
3043 return false;
3044 }

References ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ performTestPassFinishedTasks()

ilTestPlayerAbstractGUI::performTestPassFinishedTasks ( StatusOfAttempt  $status_of_attempt)
protected

Definition at line 1023 of file class.ilTestPlayerAbstractGUI.php.

1023 : void
1024 {
1026 $this->test_session,
1027 $this->object,
1028 $this->test_result_repository
1029 ))->performFinishTasks($this->process_locker, $status_of_attempt);
1030 $this->test_result_repository->updateTestResultCache($this->test_session->getActiveId());
1031 }
Class ilTestPassFinishTasks.

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

Definition at line 674 of file class.ilTestPlayerAbstractGUI.php.

675 {
676 $this->tpl->setCurrentBlock("ContentStyle");
677 $this->tpl->setVariable(
678 "LOCATION_CONTENT_STYLESHEET",
680 );
681 $this->tpl->parseCurrentBlock();
682 }

References ilObjStyleSheet\getContentStylePath().

+ Here is the call graph for this function:

◆ populateDiscardSolutionModal()

ilTestPlayerAbstractGUI::populateDiscardSolutionModal ( )
protected

Definition at line 2785 of file class.ilTestPlayerAbstractGUI.php.

2785 : Signal
2786 {
2787 $modal = $this->ui_factory->modal()->interruptive(
2788 $this->lng->txt('discard_answer'),
2789 $this->lng->txt('discard_answer_confirmation'),
2790 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DISCARD_SOLUTION)
2791 )->withActionButtonLabel($this->lng->txt('discard_answer'));
2792
2793 $this->tpl->setCurrentBlock('discard_solution_modal');
2794 $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $this->ui_renderer->render($modal));
2795 $this->tpl->parseCurrentBlock();
2796 return $modal->getShowSignal();
2797 }

References ilTestPlayerCommands\DISCARD_SOLUTION, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

Definition at line 2581 of file class.ilTestPlayerAbstractGUI.php.

2582 {
2583 if ($withFocusAnchor) {
2584 $this->tpl->setCurrentBlock('inst_resp_id');
2585 $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
2586 $this->tpl->parseCurrentBlock();
2587 }
2588
2589 $this->tpl->setCurrentBlock('instant_response_header');
2590 $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
2591 $this->tpl->parseCurrentBlock();
2592 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateFeedbackBlockMessage()

ilTestPlayerAbstractGUI::populateFeedbackBlockMessage ( string  $a_message)
protected

Definition at line 2594 of file class.ilTestPlayerAbstractGUI.php.

2595 {
2596 $this->tpl->setCurrentBlock('instant_response_message');
2597 $this->tpl->setVariable('INSTANT_RESPONSE_MESSAGE', $a_message);
2598 $this->tpl->parseCurrentBlock();
2599 }

◆ populateGenericFeedbackBlock()

ilTestPlayerAbstractGUI::populateGenericFeedbackBlock ( assQuestionGUI  $question_gui,
  $solutionCorrect 
)
protected
Returns
bool true, if there is some feedback populated

Definition at line 621 of file class.ilTestPlayerAbstractGUI.php.

621 : bool
622 {
623 // fix #031263: add pass
624 $feedback = $question_gui->getGenericFeedbackOutput($this->test_session->getActiveId(), $this->test_session->getPass());
625
626 if (strlen($feedback)) {
627 $cssClass = (
628 $solutionCorrect ?
630 );
631
632 $this->tpl->setCurrentBlock("answer_feedback");
633 $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
634 $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
635 $this->tpl->parseCurrentBlock();
636 return true;
637 }
638 return false;
639 }
getGenericFeedbackOutput(int $active_id, ?int $pass)

References ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, and assQuestionGUI\getGenericFeedbackOutput().

+ Here is the call graph for this function:

◆ populateHelperGuiContent()

ilTestPlayerAbstractGUI::populateHelperGuiContent (   $helperGui)
protected
Parameters
$helperGui

Definition at line 2345 of file class.ilTestPlayerAbstractGUI.php.

2346 {
2347 $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
2348 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateInstantResponseBlocks()

ilTestPlayerAbstractGUI::populateInstantResponseBlocks ( assQuestionGUI  $question_gui,
  $authorizedSolution 
)
protected
See also
ilAssQuestionPreviewGUI::handleInstantResponseRendering()

Definition at line 2504 of file class.ilTestPlayerAbstractGUI.php.

2505 {
2506 $response_available = false;
2507 $jump_to_response = false;
2508
2509 // This controls if the solution should be shown.
2510 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2511 if ($this->object->getInstantFeedbackSolution()) {
2512 $show_question_inline_score = $this->determineInlineScoreDisplay();
2513
2514 // Notation of the params prior to getting rid of this crap in favor of a class
2515 $solutionoutput = $question_gui->getSolutionOutput(
2516 $this->test_session->getActiveId(), #active_id
2517 $this->test_session->getPass(), #pass
2518 false, #graphical_output
2519 $show_question_inline_score, #result_output
2520 true, #show_question_only
2521 false, #show_feedback
2522 true, #show_correct_solution
2523 false, #show_manual_scoring
2524 false #show_question_text
2525 );
2526 $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
2527 $this->populateSolutionBlock($solutionoutput);
2528 $response_available = true;
2529 $jump_to_response = true;
2530 }
2531
2532 $reachedPoints = $question_gui->getObject()->getAdjustedReachedPoints(
2533 $this->test_session->getActiveId(),
2534 ilObjTest::_getPass($this->test_session->getActiveId()),
2535 $authorizedSolution
2536 );
2537
2538 $maxPoints = $question_gui->getObject()->getMaximumPoints();
2539
2540 $solutionCorrect = ($reachedPoints == $maxPoints);
2541
2542 // This controls if the score should be shown.
2543 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
2544 if ($this->object->getAnswerFeedbackPoints()) {
2545 $this->populateScoreBlock($reachedPoints, $maxPoints);
2546 $response_available = true;
2547 $jump_to_response = true;
2548 }
2549
2550 // This controls if the generic feedback should be shown.
2551 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2552 if ($this->object->getGenericAnswerFeedback()) {
2553 if ($this->populateGenericFeedbackBlock($question_gui, $solutionCorrect)) {
2554 $response_available = true;
2555 $jump_to_response = true;
2556 }
2557 }
2558
2559 // This controls if the specific feedback should be shown.
2560 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
2561 if ($this->object->getSpecificAnswerFeedback()) {
2562 if ($question_gui->hasInlineFeedback()) {
2563 // Don't jump to the feedback below the question if some feedback is shown within the question
2564 $jump_to_response = false;
2565 } elseif ($this->populateSpecificFeedbackBlock($question_gui)) {
2566 $response_available = true;
2567 $jump_to_response = true;
2568 }
2569 }
2570
2571 $this->populateFeedbackBlockHeader($jump_to_response);
2572 if (!$response_available) {
2573 if ($question_gui->hasInlineFeedback()) {
2574 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_is_given_inline'));
2575 } else {
2576 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_not_available_for_answer'));
2577 }
2578 }
2579 }
getSolutionOutput(int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
populateGenericFeedbackBlock(assQuestionGUI $question_gui, $solutionCorrect)
populateScoreBlock($reachedPoints, $maxPoints)
populateSpecificFeedbackBlock(assQuestionGUI $question_gui)

References ilObjTest\_getPass(), assQuestionGUI\getObject(), assQuestionGUI\getSolutionOutput(), assQuestionGUI\hasInlineFeedback(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ populateInstantResponseModal()

ilTestPlayerAbstractGUI::populateInstantResponseModal ( assQuestionGUI  $question_gui,
  $nav_url 
)
protected

Definition at line 2447 of file class.ilTestPlayerAbstractGUI.php.

2447 : void
2448 {
2449 $question_gui->setNavigationGUI(null);
2450 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
2451
2452 $answer_feedback_enabled = $this->object->getSpecificAnswerFeedback();
2453
2454 $solutionoutput = $question_gui->getSolutionOutput(
2455 $this->test_session->getActiveId(), #active_id
2456 $this->test_session->getPass(), #pass
2457 false, #graphical_output
2458 false, #result_output
2459 true, #show_question_only
2460 $answer_feedback_enabled, #show_feedback
2461 false, #show_correct_solution
2462 false, #show_manual_scoring
2463 true #show_question_text
2464 );
2465
2466 $pageoutput = $question_gui->outQuestionPage(
2467 "",
2468 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
2469 $this->test_session->getActiveId(),
2470 $solutionoutput
2471 );
2472
2473 $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'components/ILIAS/Test');
2474
2475 // populate the instant response blocks in the
2476 $saved_tpl = $this->tpl;
2477 $this->tpl = $tpl;
2478 $this->populateInstantResponseBlocks($question_gui, true);
2479 $this->tpl = $saved_tpl;
2480
2481 $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
2482 $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $this->getQuestionFeedbackModalHtml($tpl, $nav_url));
2483 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
special template class to simplify handling of ITX/PEAR
getQuestionFeedbackModalHtml(ilTemplate $tpl, string $nav_url)
populateInstantResponseBlocks(assQuestionGUI $question_gui, $authorizedSolution)
setVariable(string $variable, $value='')
Sets the given variable to the given value.

References assQuestionGUI\getObject(), assQuestionGUI\getQuestionHeaderBlockBuilder(), assQuestionGUI\getSolutionOutput(), assQuestionGUI\outQuestionPage(), and assQuestionGUI\setNavigationGUI().

+ Here is the call graph for this function:

◆ populateLowerNextButtonBlock()

ilTestPlayerAbstractGUI::populateLowerNextButtonBlock (   $primary_next)
protected

Definition at line 511 of file class.ilTestPlayerAbstractGUI.php.

511 : void
512 {
513 $button = $this->buildNextButtonInstance($primary_next);
514
515 $this->tpl->setCurrentBlock("next_bottom");
516 $this->tpl->setVariable("BTN_NEXT_BOTTOM", $this->ui_renderer->render($button));
517 $this->tpl->parseCurrentBlock();
518 }

◆ populateLowerPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateLowerPreviousButtonBlock ( )
protected

Definition at line 529 of file class.ilTestPlayerAbstractGUI.php.

530 {
531 $button = $this->buildPreviousButtonInstance();
532
533 $this->tpl->setCurrentBlock("prev_bottom");
534 $this->tpl->setVariable("BTN_PREV_BOTTOM", $this->ui_renderer->render($button));
535 $this->tpl->parseCurrentBlock();
536 }

◆ populateMessageContent()

ilTestPlayerAbstractGUI::populateMessageContent ( string  $content_html)
protected

Definition at line 2760 of file class.ilTestPlayerAbstractGUI.php.

2760 : void
2761 {
2762 if ($this->object->getKioskMode()) {
2763 $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "components/ILIAS/Test");
2764 $this->tpl->setContent($content_html);
2765 return;
2766 }
2767 $this->tpl->setVariable($this->getContentBlockName(), $content_html);
2768 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ populateModals()

ilTestPlayerAbstractGUI::populateModals ( )
protected
Returns
array<self::DISCARD_MODAL|self::LOCKS_CHANGED_MODAL|self::LOCKS_UNCHANGED_MODAL, Signal>

Definition at line 2773 of file class.ilTestPlayerAbstractGUI.php.

2773 : array
2774 {
2775 $signals = [self::DISCARD_MODAL => $this->populateDiscardSolutionModal()];
2776
2777 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2780 }
2781
2782 return $signals;
2783 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ populateNextButtons()

ilTestPlayerAbstractGUI::populateNextButtons (   $primary_next)
protected

Definition at line 505 of file class.ilTestPlayerAbstractGUI.php.

505 : void
506 {
507 $this->populateUpperNextButtonBlock($primary_next);
508 $this->populateLowerNextButtonBlock($primary_next);
509 }

◆ populateNextLocksChangedModal()

ilTestPlayerAbstractGUI::populateNextLocksChangedModal ( )
protected

Definition at line 2813 of file class.ilTestPlayerAbstractGUI.php.

2813 : Signal
2814 {
2815 $empty_signal = new \ILIAS\UI\Implementation\Component\Signal('');
2817 return $empty_signal;
2818 }
2819
2820 $modal_message = $this->ui_factory->messageBox()->confirmation(
2821 $this->lng->txt('tst_nav_next_locks_current_answer_confirm')
2822 );
2823 $modal_checkbox = $this->ui_factory->input()->field()->checkbox(
2824 $this->lng->txt('tst_dont_show_msg_again_in_current_session')
2825 )->withDedicatedName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2826
2827 $modal = $this->ui_factory->modal()->roundtrip(
2828 $this->lng->txt('tst_nav_next_locks_current_answer_header'),
2829 $modal_message,
2830 [ $modal_checkbox ],
2831 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksChanged()'
2832 )->withSubmitLabel($this->lng->txt('tst_proceed'));
2833
2834 $this->tpl->setCurrentBlock('next_locks_changed_modal');
2835 $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $this->ui_renderer->render($modal));
2836 $this->tpl->parseCurrentBlock();
2837 return $modal->getShowSignal();
2838 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

Definition at line 2799 of file class.ilTestPlayerAbstractGUI.php.

2799 : Signal
2800 {
2801 $modal = $this->ui_factory->modal()->interruptive(
2802 $this->lng->txt('tst_nav_next_locks_empty_answer_header'),
2803 $this->lng->txt('tst_nav_next_locks_empty_answer_confirm'),
2804 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksUnchanged()'
2805 )->withActionButtonLabel($this->lng->txt('tst_proceed'));
2806
2807 $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2808 $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $this->ui_renderer->render($modal));
2809 $this->tpl->parseCurrentBlock();
2810 return $modal->getShowSignal();
2811 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populatePreviousButtons()

ilTestPlayerAbstractGUI::populatePreviousButtons ( )
protected

◆ populateQuestionEditControl()

ilTestPlayerAbstractGUI::populateQuestionEditControl ( assQuestionGUI  $question_gui)
protected

Definition at line 2856 of file class.ilTestPlayerAbstractGUI.php.

2856 : void
2857 {
2858 $config = [];
2859 $state = $question_gui->getObject()->lookupForExistingSolutions($this->test_session->getActiveId(), $this->test_session->getPass());
2860 $config['isAnswered'] = $state['authorized'];
2861 $config['isAnswerChanged'] = $state['intermediate'] || $this->getAnswerChangedParameter();
2862 $config['isAnswerFixed'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2863 $config['saveOnTimeReachedUrl'] = str_replace('&amp;', '&', $this->ctrl->getFormAction($this, ilTestPlayerCommands::AUTO_SAVE_ON_TIME_LIMIT));
2864
2865 $config['autosaveUrl'] = '';
2866 $config['autosaveInterval'] = 0;
2867 if ($question_gui->getObject() instanceof QuestionAutosaveable && $this->object->getAutosave()) {
2868 $config['autosaveUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AUTO_SAVE, '', true);
2869 $config['autosaveInterval'] = $this->object->getMainSettings()->getQuestionBehaviourSettings()->getAutosaveInterval();
2870 }
2871
2872 $question_config = $question_gui->getObject()->getTestPresentationConfig();
2873
2874 $config['withFormChangeDetection'] = $question_config->isFormChangeDetectionEnabled();
2875
2876 // Flash and Java questions: changes are directly sent to ilias and have to be polled from there
2877 $config['withBackgroundChangeDetection'] = $question_config->isBackgroundChangeDetectionEnabled();
2878 $config['backgroundDetectorUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DETECT_CHANGES, '', true);
2879
2880 // Forced feedback will change the navigation saving command
2881 $config['forcedInstantFeedback'] = $this->object->isForceInstantFeedbackEnabled();
2882 $config['questionLocked'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2883 $config['nextQuestionLocks'] = $this->object->isFollowupQuestionAnswerFixationEnabled();
2884 $config['autosaveFailureMessage'] = $this->lng->txt('autosave_failed');
2885
2886 // Add the modal signals and parameter name for the follow-up question locks confirmation
2887 $config['modalSignals'] = array_map(fn(Signal $signal) => $signal->getId(), $this->modal_signals);
2888 $config['preventConfirmationParam'] = self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM;
2889
2890 $this->tpl->addJavascript('assets/js/ilTestPlayerQuestionEditControl.js');
2891 $this->tpl->addOnLoadCode('il.TestPlayerQuestionEditControl.init(' . json_encode($config) . ')');
2892 }
getId()
Get the ID of this signal.

References ilTestPlayerCommands\AUTO_SAVE, ilTestPlayerCommands\AUTO_SAVE_ON_TIME_LIMIT, ILIAS\Repository\ctrl(), ilTestPlayerCommands\DETECT_CHANGES, ILIAS\UI\Component\Signal\getId(), assQuestionGUI\getObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateQuestionNavigation()

ilTestPlayerAbstractGUI::populateQuestionNavigation (   $sequence_element,
  $primary_next 
)
protected

Definition at line 488 of file class.ilTestPlayerAbstractGUI.php.

488 : void
489 {
490 if (!$this->isFirstQuestionInSequence($sequence_element)) {
492 }
493
494 if (!$this->isLastQuestionInSequence($sequence_element)) {
495 $this->populateNextButtons($primary_next);
496 }
497 }

◆ populateQuestionOptionalMessage()

ilTestPlayerAbstractGUI::populateQuestionOptionalMessage ( )
abstractprotected

◆ populateScoreBlock()

ilTestPlayerAbstractGUI::populateScoreBlock (   $reachedPoints,
  $maxPoints 
)
protected

Definition at line 641 of file class.ilTestPlayerAbstractGUI.php.

642 {
643 $scoreInformation = sprintf(
644 $this->lng->txt("you_received_a_of_b_points"),
645 $reachedPoints,
646 $maxPoints
647 );
648
649 $this->tpl->setCurrentBlock("received_points_information");
650 $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
651 $this->tpl->parseCurrentBlock();
652 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

Definition at line 654 of file class.ilTestPlayerAbstractGUI.php.

655 {
656 if (strlen($solutionoutput)) {
657 $this->tpl->setCurrentBlock("solution_output");
658 $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
659 $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
660 $this->tpl->parseCurrentBlock();
661 }
662 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateSpecificFeedbackBlock()

ilTestPlayerAbstractGUI::populateSpecificFeedbackBlock ( assQuestionGUI  $question_gui)
protected
Returns
bool true, if there is some feedback populated

Definition at line 598 of file class.ilTestPlayerAbstractGUI.php.

598 : bool
599 {
600 $solutionValues = $question_gui->getObject()->getSolutionValues(
601 $this->test_session->getActiveId(),
602 null
603 );
604
605 $feedback = $question_gui->getSpecificFeedbackOutput(
606 $question_gui->getObject()->fetchIndexedValuesFromValuePairs($solutionValues)
607 );
608
609 if (!empty($feedback)) {
610 $this->tpl->setCurrentBlock("specific_feedback");
611 $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
612 $this->tpl->parseCurrentBlock();
613 return true;
614 }
615 return false;
616 }
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.

References assQuestionGUI\getObject(), and assQuestionGUI\getSpecificFeedbackOutput().

+ Here is the call graph for this function:

◆ populateSyntaxStyleBlock()

ilTestPlayerAbstractGUI::populateSyntaxStyleBlock ( )
protected

Definition at line 664 of file class.ilTestPlayerAbstractGUI.php.

665 {
666 $this->tpl->setCurrentBlock("SyntaxStyle");
667 $this->tpl->setVariable(
668 "LOCATION_SYNTAX_STYLESHEET",
670 );
671 $this->tpl->parseCurrentBlock();
672 }

References ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ populateTestNavigationToolbar()

ilTestPlayerAbstractGUI::populateTestNavigationToolbar ( ilTestNavigationToolbarGUI  $toolbar_gui)
protected

Definition at line 468 of file class.ilTestPlayerAbstractGUI.php.

468 : void
469 {
470 $this->tpl->setCurrentBlock('test_nav_toolbar');
471 $this->tpl->setVariable('TEST_NAV_TOOLBAR', $toolbar_gui->getHTML());
472 $this->tpl->parseCurrentBlock();
473
474 if ($this->finish_test_modal === null) {
475 return;
476 }
477
478 $this->tpl->setCurrentBlock('finish_test_modal');
479 $this->tpl->setVariable(
480 'FINISH_TEST_MODAL',
481 $this->ui_renderer->render(
482 $this->finish_test_modal->withOnLoad($this->finish_test_modal->getShowSignal())
483 )
484 );
485 $this->tpl->parseCurrentBlock();
486 }

◆ populateUpperNextButtonBlock()

ilTestPlayerAbstractGUI::populateUpperNextButtonBlock (   $primaryNext)
protected

Definition at line 520 of file class.ilTestPlayerAbstractGUI.php.

521 {
522 $button = $this->buildNextButtonInstance($primaryNext);
523
524 $this->tpl->setCurrentBlock("next");
525 $this->tpl->setVariable("BTN_NEXT", $this->ui_renderer->render($button));
526 $this->tpl->parseCurrentBlock();
527 }

◆ populateUpperPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateUpperPreviousButtonBlock ( )
protected

Definition at line 538 of file class.ilTestPlayerAbstractGUI.php.

539 {
540 $button = $this->buildPreviousButtonInstance();
541
542 $this->tpl->setCurrentBlock("prev");
543 $this->tpl->setVariable("BTN_PREV", $this->ui_renderer->render($button));
544 $this->tpl->parseCurrentBlock();
545 }

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

Definition at line 2181 of file class.ilTestPlayerAbstractGUI.php.

2182 {
2183 $this->tpl->addBlockFile(
2184 $this->getContentBlockName(),
2185 'adm_content',
2186 'tpl.il_as_tst_question_summary.html',
2187 'components/ILIAS/Test'
2188 );
2189 }

◆ prepareTestPage()

ilTestPlayerAbstractGUI::prepareTestPage (   $presentationMode,
  $sequenceElement,
  $question_id 
)
protected

Definition at line 1122 of file class.ilTestPlayerAbstractGUI.php.

1123 {
1124 $this->navigation_history->addItem(
1125 $this->test_session->getRefId(),
1126 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::RESUME_PLAYER),
1127 'tst'
1128 );
1129
1130 $this->initTestPageTemplate();
1132 $this->populateSyntaxStyleBlock();
1133
1134 if ($this->isMaxProcessingTimeReached()) {
1136 return;
1137 }
1138
1139 if ($this->object->endingTimeReached()) {
1140 $this->endingTimeReached();
1141 return;
1142 }
1143
1144 if ($this->isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)) {
1145 $this->ctrl->setParameter($this, "sequence", $sequenceElement);
1147 return;
1148 }
1149
1150 $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId());
1151 $this->tpl->setVariable("LOGIN", $this->user->getLogin());
1152
1153 $this->tpl->setVariable("SEQ_ID", $sequenceElement);
1154 $this->tpl->setVariable("QUEST_ID", $question_id);
1155
1156 if ($this->object->getEnableProcessingTime()) {
1157 $this->outProcessingTime($this->test_session->getActiveId(), false);
1158 }
1159
1160 $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1161
1162 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
1163 $this->tpl->setCurrentBlock('exam_id_footer');
1164 $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1165 $this->test_session->getActiveId(),
1166 $this->test_session->getPass(),
1167 $this->object->getId()
1168 ));
1169 $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1170 $this->tpl->parseCurrentBlock();
1171 }
1172
1173 if ($this->object->getListOfQuestions()) {
1174 $this->showSideList($sequenceElement);
1175 }
1176 }
max_processing_time_reached()
Outputs a message when the maximum processing time is reached.
showSideList($current_sequence_element)
isOptionalQuestionAnsweringConfirmationRequired(int $sequence_key)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), ilTestPlayerCommands\RESUME_PLAYER, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ previousQuestionCmd()

ilTestPlayerAbstractGUI::previousQuestionCmd ( )
protected

Definition at line 2163 of file class.ilTestPlayerAbstractGUI.php.

2164 {
2165 $this->handleCheckTestPassValid();
2166
2167 $sequence_element = $this->test_sequence->getPreviousSequence(
2169 );
2170
2171 if (!$this->isValidSequenceElement($sequence_element)) {
2172 $sequence_element = $this->test_sequence->getLastSequence();
2173 }
2174
2175 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
2176 $this->ctrl->setParameter($this, 'pmode', '');
2177
2178 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2179 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ redirectAfterAutosaveCmd()

ilTestPlayerAbstractGUI::redirectAfterAutosaveCmd ( )

Redirect the user after an automatic save when the time limit is reached.

Exceptions
ilTestException

Definition at line 841 of file class.ilTestPlayerAbstractGUI.php.

841 : void
842 {
843 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_DURATION);
844
845 $this->redirectAfterFinish();
846 }

◆ redirectAfterFinish()

ilTestPlayerAbstractGUI::redirectAfterFinish ( )
protected

Definition at line 855 of file class.ilTestPlayerAbstractGUI.php.

855 : void
856 {
857 $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
858
859 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "components/ILIAS/Test");
860 $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
861 $this->tpl->setVariable("URL", $url);
862 }
$url
Definition: shib_logout.php:68

References $url, ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ redirectAfterQuestionListCmd()

ilTestPlayerAbstractGUI::redirectAfterQuestionListCmd ( )

Definition at line 848 of file class.ilTestPlayerAbstractGUI.php.

848 : void
849 {
850 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_DURATION);
851
852 $this->redirectAfterFinish();
853 }

◆ redirectBackCmd()

ilTestPlayerAbstractGUI::redirectBackCmd ( )

Definition at line 1078 of file class.ilTestPlayerAbstractGUI.php.

1078 : void
1079 {
1080 $testPassesSelector = new ilTestPassesSelector($this->db, $this->object);
1081 $testPassesSelector->setActiveId($this->test_session->getActiveId());
1082 $testPassesSelector->setLastFinishedPass($this->test_session->getLastFinishedPass());
1083
1084 if (count($testPassesSelector->getReportablePasses())) {
1085 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1086 $this->ctrl->redirectByClass(['ilTestResultsGUI', 'ilTestEvalObjectiveOrientedGUI']);
1087 }
1088
1089 $this->ctrl->redirectByClass([ilTestResultsGUI::class, ilMyTestResultsGUI::class, ilTestEvaluationGUI::class]);
1090 }
1091
1092 $this->ctrl->redirectByClass(TestScreenGUI::class, TestScreenGUI::DEFAULT_CMD);
1093 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl ( string  $forced_feedback_nav_url)
protected

Definition at line 2900 of file class.ilTestPlayerAbstractGUI.php.

2900 : void
2901 {
2902 if (ilSession::get('forced_feedback_navigation_url') == null) {
2903 ilSession::set('forced_feedback_navigation_url', []);
2904 }
2905 $forced_feeback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2906 $forced_feeback_navigation_url[$this->test_session->getActiveId()] = $forced_feedback_nav_url;
2907 ilSession::set('forced_feedback_navigation_url', $forced_feeback_navigation_url);
2908 }

References ilSession\get(), and ilSession\set().

+ Here is the call graph for this function:

◆ removeIntermediateSolution()

ilTestPlayerAbstractGUI::removeIntermediateSolution ( )

Definition at line 323 of file class.ilTestPlayerAbstractGUI.php.

323 : void
324 {
325 $question_id = $this->getCurrentQuestionId();
326
327 $this->getQuestionInstance($question_id)->removeIntermediateSolution(
328 $this->test_session->getActiveId(),
329 $this->test_session->getPass()
330 );
331 }

References getCurrentQuestionId(), and getQuestionInstance().

+ Here is the call graph for this function:

◆ resumePlayerCmd()

ilTestPlayerAbstractGUI::resumePlayerCmd ( )
protected

Definition at line 734 of file class.ilTestPlayerAbstractGUI.php.

735 {
736 $this->handleUserSettings();
737
738 $active_id = $this->test_session->getActiveId();
739 $this->ctrl->setParameter($this, "active_id", $active_id);
740
741 $active_time_id = $this->object->startWorkingTime($active_id, $this->test_session->getPass());
742 ilSession::set("active_time_id", $active_time_id);
743 ilSession::set('tst_pass_finish', 0);
744
745 if ($this->object->isRandomTest()) {
746 if (!$this->test_sequence->hasRandomQuestionsForPass($active_id, $this->test_session->getPass())) {
747 // create a new set of random questions
749 }
750 }
751
752 $shuffle = $this->object->getShuffleQuestions();
753 if ($this->object->isRandomTest()) {
754 $shuffle = false;
755 }
756
757 $this->test_result_repository->updateTestAttemptResult(
758 $active_id,
759 $this->test_session->getPass(),
760 null,
761 $this->object->getId()
762 );
763
764 // ensure existing test sequence
765 if (!$this->test_sequence->hasSequence()) {
766 $this->test_sequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
767 $this->test_sequence->saveToDb();
768 }
769
770 if ($this->object->getListOfQuestionsStart()) {
771 $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY);
772 }
773
774 $this->ctrl->setParameter($this, 'sequence', $this->test_session->getLastSequence());
775 $this->ctrl->setParameter($this, 'pmode', '');
776 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
777 }
handleUserSettings()
Handles some form parameters on starting and resuming a test.

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), ilTestPlayerCommands\QUESTION_SUMMARY, ilSession\set(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ revertChangesCmd()

ilTestPlayerAbstractGUI::revertChangesCmd ( )
protected

Definition at line 1534 of file class.ilTestPlayerAbstractGUI.php.

1535 {
1537 $this->setAnswerChangedParameter(false);
1538 $this->ctrl->saveParameter($this, 'sequence');
1539 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1540 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ save()

ilTestPlayerAbstractGUI::save ( assQuestion  $question_obj,
bool  $authorized 
)
private

Definition at line 401 of file class.ilTestPlayerAbstractGUI.php.

401 : bool
402 {
403 $active_id = $this->test_session->getActiveId();
404 $pass = ilObjTest::_getPass($active_id);
405 if (!$question_obj->persistWorkingState(
406 $active_id,
407 $pass,
408 $authorized
409 )) {
410 return false;
411 }
412
413 if ($authorized && $this->test_session->isObjectiveOriented()) {
414 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->test_session);
415 $objectivesAdapter->updateQuestionResult($this->test_session, $question_obj);
416 }
417
418 if ($authorized && $this->object->isSkillServiceToBeConsidered()) {
419 $this->handleSkillTriggering($this->test_session);
420 }
421
422 if ($authorized && $this->logger->isLoggingEnabled()
423 && !$this->getObject()->getAnonymity()
424 && ($interaction = $question_obj->answerToParticipantInteraction(
425 $this->logger->getAdditionalInformationGenerator(),
426 $this->getObject()->getRefId(),
427 $active_id,
428 $pass,
429 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
430 TestParticipantInteractionTypes::ANSWER_SUBMITTED
431 )) !== null) {
432 $this->logger->logParticipantInteraction($interaction);
433 }
434 return true;
435 }
answerToParticipantInteraction(AdditionalInformationGenerator $additional_info, int $test_ref_id, int $active_id, int $pass, string $source_ip, TestParticipantInteractionTypes $interaction_type)
persistWorkingState(int $active_id, $pass, bool $authorized=true)
persists the working state for current testactive and testpass
static getInstance(ilTestSession $a_test_session)
handleSkillTriggering(ilTestSession $test_session)

References $_SERVER, ilObjTest\_getPass(), assQuestion\answerToParticipantInteraction(), ilLOTestQuestionAdapter\getInstance(), ILIAS\Repository\logger(), ILIAS\Repository\object(), and assQuestion\persistWorkingState().

+ Here is the call graph for this function:

◆ saveNavigationPreventConfirmation()

ilTestPlayerAbstractGUI::saveNavigationPreventConfirmation ( )
protected

Definition at line 2683 of file class.ilTestPlayerAbstractGUI.php.

2683 : void
2684 {
2685 if ($this->testrequest->retrieveBoolFromPost('save_on_navigation_prevent_confirmation')) {
2686 ilSession::set('save_on_navigation_prevent_confirmation', true);
2687 }
2688
2689 if ($this->testrequest->retrieveBoolFromPost(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM)) {
2690 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2691 }
2692 }

References ilSession\set().

+ Here is the call graph for this function:

◆ saveQuestionSolution()

ilTestPlayerAbstractGUI::saveQuestionSolution ( bool  $authorized = true,
bool  $force = false 
)

Definition at line 333 of file class.ilTestPlayerAbstractGUI.php.

336 : bool {
337 $this->updateWorkingTime();
338
339 if (!$this->checkAndUpdateSaveAllowedByFormTimestamp($force)) {
340 return false;
341 }
342
343 /*
344 #21097 - exceed maximum passes
345 this is a battle of conditions; e.g. ilTestPlayerAbstractGUI::autosaveOnTimeLimitCmd forces saving of results.
346 However, if an admin has finished the pass in the meantime, a new pass should not be created.
347 */
348 if ($force && $this->isNrOfTriesReached()) {
349 $force = false;
350 }
351
352 $question_obj = $this->buildQuestionObject();
353
354 if ($question_obj === null) {
355 return false;
356 }
357
358 $saved = ($force || $this->canSaveResult()) && $this->save($question_obj, $authorized);
359
360 if (!$saved || ($question_obj instanceof QuestionPartiallySaveable && !$question_obj->validateSolutionSubmit())) {
361 $this->ctrl->setParameter($this, 'save_error', '1');
362 ilSession::set('previouspost', $this->testrequest->getParsedBody());
363 }
364
365 return $saved;
366 }
save(assQuestion $question_obj, bool $authorized)

◆ saveTagsCmd()

ilTestPlayerAbstractGUI::saveTagsCmd ( )

Save tags for tagging gui.

Needed this function here because the test info page uses another class to send its form results

Definition at line 297 of file class.ilTestPlayerAbstractGUI.php.

298 {
299 $tagging_gui = new ilTaggingGUI();
300 $tagging_gui->setObject($this->object->getId(), $this->object->getType());
301 $tagging_gui->saveInput();
302 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
303 }
Class ilTaggingGUI.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ setAnonymousIdCmd()

ilTestPlayerAbstractGUI::setAnonymousIdCmd ( )

Sets a session variable with the test access code for an anonymous test user.

Sets a session variable with the test access code for an anonymous test user

Definition at line 689 of file class.ilTestPlayerAbstractGUI.php.

689 : void
690 {
691 if ($this->test_session->isAnonymousUser()) {
692 $this->test_session->setAccessCodeToSession($this->testrequest->strVal('anonymous_id'));
693 }
694
695 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
696 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setAnswerChangedParameter()

ilTestPlayerAbstractGUI::setAnswerChangedParameter ( bool  $changed = true)
protected

Definition at line 2668 of file class.ilTestPlayerAbstractGUI.php.

2669 {
2670 $this->ctrl->setParameter($this, 'test_answer_changed', $changed ? '1' : '0');
2671 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

Definition at line 2842 of file class.ilTestPlayerAbstractGUI.php.

2843 {
2844 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2845 }

References ilSession\set().

+ Here is the call graph for this function:

◆ showAnswerOptionalQuestionsConfirmation()

ilTestPlayerAbstractGUI::showAnswerOptionalQuestionsConfirmation ( )
protected

Definition at line 2309 of file class.ilTestPlayerAbstractGUI.php.

2310 {
2311 $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
2312
2313 $confirmation->setFormAction($this->ctrl->getFormAction($this));
2314 $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
2315 $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
2316
2317 $confirmation->build($this->object->isFixedTest());
2318
2319 $this->populateHelperGuiContent($confirmation);
2320 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ showFinalStatementCmd()

ilTestPlayerAbstractGUI::showFinalStatementCmd ( )

Definition at line 1098 of file class.ilTestPlayerAbstractGUI.php.

1099 {
1100 $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
1102 $this->object->getTitle() . ' - ' . $this->lng->txt('final_statement')
1103 );
1104
1105 $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1106 $this->ctrl->setParameterByClass(ilTestPageGUI::class, 'page_type', 'concludingremarkspage');
1107 $this->ctrl->setParameterByClass(static::class, 'skipfinalstatement', 1);
1108 $this->tpl->setVariable(
1109 $this->getContentBlockName(),
1110 $this->ui_renderer->render([
1111 $this->ui_factory->legacy()->content(
1112 $this->object->prepareTextareaOutput($this->object->getFinalStatement(), true)
1113 ),
1114 $this->ui_factory->button()->standard(
1115 $this->lng->txt('btn_next'),
1116 $this->ctrl->getLinkTargetByClass(static::class, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED)
1117 )
1118 ])
1119 );
1120 }

References ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilTestPlayerLayoutProvider\TEST_PLAYER_VIEW_TITLE.

+ Here is the call graph for this function:

◆ showInstantResponseCmd()

ilTestPlayerAbstractGUI::showInstantResponseCmd ( )
protected

Definition at line 2090 of file class.ilTestPlayerAbstractGUI.php.

2091 {
2092 $question_id = $this->test_sequence->getQuestionForSequence(
2094 );
2095
2096 if (!$this->isParticipantsAnswerFixed($question_id)) {
2097 if ($this->saveQuestionSolution(true)) {
2099 $this->setAnswerChangedParameter(false);
2100 } else {
2101 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2102 }
2103 $this->test_sequence->setQuestionChecked($question_id);
2104 $this->test_sequence->saveToDb();
2105 } elseif ($this->object->isForceInstantFeedbackEnabled()) {
2106 $this->test_sequence->setQuestionChecked($question_id);
2107 $this->test_sequence->saveToDb();
2108 }
2109
2110 $this->ctrl->setParameter($this, 'instresp', 1);
2111
2112 // fau: testNav - handle navigation after feedback
2113 if ($this->getNavigationUrlParameter()) {
2116 }
2117 // fau.
2118 $this->ctrl->redirectByClass(static::class, ilTestPlayerCommands::SHOW_QUESTION);
2119 }
registerForcedFeedbackNavUrl(string $forced_feedback_nav_url)

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ showListOfAnswers()

ilTestPlayerAbstractGUI::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 will be shown)

Parameters
integer$active_idActive id of the participant
integer$passTest pass of the participant
boolean$testnavigationDeceides wheather to show a navigation for tests or not @access public

Definition at line 1964 of file class.ilTestPlayerAbstractGUI.php.

1965 {
1966 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "components/ILIAS/Test");
1967
1968 $result_array = $this->object->getTestResult(
1969 $active_id,
1970 $pass,
1971 false,
1972 !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1973 );
1974
1975 $counter = 1;
1976 // output of questions with solutions
1977 foreach ($result_array as $question_data) {
1978 $question = $question_data["qid"];
1979 if (is_numeric($question)) {
1980 $this->tpl->setCurrentBlock("printview_question");
1981 $question_gui = $this->object->createQuestionGUI("", $question);
1982 $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "components/ILIAS/TestQuestionPool");
1983 $template->setVariable("COUNTER_QUESTION", $counter . ". ");
1984 $template->setVariable("QUESTION_TITLE", $question_gui->getObject()->getTitleForHTMLOutput());
1985
1986 $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
1987 $result_output = $question_gui->getSolutionOutput(
1988 $active_id,
1989 $pass,
1990 false,
1991 false,
1992 $show_question_only,
1993 $this->object->getShowSolutionFeedback()
1994 );
1995 $template->setVariable("SOLUTION_OUTPUT", $result_output);
1996 $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1997 $this->tpl->parseCurrentBlock();
1998 $counter++;
1999 }
2000 }
2001
2002 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css"), "print");
2003 if ($this->object->getShowSolutionAnswersOnly()) {
2004 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css"), "print");
2005 }
2006 if (strlen($top_data)) {
2007 $this->tpl->setCurrentBlock("top_data");
2008 $this->tpl->setVariable("TOP_DATA", $top_data);
2009 $this->tpl->parseCurrentBlock();
2010 }
2011
2012 if (strlen($bottom_data)) {
2013 $this->tpl->setCurrentBlock("bottom_data");
2014 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
2015 $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
2016 $this->tpl->parseCurrentBlock();
2017 }
2018
2019 $this->tpl->setCurrentBlock("adm_content");
2020 $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
2021 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($this->test_session, $active_id, true);
2022 $signature = $this->getResultsSignature();
2023 $this->tpl->setVariable("USER_DETAILS", $user_data);
2024 $this->tpl->setVariable("SIGNATURE", $signature);
2025 $this->tpl->setVariable("TITLE", $this->object->getTitle());
2026 $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
2027 $invited_user = &$this->object->getInvitedUsers($this->user->getId());
2028 $pagetitle = $this->object->getTitle() . ' - ' . $this->lng->txt('clientip') .
2029 ': ' . $_SERVER['REMOTE_ADDR'] . ' - ' .
2030 $this->lng->txt('matriculation') . ': ' .
2031 $invited_user[$this->user->getId()]['matriculation'];
2032 $this->tpl->setVariable('PAGETITLE', $pagetitle);
2033 $this->tpl->parseCurrentBlock();
2034 }
getResultsSignature()
Returns HTML code for a signature field.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$counter

References $_SERVER, $counter, ILIAS\Repository\ctrl(), assQuestionGUI\getObject(), assQuestionGUI\getSolutionOutput(), ilUtil\getStyleSheetLocation(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ showQuestionCmd()

ilTestPlayerAbstractGUI::showQuestionCmd ( )
protected

Definition at line 1327 of file class.ilTestPlayerAbstractGUI.php.

1327 : void
1328 {
1329 ilSession::set('tst_pass_finish', 0);
1330
1332 "active_time_id",
1333 $this->object->startWorkingTime(
1334 $this->test_session->getActiveId(),
1335 $this->test_session->getPass()
1336 )
1337 );
1338
1339 $this->help->setScreenIdComponent('tst');
1340 $this->help->setScreenId('assessment');
1341 $this->help->setSubScreenId('question');
1342
1343 $sequence_element = $this->getCurrentSequenceElement();
1344
1345 if (!$this->isValidSequenceElement($sequence_element)) {
1346 $sequence_element = $this->test_sequence->getFirstSequence();
1347 }
1348
1349 $this->test_session->setLastSequence($sequence_element ?? 0);
1350 $this->test_session->saveToDb();
1351
1352 $question_id = $this->test_sequence->getQuestionForSequence($sequence_element ?? 0);
1353 if ($question_id === null && $this->test_session->isObjectiveOriented()) {
1355 }
1356
1357 if ($question_id !== null && !$this->test_sequence->isQuestionPresented($question_id)) {
1358 $this->test_sequence->setQuestionPresented($question_id);
1359 $this->test_sequence->saveToDb();
1360 }
1361
1362 $question_worked_through = $this->questionrepository->lookupResultRecordExist(
1363 $this->test_session->getActiveId(),
1364 $question_id,
1365 $this->test_session->getPass()
1366 );
1367
1368 $instant_response = false;
1369 if ($this->isParticipantsAnswerFixed($question_id)) {
1371 $s = $this->object->getMainSettings()->getQuestionBehaviourSettings();
1372 if ($s->getInstantFeedbackGenericEnabled()
1373 || $s->getInstantFeedbackPointsEnabled()
1374 || $s->getInstantFeedbackSolutionEnabled()
1375 || $s->getInstantFeedbackSpecificEnabled()) {
1376 $instant_response = true;
1377 }
1378 } else {
1380 if (!$this->object->isInstantFeedbackAnswerFixationEnabled()) {
1381 $instant_response = $this->getInstantResponseParameter();
1382 }
1383 }
1384
1385 $question_gui = $this->getQuestionGuiInstance($question_id);
1386
1387 if (!($question_gui instanceof assQuestionGUI)) {
1388 $this->handleTearsAndAngerQuestionIsNull($question_id, $sequence_element);
1389 }
1390
1391 $question_gui->setSequenceNumber($this->test_sequence->getPositionOfSequence($sequence_element));
1392 $question_gui->setQuestionCount($this->test_sequence->getUserQuestionCount());
1393
1394 $header_block_builder = new ilTestQuestionHeaderBlockBuilder($this->lng);
1395 $header_block_builder->setHeaderMode($this->object->getTitleOutput());
1396 $header_block_builder->setQuestionTitle($question_gui->getObject()->getTitleForHTMLOutput());
1397 $header_block_builder->setQuestionPoints($question_gui->getObject()->getPoints());
1398 $header_block_builder->setQuestionPosition($this->test_sequence->getPositionOfSequence($sequence_element));
1399 $header_block_builder->setQuestionCount($this->test_sequence->getUserQuestionCount());
1400 $header_block_builder->setQuestionPostponed($this->test_sequence->isPostponedQuestion($question_id));
1401 if ($this->test_session->isObjectiveOriented()) {
1402 $objectives_adapter = ilLOTestQuestionAdapter::getInstance($this->test_session);
1403 $objectives_adapter->buildQuestionRelatedObjectiveList($this->test_sequence, $this->question_related_objectives_list);
1404 $this->question_related_objectives_list->loadObjectivesTitles();
1405
1406 $header_block_builder->setQuestionRelatedObjectives(
1407 $this->question_related_objectives_list->getQuestionRelatedObjectiveTitles($question_id)
1408 );
1409 }
1410 $question_gui->setQuestionHeaderBlockBuilder($header_block_builder);
1411
1412 $this->prepareTestPage($presentation_mode, $sequence_element, $question_id);
1413
1414 $navigation_toolbar_gui = $this->getTestNavigationToolbarGUI();
1415 $navigation_toolbar_gui->setFinishTestButtonEnabled(true);
1416
1417 $is_next_primary = $this->handlePrimaryButton($navigation_toolbar_gui, $question_id);
1418
1419 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
1420 $this->ctrl->setParameter($this, 'pmode', $presentation_mode);
1421 $form_action = $this->ctrl->getFormAction($this, ilTestPlayerCommands::SUBMIT_INTERMEDIATE_SOLUTION);
1422
1423 switch ($presentation_mode) {
1425 $navigation_toolbar_gui->setDisabledStateEnabled(false);
1426 $this->showQuestionEditable(
1427 $question_gui,
1428 $form_action,
1429 $question_worked_through,
1430 $instant_response
1431 );
1432
1433 if ($this->ctrl->getCmd() !== self::FINISH_TEST_CMD
1434 && $this->logger->isLoggingEnabled()
1435 && !$this->getObject()->getAnonymity()) {
1436 $this->logger->logParticipantInteraction(
1437 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1438 $this->object->getRefId(),
1439 $question_id,
1440 $this->user->getId(),
1441 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1442 TestParticipantInteractionTypes::QUESTION_SHOWN,
1443 []
1444 )
1445 );
1446 }
1447 break;
1448
1450 if ($this->test_sequence->isQuestionOptional($question_gui->getObject()->getId())) {
1452 }
1453
1454 $this->showQuestionViewable(
1455 $question_gui,
1456 $form_action,
1457 $question_worked_through,
1458 $instant_response
1459 );
1460 break;
1461
1462 default:
1463 throw new ilTestException('no presentation mode given');
1464 }
1465
1466 $navigation_toolbar_gui->build();
1467 $this->populateTestNavigationToolbar($navigation_toolbar_gui);
1468 $this->populateQuestionNavigation($sequence_element, $is_next_primary);
1469
1470 if ($instant_response) {
1472 $question_gui,
1473 true
1474 );
1475 }
1476
1477 if ($this->isForcedFeedbackNavUrlRegistered()) {
1480 }
1481 }
populateInstantResponseModal(assQuestionGUI $question_gui, $nav_url)
showQuestionViewable(assQuestionGUI $question_gui, string $form_action, bool $is_question_worked_through, bool $instant_response)
prepareTestPage($presentationMode, $sequenceElement, $question_id)
populateQuestionNavigation($sequence_element, $primary_next)
handleTearsAndAngerQuestionIsNull(int $question_id, $sequence_element)
populateTestNavigationToolbar(ilTestNavigationToolbarGUI $toolbar_gui)
handlePrimaryButton(ilTestNavigationToolbarGUI $navigation_toolbar_gui, int $current_question_id)
getQuestionGuiInstance(int $question_id, bool $from_cache=true)
showQuestionEditable(assQuestionGUI $question_gui, string $form_action, bool $is_question_worked_through, bool $instant_response)

References $_SERVER, ILIAS\Repository\ctrl(), ilLOTestQuestionAdapter\getInstance(), assQuestionGUI\getObject(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\object(), PRESENTATION_MODE_EDIT, PRESENTATION_MODE_VIEW, ilSession\set(), assQuestionGUI\setQuestionCount(), assQuestionGUI\setQuestionHeaderBlockBuilder(), assQuestionGUI\setSequenceNumber(), and ilTestPlayerCommands\SUBMIT_INTERMEDIATE_SOLUTION.

+ Here is the call graph for this function:

◆ showQuestionEditable()

ilTestPlayerAbstractGUI::showQuestionEditable ( assQuestionGUI  $question_gui,
string  $form_action,
bool  $is_question_worked_through,
bool  $instant_response 
)
protected

Definition at line 1242 of file class.ilTestPlayerAbstractGUI.php.

1247 : void {
1248 $question_navigation_gui = $this->buildEditableStateQuestionNavigationGUI($question_gui->getObject()->getId());
1249 $question_navigation_gui->setQuestionWorkedThrough($is_question_worked_through);
1250 if ($is_question_worked_through) {
1251 $question_navigation_gui->setDiscardSolutionButtonEnabled(true);
1252 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
1253 } elseif ($this->object->isPostponingEnabled()) {
1254 $question_navigation_gui->setSkipQuestionLinkTarget(
1255 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION)
1256 );
1257 }
1258 $question_gui->setNavigationGUI($question_navigation_gui);
1259
1260 $user_post_solution = false;
1261 if ($this->testrequest->isset('save_error')
1262 && $this->testrequest->int('save_error') === 1
1263 && ilSession::get('previouspost') !== null) {
1264 $user_post_solution = ilSession::get('previouspost');
1265 ilSession::clear('previouspost');
1266 }
1267
1268 $question_config = $question_gui->getObject()->getTestPresentationConfig();
1269
1270 if ($question_gui instanceof assMultipleChoiceGUI) {
1271 $question_config->setWorkedThrough($is_question_worked_through);
1272 }
1273
1274 if ($question_config->isPreviousPassSolutionReuseAllowed()) {
1275 $pass_index = $this->determineSolutionPassIndex($question_gui);
1276 if ($pass_index < $this->test_session->getPass()) {
1277 $question_config->setSolutionInitiallyPrefilled(true);
1278 }
1279 } else {
1280 $pass_index = $this->test_session->getPass();
1281 }
1282
1283
1284 $this->modal_signals = $this->populateModals();
1285 $question_navigation_gui->setShowDiscardModalSignal($this->modal_signals[self::DISCARD_MODAL]);
1286
1287 $question_gui->outQuestionForTest(
1288 $form_action,
1289 $this->test_session->getActiveId(),
1290 $pass_index,
1291 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
1292 $user_post_solution,
1293 $instant_response && $this->object->getSpecificAnswerFeedback()
1294 );
1295
1296 $this->populateQuestionEditControl($question_gui);
1297 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
outQuestionForTest(string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
populateQuestionEditControl(assQuestionGUI $question_gui)
determineSolutionPassIndex(assQuestionGUI $question_gui)

References assQuestionGUI\getQuestionHeaderBlockBuilder().

+ Here is the call graph for this function:

◆ showQuestionViewable()

ilTestPlayerAbstractGUI::showQuestionViewable ( assQuestionGUI  $question_gui,
string  $form_action,
bool  $is_question_worked_through,
bool  $instant_response 
)
protected

Definition at line 1198 of file class.ilTestPlayerAbstractGUI.php.

1203 : void {
1204 $question_navigation_gui = $this->buildReadOnlyStateQuestionNavigationGUI($question_gui->getObject()->getId());
1205 $question_navigation_gui->setQuestionWorkedThrough($is_question_worked_through);
1206 $question_gui->setNavigationGUI($question_navigation_gui);
1207 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered($is_question_worked_through);
1208
1209 $solutionoutput = $question_gui->getSolutionOutput(
1210 $this->test_session->getActiveId(),
1211 $this->test_session->getPass(),
1212 false,
1213 false,
1214 true,
1215 $instant_response && $this->object->getSpecificAnswerFeedback(),
1216 false,
1217 false,
1218 true
1219 );
1220
1221 $pageoutput = $question_gui->outQuestionPage(
1222 '',
1223 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
1224 $this->test_session->getActiveId(),
1225 $solutionoutput
1226 );
1227
1228 $this->tpl->setVariable(
1229 'LOCKSTATE_INFOBOX',
1230 $this->ui_renderer->render(
1231 $this->ui_factory->messageBox()->info($this->lng->txt('tst_player_answer_saved_and_locked'))
1232 )
1233 );
1234 $this->tpl->parseCurrentBlock();
1235 $this->tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
1236 $this->tpl->setVariable('FORMACTION', $form_action);
1237 $this->tpl->setVariable('ENCTYPE', 'enctype="' . $question_gui->getFormEncodingType() . '"');
1238 $this->tpl->setVariable('FORM_TIMESTAMP', time());
1239 $this->populateQuestionEditControl($question_gui);
1240 }

◆ showSideList()

ilTestPlayerAbstractGUI::showSideList (   $current_sequence_element)
protected

Definition at line 1816 of file class.ilTestPlayerAbstractGUI.php.

1816 : void
1817 {
1818 $question_summary_data = $this->service->getQuestionSummaryData($this->test_sequence);
1819 $questions = [];
1820 $active = 0;
1821
1822 foreach ($question_summary_data as $idx => $row) {
1823 $title = htmlspecialchars($row['title'], ENT_QUOTES, null, false);
1824 $description = '';
1825 if ($row['description'] !== '') {
1826 $description = htmlspecialchars($row['description'], ENT_QUOTES, null, false);
1827 }
1828
1829 if (!$row['disabled']) {
1830 $this->ctrl->setParameter($this, 'pmode', '');
1831 $this->ctrl->setParameter($this, 'sequence', $row['sequence']);
1832 $action = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SHOW_QUESTION);
1833 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1834 $this->ctrl->setParameter($this, 'sequence', $this->getCurrentSequenceElement($current_sequence_element));
1835 }
1836
1838
1839 if (
1840 ($row['worked_through'] || $row['isAnswered'])
1841 && $row['has_authorized_answer']
1842 ) {
1844 }
1845
1846 $questions[] = $this->ui_factory->listing()->workflow()
1847 ->step($title, $description, $action)
1848 ->withStatus($status);
1849 $active = $row['sequence'] == $current_sequence_element ? $idx : $active;
1850 }
1851
1852 $question_listing = $this->ui_factory->listing()->workflow()->linear(
1853 $this->lng->txt('mainbar_button_label_questionlist'),
1854 $questions
1855 )->withActive($active);
1856
1857
1858 $this->global_screen->tool()->context()->current()->addAdditionalData(
1860 $question_listing
1861 );
1862 }

References ILIAS\Repository\ctrl(), ILIAS\UI\Component\Listing\Workflow\Step\IN_PROGRESS, ILIAS\Repository\lng(), ILIAS\UI\Component\Listing\Workflow\Step\NOT_STARTED, PRESENTATION_MODE_VIEW, ilTestPlayerCommands\SHOW_QUESTION, and ilTestPlayerLayoutProvider\TEST_PLAYER_QUESTIONLIST.

+ Here is the call graph for this function:

◆ skipQuestionCmd()

ilTestPlayerAbstractGUI::skipQuestionCmd ( )
protected

Definition at line 1578 of file class.ilTestPlayerAbstractGUI.php.

1579 {
1580 $current_sequence_element = $this->getCurrentSequenceElement();
1581 $next_sequence_element = $this->test_sequence->getNextSequence($current_sequence_element);
1582
1583 if (!$this->isValidSequenceElement($next_sequence_element)) {
1584 $next_sequence_element = $this->test_sequence->getFirstSequence();
1585 }
1586
1587 if ($this->object->isPostponingEnabled()) {
1588 $this->test_sequence->postponeSequence($current_sequence_element);
1589 $this->test_sequence->saveToDb();
1590 }
1591
1592 if ($this->logger->isLoggingEnabled()
1593 && !$this->getObject()->getAnonymity()) {
1594 $this->logger->logParticipantInteraction(
1595 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1596 $this->object->getRefId(),
1597 $this->test_sequence->getQuestionForSequence($current_sequence_element),
1598 $this->user->getId(),
1599 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1600 TestParticipantInteractionTypes::QUESTION_SKIPPED,
1601 []
1602 )
1603 );
1604 }
1605
1606 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
1607 $this->ctrl->setParameter($this, 'pmode', '');
1608
1609 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1610 }

References $_SERVER, ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), ILIAS\Repository\object(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ startPlayerCmd()

ilTestPlayerAbstractGUI::startPlayerCmd ( )
protected

Start a test for the first time.

Start a test for the first time. This method contains a lock to prevent multiple submissions by the start test button

Definition at line 704 of file class.ilTestPlayerAbstractGUI.php.

705 {
706 $testStartLock = $this->getLockParameter();
707 $isFirstTestStartRequest = false;
708
709 $this->process_locker->executeTestStartLockOperation(function () use ($testStartLock, &$isFirstTestStartRequest) {
710 if ($this->test_session->lookupTestStartLock() !== $testStartLock) {
711 $this->test_session->persistTestStartLock($testStartLock);
712 $isFirstTestStartRequest = true;
713 }
714 });
715
716 if ($isFirstTestStartRequest) {
717 $this->handleUserSettings();
718 $this->ctrl->redirect($this, ilTestPlayerCommands::INIT_TEST);
719 }
720
721 $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
722 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
723 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\INIT_TEST.

+ Here is the call graph for this function:

◆ startTestCmd()

ilTestPlayerAbstractGUI::startTestCmd ( )
protected

Definition at line 1612 of file class.ilTestPlayerAbstractGUI.php.

1613 {
1614 ilSession::set('tst_pass_finish', 0);
1615
1616 // ensure existing test session
1617 $this->test_session->setUserId($this->user->getId());
1618 $access_code = ilSession::get('tst_access_code');
1619 if ($access_code != null && isset($access_code[$this->object->getTestId()])) {
1620 $this->test_session->setAnonymousId($access_code[$this->object->getTestId()]);
1621 }
1622 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1623 $this->test_session->setObjectiveOrientedContainerId($this->getObjectiveOrientedContainer()->getObjId());
1624 }
1625 $this->test_session->saveToDb();
1626
1627 $active_id = $this->test_session->getActiveId();
1628 $this->ctrl->setParameter($this, "active_id", $active_id);
1629
1630 $shuffle = $this->object->getShuffleQuestions();
1631 if ($this->object->isRandomTest()) {
1633
1634 $this->object->loadQuestions();
1635 $shuffle = false; // shuffle is already done during the creation of the random questions
1636 }
1637
1638 $this->test_result_repository->updateTestAttemptResult(
1639 $active_id,
1640 $this->test_session->getPass(),
1641 null,
1642 $this->object->getId()
1643 );
1644
1645 // ensure existing test sequence
1646 if (!$this->test_sequence->hasSequence()) {
1647 $this->test_sequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
1648 $this->test_sequence->saveToDb();
1649 }
1650
1651 $this->test_sequence->loadFromDb();
1652 $this->test_sequence->loadQuestions();
1653
1654 if ($this->test_session->isObjectiveOriented()) {
1655 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->test_session);
1656
1657 $objectivesAdapter->notifyTestStart($this->test_session, $this->object->getId());
1658 $objectivesAdapter->prepareTestPass($this->test_session, $this->test_sequence);
1659
1660 $objectivesAdapter->buildQuestionRelatedObjectiveList(
1661 $this->test_sequence,
1662 $this->question_related_objectives_list
1663 );
1664
1665 if ($this->test_sequence->hasOptionalQuestions()) {
1667
1668 $this->test_sequence->reorderOptionalQuestionsToSequenceEnd();
1669 $this->test_sequence->saveToDb();
1670 }
1671 }
1672
1673 $active_time_id = $this->object->startWorkingTime(
1674 $this->test_session->getActiveId(),
1675 $this->test_session->getPass()
1676 );
1677 ilSession::set("active_time_id", $active_time_id);
1678
1680
1681 $sequence_element = $this->test_sequence->getFirstSequence();
1682
1683 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
1684 $this->ctrl->setParameter($this, 'pmode', '');
1685
1686 if ($this->logger->isLoggingEnabled()
1687 && !$this->getObject()->getAnonymity()) {
1688 $this->logger->logParticipantInteraction(
1689 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1690 $this->object->getRefId(),
1691 null,
1692 $this->user->getId(),
1693 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1694 TestParticipantInteractionTypes::TEST_RUN_STARTED,
1695 []
1696 )
1697 );
1698 }
1699
1700 if ($this->object->getListOfQuestionsStart()) {
1701 $this->ctrl->setParameterByClass(static::class, 'first', '1');
1702 $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY);
1703 }
1704
1705 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1706 }

References $_SERVER, ILIAS\Repository\ctrl(), ilSession\get(), ilLOTestQuestionAdapter\getInstance(), ILIAS\Repository\logger(), ILIAS\Repository\object(), ilTestPlayerCommands\QUESTION_SUMMARY, ilSession\set(), ilTestPlayerCommands\SHOW_QUESTION, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ submitIntermediateSolutionCmd()

ilTestPlayerAbstractGUI::submitIntermediateSolutionCmd ( )
protected

Definition at line 938 of file class.ilTestPlayerAbstractGUI.php.

939 {
940 $this->saveQuestionSolution(false, true);
941 // fau: testNav - set the 'answer changed' parameter when an intermediate solution is submitted
942 $this->setAnswerChangedParameter(true);
943 // fau.
944 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
945 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ submitSolutionAndNextCmd()

ilTestPlayerAbstractGUI::submitSolutionAndNextCmd ( )
protected

Definition at line 2966 of file class.ilTestPlayerAbstractGUI.php.

2966 : void
2967 {
2968 if ($this->object->isForceInstantFeedbackEnabled()) {
2969 $this->submitSolutionCmd();
2970 return;
2971 }
2972
2973 if ($this->saveQuestionSolution(true, false)) {
2974 $this->test_sequence->getQuestionForSequence(
2976 );
2977
2979
2980 $next_sequence_element = $this->test_sequence->getNextSequence($this->getCurrentSequenceElement());
2981
2982 if (!$this->isValidSequenceElement($next_sequence_element)) {
2983 $next_sequence_element = $this->test_sequence->getFirstSequence();
2984 }
2985
2986 $this->test_session->setLastSequence($next_sequence_element ?? 0);
2987 $this->test_session->saveToDb();
2988
2989 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
2990 $this->ctrl->setParameter($this, 'pmode', '');
2991 }
2992
2993 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2994 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ submitSolutionCmd()

ilTestPlayerAbstractGUI::submitSolutionCmd ( )
protected

Definition at line 1489 of file class.ilTestPlayerAbstractGUI.php.

1490 {
1491 if ($this->saveQuestionSolution(true, false)) {
1492 $question_id = $this->test_sequence->getQuestionForSequence(
1494 );
1495
1497
1498 if ($this->object->isForceInstantFeedbackEnabled()) {
1499 $this->ctrl->setParameter($this, 'instresp', 1);
1500
1501 $this->test_sequence->setQuestionChecked($question_id);
1502 $this->test_sequence->saveToDb();
1503 }
1504
1505 if ($this->getNextCommandParameter()) {
1506 if ($this->getNextSequenceParameter()) {
1507 $this->ctrl->setParameter($this, 'sequence', $this->getNextSequenceParameter());
1508 $this->ctrl->setParameter($this, 'pmode', '');
1509 }
1510
1511 $this->ctrl->redirect($this, $this->getNextCommandParameter());
1512 }
1513
1514 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1515 } else {
1516 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1517 }
1518
1519 // fau: testNav - remember to prevent the navigation confirmation
1521 // fau.
1522
1523 // fau: testNav - handle navigation after saving
1524 if ($this->getNavigationUrlParameter()) {
1526 } else {
1527 $this->ctrl->saveParameter($this, 'sequence');
1528 }
1529 // fau.
1530 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1531 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), PRESENTATION_MODE_VIEW, ilUtil\redirect(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ suspendTestCmd()

ilTestPlayerAbstractGUI::suspendTestCmd ( )

Definition at line 442 of file class.ilTestPlayerAbstractGUI.php.

443 {
444 $this->ctrl->redirectByClass(TestScreenGUI::class, TestScreenGUI::DEFAULT_CMD);
445 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

Definition at line 967 of file class.ilTestPlayerAbstractGUI.php.

968 {
969 // fau: testNav - handle intermediate submit when unmarking the question
971 // fau.
972 $this->unmarkQuestionCmd();
973 }
unmarkQuestionCmd()
Set a question unsolved.

◆ unmarkQuestionCmd()

ilTestPlayerAbstractGUI::unmarkQuestionCmd ( )
protected

Set a question unsolved.

Definition at line 978 of file class.ilTestPlayerAbstractGUI.php.

979 {
980 $question_id = $this->test_sequence->getQuestionForSequence(
982 );
983
984 $this->object->setQuestionSetSolved(0, $question_id, $this->test_session->getUserId());
985
986 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
987 }

References ILIAS\Repository\ctrl(), and ilTestPlayerCommands\SHOW_QUESTION.

+ Here is the call graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

Definition at line 2928 of file class.ilTestPlayerAbstractGUI.php.

2928 : void
2929 {
2930 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2931 if (isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2932 unset($forced_feedback_navigation_url[$this->test_session->getActiveId()]);
2933 ilSession::set('forced_feedback_navigation_url', $forced_feedback_navigation_url);
2934 }
2935 }

References ilSession\get(), and ilSession\set().

+ Here is the call graph for this function:

◆ updateLearningProgressOnTestStart()

ilTestPlayerAbstractGUI::updateLearningProgressOnTestStart ( )
protected

Definition at line 2944 of file class.ilTestPlayerAbstractGUI.php.

2944 : void
2945 {
2946 ilLPStatusWrapper::_updateStatus($this->object->getId(), $this->user->getId());
2947 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

References ilLPStatusWrapper\_updateStatus(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ updateWorkingTime()

ilTestPlayerAbstractGUI::updateWorkingTime ( )

updates working time and stores state saveresult to see if question has to be stored or not

Definition at line 308 of file class.ilTestPlayerAbstractGUI.php.

309 {
310 if (ilSession::get("active_time_id") != null) {
311 $this->object->updateWorkingTime(ilSession::get("active_time_id"));
312 }
313
315 "active_time_id",
316 $this->object->startWorkingTime(
317 $this->test_session->getActiveId(),
318 $this->test_session->getPass()
319 )
320 );
321 }

References ilSession\get(), ILIAS\Repository\object(), and ilSession\set().

+ Here is the call graph for this function:

Field Documentation

◆ $ass_settings

ilSetting ilTestPlayerAbstractGUI::$ass_settings = null
protected

Definition at line 64 of file class.ilTestPlayerAbstractGUI.php.

◆ $cached_question_guis

array ilTestPlayerAbstractGUI::$cached_question_guis = []
private

Definition at line 54 of file class.ilTestPlayerAbstractGUI.php.

◆ $cached_question_objects

array ilTestPlayerAbstractGUI::$cached_question_objects = []
private

Definition at line 59 of file class.ilTestPlayerAbstractGUI.php.

◆ $ending_time_reached

bool ilTestPlayerAbstractGUI::$ending_time_reached

Definition at line 48 of file class.ilTestPlayerAbstractGUI.php.

◆ $finish_test_modal

InterruptiveModal ilTestPlayerAbstractGUI::$finish_test_modal = null
protected

Definition at line 68 of file class.ilTestPlayerAbstractGUI.php.

◆ $max_processing_time_reached

bool ilTestPlayerAbstractGUI::$max_processing_time_reached

Definition at line 47 of file class.ilTestPlayerAbstractGUI.php.

◆ $modal_signals

array ilTestPlayerAbstractGUI::$modal_signals = []
protected

Definition at line 78 of file class.ilTestPlayerAbstractGUI.php.

◆ $password_checker

ilTestPasswordChecker ilTestPlayerAbstractGUI::$password_checker
protected

Definition at line 61 of file class.ilTestPlayerAbstractGUI.php.

◆ $process_locker

ilTestProcessLocker ilTestPlayerAbstractGUI::$process_locker
protected

Definition at line 62 of file class.ilTestPlayerAbstractGUI.php.

◆ $question_related_objectives_list

ilTestQuestionRelatedObjectivesList ilTestPlayerAbstractGUI::$question_related_objectives_list
protected

Definition at line 66 of file class.ilTestPlayerAbstractGUI.php.

◆ $ref_id

int ilTestPlayerAbstractGUI::$ref_id

Definition at line 49 of file class.ilTestPlayerAbstractGUI.php.

◆ $test_sequence

ilTestSequence ilTestPlayerAbstractGUI::$test_sequence = null
protected

Definition at line 65 of file class.ilTestPlayerAbstractGUI.php.

◆ $test_session

ilTestSession ilTestPlayerAbstractGUI::$test_session = null
protected

◆ DISCARD_MODAL

const ilTestPlayerAbstractGUI::DISCARD_MODAL = "discard_modal"
protected

Definition at line 70 of file class.ilTestPlayerAbstractGUI.php.

◆ FINISH_TEST_CMD

const ilTestPlayerAbstractGUI::FINISH_TEST_CMD = 'finishTest'
protected

Definition at line 43 of file class.ilTestPlayerAbstractGUI.php.

◆ FIXED_SHUFFLER_SEED_MIN_LENGTH

const ilTestPlayerAbstractGUI::FIXED_SHUFFLER_SEED_MIN_LENGTH = 8

Definition at line 45 of file class.ilTestPlayerAbstractGUI.php.

◆ FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM

const ilTestPlayerAbstractGUI::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'

Definition at line 2840 of file class.ilTestPlayerAbstractGUI.php.

◆ LOCKS_CHANGED_MODAL

const ilTestPlayerAbstractGUI::LOCKS_CHANGED_MODAL = "locks_changed_modal"
protected

Definition at line 71 of file class.ilTestPlayerAbstractGUI.php.

◆ LOCKS_UNCHANGED_MODAL

const ilTestPlayerAbstractGUI::LOCKS_UNCHANGED_MODAL = "locks_unchanged_modal"
protected

Definition at line 72 of file class.ilTestPlayerAbstractGUI.php.

◆ PRESENTATION_MODE_EDIT

const ilTestPlayerAbstractGUI::PRESENTATION_MODE_EDIT = 'edit'

Definition at line 41 of file class.ilTestPlayerAbstractGUI.php.

Referenced by editSolutionCmd(), and showQuestionCmd().

◆ PRESENTATION_MODE_VIEW

const ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW = 'view'

The documentation for this class was generated from the following file: