ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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...
 
 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 (int $active_id, bool $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 ()
 
 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 ilComponentFactory $component_factory
 
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 806 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 3001 of file class.ilTestPlayerAbstractGUI.php.

3001 : void
3002 {
3003 $ass_settings = new ilSetting('assessment');
3004
3005 $userSolutionAdopter = new ilAssQuestionUserSolutionAdopter($this->db, $ass_settings);
3006 $userSolutionAdopter->setUserId($this->user->getId());
3007 $userSolutionAdopter->setActiveId($this->test_session->getActiveId());
3008 $userSolutionAdopter->setTargetPass($this->test_sequence->getPass());
3009 $userSolutionAdopter->setQuestionIds($this->test_sequence->getOptionalQuestions());
3010
3011 $userSolutionAdopter->perform();
3012 }
ILIAS Setting Class.

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ afterTestPassFinishedCmd()

ilTestPlayerAbstractGUI::afterTestPassFinishedCmd ( )
protected

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

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

References ILIAS\Test\Settings\MainSettings\ALWAYS_TO_LOGOUT, ILIAS\Repository\ctrl(), ilStartUpGUI\logoutUrl(), ILIAS\Repository\object(), 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 866 of file class.ilTestPlayerAbstractGUI.php.

866 : void
867 {
868 if (!$this->access->checkAccess('read', '', $this->ref_id)) {
869 echo $this->lng->txt('autosave_failed') . ': ' . $this->lng->txt('msg_no_perm_read_item');
870 exit;
871 }
872 $test_can_run = $this->object->isExecutable($this->test_session, $this->test_session->getUserId());
873 if (!$test_can_run['executable']) {
874 echo $test_can_run['errormessage'];
875 exit;
876 }
877 if ($this->testrequest->getPostKeys() === []) {
878 echo '';
879 exit;
880 }
881
882 if (!$this->canSaveResult() || $this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
883 echo '-IGNORE-';
884 exit;
885 }
886
887 if ($this->saveQuestionSolution(!$this->getAnswerChangedParameter(), true)) {
888 echo $this->lng->txt('autosave_success');
889 exit;
890 }
891
892 echo $this->lng->txt('autosave_failed');
893 exit;
894 }
saveQuestionSolution(bool $authorized=true, bool $force=false)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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 900 of file class.ilTestPlayerAbstractGUI.php.

901 {
902 if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
903 $this->saveQuestionSolution(false, true);
904 }
905 $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
906 }

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

+ Here is the call graph for this function:

◆ backFromFinishingCmd()

ilTestPlayerAbstractGUI::backFromFinishingCmd ( )

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

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

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 2311 of file class.ilTestPlayerAbstractGUI.php.

2312 {
2313 $navigation_gui = new ilTestQuestionNavigationGUI(
2314 $this->lng,
2315 $this->ui_factory,
2316 $this->ui_renderer
2317 );
2318
2319 // fau: testNav - add a 'revert changes' link for editable question
2320 $navigation_gui->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
2321
2322 if ($this->object->getSpecificAnswerFeedback()
2323 || $this->object->getGenericAnswerFeedback()
2324 || $this->object->getAnswerFeedbackPoints()
2325 || $this->object->getInstantFeedbackSolution()) {
2326 $navigation_gui->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
2327
2328 if ($this->object->isForceInstantFeedbackEnabled()) {
2329 $navigation_gui->setForceInstantResponseEnabled(true);
2330 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2331 } else {
2332 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
2333 }
2334 }
2335
2336 if ($this->object->getShowMarker()) {
2337 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2338 $solved = 0;
2339
2340 if (count($solved_array) > 0) {
2341 $solved = array_pop($solved_array);
2342 $solved = $solved['solved'];
2343 }
2344
2345 if ($solved === 1) {
2346 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
2347 $navigation_gui->setQuestionMarked(true);
2348 } else {
2349 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
2350 $navigation_gui->setQuestionMarked(false);
2351 }
2352 }
2353 return $navigation_gui;
2354 }
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 1055 of file class.ilTestPlayerAbstractGUI.php.

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

References $message, 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 544 of file class.ilTestPlayerAbstractGUI.php.

545 {
546 $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::NEXT_QUESTION);
547 if ($primaryNext) {
548 $button = $this->ui_factory->button()->primary(
549 $this->lng->txt('next_question') . $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->next()),
550 ''
551 )->withUnavailableAction(true)
553 } else {
554 $button = $this->ui_factory->button()->standard(
555 $this->lng->txt('next_question') . $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->next()),
556 ''
557 )->withUnavailableAction(true)
559 }
560 return $button;
561 }
getOnLoadCodeForNavigationButtons(string $target, string $cmd)

References ILIAS\Scripts\PHPStan\$target, 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 567 of file class.ilTestPlayerAbstractGUI.php.

568 {
569 $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::PREVIOUS_QUESTION);
570 $button = $this->ui_factory->button()->standard(
571 $this->ui_renderer->render($this->ui_factory->symbol()->glyph()->back()) . $this->lng->txt('previous_question'),
572 ''
573 )->withUnavailableAction(true)
575 return $button;
576 }

References ILIAS\Scripts\PHPStan\$target, ILIAS\Repository\ctrl(), and ilTestPlayerCommands\PREVIOUS_QUESTION.

+ Here is the call graph for this function:

◆ buildQuestionObject()

ilTestPlayerAbstractGUI::buildQuestionObject ( )
private

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

377 : ?assQuestion
378 {
379 $q_id = $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
380
381 if ($this->isParticipantsAnswerFixed($q_id)) {
382 // should only be reached by firebugging the disabled form in ui
383 $this->tpl->setOnScreenMessage(ilGlobalTemplateInterface::MESSAGE_TYPE_FAILURE, $this->lng->txt('tst_player_answer_saved_and_locked'), true);
384 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
385 }
386
387 if ($q_id === null) {
388 return null;
389 }
390
391 return $this->getQuestionInstance($q_id);
392 }
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 2277 of file class.ilTestPlayerAbstractGUI.php.

2278 {
2279 $navigationGUI = new ilTestQuestionNavigationGUI(
2280 $this->lng,
2281 $this->ui_factory,
2282 $this->ui_renderer
2283 );
2284
2285 if (!$this->isParticipantsAnswerFixed($question_id)) {
2286 $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
2287 }
2288
2289 if ($this->object->getShowMarker()) {
2290 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2291 $solved = 0;
2292
2293 if (count($solved_array) > 0) {
2294 $solved = array_pop($solved_array);
2295 $solved = $solved["solved"];
2296 }
2297 // fau: testNav - change question mark command to link target
2298 if ($solved == 1) {
2299 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
2300 $navigationGUI->setQuestionMarked(true);
2301 } else {
2302 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
2303 $navigationGUI->setQuestionMarked(false);
2304 }
2305 }
2306 // fau.
2307
2308 return $navigationGUI;
2309 }

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 2249 of file class.ilTestPlayerAbstractGUI.php.

2250 {
2251 if ($this->object->getListOfQuestions()) {
2252 $this->ctrl->setParameter($this, 'activecommand', 'summary');
2253 } else {
2254 $this->ctrl->setParameter($this, 'activecommand', 'previous');
2255 }
2256
2257 $this->ctrl->redirect($this, 'redirectQuestion');
2258 }

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

+ Here is the call graph for this function:

◆ canSaveResult()

ilTestPlayerAbstractGUI::canSaveResult ( )
protected

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

430 : bool
431 {
432 return !$this->object->endingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
433 }

◆ checkAndUpdateSaveAllowedByFormTimestamp()

ilTestPlayerAbstractGUI::checkAndUpdateSaveAllowedByFormTimestamp ( bool  $force)
private

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

361 : bool
362 {
363 if ($force) {
364 return true;
365 }
366
367 $formtimestamp = $this->testrequest->int('formtimestamp');
368 if (ilSession::get('formtimestamp') !== null
369 && $formtimestamp === ilSession::get('formtimestamp')) {
370 return false;
371 }
372
373 ilSession::set('formtimestamp', $formtimestamp);
374 return true;
375 }
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:

◆ 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 1808 of file class.ilTestPlayerAbstractGUI.php.

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

References exit.

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

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

2241 {
2242 $this->test_sequence->setAnsweringOptionalQuestionsConfirmed(true);
2243 $this->test_sequence->saveToDb();
2244
2245 $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
2246 $this->ctrl->redirect($this, 'redirectQuestion');
2247 }

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 1755 of file class.ilTestPlayerAbstractGUI.php.

1756 {
1757 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "components/ILIAS/Test");
1758 $this->tpl->setCurrentBlock("adm_content");
1759 if ($this->object->isTestFinished($this->test_session->getActiveId())) {
1760 $this->tpl->setCurrentBlock("not_submit_allowed");
1761 $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1762 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1763 } else {
1764 $this->tpl->setCurrentBlock("submit_allowed");
1765 $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1766 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1767 }
1768 $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1769 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1770 $this->tpl->parseCurrentBlock();
1771 }
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 915 of file class.ilTestPlayerAbstractGUI.php.

916 {
917 $question_id = $this->getCurrentQuestionId();
918 $state = $this->getQuestionInstance($question_id)->lookupForExistingSolutions(
919 $this->test_session->getActiveId(),
920 $this->test_session->getPass()
921 );
922 $result = [];
923 $result['isAnswered'] = $state['authorized'];
924 $result['isAnswerChanged'] = $state['intermediate'];
925
926 echo json_encode($result);
927 exit;
928 }

References exit.

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

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

451 : bool
452 {
453 $show_question_inline_score = false;
454 if ($this->object->getAnswerFeedbackPoints()) {
455 $show_question_inline_score = true;
456 return $show_question_inline_score;
457 }
458 return $show_question_inline_score;
459 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ determineSolutionPassIndex()

ilTestPlayerAbstractGUI::determineSolutionPassIndex ( assQuestionGUI  $question_gui)
protected

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

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

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

+ Here is the call graph for this function:

◆ discardSolutionCmd()

ilTestPlayerAbstractGUI::discardSolutionCmd ( )
protected

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

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

References 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 794 of file class.ilTestPlayerAbstractGUI.php.

795 {
796 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "components/ILIAS/Test");
797 $this->tpl->setCurrentBlock("adm_content");
798 $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
799 $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->test_session->getAccessCodeFromSession());
800 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
801 $this->tpl->setVariable("CMD_CONFIRM", ilTestPlayerCommands::ACCESS_CODE_CONFIRMED);
802 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("continue_work"));
803 $this->tpl->parseCurrentBlock();
804 }

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 1479 of file class.ilTestPlayerAbstractGUI.php.

1480 {
1481 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_EDIT);
1482 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1483 }

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 1728 of file class.ilTestPlayerAbstractGUI.php.

1729 {
1730 $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1731 $this->test_session->increasePass();
1732 $this->test_session->setLastSequence(0);
1733 $this->test_session->saveToDb();
1734
1735 $this->redirectBackCmd();
1736 }
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 258 of file class.ilTestPlayerAbstractGUI.php.

258 : void
259 {
260 if ($test_session->getActiveId()) {
261 return;
262 }
263
264 $test_session->setUserId($this->user->getId());
265
266 if ($test_session->isAnonymousUser()) {
268 return;
269 }
270
272 }
273
275 }
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->test_session->checkAccess($this->object);
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)
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(), 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 982 of file class.ilTestPlayerAbstractGUI.php.

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

References 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 2964 of file class.ilTestPlayerAbstractGUI.php.

2964 : void
2965 {
2966 $questionSetConfig = new ilTestRandomQuestionSetConfig(
2967 $this->tree,
2968 $this->db,
2969 $this->lng,
2970 $this->logger,
2971 $this->component_repository,
2972 $this->object,
2973 $this->questionrepository
2974 );
2975 $questionSetConfig->loadFromDb();
2976
2977 $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($this->db, $this->object);
2978
2979 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList($this->db, $this->object, $sourcePoolDefinitionFactory);
2980 $sourcePoolDefinitionList->loadDefinitions();
2981
2982 $this->process_locker->executeRandomPassBuildOperation(function () use ($questionSetConfig, $sourcePoolDefinitionList) {
2984 $stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($this->db, $this->component_repository);
2985
2986 $questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance(
2987 $this->db,
2988 $this->lng,
2989 $this->logger,
2990 $this->object,
2991 $questionSetConfig,
2992 $sourcePoolDefinitionList,
2993 $stagingPoolQuestionList
2994 );
2995
2996 $questionSetBuilder->performBuild($this->test_session);
2997 }
2998 }, $sourcePoolDefinitionList->hasTaxonomyFilters());
2999 }
static getInstance(ilDBInterface $db, ilLanguage $lng, TestLogger $logger, ilObjTest $test_obj, ilTestRandomQuestionSetConfig $question_set_config, ilTestRandomQuestionSetSourcePoolDefinitionList $source_pool_definition_list, ilTestRandomQuestionSetStagingPoolQuestionList $staging_pool_question_list)

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 2581 of file class.ilTestPlayerAbstractGUI.php.

2581 : bool
2582 {
2583 return !empty($this->testrequest->raw('test_answer_changed'));
2584 }

◆ 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 1959 of file class.ilTestPlayerAbstractGUI.php.

1959 : string
1960 {
1961 return "ADM_CONTENT";
1962
1963 if ($this->object->getKioskMode()) {
1964 $this->tpl->setBodyClass("kiosk");
1965 $this->tpl->hideFooter();
1966 return "CONTENT";
1967 } else {
1968 return "ADM_CONTENT";
1969 }
1970 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getCurrentQuestionId()

ilTestPlayerAbstractGUI::getCurrentQuestionId ( )
protected

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

857 : int
858 {
859 return $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
860 }

Referenced by removeIntermediateSolution().

+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestPlayerAbstractGUI::getCurrentSequenceElement ( )
protected

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

2520 : int
2521 {
2522 if ($this->getSequenceElementParameter()) {
2523 return $this->getSequenceElementParameter();
2524 }
2525
2526 return $this->test_session->getLastSequence();
2527 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestPlayerAbstractGUI::getFinishTestCommand ( )
protected

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

2356 : string
2357 {
2358 if (!$this->object->getListOfQuestionsEnd()) {
2360 }
2361
2363 }

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 2547 of file class.ilTestPlayerAbstractGUI.php.

2547 : bool
2548 {
2549 return $this->testrequest->isInstanceResponseRequested();
2550 }

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

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

2181 : string
2182 {
2183 return $this->lng->txt("save_introduction");
2184 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLockParameter()

ilTestPlayerAbstractGUI::getLockParameter ( )

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

719 {
720 if ($this->testrequest->isset('lock') && strlen($this->testrequest->raw('lock'))) {
721 return $this->testrequest->raw('lock');
722 }
723
724 return null;
725 }

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

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

2567 : string
2568 {
2569 $navigation_url = $this->testrequest->strVal('test_player_navigation_url');
2570 if ($navigation_url !== '') {
2571 $navigation_url_parts = parse_url($navigation_url);
2572 $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2573
2574 if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2575 return $navigation_url;
2576 }
2577 }
2578 return '';
2579 }
static _getHttpPath()

References ilUtil\_getHttpPath().

+ Here is the call graph for this function:

◆ getNextCommandParameter()

ilTestPlayerAbstractGUI::getNextCommandParameter ( )
protected

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

2553 {
2554 $nextcmd = '';
2555 if ($this->testrequest->isset('nextcmd')) {
2556 $nextcmd = $this->testrequest->strVal('nextcmd');
2557 }
2558
2559 return $nextcmd !== '' ? $nextcmd : null;
2560 }

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

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

2562 : int
2563 {
2564 return $this->testrequest->int('nextseq');
2565 }

◆ getOnLoadCodeForNavigationButtons()

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

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

578 : Closure
579 {
580 return static function (string $id) use ($target, $cmd): string {
581 return "document.getElementById('{$id}').addEventListener('click', "
582 . "(e) => {il.TestPlayerQuestionEditControl.checkNavigation('{$target}', '{$cmd}', e);}"
583 . "); "
584 . "document.getElementById('{$id}').removeAttribute('disabled');";
585 };
586 }

References $id, and ILIAS\Scripts\PHPStan\$target.

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

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

2539 {
2540 if ($this->testrequest->isset('pmode')) {
2541 return $this->testrequest->raw('pmode');
2542 }
2543
2544 return null;
2545 }

◆ getQuestionFeedbackModalHtml()

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

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

2403 : string
2404 {
2405 $modal = $this->ui_factory->modal()->roundtrip(
2406 $this->lng->txt('tst_instant_feedback'),
2407 $this->ui_factory->legacy()->content($tpl->get()),
2408 []
2409 )->withActionButtons([
2410 $this->ui_factory->button()->standard($this->lng->txt('proceed'), $nav_url)
2411 ]);
2412
2413 return $this->ui_renderer->render([
2414 $modal->withOnLoad($modal->getShowSignal())
2415 ]);
2416 }
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 ILIAS\News\Common\Table\$tpl, ILIAS\UICore\GlobalTemplate\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 2612 of file class.ilTestPlayerAbstractGUI.php.

2612 : object
2613 {
2614 $tpl = $this->tpl;
2615
2616 if (!$from_cache || !isset($this->cached_question_guis[$question_id])) {
2617 $question_gui = $this->object->createQuestionGUI("", $question_id);
2618 $question_gui->setTargetGui($this);
2619 $question_gui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2620 $question = $question_gui->getObject();
2621 $question->setShuffler($this->shuffler->getAnswerShuffleFor(
2622 $question_id,
2623 $this->test_session->getActiveId(),
2624 $this->test_session->getPass()
2625 ));
2626 $question_gui->setObject($question);
2627 $question_gui->populateJavascriptFilesRequiredForWorkForm($tpl);
2628
2629 // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2630 $this->initTestQuestionConfig($question_gui->getObject());
2631 // hey.
2632
2633 $this->cached_question_guis[$question_id] = $question_gui;
2634 }
2635
2636 return $this->cached_question_guis[$question_id];
2637 }
initTestQuestionConfig(assQuestion $question_obj)

References ILIAS\News\Common\Table\$tpl, 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 2639 of file class.ilTestPlayerAbstractGUI.php.

2639 : assQuestion
2640 {
2641 if ($from_cache && isset($this->cached_question_objects[$question_id])) {
2642 return $this->cached_question_objects[$question_id];
2643 }
2644 $question = assQuestion::instantiateQuestion($question_id);
2645 $ass_settings = new ilSetting('assessment');
2646
2647 $process_locker_factory = new ilAssQuestionProcessLockerFactory($ass_settings, $this->db, ilLoggerFactory::getLogger('tst'));
2648 $process_locker_factory->setQuestionId($question->getId());
2649 $process_locker_factory->setUserId($this->user->getId());
2650 $question->setProcessLocker($process_locker_factory->getLocker());
2651
2652 $this->initTestQuestionConfig($question);
2653
2654 $this->cached_question_objects[$question_id] = $question;
2655 return $question;
2656 }
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 2813 of file class.ilTestPlayerAbstractGUI.php.

2813 : string
2814 {
2816 }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

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

2828 : ?string
2829 {
2830 if (ilSession::get('forced_feedback_navigation_url') === null) {
2831 return null;
2832 }
2833 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2834 if (!isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2835 return null;
2836 }
2837
2838 return $forced_feedback_navigation_url[$this->test_session->getActiveId()];
2839 }

References ilSession\get().

+ Here is the call graph for this function:

◆ getSequenceElementParameter()

ilTestPlayerAbstractGUI::getSequenceElementParameter ( )
protected

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

2529 : ?int
2530 {
2531 if ($this->testrequest->isset('sequence')) {
2532 return $this->testrequest->int('sequence');
2533 }
2534
2535 return null;
2536 }

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

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

2269 {
2270 $navigation_toolbar = new ilTestNavigationToolbarGUI($this->ctrl, $this);
2271 $navigation_toolbar->setSuspendTestButtonEnabled($this->object->getShowCancel());
2272 $navigation_toolbar->setUserPassOverviewEnabled($this->object->getUsrPassOverviewEnabled());
2273 $navigation_toolbar->setFinishTestCommand($this->getFinishTestCommand());
2274 return $navigation_toolbar;
2275 }

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

+ Here is the call graph for this function:

◆ getTestPlayerTitle()

ilTestPlayerAbstractGUI::getTestPlayerTitle ( )
protected

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

3048 : string
3049 {
3050 $title_content = $this->ui_factory->listing()->property();
3051
3052 if ($this->object->getShowKioskModeParticipant()) {
3053 $pax_name_label = $this->lng->txt("conf_user_name");
3054 // this is a placeholder solution with inline html tags to differentiate the different elements
3055 // should be removed when a title component with grouping and visual weighting is available
3056 // see: https://github.com/ILIAS-eLearning/ILIAS/pull/7311
3057 $pax_name_value = $this->ui_factory->legacy()->content(
3058 sprintf(
3059 "<span class='il-test-kiosk-head__participant-name'>%s</span>",
3060 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($this->user->getFullname())
3061 )
3062 );
3063 $title_content = $title_content->withProperty($pax_name_label, $pax_name_value, false);
3064 }
3065
3066 if ($this->object->isShowExamIdInTestPassEnabled()) {
3067 $exam_id_label = $this->lng->txt("exam_id_label");
3068 $exam_id_value = ilObjTest::buildExamId(
3069 $this->test_session->getActiveId(),
3070 $this->test_session->getPass(),
3071 $this->object->getId()
3072 );
3073 $title_content = $title_content->withProperty($exam_id_label, $exam_id_value);
3074 }
3075
3076 if ($this->object->getShowKioskModeTitle()) {
3077 $test_title_label = $this->lng->txt("test");
3078 $test_title_value = $this->object->getTitle();
3079 $title_content = $title_content->withProperty($test_title_label, $test_title_value, false);
3080 }
3081
3082 return $this->ui_renderer->render($title_content);
3083 }
static buildExamId($active_id, $pass, $test_obj_id=null)

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

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 2921 of file class.ilTestPlayerAbstractGUI.php.

2921 : void
2922 {
2923 $testObj = new ilObjTest($this->ref_id, true);
2924
2925 $participants = $testObj->getActiveParticipantList();
2926 $participant = $participants->getParticipantByActiveId($this->testrequest->getActiveId());
2927 if ($participant && $participant->hasUnfinishedPasses()) {
2928 return;
2929 }
2930 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_current_run_no_longer_valid'), true);
2931 if ($with_redirect) {
2932 $this->ctrl->redirectByClass([
2933 ilRepositoryGUI::class,
2934 ilObjTestGUI::class,
2935 TestScreenGUI::class
2936 ]);
2937 }
2938 }

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 2855 of file class.ilTestPlayerAbstractGUI.php.

2855 : void
2856 {
2857 $this->updateWorkingTime();
2858 $this->saveQuestionSolution(false);
2859 $this->ctrl->redirect($this, ilTestPlayerCommands::SUBMIT_SOLUTION);
2860 }
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 2591 of file class.ilTestPlayerAbstractGUI.php.

2592 {
2593 if ($this->getAnswerChangedParameter()) {
2594 $this->saveQuestionSolution(false);
2595 } else {
2597 }
2599 }

◆ 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 2137 of file class.ilTestPlayerAbstractGUI.php.

2138 {
2145 if ($this->test_session->isPasswordChecked() === true) {
2146 return;
2147 }
2148
2149 if ($this->ctrl->getNextClass() === 'iltestpasswordprotectiongui') {
2150 return;
2151 }
2152
2153 if (!$this->password_checker->isPasswordProtectionPageRedirectRequired()) {
2154 $this->test_session->setPasswordChecked(true);
2155 return;
2156 }
2157
2158 $this->ctrl->setParameterByClass(self::class, 'lock', $this->getLockParameter());
2159
2160 $next_command = $this->ctrl->getCmdClass() . '::' . ilTestPlayerCommands::START_TEST;
2161 $this->ctrl->setParameterByClass(ilTestPasswordProtectionGUI::class, 'nextCommand', $next_command);
2162 $this->ctrl->redirectByClass(ilTestPasswordProtectionGUI::class, 'showPasswordForm');
2163 }

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 3020 of file class.ilTestPlayerAbstractGUI.php.

3020 : bool
3021 {
3022 $is_next_primary = true;
3023
3024 if ($this->object->isForceInstantFeedbackEnabled()) {
3025 $is_next_primary = false;
3026 }
3027
3028 $questions_missing_result = $this->questionrepository->getQuestionsMissingResultRecord(
3029 $this->test_session->getActiveId(),
3030 $this->test_session->getPass(),
3031 $this->test_sequence->getOrderedSequenceQuestions()
3032 );
3033
3034 if ($questions_missing_result === []) {
3035 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3036 return false;
3037 }
3038
3039 if (count($questions_missing_result) === 1
3040 && $current_question_id === current($questions_missing_result)) {
3041 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3042 return false;
3043 }
3044
3045 return $is_next_primary;
3046 }
setFinishTestButtonPrimary($finishTestButtonPrimary)

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

+ Here is the call graph for this function:

◆ handleQuestionActionCmd()

ilTestPlayerAbstractGUI::handleQuestionActionCmd ( )
protected

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

1992 {
1993 $question_id = $this->test_sequence->getQuestionForSequence(
1995 );
1996
1997 if (!$this->isParticipantsAnswerFixed($question_id)) {
1998 $this->updateWorkingTime();
1999 $this->saveQuestionSolution(false);
2000 // fau: testNav - add changed status of the question
2001 $this->setAnswerChangedParameter(true);
2002 // fau.
2003 }
2004
2005 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2006 }

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 2914 of file class.ilTestPlayerAbstractGUI.php.

2916 : void {
2917 $this->test_sequence->postponeQuestion($question_id);
2918 $this->test_sequence->saveToDb();
2919 }

◆ handleSkillTriggering()

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

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

2194 : void
2195 {
2196 $skill_evaluation = new ilTestSkillEvaluation(
2197 $this->db,
2198 $this->logger,
2199 $this->object->getTestId(),
2200 $this->object->getRefId(),
2201 $this->skills_service->profile(),
2202 $this->skills_service->personal()
2203 );
2204
2205 $skill_evaluation->setUserId($test_session->getUserId());
2206 $skill_evaluation->setActiveId($test_session->getActiveId());
2207 $skill_evaluation->setPass($test_session->getPass());
2208
2209 $skill_evaluation->setNumRequiredBookingsForSkillTriggering(
2210 $this->object->getGlobalSettings()->getSkillTriggeringNumberOfAnswers()
2211 );
2212
2213 $question_list = $this->buildTestPassQuestionList();
2214 $question_list->load();
2215 $skill_evaluation->init($question_list);
2216 $skill_evaluation->evaluate(
2217 $this->object->getTestResult(
2218 $test_session->getActiveId(),
2220 true
2221 )
2222 );
2223
2224 $skill_evaluation->handleSkillTriggering();
2225 }

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 3014 of file class.ilTestPlayerAbstractGUI.php.

3014 : void
3015 {
3016 $this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_objective_oriented_test_pass_without_questions'), $this->object->getTitle()), true);
3017 $this->ctrl->redirectByClass(ilObjTestGUI::class);
3018 }

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 2665 of file class.ilTestPlayerAbstractGUI.php.

2665 : void
2666 {
2667 $this->logger->error(
2668 "INV SEQ:"
2669 . "active={$this->test_session->getActiveId()} "
2670 . "qId=$question_id seq=$sequence_element "
2671 . serialize($this->test_sequence)
2672 );
2673
2674 $this->ctrl->setParameter($this, 'sequence', $this->test_sequence->getFirstSequence());
2675 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2676 }

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 814 of file class.ilTestPlayerAbstractGUI.php.

815 {
816 if ($this->object->getNrOfTries() != 1
817 && $this->object->getUsePreviousAnswers() == 1
818 ) {
819 $chb_use_previous_answers = 0;
820 if ($this->post_wrapper->has('chb_use_previous_answers')) {
821 $chb_use_previous_answers = $this->post_wrapper->retrieve(
822 'chb_use_previous_answers',
823 $this->refinery->kindlyTo()->int()
824 );
825 }
826 $this->user->writePref("tst_use_previous_answers", (string) $chb_use_previous_answers);
827 }
828 }

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 2186 of file class.ilTestPlayerAbstractGUI.php.

2187 {
2188 $this->ass_settings = new ilSetting('assessment');
2189 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

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

278 {
280 $process_lockerFactory = new ilTestProcessLockerFactory($this->ass_settings, $ilDB, $this->logger);
281 $this->process_locker = $process_lockerFactory->withContextId((int) $activeId)->getLocker();
282 }
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 775 of file class.ilTestPlayerAbstractGUI.php.

776 {
777 if ($this->test_session->isAnonymousUser()
778 && !$this->test_session->doesAccessCodeInSessionExists()) {
779 $access_code = $this->test_session->createNewAccessCode();
780
781 $this->test_session->setAccessCodeToSession($access_code);
782 $this->test_session->setAnonymousId($access_code);
783 $this->test_session->saveToDb();
784
785 $this->ctrl->redirect($this, ilTestPlayerCommands::DISPLAY_ACCESS_CODE);
786 }
787
788 if (!$this->test_session->isAnonymousUser()) {
789 $this->test_session->unsetAccessCodeInSession();
790 }
791 $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
792 }

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 2109 of file class.ilTestPlayerAbstractGUI.php.

2110 {
2111 $onload_js = <<<JS
2112 let key_event = (event) => {
2113 if( event.key === 13 && event.target.tagName.toLowerCase() === "a" ) {
2114 return;
2115 }
2116 if (event.key === 13 &&
2117 event.target.tagName.toLowerCase() !== "textarea" &&
2118 (event.target.tagName.toLowerCase() !== "input" || event.target.type.toLowerCase() !== "submit")) {
2119 event.preventDefault();
2120 }
2121 };
2122
2123 let form = document.getElementById('taForm');
2124 form.onkeyup = key_event;
2125 form.onkeydown = key_event;
2126 form.onkeypress = key_event;
2127JS;
2128 $this->tpl->addOnLoadCode($onload_js);
2129 $this->tpl->addBlockFile(
2130 $this->getContentBlockName(),
2131 'adm_content',
2132 'tpl.il_as_tst_output.html',
2133 'components/ILIAS/Test'
2134 );
2135 }
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 2658 of file class.ilTestPlayerAbstractGUI.php.

2659 {
2660 $question_obj->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2661 $this->object->isPreviousSolutionReuseEnabled()
2662 );
2663 }

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

+ Here is the call graph for this function:

◆ isFirstQuestionInSequence()

ilTestPlayerAbstractGUI::isFirstQuestionInSequence (   $sequence_element)
protected

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

1981 : bool
1982 {
1983 return $sequence_element == $this->test_sequence->getFirstSequence();
1984 }

◆ isFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::isFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

2766 {
2767 if (ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM) == null) {
2768 return false;
2769 }
2770
2771 return ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2772 }

References ilSession\get().

+ Here is the call graph for this function:

◆ isForcedFeedbackNavUrlRegistered()

ilTestPlayerAbstractGUI::isForcedFeedbackNavUrlRegistered ( )
protected

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

2841 : bool
2842 {
2843 return $this->getRegisteredForcedFeedbackNavUrl() !== null;
2844 }

◆ isLastQuestionInSequence()

ilTestPlayerAbstractGUI::isLastQuestionInSequence (   $sequence_element)
protected

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

1986 : bool
1987 {
1988 return $sequence_element == $this->test_sequence->getLastSequence();
1989 }

◆ isMaxProcessingTimeReached()

ilTestPlayerAbstractGUI::isMaxProcessingTimeReached ( )

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

440 : bool
441 {
442 $active_id = $this->test_session->getActiveId();
443 $starting_time = $this->object->getStartingTimeOfUser($active_id);
444 if ($starting_time === false) {
445 return false;
446 } else {
447 return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
448 }
449 }

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

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

1718 : bool
1719 {
1720 return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->test_session->getPass());
1721 }

◆ isOptionalQuestionAnsweringConfirmationRequired()

ilTestPlayerAbstractGUI::isOptionalQuestionAnsweringConfirmationRequired ( int  $sequence_key)
protected

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

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

◆ isParticipantsAnswerFixed()

ilTestPlayerAbstractGUI::isParticipantsAnswerFixed (   $question_id)
protected

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

2165 : bool
2166 {
2167 if ($this->object->isInstantFeedbackAnswerFixationEnabled()) {
2168 return $this->test_sequence->isQuestionChecked($question_id);
2169 }
2170
2171 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2172 return $this->isForcedFeedbackNavUrlRegistered() || $this->test_sequence->isNextQuestionPresented($question_id);
2173 }
2174
2175 return false;
2176 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ isShowingPostponeStatusReguired()

ilTestPlayerAbstractGUI::isShowingPostponeStatusReguired ( int  $question_id)
protected

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

1189 : bool
1190 {
1191 return $this->test_sequence->isPostponedQuestion($question_id);
1192 }

◆ isTestAccessible()

ilTestPlayerAbstractGUI::isTestAccessible ( )

test accessible returns true if the user can perform the test

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

1707 : bool
1708 {
1709 return !$this->isNrOfTriesReached()
1710 and !$this->isMaxProcessingTimeReached()
1711 and $this->object->startingTimeReached()
1712 and !$this->object->endingTimeReached();
1713 }
endingTimeReached()
handle endingTimeReached

◆ isValidSequenceElement()

ilTestPlayerAbstractGUI::isValidSequenceElement (   $sequence_element)
private

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

2867 : bool
2868 {
2869 if ($sequence_element === false) {
2870 return false;
2871 }
2872
2873 if ($sequence_element < 1) {
2874 return false;
2875 }
2876
2877 if (!$this->test_sequence->getPositionOfSequence($sequence_element)) {
2878 return false;
2879 }
2880
2881 return true;
2882 }

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

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

940 : void
941 {
943 $this->markQuestionCmd();
944 }
markQuestionCmd()
Set a question solved.

◆ markQuestionCmd()

ilTestPlayerAbstractGUI::markQuestionCmd ( )
protected

Set a question solved.

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

949 : void
950 {
951 $question_id = $this->test_sequence->getQuestionForSequence(
953 );
954
955 $this->object->setQuestionSetSolved(1, $question_id, $this->test_session->getUserId());
956
957 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
958 }

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 1745 of file class.ilTestPlayerAbstractGUI.php.

1746 {
1747 $this->suspendTestCmd();
1748 }

◆ nextQuestionCmd()

ilTestPlayerAbstractGUI::nextQuestionCmd ( )
protected

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

2040 {
2041 $this->handleCheckTestPassValid();
2042 $last_sequence_element = $this->getCurrentSequenceElement();
2043 $next_sequence_element = $this->test_sequence->getNextSequence($last_sequence_element);
2044
2045 $question_id = $this->test_sequence->getQuestionForSequence($last_sequence_element);
2046 $is_worked_through = $this->questionrepository->lookupResultRecordExist(
2047 $this->test_session->getActiveId(),
2048 $question_id,
2049 $this->test_session->getPass()
2050 );
2051
2052 if (!$is_worked_through) {
2053 if ($this->logger->isLoggingEnabled()
2054 && !$this->getObject()->getAnonymity()) {
2055 $this->logger->logParticipantInteraction(
2056 $this->logger->getInteractionFactory()->buildParticipantInteraction(
2057 $this->object->getRefId(),
2058 $question_id,
2059 $this->user->getId(),
2060 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
2061 TestParticipantInteractionTypes::QUESTION_SKIPPED,
2062 []
2063 )
2064 );
2065 }
2066 if ($this->object->isPostponingEnabled()) {
2067 $this->handleQuestionPostponing($question_id);
2068 }
2069 }
2070
2071 if (!$this->isValidSequenceElement($next_sequence_element)) {
2072 $next_sequence_element = $this->test_sequence->getFirstSequence();
2073 }
2074
2075 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
2076 $this->ctrl->setParameter($this, 'pmode', '');
2077
2078 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2079 }

References 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 1927 of file class.ilTestPlayerAbstractGUI.php.

1927 : void
1928 {
1929 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "components/ILIAS/Test");
1930
1931 $this->tpl->setCurrentBlock("ContentStyle");
1932 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1933 $this->tpl->parseCurrentBlock();
1934
1935 $this->tpl->setCurrentBlock("SyntaxStyle");
1936 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1937 $this->tpl->parseCurrentBlock();
1938
1939 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css"), "print");
1940 if ($this->object->getShowSolutionAnswersOnly()) {
1941 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css"), "print");
1942 }
1943
1944 $this->tpl->setCurrentBlock("adm_content");
1945 $solution = $this->getCorrectSolutionOutput($this->testrequest->raw("evaluation"), $this->testrequest->raw("active_id"), $this->testrequest->raw("pass"));
1946 $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1947 $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1948 $this->ctrl->saveParameter($this, "pass");
1949 $this->ctrl->saveParameter($this, "active_id");
1950 $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1951 $this->tpl->parseCurrentBlock();
1952 }
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 1773 of file class.ilTestPlayerAbstractGUI.php.

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

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 1866 of file class.ilTestPlayerAbstractGUI.php.

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

1973 {
1974 $this->ctrl->redirectByClass(
1975 [ilRepositoryGUI::class, ilObjTestGUI::class, ilTestEvaluationGUI::class],
1976 "outUserResultsOverview"
1977 );
1978 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ performTearsAndAngerBrokenConfessionChecks()

ilTestPlayerAbstractGUI::performTearsAndAngerBrokenConfessionChecks ( )
protected

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

2940 : bool
2941 {
2942 if ($this->test_session->getActiveId() > 0) {
2943 if ($this->test_sequence->hasRandomQuestionsForPass($this->test_session->getActiveId(), $this->test_session->getPass()) > 0) {
2944 $this->logger->info(
2945 __METHOD__ . ' Random Questions allready exists for user ' .
2946 $this->user->getId() . ' in test ' . $this->object->getTestId()
2947 );
2948
2949 return true;
2950 }
2951 } else {
2952 $this->logger->info(__METHOD__ . ' ' . sprintf(
2953 $this->lng->txt("error_random_question_generation"),
2954 $this->user->getId(),
2955 $this->object->getTestId()
2956 ));
2957
2958 return true;
2959 };
2960
2961 return false;
2962 }

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 1016 of file class.ilTestPlayerAbstractGUI.php.

1016 : void
1017 {
1019 $this->test_session,
1020 $this->object,
1021 $this->test_result_repository
1022 ))->performFinishTasks($this->process_locker, $status_of_attempt);
1023 $this->test_result_repository->updateTestResultCache($this->test_session->getActiveId());
1024 }
Class ilTestPassFinishTasks.

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

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

668 {
669 $this->tpl->setCurrentBlock("ContentStyle");
670 $this->tpl->setVariable(
671 "LOCATION_CONTENT_STYLESHEET",
673 );
674 $this->tpl->parseCurrentBlock();
675 }

References ilObjStyleSheet\getContentStylePath().

+ Here is the call graph for this function:

◆ populateDiscardSolutionModal()

ilTestPlayerAbstractGUI::populateDiscardSolutionModal ( )
protected

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

2703 : Signal
2704 {
2705 $modal = $this->ui_factory->modal()->interruptive(
2706 $this->lng->txt('discard_answer'),
2707 $this->lng->txt('discard_answer_confirmation'),
2708 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DISCARD_SOLUTION)
2709 )->withActionButtonLabel($this->lng->txt('discard_answer'));
2710
2711 $this->tpl->setCurrentBlock('discard_solution_modal');
2712 $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $this->ui_renderer->render($modal));
2713 $this->tpl->parseCurrentBlock();
2714 return $modal->getShowSignal();
2715 }

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

+ Here is the call graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

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

2500 {
2501 if ($withFocusAnchor) {
2502 $this->tpl->setCurrentBlock('inst_resp_id');
2503 $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
2504 $this->tpl->parseCurrentBlock();
2505 }
2506
2507 $this->tpl->setCurrentBlock('instant_response_header');
2508 $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
2509 $this->tpl->parseCurrentBlock();
2510 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateFeedbackBlockMessage()

ilTestPlayerAbstractGUI::populateFeedbackBlockMessage ( string  $a_message)
protected

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

2513 {
2514 $this->tpl->setCurrentBlock('instant_response_message');
2515 $this->tpl->setVariable('INSTANT_RESPONSE_MESSAGE', $a_message);
2516 $this->tpl->parseCurrentBlock();
2517 }

◆ populateGenericFeedbackBlock()

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

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

614 : bool
615 {
616 // fix #031263: add pass
617 $feedback = $question_gui->getGenericFeedbackOutput($this->test_session->getActiveId(), $this->test_session->getPass());
618
619 if (strlen($feedback)) {
620 $cssClass = (
621 $solutionCorrect ?
623 );
624
625 $this->tpl->setCurrentBlock("answer_feedback");
626 $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
627 $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
628 $this->tpl->parseCurrentBlock();
629 return true;
630 }
631 return false;
632 }
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 2263 of file class.ilTestPlayerAbstractGUI.php.

2264 {
2265 $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
2266 }

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 2422 of file class.ilTestPlayerAbstractGUI.php.

2423 {
2424 $response_available = false;
2425 $jump_to_response = false;
2426
2427 // This controls if the solution should be shown.
2428 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2429 if ($this->object->getInstantFeedbackSolution()) {
2430 $show_question_inline_score = $this->determineInlineScoreDisplay();
2431
2432 // Notation of the params prior to getting rid of this crap in favor of a class
2433 $solutionoutput = $question_gui->getSolutionOutput(
2434 $this->test_session->getActiveId(), #active_id
2435 $this->test_session->getPass(), #pass
2436 false, #graphical_output
2437 $show_question_inline_score, #result_output
2438 true, #show_question_only
2439 false, #show_feedback
2440 true, #show_correct_solution
2441 false, #show_manual_scoring
2442 false #show_question_text
2443 );
2444 $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
2445 $this->populateSolutionBlock($solutionoutput);
2446 $response_available = true;
2447 $jump_to_response = true;
2448 }
2449
2450 $reachedPoints = $question_gui->getObject()->getAdjustedReachedPoints(
2451 $this->test_session->getActiveId(),
2452 ilObjTest::_getPass($this->test_session->getActiveId()),
2453 $authorizedSolution
2454 );
2455
2456 $maxPoints = $question_gui->getObject()->getMaximumPoints();
2457
2458 $solutionCorrect = ($reachedPoints == $maxPoints);
2459
2460 // This controls if the score should be shown.
2461 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
2462 if ($this->object->getAnswerFeedbackPoints()) {
2463 $this->populateScoreBlock($reachedPoints, $maxPoints);
2464 $response_available = true;
2465 $jump_to_response = true;
2466 }
2467
2468 // This controls if the generic feedback should be shown.
2469 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2470 if ($this->object->getGenericAnswerFeedback()) {
2471 if ($this->populateGenericFeedbackBlock($question_gui, $solutionCorrect)) {
2472 $response_available = true;
2473 $jump_to_response = true;
2474 }
2475 }
2476
2477 // This controls if the specific feedback should be shown.
2478 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
2479 if ($this->object->getSpecificAnswerFeedback()) {
2480 if ($question_gui->hasInlineFeedback()) {
2481 // Don't jump to the feedback below the question if some feedback is shown within the question
2482 $jump_to_response = false;
2483 } elseif ($this->populateSpecificFeedbackBlock($question_gui)) {
2484 $response_available = true;
2485 $jump_to_response = true;
2486 }
2487 }
2488
2489 $this->populateFeedbackBlockHeader($jump_to_response);
2490 if (!$response_available) {
2491 if ($question_gui->hasInlineFeedback()) {
2492 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_is_given_inline'));
2493 } else {
2494 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_not_available_for_answer'));
2495 }
2496 }
2497 }
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 2365 of file class.ilTestPlayerAbstractGUI.php.

2365 : void
2366 {
2367 $question_gui->setNavigationGUI(null);
2368 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
2369
2370 $answer_feedback_enabled = $this->object->getSpecificAnswerFeedback();
2371
2372 $solutionoutput = $question_gui->getSolutionOutput(
2373 $this->test_session->getActiveId(), #active_id
2374 $this->test_session->getPass(), #pass
2375 false, #graphical_output
2376 false, #result_output
2377 true, #show_question_only
2378 $answer_feedback_enabled, #show_feedback
2379 false, #show_correct_solution
2380 false, #show_manual_scoring
2381 true #show_question_text
2382 );
2383
2384 $pageoutput = $question_gui->outQuestionPage(
2385 "",
2386 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
2387 $this->test_session->getActiveId(),
2388 $solutionoutput
2389 );
2390
2391 $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'components/ILIAS/Test');
2392
2393 // populate the instant response blocks in the
2394 $saved_tpl = $this->tpl;
2395 $this->tpl = $tpl;
2396 $this->populateInstantResponseBlocks($question_gui, true);
2397 $this->tpl = $saved_tpl;
2398
2399 $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
2400 $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $this->getQuestionFeedbackModalHtml($tpl, $nav_url));
2401 }
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 ILIAS\News\Common\Table\$tpl, assQuestionGUI\getObject(), assQuestionGUI\getQuestionHeaderBlockBuilder(), assQuestionGUI\getSolutionOutput(), assQuestionGUI\outQuestionPage(), assQuestionGUI\setNavigationGUI(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ populateLowerNextButtonBlock()

ilTestPlayerAbstractGUI::populateLowerNextButtonBlock (   $primary_next)
protected

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

504 : void
505 {
506 $button = $this->buildNextButtonInstance($primary_next);
507
508 $this->tpl->setCurrentBlock("next_bottom");
509 $this->tpl->setVariable("BTN_NEXT_BOTTOM", $this->ui_renderer->render($button));
510 $this->tpl->parseCurrentBlock();
511 }

◆ populateLowerPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateLowerPreviousButtonBlock ( )
protected

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

523 {
524 $button = $this->buildPreviousButtonInstance();
525
526 $this->tpl->setCurrentBlock("prev_bottom");
527 $this->tpl->setVariable("BTN_PREV_BOTTOM", $this->ui_renderer->render($button));
528 $this->tpl->parseCurrentBlock();
529 }

◆ populateMessageContent()

ilTestPlayerAbstractGUI::populateMessageContent ( string  $content_html)
protected

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

2678 : void
2679 {
2680 if ($this->object->getKioskMode()) {
2681 $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "components/ILIAS/Test");
2682 $this->tpl->setContent($content_html);
2683 return;
2684 }
2685 $this->tpl->setVariable($this->getContentBlockName(), $content_html);
2686 }

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 2691 of file class.ilTestPlayerAbstractGUI.php.

2691 : array
2692 {
2693 $signals = [self::DISCARD_MODAL => $this->populateDiscardSolutionModal()];
2694
2695 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2698 }
2699
2700 return $signals;
2701 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ populateNextButtons()

ilTestPlayerAbstractGUI::populateNextButtons (   $primary_next)
protected

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

498 : void
499 {
500 $this->populateUpperNextButtonBlock($primary_next);
501 $this->populateLowerNextButtonBlock($primary_next);
502 }

◆ populateNextLocksChangedModal()

ilTestPlayerAbstractGUI::populateNextLocksChangedModal ( )
protected

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

2731 : Signal
2732 {
2733 $empty_signal = new \ILIAS\UI\Implementation\Component\Signal('');
2735 return $empty_signal;
2736 }
2737
2738 $modal_message = $this->ui_factory->messageBox()->confirmation(
2739 $this->lng->txt('tst_nav_next_locks_current_answer_confirm')
2740 );
2741 $modal_checkbox = $this->ui_factory->input()->field()->checkbox(
2742 $this->lng->txt('tst_dont_show_msg_again_in_current_session')
2743 )->withDedicatedName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2744
2745 $modal = $this->ui_factory->modal()->roundtrip(
2746 $this->lng->txt('tst_nav_next_locks_current_answer_header'),
2747 $modal_message,
2748 [ $modal_checkbox ],
2749 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksChanged()'
2750 )->withSubmitLabel($this->lng->txt('tst_proceed'));
2751
2752 $this->tpl->setCurrentBlock('next_locks_changed_modal');
2753 $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $this->ui_renderer->render($modal));
2754 $this->tpl->parseCurrentBlock();
2755 return $modal->getShowSignal();
2756 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

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

2717 : Signal
2718 {
2719 $modal = $this->ui_factory->modal()->interruptive(
2720 $this->lng->txt('tst_nav_next_locks_empty_answer_header'),
2721 $this->lng->txt('tst_nav_next_locks_empty_answer_confirm'),
2722 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksUnchanged()'
2723 )->withActionButtonLabel($this->lng->txt('tst_proceed'));
2724
2725 $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2726 $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $this->ui_renderer->render($modal));
2727 $this->tpl->parseCurrentBlock();
2728 return $modal->getShowSignal();
2729 }

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 2774 of file class.ilTestPlayerAbstractGUI.php.

2774 : void
2775 {
2776 $config = [];
2777 $state = $question_gui->getObject()->lookupForExistingSolutions($this->test_session->getActiveId(), $this->test_session->getPass());
2778 $config['isAnswered'] = $state['authorized'];
2779 $config['isAnswerChanged'] = $state['intermediate'] || $this->getAnswerChangedParameter();
2780 $config['isAnswerFixed'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2781 $config['saveOnTimeReachedUrl'] = str_replace('&amp;', '&', $this->ctrl->getFormAction($this, ilTestPlayerCommands::AUTO_SAVE_ON_TIME_LIMIT));
2782
2783 $config['autosaveUrl'] = '';
2784 $config['autosaveInterval'] = 0;
2785 if ($question_gui->getObject() instanceof QuestionAutosaveable && $this->object->getAutosave()) {
2786 $config['autosaveUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AUTO_SAVE, '', true);
2787 $config['autosaveInterval'] = $this->object->getMainSettings()->getQuestionBehaviourSettings()->getAutosaveInterval();
2788 }
2789
2790 $question_config = $question_gui->getObject()->getTestPresentationConfig();
2791
2792 $config['withFormChangeDetection'] = $question_config->isFormChangeDetectionEnabled();
2793
2794 // Flash and Java questions: changes are directly sent to ilias and have to be polled from there
2795 $config['withBackgroundChangeDetection'] = $question_config->isBackgroundChangeDetectionEnabled();
2796 $config['backgroundDetectorUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DETECT_CHANGES, '', true);
2797
2798 // Forced feedback will change the navigation saving command
2799 $config['forcedInstantFeedback'] = $this->object->isForceInstantFeedbackEnabled();
2800 $config['questionLocked'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2801 $config['nextQuestionLocks'] = $this->object->isFollowupQuestionAnswerFixationEnabled();
2802 $config['autosaveFailureMessage'] = $this->lng->txt('autosave_failed');
2803
2804 // Add the modal signals and parameter name for the follow-up question locks confirmation
2805 $config['modalSignals'] = array_map(fn(Signal $signal) => $signal->getId(), $this->modal_signals);
2806 $config['preventConfirmationParam'] = self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM;
2807
2808 $this->tpl->addJavascript('assets/js/ilTestPlayerQuestionEditControl.js');
2809 $this->tpl->addOnLoadCode('il.TestPlayerQuestionEditControl.init(' . json_encode($config) . ')');
2810 }
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 481 of file class.ilTestPlayerAbstractGUI.php.

481 : void
482 {
483 if (!$this->isFirstQuestionInSequence($sequence_element)) {
485 }
486
487 if (!$this->isLastQuestionInSequence($sequence_element)) {
488 $this->populateNextButtons($primary_next);
489 }
490 }

◆ populateQuestionOptionalMessage()

ilTestPlayerAbstractGUI::populateQuestionOptionalMessage ( )
abstractprotected

◆ populateScoreBlock()

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

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

635 {
636 $scoreInformation = sprintf(
637 $this->lng->txt("you_received_a_of_b_points"),
638 $reachedPoints,
639 $maxPoints
640 );
641
642 $this->tpl->setCurrentBlock("received_points_information");
643 $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
644 $this->tpl->parseCurrentBlock();
645 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

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

648 {
649 if (strlen($solutionoutput)) {
650 $this->tpl->setCurrentBlock("solution_output");
651 $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
652 $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
653 $this->tpl->parseCurrentBlock();
654 }
655 }

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 591 of file class.ilTestPlayerAbstractGUI.php.

591 : bool
592 {
593 $solutionValues = $question_gui->getObject()->getSolutionValues(
594 $this->test_session->getActiveId(),
595 null
596 );
597
598 $feedback = $question_gui->getSpecificFeedbackOutput(
599 $question_gui->getObject()->fetchIndexedValuesFromValuePairs($solutionValues)
600 );
601
602 if (!empty($feedback)) {
603 $this->tpl->setCurrentBlock("specific_feedback");
604 $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
605 $this->tpl->parseCurrentBlock();
606 return true;
607 }
608 return false;
609 }
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 657 of file class.ilTestPlayerAbstractGUI.php.

658 {
659 $this->tpl->setCurrentBlock("SyntaxStyle");
660 $this->tpl->setVariable(
661 "LOCATION_SYNTAX_STYLESHEET",
663 );
664 $this->tpl->parseCurrentBlock();
665 }

References ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ populateTestNavigationToolbar()

ilTestPlayerAbstractGUI::populateTestNavigationToolbar ( ilTestNavigationToolbarGUI  $toolbar_gui)
protected

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

461 : void
462 {
463 $this->tpl->setCurrentBlock('test_nav_toolbar');
464 $this->tpl->setVariable('TEST_NAV_TOOLBAR', $toolbar_gui->getHTML());
465 $this->tpl->parseCurrentBlock();
466
467 if ($this->finish_test_modal === null) {
468 return;
469 }
470
471 $this->tpl->setCurrentBlock('finish_test_modal');
472 $this->tpl->setVariable(
473 'FINISH_TEST_MODAL',
474 $this->ui_renderer->render(
475 $this->finish_test_modal->withOnLoad($this->finish_test_modal->getShowSignal())
476 )
477 );
478 $this->tpl->parseCurrentBlock();
479 }

◆ populateUpperNextButtonBlock()

ilTestPlayerAbstractGUI::populateUpperNextButtonBlock (   $primaryNext)
protected

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

514 {
515 $button = $this->buildNextButtonInstance($primaryNext);
516
517 $this->tpl->setCurrentBlock("next");
518 $this->tpl->setVariable("BTN_NEXT", $this->ui_renderer->render($button));
519 $this->tpl->parseCurrentBlock();
520 }

◆ populateUpperPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateUpperPreviousButtonBlock ( )
protected

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

532 {
533 $button = $this->buildPreviousButtonInstance();
534
535 $this->tpl->setCurrentBlock("prev");
536 $this->tpl->setVariable("BTN_PREV", $this->ui_renderer->render($button));
537 $this->tpl->parseCurrentBlock();
538 }

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

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

2100 {
2101 $this->tpl->addBlockFile(
2102 $this->getContentBlockName(),
2103 'adm_content',
2104 'tpl.il_as_tst_question_summary.html',
2105 'components/ILIAS/Test'
2106 );
2107 }

◆ prepareTestPage()

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

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

1119 {
1120 $this->navigation_history->addItem(
1121 $this->test_session->getRefId(),
1122 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::RESUME_PLAYER),
1123 'tst'
1124 );
1125
1126 $this->initTestPageTemplate();
1128 $this->populateSyntaxStyleBlock();
1129
1130 if ($this->isMaxProcessingTimeReached()) {
1132 return;
1133 }
1134
1135 if ($this->object->endingTimeReached()) {
1136 $this->endingTimeReached();
1137 return;
1138 }
1139
1140 if ($this->isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)) {
1141 $this->ctrl->setParameter($this, "sequence", $sequenceElement);
1143 return;
1144 }
1145
1146 $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId());
1147 $this->tpl->setVariable("LOGIN", $this->user->getLogin());
1148
1149 $this->tpl->setVariable("SEQ_ID", $sequenceElement);
1150 $this->tpl->setVariable("QUEST_ID", $question_id);
1151
1152 if ($this->object->getEnableProcessingTime()) {
1153 $this->outProcessingTime($this->test_session->getActiveId(), false);
1154 }
1155
1156 $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1157
1158 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
1159 $this->tpl->setCurrentBlock('exam_id_footer');
1160 $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1161 $this->test_session->getActiveId(),
1162 $this->test_session->getPass(),
1163 $this->object->getId()
1164 ));
1165 $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1166 $this->tpl->parseCurrentBlock();
1167 }
1168
1169 if ($this->object->getListOfQuestions()) {
1170 $this->showSideList($sequenceElement);
1171 }
1172 }
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 2081 of file class.ilTestPlayerAbstractGUI.php.

2082 {
2083 $this->handleCheckTestPassValid();
2084
2085 $sequence_element = $this->test_sequence->getPreviousSequence(
2087 );
2088
2089 if (!$this->isValidSequenceElement($sequence_element)) {
2090 $sequence_element = $this->test_sequence->getLastSequence();
2091 }
2092
2093 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
2094 $this->ctrl->setParameter($this, 'pmode', '');
2095
2096 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2097 }

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 834 of file class.ilTestPlayerAbstractGUI.php.

834 : void
835 {
836 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_DURATION);
837
838 $this->redirectAfterFinish();
839 }

◆ redirectAfterFinish()

ilTestPlayerAbstractGUI::redirectAfterFinish ( )
protected

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

848 : void
849 {
850 $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
851
852 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "components/ILIAS/Test");
853 $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
854 $this->tpl->setVariable("URL", $url);
855 }

References 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 841 of file class.ilTestPlayerAbstractGUI.php.

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

◆ redirectBackCmd()

ilTestPlayerAbstractGUI::redirectBackCmd ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl ( string  $forced_feedback_nav_url)
protected

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

2818 : void
2819 {
2820 if (ilSession::get('forced_feedback_navigation_url') == null) {
2821 ilSession::set('forced_feedback_navigation_url', []);
2822 }
2823 $forced_feeback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2824 $forced_feeback_navigation_url[$this->test_session->getActiveId()] = $forced_feedback_nav_url;
2825 ilSession::set('forced_feedback_navigation_url', $forced_feeback_navigation_url);
2826 }

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

+ Here is the call graph for this function:

◆ removeIntermediateSolution()

ilTestPlayerAbstractGUI::removeIntermediateSolution ( )

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

316 : void
317 {
318 $question_id = $this->getCurrentQuestionId();
319
320 $this->getQuestionInstance($question_id)->removeIntermediateSolution(
321 $this->test_session->getActiveId(),
322 $this->test_session->getPass()
323 );
324 }

References getCurrentQuestionId(), and getQuestionInstance().

+ Here is the call graph for this function:

◆ resumePlayerCmd()

ilTestPlayerAbstractGUI::resumePlayerCmd ( )
protected

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

728 {
729 $this->handleUserSettings();
730
731 $active_id = $this->test_session->getActiveId();
732 $this->ctrl->setParameter($this, "active_id", $active_id);
733
734 $active_time_id = $this->object->startWorkingTime($active_id, $this->test_session->getPass());
735 ilSession::set("active_time_id", $active_time_id);
736 ilSession::set('tst_pass_finish', 0);
737
738 if ($this->object->isRandomTest()) {
739 if (!$this->test_sequence->hasRandomQuestionsForPass($active_id, $this->test_session->getPass())) {
740 // create a new set of random questions
742 }
743 }
744
745 $shuffle = $this->object->getShuffleQuestions();
746 if ($this->object->isRandomTest()) {
747 $shuffle = false;
748 }
749
750 $this->test_result_repository->updateTestAttemptResult(
751 $active_id,
752 $this->test_session->getPass(),
753 null,
754 $this->object->getId()
755 );
756
757 // ensure existing test sequence
758 if (!$this->test_sequence->hasSequence()) {
759 $this->test_sequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
760 $this->test_sequence->saveToDb();
761 }
762
763 if ($this->object->getListOfQuestionsStart()) {
764 $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY);
765 }
766
767 $this->ctrl->setParameter($this, 'sequence', $this->test_session->getLastSequence());
768 $this->ctrl->setParameter($this, 'pmode', '');
769 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
770 }
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 1530 of file class.ilTestPlayerAbstractGUI.php.

1531 {
1533 $this->setAnswerChangedParameter(false);
1534 $this->ctrl->saveParameter($this, 'sequence');
1535 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1536 }

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 394 of file class.ilTestPlayerAbstractGUI.php.

394 : bool
395 {
396 $active_id = $this->test_session->getActiveId();
397 $pass = ilObjTest::_getPass($active_id);
398 if (!$question_obj->persistWorkingState(
399 $active_id,
400 $pass,
401 $authorized
402 )) {
403 return false;
404 }
405
406 if ($authorized && $this->test_session->isObjectiveOriented()) {
407 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->test_session);
408 $objectivesAdapter->updateQuestionResult($this->test_session, $question_obj);
409 }
410
411 if ($authorized && $this->object->isSkillServiceToBeConsidered()) {
412 $this->handleSkillTriggering($this->test_session);
413 }
414
415 if ($authorized && $this->logger->isLoggingEnabled()
416 && !$this->getObject()->getAnonymity()
417 && ($interaction = $question_obj->answerToParticipantInteraction(
418 $this->logger->getAdditionalInformationGenerator(),
419 $this->getObject()->getRefId(),
420 $active_id,
421 $pass,
422 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
423 TestParticipantInteractionTypes::ANSWER_SUBMITTED
424 )) !== null) {
425 $this->logger->logParticipantInteraction($interaction);
426 }
427 return true;
428 }
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 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 2601 of file class.ilTestPlayerAbstractGUI.php.

2601 : void
2602 {
2603 if ($this->testrequest->retrieveBoolFromPost('save_on_navigation_prevent_confirmation')) {
2604 ilSession::set('save_on_navigation_prevent_confirmation', true);
2605 }
2606
2607 if ($this->testrequest->retrieveBoolFromPost(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM)) {
2608 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2609 }
2610 }

References ilSession\set().

+ Here is the call graph for this function:

◆ saveQuestionSolution()

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

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

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

291 {
292 $tagging_gui = new ilTaggingGUI();
293 $tagging_gui->setObject($this->object->getId(), $this->object->getType());
294 $tagging_gui->saveInput();
295 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
296 }
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 682 of file class.ilTestPlayerAbstractGUI.php.

682 : void
683 {
684 if ($this->test_session->isAnonymousUser()) {
685 $this->test_session->setAccessCodeToSession($this->testrequest->strVal('anonymous_id'));
686 }
687
688 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
689 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setAnswerChangedParameter()

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

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

2587 {
2588 $this->ctrl->setParameter($this, 'test_answer_changed', $changed ? '1' : '0');
2589 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

2761 {
2762 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2763 }

References ilSession\set().

+ Here is the call graph for this function:

◆ showAnswerOptionalQuestionsConfirmation()

ilTestPlayerAbstractGUI::showAnswerOptionalQuestionsConfirmation ( )
protected

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

2228 {
2229 $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
2230
2231 $confirmation->setFormAction($this->ctrl->getFormAction($this));
2232 $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
2233 $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
2234
2235 $confirmation->build($this->object->isFixedTest());
2236
2237 $this->populateHelperGuiContent($confirmation);
2238 }

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 1094 of file class.ilTestPlayerAbstractGUI.php.

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

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 2008 of file class.ilTestPlayerAbstractGUI.php.

2009 {
2010 $question_id = $this->test_sequence->getQuestionForSequence(
2012 );
2013
2014 if (!$this->isParticipantsAnswerFixed($question_id)) {
2015 if ($this->saveQuestionSolution(true)) {
2017 $this->setAnswerChangedParameter(false);
2018 } else {
2019 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2020 }
2021 $this->test_sequence->setQuestionChecked($question_id);
2022 $this->test_sequence->saveToDb();
2023 } elseif ($this->object->isForceInstantFeedbackEnabled()) {
2024 $this->test_sequence->setQuestionChecked($question_id);
2025 $this->test_sequence->saveToDb();
2026 }
2027
2028 $this->ctrl->setParameter($this, 'instresp', 1);
2029
2030 // fau: testNav - handle navigation after feedback
2031 if ($this->getNavigationUrlParameter()) {
2034 }
2035 // fau.
2036 $this->ctrl->redirectByClass(static::class, ilTestPlayerCommands::SHOW_QUESTION);
2037 }
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:

◆ showQuestionCmd()

ilTestPlayerAbstractGUI::showQuestionCmd ( )
protected

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

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

1243 : void {
1244 $question_navigation_gui = $this->buildEditableStateQuestionNavigationGUI($question_gui->getObject()->getId());
1245 $question_navigation_gui->setQuestionWorkedThrough($is_question_worked_through);
1246 if ($is_question_worked_through) {
1247 $question_navigation_gui->setDiscardSolutionButtonEnabled(true);
1248 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
1249 } elseif ($this->object->isPostponingEnabled()) {
1250 $question_navigation_gui->setSkipQuestionLinkTarget(
1251 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION)
1252 );
1253 }
1254 $question_gui->setNavigationGUI($question_navigation_gui);
1255
1256 $user_post_solution = false;
1257 if ($this->testrequest->isset('save_error')
1258 && $this->testrequest->int('save_error') === 1
1259 && ilSession::get('previouspost') !== null) {
1260 $user_post_solution = ilSession::get('previouspost');
1261 ilSession::clear('previouspost');
1262 }
1263
1264 $question_config = $question_gui->getObject()->getTestPresentationConfig();
1265
1266 if ($question_gui instanceof assMultipleChoiceGUI) {
1267 $question_config->setWorkedThrough($is_question_worked_through);
1268 }
1269
1270 if ($question_config->isPreviousPassSolutionReuseAllowed()) {
1271 $pass_index = $this->determineSolutionPassIndex($question_gui);
1272 if ($pass_index < $this->test_session->getPass()) {
1273 $question_config->setSolutionInitiallyPrefilled(true);
1274 }
1275 } else {
1276 $pass_index = $this->test_session->getPass();
1277 }
1278
1279
1280 $this->modal_signals = $this->populateModals();
1281 $question_navigation_gui->setShowDiscardModalSignal($this->modal_signals[self::DISCARD_MODAL]);
1282
1283 $question_gui->outQuestionForTest(
1284 $form_action,
1285 $this->test_session->getActiveId(),
1286 $pass_index,
1287 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
1288 $user_post_solution,
1289 $instant_response && $this->object->getSpecificAnswerFeedback()
1290 );
1291
1292 $this->populateQuestionEditControl($question_gui);
1293 }
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 1194 of file class.ilTestPlayerAbstractGUI.php.

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

◆ showSideList()

ilTestPlayerAbstractGUI::showSideList (   $current_sequence_element)
protected

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

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

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 1574 of file class.ilTestPlayerAbstractGUI.php.

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

References 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 697 of file class.ilTestPlayerAbstractGUI.php.

698 {
699 $testStartLock = $this->getLockParameter();
700 $isFirstTestStartRequest = false;
701
702 $this->process_locker->executeTestStartLockOperation(function () use ($testStartLock, &$isFirstTestStartRequest) {
703 if ($this->test_session->lookupTestStartLock() !== $testStartLock) {
704 $this->test_session->persistTestStartLock($testStartLock);
705 $isFirstTestStartRequest = true;
706 }
707 });
708
709 if ($isFirstTestStartRequest) {
710 $this->handleUserSettings();
711 $this->ctrl->redirect($this, ilTestPlayerCommands::INIT_TEST);
712 }
713
714 $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
715 $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
716 }

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

+ Here is the call graph for this function:

◆ startTestCmd()

ilTestPlayerAbstractGUI::startTestCmd ( )
protected

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

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

References 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 931 of file class.ilTestPlayerAbstractGUI.php.

932 {
933 $this->saveQuestionSolution(false, true);
934 // fau: testNav - set the 'answer changed' parameter when an intermediate solution is submitted
935 $this->setAnswerChangedParameter(true);
936 // fau.
937 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
938 }

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

+ Here is the call graph for this function:

◆ submitSolutionAndNextCmd()

ilTestPlayerAbstractGUI::submitSolutionAndNextCmd ( )
protected

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

2884 : void
2885 {
2886 if ($this->object->isForceInstantFeedbackEnabled()) {
2887 $this->submitSolutionCmd();
2888 return;
2889 }
2890
2891 if ($this->saveQuestionSolution(true, false)) {
2892 $this->test_sequence->getQuestionForSequence(
2894 );
2895
2897
2898 $next_sequence_element = $this->test_sequence->getNextSequence($this->getCurrentSequenceElement());
2899
2900 if (!$this->isValidSequenceElement($next_sequence_element)) {
2901 $next_sequence_element = $this->test_sequence->getFirstSequence();
2902 }
2903
2904 $this->test_session->setLastSequence($next_sequence_element ?? 0);
2905 $this->test_session->saveToDb();
2906
2907 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
2908 $this->ctrl->setParameter($this, 'pmode', '');
2909 }
2910
2911 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2912 }

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 1485 of file class.ilTestPlayerAbstractGUI.php.

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

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 435 of file class.ilTestPlayerAbstractGUI.php.

436 {
437 $this->ctrl->redirectByClass(TestScreenGUI::class, TestScreenGUI::DEFAULT_CMD);
438 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

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

961 {
962 // fau: testNav - handle intermediate submit when unmarking the question
964 // fau.
965 $this->unmarkQuestionCmd();
966 }
unmarkQuestionCmd()
Set a question unsolved.

◆ unmarkQuestionCmd()

ilTestPlayerAbstractGUI::unmarkQuestionCmd ( )
protected

Set a question unsolved.

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

972 {
973 $question_id = $this->test_sequence->getQuestionForSequence(
975 );
976
977 $this->object->setQuestionSetSolved(0, $question_id, $this->test_session->getUserId());
978
979 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
980 }

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

+ Here is the call graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

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

2846 : void
2847 {
2848 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2849 if (isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2850 unset($forced_feedback_navigation_url[$this->test_session->getActiveId()]);
2851 ilSession::set('forced_feedback_navigation_url', $forced_feedback_navigation_url);
2852 }
2853 }

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

+ Here is the call graph for this function:

◆ updateLearningProgressOnTestStart()

ilTestPlayerAbstractGUI::updateLearningProgressOnTestStart ( )
protected

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

2862 : void
2863 {
2864 ilLPStatusWrapper::_updateStatus($this->object->getId(), $this->user->getId());
2865 }
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 301 of file class.ilTestPlayerAbstractGUI.php.

302 {
303 if (ilSession::get("active_time_id") != null) {
304 $this->object->updateWorkingTime(ilSession::get("active_time_id"));
305 }
306
308 "active_time_id",
309 $this->object->startWorkingTime(
310 $this->test_session->getActiveId(),
311 $this->test_session->getPass()
312 )
313 );
314 }

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

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

Referenced by ensureExistingTestSession().

◆ 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 2758 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: