ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestPlayerAbstractGUI Class Reference
+ Inheritance diagram for ilTestPlayerAbstractGUI:
+ Collaboration diagram for ilTestPlayerAbstractGUI:

Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerAbstractGUI::__construct ( ilObjTest  $object)

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ accessCodeConfirmedCmd()

ilTestPlayerAbstractGUI::accessCodeConfirmedCmd ( )

Definition at line 817 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 3112 of file class.ilTestPlayerAbstractGUI.php.

3112 : void
3113 {
3114 $ass_settings = new ilSetting('assessment');
3115
3116 $userSolutionAdopter = new ilAssQuestionUserSolutionAdopter($this->db, $ass_settings);
3117 $userSolutionAdopter->setUserId($this->user->getId());
3118 $userSolutionAdopter->setActiveId($this->test_session->getActiveId());
3119 $userSolutionAdopter->setTargetPass($this->test_sequence->getPass());
3120 $userSolutionAdopter->setQuestionIds($this->test_sequence->getOptionalQuestions());
3121
3122 $userSolutionAdopter->perform();
3123 }
ILIAS Setting Class.

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ afterTestPassFinishedCmd()

ilTestPlayerAbstractGUI::afterTestPassFinishedCmd ( )
protected

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

1063 {
1064 // show final statement
1065 if (!$this->testrequest->isset('skipfinalstatement')) {
1066 if ($this->object->getMainSettings()->getFinishingSettings()->getConcludingRemarksEnabled()) {
1067 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_FINAL_STATMENT);
1068 }
1069 }
1070
1071 // redirect after test
1072 $redirection_mode = $this->object->getMainSettings()->getFinishingSettings()->getRedirectionMode();
1073 $redirection_url = $this->object->getMainSettings()->getFinishingSettings()->getRedirectionUrl();
1074 if (empty($redirection_url)
1075 || $this->object->canShowTestResults($this->test_session)
1076 || $redirection_mode === RedirectionModes::NONE
1077 || $redirection_mode === RedirectionModes::IF_KIOSK_ACTIVATED && !$this->object->getKioskMode()) {
1078 $this->redirectBackCmd();
1079 }
1080
1081 if ($redirection_mode === RedirectionModes::ALWAYS_TO_LOGOUT) {
1082 $redirection_url = ilStartUpGUI::logoutUrl();
1083 }
1084
1085 ilUtil::redirect($redirection_url);
1086 }
static logoutUrl(array $parameters=[])
Return the logout URL with a valid CSRF token.
static redirect(string $a_script)

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

+ Here is the call graph for this function:

◆ autosaveCmd()

ilTestPlayerAbstractGUI::autosaveCmd ( )

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

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

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

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

+ Here is the call graph for this function:

◆ autosaveOnTimeLimitCmd()

ilTestPlayerAbstractGUI::autosaveOnTimeLimitCmd ( )

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

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

912 {
913 if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
914 $this->saveQuestionSolution(false, true);
915 }
916 $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
917 }

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

+ Here is the call graph for this function:

◆ backFromFinishingCmd()

ilTestPlayerAbstractGUI::backFromFinishingCmd ( )

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

1950 {
1951 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1952 }

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

2423 {
2424 $navigation_gui = new ilTestQuestionNavigationGUI(
2425 $this->lng,
2426 $this->ui_factory,
2427 $this->ui_renderer
2428 );
2429
2430 // fau: testNav - add a 'revert changes' link for editable question
2431 $navigation_gui->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
2432
2433 if ($this->object->getSpecificAnswerFeedback()
2434 || $this->object->getGenericAnswerFeedback()
2435 || $this->object->getAnswerFeedbackPoints()
2436 || $this->object->getInstantFeedbackSolution()) {
2437 $navigation_gui->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
2438
2439 if ($this->object->isForceInstantFeedbackEnabled()) {
2440 $navigation_gui->setForceInstantResponseEnabled(true);
2441 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2442 } else {
2443 $navigation_gui->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
2444 }
2445 }
2446
2447 if ($this->object->getShowMarker()) {
2448 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2449 $solved = 0;
2450
2451 if (count($solved_array) > 0) {
2452 $solved = array_pop($solved_array);
2453 $solved = $solved['solved'];
2454 }
2455
2456 if ($solved === 1) {
2457 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
2458 $navigation_gui->setQuestionMarked(true);
2459 } else {
2460 $navigation_gui->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
2461 $navigation_gui->setQuestionMarked(false);
2462 }
2463 }
2464 return $navigation_gui;
2465 }
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 1088 of file class.ilTestPlayerAbstractGUI.php.

1088 : InterruptiveModal
1089 {
1090 $class = get_class($this);
1091 $this->ctrl->setParameterByClass($class, 'finalization_confirmed', 'confirmed');
1092 $next_url = $this->ctrl->getLinkTargetByClass($class, ilTestPlayerCommands::FINISH_TEST);
1093 $this->ctrl->clearParameterByClass($class, 'finalization_confirmed');
1094
1095 $message = $this->lng->txt('tst_finish_confirmation_question');
1096 if (($this->object->getNrOfTries() - 1) === $this->test_session->getPass()) {
1097 $message = $this->lng->txt('tst_finish_confirmation_question_no_attempts_left');
1098 }
1099
1100 return $this->ui_factory->modal()->interruptive(
1101 $this->lng->txt('finish_test'),
1102 $message,
1103 $next_url
1104 )->withActionButtonLabel($this->lng->txt('tst_finish_confirm_button'));
1105 }
$message
Definition: xapiexit.php:31

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

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

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

+ Here is the call graph for this function:

◆ buildPreviousButtonInstance()

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

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

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

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

+ Here is the call graph for this function:

◆ buildQuestionObject()

ilTestPlayerAbstractGUI::buildQuestionObject ( )
private

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

389 : ?assQuestion
390 {
391 $q_id = $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
392
393 if ($this->isParticipantsAnswerFixed($q_id)) {
394 // should only be reached by firebugging the disabled form in ui
395 throw new ilTestException('not allowed request');
396 }
397
398 if ($q_id === null) {
399 return null;
400 }
401
402 return $this->getQuestionInstance($q_id);
403 }
Base Exception for all Exceptions relating to Modules/Test.
getQuestionInstance(int $question_id, bool $from_cache=true)

◆ buildReadOnlyStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildReadOnlyStateQuestionNavigationGUI (   $question_id)
protected

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

2389 {
2390 $navigationGUI = new ilTestQuestionNavigationGUI(
2391 $this->lng,
2392 $this->ui_factory,
2393 $this->ui_renderer
2394 );
2395
2396 if (!$this->isParticipantsAnswerFixed($question_id)) {
2397 $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
2398 }
2399
2400 if ($this->object->getShowMarker()) {
2401 $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $question_id);
2402 $solved = 0;
2403
2404 if (count($solved_array) > 0) {
2405 $solved = array_pop($solved_array);
2406 $solved = $solved["solved"];
2407 }
2408 // fau: testNav - change question mark command to link target
2409 if ($solved == 1) {
2410 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
2411 $navigationGUI->setQuestionMarked(true);
2412 } else {
2413 $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
2414 $navigationGUI->setQuestionMarked(false);
2415 }
2416 }
2417 // fau.
2418
2419 return $navigationGUI;
2420 }

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

2361 {
2362 if ($this->object->getListOfQuestions()) {
2363 $this->ctrl->setParameter($this, 'activecommand', 'summary');
2364 } else {
2365 $this->ctrl->setParameter($this, 'activecommand', 'previous');
2366 }
2367
2368 $this->ctrl->redirect($this, 'redirectQuestion');
2369 }

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

+ Here is the call graph for this function:

◆ canSaveResult()

ilTestPlayerAbstractGUI::canSaveResult ( )
protected

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

441 : bool
442 {
443 return !$this->object->endingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
444 }

◆ checkAndUpdateSaveAllowedByFormTimestamp()

ilTestPlayerAbstractGUI::checkAndUpdateSaveAllowedByFormTimestamp ( bool  $force)
private

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

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

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

+ Here is the call graph for this function:

◆ checkReadAccess()

ilTestPlayerAbstractGUI::checkReadAccess ( )
protected

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

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

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

Referenced by executeCommand().

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

◆ checkTestExecutable()

ilTestPlayerAbstractGUI::checkTestExecutable ( )
protected

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

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

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

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

◆ checkTestSessionUser()

ilTestPlayerAbstractGUI::checkTestSessionUser ( ilTestSession  $test_session)
protected

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

258 : void
259 {
260 if ($test_session->getUserId() != $this->user->getId()) {
261 throw new ilTestException('active id given does not relate to current user!');
262 }
263 }

References $test_session, and ilTestSession\getUserId().

Referenced by executeCommand().

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

◆ checkWorkingTimeCmd()

ilTestPlayerAbstractGUI::checkWorkingTimeCmd ( )

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

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

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

1838 : void
1839 {
1840 $active_id = $this->test_session->getActiveId();
1841 echo (string) $this->object->getProcessingTimeInSeconds($active_id);
1842 exit;
1843 }

References exit.

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

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

2352 {
2353 $this->test_sequence->setAnsweringOptionalQuestionsConfirmed(true);
2354 $this->test_sequence->saveToDb();
2355
2356 $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
2357 $this->ctrl->redirect($this, 'redirectQuestion');
2358 }

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

1789 {
1790 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "components/ILIAS/Test");
1791 $this->tpl->setCurrentBlock("adm_content");
1792 if ($this->object->isTestFinished($this->test_session->getActiveId())) {
1793 $this->tpl->setCurrentBlock("not_submit_allowed");
1794 $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1795 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1796 } else {
1797 $this->tpl->setCurrentBlock("submit_allowed");
1798 $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1799 $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1800 }
1801 $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1802 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1803 $this->tpl->parseCurrentBlock();
1804 }
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 926 of file class.ilTestPlayerAbstractGUI.php.

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

References exit.

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

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

462 : bool
463 {
464 $show_question_inline_score = false;
465 if ($this->object->getAnswerFeedbackPoints()) {
466 $show_question_inline_score = true;
467 return $show_question_inline_score;
468 }
469 return $show_question_inline_score;
470 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ determineSolutionPassIndex()

ilTestPlayerAbstractGUI::determineSolutionPassIndex ( assQuestionGUI  $question_gui)
protected

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

1328 : int
1329 {
1330 if ($this->object->isPreviousSolutionReuseEnabled($this->test_session->getActiveId())) {
1331 $currentSolutionAvailable = $question_gui->getObject()->authorizedOrIntermediateSolutionExists(
1332 $this->test_session->getActiveId(),
1333 $this->test_session->getPass()
1334 );
1335
1336 if (!$currentSolutionAvailable) {
1337 $previousPass = $question_gui->getObject()->getSolutionMaxPass(
1338 $this->test_session->getActiveId()
1339 );
1340
1341 $previousSolutionAvailable = $question_gui->getObject()->authorizedSolutionExists(
1342 $this->test_session->getActiveId(),
1343 $previousPass
1344 );
1345
1346 if ($previousSolutionAvailable) {
1347 return $previousPass;
1348 }
1349
1350 }
1351 }
1352
1353 return $this->test_session->getPass();
1354 }

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

+ Here is the call graph for this function:

◆ discardSolutionCmd()

ilTestPlayerAbstractGUI::discardSolutionCmd ( )
protected

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

1573 {
1574 $current_sequence_element = $this->getCurrentSequenceElement();
1575
1576 $current_question_obj = $this->getQuestionInstance(
1577 $this->test_sequence->getQuestionForSequence($current_sequence_element)
1578 );
1579 $current_question_obj->setTestId($this->object->getId());
1580
1581 $current_question_obj->resetUsersAnswer(
1582 $this->test_session->getActiveId(),
1583 $this->test_session->getPass()
1584 );
1585
1586 if ($this->logger->isLoggingEnabled()
1587 && !$this->getObject()->getAnonymity()) {
1588 $this->logger->logParticipantInteraction(
1589 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1590 $this->object->getRefId(),
1591 $this->test_sequence->getQuestionForSequence($current_sequence_element),
1592 $this->user->getId(),
1593 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1594 TestParticipantInteractionTypes::ANSWER_DELETED,
1595 []
1596 )
1597 );
1598 }
1599
1600 $this->ctrl->saveParameter($this, 'sequence');
1601
1602 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1603
1604 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1605 }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26

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

+ Here is the call graph for this function:

◆ displayAccessCodeCmd()

ilTestPlayerAbstractGUI::displayAccessCodeCmd ( )

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

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

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

1513 {
1514 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_EDIT);
1515 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1516 }

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

1762 {
1763 $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1764 $this->test_session->increasePass();
1765 $this->test_session->setLastSequence(0);
1766 $this->test_session->saveToDb();
1767
1768 $this->redirectBackCmd();
1769 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling

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

+ Here is the call graph for this function:

◆ ensureExistingTestSession()

ilTestPlayerAbstractGUI::ensureExistingTestSession ( ilTestSession  $test_session)
protected

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

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

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

Referenced by executeCommand().

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

◆ executeCommand()

ilTestPlayerAbstractGUI::executeCommand ( )

execute command

Reimplemented from ilTestServiceGUI.

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

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

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

+ Here is the call graph for this function:

◆ finishTestCmd()

ilTestPlayerAbstractGUI::finishTestCmd ( )

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

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

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

+ Here is the call graph for this function:

◆ generateRandomTestPassForActiveUser()

ilTestPlayerAbstractGUI::generateRandomTestPassForActiveUser ( )
protected

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

3075 : void
3076 {
3077 $questionSetConfig = new ilTestRandomQuestionSetConfig(
3078 $this->tree,
3079 $this->db,
3080 $this->lng,
3081 $this->logger,
3082 $this->component_repository,
3083 $this->object,
3084 $this->questionrepository
3085 );
3086 $questionSetConfig->loadFromDb();
3087
3088 $sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($this->db, $this->object);
3089
3090 $sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList($this->db, $this->object, $sourcePoolDefinitionFactory);
3091 $sourcePoolDefinitionList->loadDefinitions();
3092
3093 $this->process_locker->executeRandomPassBuildOperation(function () use ($questionSetConfig, $sourcePoolDefinitionList) {
3095 $stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($this->db, $this->component_repository);
3096
3097 $questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance(
3098 $this->db,
3099 $this->lng,
3100 $this->logger,
3101 $this->object,
3102 $questionSetConfig,
3103 $sourcePoolDefinitionList,
3104 $stagingPoolQuestionList
3105 );
3106
3107 $questionSetBuilder->performBuild($this->test_session);
3108 }
3109 }, $sourcePoolDefinitionList->hasTaxonomyFilters());
3110 }
static getInstance(ilDBInterface $db, ilLanguage $lng, TestLogger $logger, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)

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

+ Here is the call graph for this function:

◆ getAnswerChangedParameter()

ilTestPlayerAbstractGUI::getAnswerChangedParameter ( )
protected

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

2692 : bool
2693 {
2694 return !empty($this->testrequest->raw('test_answer_changed'));
2695 }

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

2070 : string
2071 {
2072 return "ADM_CONTENT";
2073
2074 if ($this->object->getKioskMode()) {
2075 $this->tpl->setBodyClass("kiosk");
2076 $this->tpl->hideFooter();
2077 return "CONTENT";
2078 } else {
2079 return "ADM_CONTENT";
2080 }
2081 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getCurrentQuestionId()

ilTestPlayerAbstractGUI::getCurrentQuestionId ( )
protected

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

868 : int
869 {
870 return $this->test_sequence->getQuestionForSequence($this->testrequest->int('sequence'));
871 }

Referenced by removeIntermediateSolution().

+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestPlayerAbstractGUI::getCurrentSequenceElement ( )
protected

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

2631 : int
2632 {
2633 if ($this->getSequenceElementParameter()) {
2634 return $this->getSequenceElementParameter();
2635 }
2636
2637 return $this->test_session->getLastSequence();
2638 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestPlayerAbstractGUI::getFinishTestCommand ( )
protected

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

2467 : string
2468 {
2469 if (!$this->object->getListOfQuestionsEnd()) {
2471 }
2472
2474 }

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

2658 : bool
2659 {
2660 return $this->testrequest->isInstanceResponseRequested();
2661 }

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

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

2292 : string
2293 {
2294 return $this->lng->txt("save_introduction");
2295 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLockParameter()

ilTestPlayerAbstractGUI::getLockParameter ( )

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

730 {
731 if ($this->testrequest->isset('lock') && strlen($this->testrequest->raw('lock'))) {
732 return $this->testrequest->raw('lock');
733 }
734
735 return null;
736 }

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

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

2678 : string
2679 {
2680 $navigation_url = $this->testrequest->strVal('test_player_navigation_url');
2681 if ($navigation_url !== '') {
2682 $navigation_url_parts = parse_url($navigation_url);
2683 $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2684
2685 if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2686 return $navigation_url;
2687 }
2688 }
2689 return '';
2690 }
static _getHttpPath()

References ilUtil\_getHttpPath().

+ Here is the call graph for this function:

◆ getNextCommandParameter()

ilTestPlayerAbstractGUI::getNextCommandParameter ( )
protected

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

2664 {
2665 $nextcmd = '';
2666 if ($this->testrequest->isset('nextcmd')) {
2667 $nextcmd = $this->testrequest->strVal('nextcmd');
2668 }
2669
2670 return $nextcmd !== '' ? $nextcmd : null;
2671 }

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

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

2673 : int
2674 {
2675 return $this->testrequest->int('nextseq');
2676 }

◆ getOnLoadCodeForNavigationButtons()

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

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

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

References $id.

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

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

2650 {
2651 if ($this->testrequest->isset('pmode')) {
2652 return $this->testrequest->raw('pmode');
2653 }
2654
2655 return null;
2656 }

◆ getQuestionFeedbackModalHtml()

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

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

2514 : string
2515 {
2516 $modal = $this->ui_factory->modal()->roundtrip(
2517 $this->lng->txt('tst_instant_feedback'),
2518 $this->ui_factory->legacy()->content($tpl->get()),
2519 []
2520 )->withActionButtons([
2521 $this->ui_factory->button()->standard($this->lng->txt('proceed'), $nav_url)
2522 ]);
2523
2524 return $this->ui_renderer->render([
2525 $modal->withOnLoad($modal->getShowSignal())
2526 ]);
2527 }
ilGlobalTemplateInterface ilTemplate $tpl
sk 2023-08-01: We need this union type, even if it is wrong! To change this
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

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

+ Here is the call graph for this function:

◆ getQuestionGuiInstance()

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

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

2723 : object
2724 {
2725 $tpl = $this->tpl;
2726
2727 if (!$from_cache || !isset($this->cached_question_guis[$question_id])) {
2728 $question_gui = $this->object->createQuestionGUI("", $question_id);
2729 $question_gui->setTargetGui($this);
2730 $question_gui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2731 $question = $question_gui->getObject();
2732 $question->setShuffler($this->shuffler->getAnswerShuffleFor(
2733 $question_id,
2734 $this->test_session->getActiveId(),
2735 $this->test_session->getPass()
2736 ));
2737 $question_gui->setObject($question);
2738 $question_gui->populateJavascriptFilesRequiredForWorkForm($tpl);
2739
2740 // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2741 $this->initTestQuestionConfig($question_gui->getObject());
2742 // hey.
2743
2744 $this->cached_question_guis[$question_id] = $question_gui;
2745 }
2746
2747 return $this->cached_question_guis[$question_id];
2748 }
initTestQuestionConfig(assQuestion $question_obj)

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

+ Here is the call graph for this function:

◆ getQuestionInstance()

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

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

2750 : assQuestion
2751 {
2752 if ($from_cache && isset($this->cached_question_objects[$question_id])) {
2753 return $this->cached_question_objects[$question_id];
2754 }
2755 $question = assQuestion::instantiateQuestion($question_id);
2756 $ass_settings = new ilSetting('assessment');
2757
2758 $process_locker_factory = new ilAssQuestionProcessLockerFactory($ass_settings, $this->db);
2759 $process_locker_factory->setQuestionId($question->getId());
2760 $process_locker_factory->setUserId($this->user->getId());
2761 $question->setProcessLocker($process_locker_factory->getLocker());
2762
2763 $this->initTestQuestionConfig($question);
2764
2765 $this->cached_question_objects[$question_id] = $question;
2766 return $question;
2767 }
static instantiateQuestion(int $question_id)

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

2924 : string
2925 {
2927 }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

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

2939 : ?string
2940 {
2941 if (ilSession::get('forced_feedback_navigation_url') === null) {
2942 return null;
2943 }
2944 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2945 if (!isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2946 return null;
2947 }
2948
2949 return $forced_feedback_navigation_url[$this->test_session->getActiveId()];
2950 }

References ilSession\get().

+ Here is the call graph for this function:

◆ getSequenceElementParameter()

ilTestPlayerAbstractGUI::getSequenceElementParameter ( )
protected

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

2640 : ?int
2641 {
2642 if ($this->testrequest->isset('sequence')) {
2643 return $this->testrequest->int('sequence');
2644 }
2645
2646 return null;
2647 }

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

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

2380 {
2381 $navigation_toolbar = new ilTestNavigationToolbarGUI($this->ctrl, $this);
2382 $navigation_toolbar->setSuspendTestButtonEnabled($this->object->getShowCancel());
2383 $navigation_toolbar->setUserPassOverviewEnabled($this->object->getUsrPassOverviewEnabled());
2384 $navigation_toolbar->setFinishTestCommand($this->getFinishTestCommand());
2385 return $navigation_toolbar;
2386 }

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

+ Here is the call graph for this function:

◆ getTestPlayerTitle()

ilTestPlayerAbstractGUI::getTestPlayerTitle ( )
protected

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

3159 : string
3160 {
3161 $title_content = $this->ui_factory->listing()->property();
3162
3163 if ($this->object->getShowKioskModeParticipant()) {
3164 $pax_name_label = $this->lng->txt("conf_user_name");
3165 // this is a placeholder solution with inline html tags to differentiate the different elements
3166 // should be removed when a title component with grouping and visual weighting is available
3167 // see: https://github.com/ILIAS-eLearning/ILIAS/pull/7311
3168 $pax_name_value = "<span class='il-test-kiosk-head__participant-name'>"
3169 . $this->user->getFullname() . "</span>";
3170 $title_content = $title_content->withProperty($pax_name_label, $pax_name_value, false);
3171 }
3172
3173 if ($this->object->isShowExamIdInTestPassEnabled()) {
3174 $exam_id_label = $this->lng->txt("exam_id_label");
3175 $exam_id_value = ilObjTest::buildExamId(
3176 $this->test_session->getActiveId(),
3177 $this->test_session->getPass(),
3178 $this->object->getId()
3179 );
3180 $title_content = $title_content->withProperty($exam_id_label, $exam_id_value);
3181 }
3182
3183 if ($this->object->getShowKioskModeTitle()) {
3184 $test_title_label = $this->lng->txt("test");
3185 $test_title_value = $this->object->getTitle();
3186 $title_content = $title_content->withProperty($test_title_label, $test_title_value, false);
3187 }
3188
3189 return $this->ui_renderer->render($title_content);
3190 }
static buildExamId($active_id, $pass, $test_obj_id=null)

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

Referenced by executeCommand().

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

◆ handleCheckTestPassValid()

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

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

3032 : void
3033 {
3034 $testObj = new ilObjTest($this->ref_id, true);
3035
3036 $participants = $testObj->getActiveParticipantList();
3037 $participant = $participants->getParticipantByActiveId($this->testrequest->getActiveId());
3038 if ($participant && $participant->hasUnfinishedPasses()) {
3039 return;
3040 }
3041 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_current_run_no_longer_valid'), true);
3042 if ($with_redirect) {
3043 $this->ctrl->redirectByClass([
3044 ilRepositoryGUI::class,
3045 ilObjTestGUI::class,
3046 TestScreenGUI::class
3047 ]);
3048 }
3049 }

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

2966 : void
2967 {
2968 $this->updateWorkingTime();
2969 $this->saveQuestionSolution(false);
2970 $this->ctrl->redirect($this, ilTestPlayerCommands::SUBMIT_SOLUTION);
2971 }
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 2702 of file class.ilTestPlayerAbstractGUI.php.

2703 {
2704 if ($this->getAnswerChangedParameter()) {
2705 $this->saveQuestionSolution(false);
2706 } else {
2708 }
2710 }

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

2249 {
2256 if ($this->test_session->isPasswordChecked() === true) {
2257 return;
2258 }
2259
2260 if ($this->ctrl->getNextClass() === 'iltestpasswordprotectiongui') {
2261 return;
2262 }
2263
2264 if (!$this->password_checker->isPasswordProtectionPageRedirectRequired()) {
2265 $this->test_session->setPasswordChecked(true);
2266 return;
2267 }
2268
2269 $this->ctrl->setParameterByClass(self::class, 'lock', $this->getLockParameter());
2270
2271 $next_command = $this->ctrl->getCmdClass() . '::' . ilTestPlayerCommands::START_TEST;
2272 $this->ctrl->setParameterByClass(ilTestPasswordProtectionGUI::class, 'nextCommand', $next_command);
2273 $this->ctrl->redirectByClass(ilTestPasswordProtectionGUI::class, 'showPasswordForm');
2274 }

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

3131 : bool
3132 {
3133 $is_next_primary = true;
3134
3135 if ($this->object->isForceInstantFeedbackEnabled()) {
3136 $is_next_primary = false;
3137 }
3138
3139 $questions_missing_result = $this->questionrepository->getQuestionsMissingResultRecord(
3140 $this->test_session->getActiveId(),
3141 $this->test_session->getPass(),
3142 $this->test_sequence->getOrderedSequenceQuestions()
3143 );
3144
3145 if ($questions_missing_result === []) {
3146 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3147 return false;
3148 }
3149
3150 if (count($questions_missing_result) === 1
3151 && $current_question_id === current($questions_missing_result)) {
3152 $navigation_toolbar_gui->setFinishTestButtonPrimary(true);
3153 return false;
3154 }
3155
3156 return $is_next_primary;
3157 }
setFinishTestButtonPrimary($finishTestButtonPrimary)

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

+ Here is the call graph for this function:

◆ handleQuestionActionCmd()

ilTestPlayerAbstractGUI::handleQuestionActionCmd ( )
protected

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

2103 {
2104 $question_id = $this->test_sequence->getQuestionForSequence(
2106 );
2107
2108 if (!$this->isParticipantsAnswerFixed($question_id)) {
2109 $this->updateWorkingTime();
2110 $this->saveQuestionSolution(false);
2111 // fau: testNav - add changed status of the question
2112 $this->setAnswerChangedParameter(true);
2113 // fau.
2114 }
2115
2116 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2117 }

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

3027 : void {
3028 $this->test_sequence->postponeQuestion($question_id);
3029 $this->test_sequence->saveToDb();
3030 }

◆ handleSkillTriggering()

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

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

2305 : void
2306 {
2307 $skill_evaluation = new ilTestSkillEvaluation(
2308 $this->db,
2309 $this->logger,
2310 $this->object->getTestId(),
2311 $this->object->getRefId(),
2312 $this->skills_service->profile(),
2313 $this->skills_service->personal()
2314 );
2315
2316 $skill_evaluation->setUserId($test_session->getUserId());
2317 $skill_evaluation->setActiveId($test_session->getActiveId());
2318 $skill_evaluation->setPass($test_session->getPass());
2319
2320 $skill_evaluation->setNumRequiredBookingsForSkillTriggering(
2321 $this->object->getGlobalSettings()->getSkillTriggeringNumberOfAnswers()
2322 );
2323
2324 $question_list = $this->buildTestPassQuestionList();
2325 $question_list->load();
2326 $skill_evaluation->init($question_list);
2327 $skill_evaluation->evaluate(
2328 $this->object->getTestResult(
2329 $test_session->getActiveId(),
2331 true
2332 )
2333 );
2334
2335 $skill_evaluation->handleSkillTriggering();
2336 }

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

3125 : void
3126 {
3127 $this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_objective_oriented_test_pass_without_questions'), $this->object->getTitle()), true);
3128 $this->ctrl->redirectByClass(ilObjTestGUI::class);
3129 }

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

2776 : void
2777 {
2778 $this->logger->error(
2779 "INV SEQ:"
2780 . "active={$this->test_session->getActiveId()} "
2781 . "qId=$question_id seq=$sequence_element "
2782 . serialize($this->test_sequence)
2783 );
2784
2785 $this->ctrl->setParameter($this, 'sequence', $this->test_sequence->getFirstSequence());
2786 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2787 }

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

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

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

2298 {
2299 $this->ass_settings = new ilSetting('assessment');
2300 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

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

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

References ilTestServiceGUI\$db, and $ilDB.

Referenced by executeCommand().

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

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

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

2221 {
2222 $onload_js = <<<JS
2223 let key_event = (event) => {
2224 if( event.key === 13 && event.target.tagName.toLowerCase() === "a" ) {
2225 return;
2226 }
2227 if (event.key === 13 &&
2228 event.target.tagName.toLowerCase() !== "textarea" &&
2229 (event.target.tagName.toLowerCase() !== "input" || event.target.type.toLowerCase() !== "submit")) {
2230 event.preventDefault();
2231 }
2232 };
2233
2234 let form = document.getElementById('taForm');
2235 form.onkeyup = key_event;
2236 form.onkeydown = key_event;
2237 form.onkeypress = key_event;
2238JS;
2239 $this->tpl->addOnLoadCode($onload_js);
2240 $this->tpl->addBlockFile(
2241 $this->getContentBlockName(),
2242 'adm_content',
2243 'tpl.il_as_tst_output.html',
2244 'components/ILIAS/Test'
2245 );
2246 }
form( $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 2769 of file class.ilTestPlayerAbstractGUI.php.

2770 {
2771 $question_obj->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2772 $this->object->isPreviousSolutionReuseEnabled($this->test_session->getActiveId())
2773 );
2774 }

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

+ Here is the call graph for this function:

◆ isFirstQuestionInSequence()

ilTestPlayerAbstractGUI::isFirstQuestionInSequence (   $sequence_element)
protected

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

2092 : bool
2093 {
2094 return $sequence_element == $this->test_sequence->getFirstSequence();
2095 }

◆ isFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::isFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

2877 {
2878 if (ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM) == null) {
2879 return false;
2880 }
2881
2882 return ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2883 }

References ilSession\get().

+ Here is the call graph for this function:

◆ isForcedFeedbackNavUrlRegistered()

ilTestPlayerAbstractGUI::isForcedFeedbackNavUrlRegistered ( )
protected

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

2952 : bool
2953 {
2954 return $this->getRegisteredForcedFeedbackNavUrl() !== null;
2955 }

◆ isLastQuestionInSequence()

ilTestPlayerAbstractGUI::isLastQuestionInSequence (   $sequence_element)
protected

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

2097 : bool
2098 {
2099 return $sequence_element == $this->test_sequence->getLastSequence();
2100 }

◆ isMaxProcessingTimeReached()

ilTestPlayerAbstractGUI::isMaxProcessingTimeReached ( )

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

451 : bool
452 {
453 $active_id = $this->test_session->getActiveId();
454 $starting_time = $this->object->getStartingTimeOfUser($active_id);
455 if ($starting_time === false) {
456 return false;
457 } else {
458 return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
459 }
460 }

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

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

1751 : bool
1752 {
1753 return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->test_session->getPass());
1754 }

◆ isOptionalQuestionAnsweringConfirmationRequired()

ilTestPlayerAbstractGUI::isOptionalQuestionAnsweringConfirmationRequired ( int  $sequence_key)
protected

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

1207 : bool
1208 {
1209 if ($this->test_sequence->isAnsweringOptionalQuestionsConfirmed()) {
1210 return false;
1211 }
1212
1213 $question_id = $this->test_sequence->getQuestionForSequence($sequence_key);
1214
1215 if (!$this->test_sequence->isQuestionOptional($question_id)) {
1216 return false;
1217 }
1218
1219 return true;
1220 }

◆ isParticipantsAnswerFixed()

ilTestPlayerAbstractGUI::isParticipantsAnswerFixed (   $question_id)
protected

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

2276 : bool
2277 {
2278 if ($this->object->isInstantFeedbackAnswerFixationEnabled()) {
2279 return $this->test_sequence->isQuestionChecked($question_id);
2280 }
2281
2282 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2283 return $this->isForcedFeedbackNavUrlRegistered() || $this->test_sequence->isNextQuestionPresented($question_id);
2284 }
2285
2286 return false;
2287 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ isShowingPostponeStatusReguired()

ilTestPlayerAbstractGUI::isShowingPostponeStatusReguired ( int  $question_id)
protected

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

1222 : bool
1223 {
1224 return $this->test_sequence->isPostponedQuestion($question_id);
1225 }

◆ isTestAccessible()

ilTestPlayerAbstractGUI::isTestAccessible ( )

test accessible returns true if the user can perform the test

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

1740 : bool
1741 {
1742 return !$this->isNrOfTriesReached()
1743 and !$this->isMaxProcessingTimeReached()
1744 and $this->object->startingTimeReached()
1745 and !$this->object->endingTimeReached();
1746 }
endingTimeReached()
handle endingTimeReached

◆ isValidSequenceElement()

ilTestPlayerAbstractGUI::isValidSequenceElement (   $sequence_element)
private

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

2978 : bool
2979 {
2980 if ($sequence_element === false) {
2981 return false;
2982 }
2983
2984 if ($sequence_element < 1) {
2985 return false;
2986 }
2987
2988 if (!$this->test_sequence->getPositionOfSequence($sequence_element)) {
2989 return false;
2990 }
2991
2992 return true;
2993 }

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

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

951 : void
952 {
954 $this->markQuestionCmd();
955 }
markQuestionCmd()
Set a question solved.

◆ markQuestionCmd()

ilTestPlayerAbstractGUI::markQuestionCmd ( )
protected

Set a question solved.

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

960 : void
961 {
962 $question_id = $this->test_sequence->getQuestionForSequence(
964 );
965
966 $this->object->setQuestionSetSolved(1, $question_id, $this->test_session->getUserId());
967
968 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
969 }

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

1779 {
1780 $this->suspendTestCmd();
1781 }

◆ nextQuestionCmd()

ilTestPlayerAbstractGUI::nextQuestionCmd ( )
protected

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

2151 {
2152 $this->handleCheckTestPassValid();
2153 $last_sequence_element = $this->getCurrentSequenceElement();
2154 $next_sequence_element = $this->test_sequence->getNextSequence($last_sequence_element);
2155
2156 $question_id = $this->test_sequence->getQuestionForSequence($last_sequence_element);
2157 $is_worked_through = $this->questionrepository->lookupResultRecordExist(
2158 $this->test_session->getActiveId(),
2159 $question_id,
2160 $this->test_session->getPass()
2161 );
2162
2163 if (!$is_worked_through) {
2164 if ($this->logger->isLoggingEnabled()
2165 && !$this->getObject()->getAnonymity()) {
2166 $this->logger->logParticipantInteraction(
2167 $this->logger->getInteractionFactory()->buildParticipantInteraction(
2168 $this->object->getRefId(),
2169 $question_id,
2170 $this->user->getId(),
2171 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
2172 TestParticipantInteractionTypes::QUESTION_SKIPPED,
2173 []
2174 )
2175 );
2176 }
2177 if ($this->object->isPostponingEnabled()) {
2178 $this->handleQuestionPostponing($question_id);
2179 }
2180 }
2181
2182 if (!$this->isValidSequenceElement($next_sequence_element)) {
2183 $next_sequence_element = $this->test_sequence->getFirstSequence();
2184 }
2185
2186 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
2187 $this->ctrl->setParameter($this, 'pmode', '');
2188
2189 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2190 }

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

+ Here is the call graph for this function:

◆ outCorrectSolution()

ilTestPlayerAbstractGUI::outCorrectSolution ( )

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

Reimplemented from ilTestServiceGUI.

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

1957 : void
1958 {
1959 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "components/ILIAS/Test");
1960
1961 $this->tpl->setCurrentBlock("ContentStyle");
1962 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1963 $this->tpl->parseCurrentBlock();
1964
1965 $this->tpl->setCurrentBlock("SyntaxStyle");
1966 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1967 $this->tpl->parseCurrentBlock();
1968
1969 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css"), "print");
1970 if ($this->object->getShowSolutionAnswersOnly()) {
1971 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css"), "print");
1972 }
1973
1974 $this->tpl->setCurrentBlock("adm_content");
1975 $solution = $this->getCorrectSolutionOutput($this->testrequest->raw("evaluation"), $this->testrequest->raw("active_id"), $this->testrequest->raw("pass"));
1976 $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1977 $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1978 $this->ctrl->saveParameter($this, "pass");
1979 $this->ctrl->saveParameter($this, "active_id");
1980 $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1981 $this->tpl->parseCurrentBlock();
1982 }
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 1806 of file class.ilTestPlayerAbstractGUI.php.

1806 : void
1807 {
1808 $starting_time = $this->object->getStartingTimeOfUser($active_id);
1809 $working_time = new WorkingTime(
1810 $this->lng,
1811 $this->ui_factory,
1812 $this->ui_renderer,
1813 $starting_time,
1814 $this->object->getProcessingTimeInSeconds($active_id)
1815 );
1816
1817 $this->tpl->setCurrentBlock('enableprocessingtime');
1818 $this->tpl->setVariable('USER_WORKING_TIME_MESSAGE_BOX', $working_time->getMessageBox($verbose));
1819 $this->tpl->parseCurrentBlock();
1820
1821 $working_time_js_template = $working_time->prepareWorkingTimeJsTemplate(
1822 $this->getObject(),
1823 getdate($starting_time),
1824 $this->ctrl->getLinkTarget($this, 'checkWorkingTime', '', true),
1825 $this->ctrl->getFormAction($this, ilTestPlayerCommands::REDIRECT_AFTER_QUESTION_LIST)
1826 );
1827
1828 $this->tpl->addOnLoadCode($working_time_js_template->get());
1829 }

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

1897 {
1898 $this->help->setScreenIdComponent('tst');
1899 $this->help->setScreenId('assessment');
1900 $this->help->setSubScreenId('question_summary');
1901
1902 $is_first_page = $this->testrequest->strVal('first') === '1';
1903
1904 $this->tpl->addBlockFile(
1905 $this->getContentBlockName(),
1906 'adm_content',
1907 'tpl.il_as_tst_question_summary.html',
1908 'components/ILIAS/Test'
1909 );
1910
1911 $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
1913 $this->getObject()->getTitle() . ' - ' . $this->lng->txt('question_summary')
1914 );
1915
1916 $active_id = $this->test_session->getActiveId();
1917 $question_summary_data = $this->service->getQuestionSummaryData($this->test_sequence);
1918
1919 $this->ctrl->setParameter($this, 'sequence', $this->testrequest->raw('sequence'));
1920
1921 $table = new QuestionsOfAttemptTable(
1922 $this->lng,
1923 $this->ctrl,
1924 $this->ui_factory,
1925 new DataFactory(),
1926 $this->http,
1927 $this,
1928 $this->object,
1929 $question_summary_data
1930 );
1931 $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $this->ui_renderer->render($table->buildComponents($is_first_page)));
1932
1933 if ($this->object->getEnableProcessingTime()) {
1934 $this->outProcessingTime($active_id, true);
1935 }
1936
1937 if ($this->object->isShowExamIdInTestPassEnabled()) {
1938 $this->tpl->setCurrentBlock('exam_id_footer');
1939 $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1940 $this->test_session->getActiveId(),
1941 $this->test_session->getPass(),
1942 $this->object->getId()
1943 ));
1944 $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1945 $this->tpl->parseCurrentBlock();
1946 }
1947 }
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 2083 of file class.ilTestPlayerAbstractGUI.php.

2084 {
2085 $this->ctrl->redirectByClass(
2086 [ilRepositoryGUI::class, ilObjTestGUI::class, ilTestEvaluationGUI::class],
2087 "outUserResultsOverview"
2088 );
2089 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ performTearsAndAngerBrokenConfessionChecks()

ilTestPlayerAbstractGUI::performTearsAndAngerBrokenConfessionChecks ( )
protected

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

3051 : bool
3052 {
3053 if ($this->test_session->getActiveId() > 0) {
3054 if ($this->test_sequence->hasRandomQuestionsForPass($this->test_session->getActiveId(), $this->test_session->getPass()) > 0) {
3055 $this->logger->info(
3056 __METHOD__ . ' Random Questions allready exists for user ' .
3057 $this->user->getId() . ' in test ' . $this->object->getTestId()
3058 );
3059
3060 return true;
3061 }
3062 } else {
3063 $this->logger->info(__METHOD__ . ' ' . sprintf(
3064 $this->lng->txt("error_random_question_generation"),
3065 $this->user->getId(),
3066 $this->object->getTestId()
3067 ));
3068
3069 return true;
3070 };
3071
3072 return false;
3073 }

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

1027 : void
1028 {
1030 $this->test_session,
1031 $this->object,
1032 $this->test_result_repository
1033 ))->performFinishTasks($this->process_locker, $status_of_attempt);
1034 $this->test_result_repository->updateTestResultCache($this->test_session->getActiveId());
1035
1037 $this->test_session->getActiveId(),
1038 $this->test_session->getPass()
1039 );
1040 }
Class ilTestPassFinishTasks.
sendNewPassFinishedNotificationEmailIfActivated(int $active_id, int $pass)

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

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

679 {
680 $this->tpl->setCurrentBlock("ContentStyle");
681 $this->tpl->setVariable(
682 "LOCATION_CONTENT_STYLESHEET",
684 );
685 $this->tpl->parseCurrentBlock();
686 }

References ilObjStyleSheet\getContentStylePath().

+ Here is the call graph for this function:

◆ populateDiscardSolutionModal()

ilTestPlayerAbstractGUI::populateDiscardSolutionModal ( )
protected

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

2814 : Signal
2815 {
2816 $modal = $this->ui_factory->modal()->interruptive(
2817 $this->lng->txt('discard_answer'),
2818 $this->lng->txt('discard_answer_confirmation'),
2819 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DISCARD_SOLUTION)
2820 )->withActionButtonLabel($this->lng->txt('discard_answer'));
2821
2822 $this->tpl->setCurrentBlock('discard_solution_modal');
2823 $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $this->ui_renderer->render($modal));
2824 $this->tpl->parseCurrentBlock();
2825 return $modal->getShowSignal();
2826 }

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

+ Here is the call graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

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

2611 {
2612 if ($withFocusAnchor) {
2613 $this->tpl->setCurrentBlock('inst_resp_id');
2614 $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
2615 $this->tpl->parseCurrentBlock();
2616 }
2617
2618 $this->tpl->setCurrentBlock('instant_response_header');
2619 $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
2620 $this->tpl->parseCurrentBlock();
2621 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateFeedbackBlockMessage()

ilTestPlayerAbstractGUI::populateFeedbackBlockMessage ( string  $a_message)
protected

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

2624 {
2625 $this->tpl->setCurrentBlock('instant_response_message');
2626 $this->tpl->setVariable('INSTANT_RESPONSE_MESSAGE', $a_message);
2627 $this->tpl->parseCurrentBlock();
2628 }

◆ populateGenericFeedbackBlock()

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

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

625 : bool
626 {
627 // fix #031263: add pass
628 $feedback = $question_gui->getGenericFeedbackOutput($this->test_session->getActiveId(), $this->test_session->getPass());
629
630 if (strlen($feedback)) {
631 $cssClass = (
632 $solutionCorrect ?
634 );
635
636 $this->tpl->setCurrentBlock("answer_feedback");
637 $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
638 $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
639 $this->tpl->parseCurrentBlock();
640 return true;
641 }
642 return false;
643 }
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 2374 of file class.ilTestPlayerAbstractGUI.php.

2375 {
2376 $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
2377 }

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

2534 {
2535 $response_available = false;
2536 $jump_to_response = false;
2537
2538 // This controls if the solution should be shown.
2539 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2540 if ($this->object->getInstantFeedbackSolution()) {
2541 $show_question_inline_score = $this->determineInlineScoreDisplay();
2542
2543 // Notation of the params prior to getting rid of this crap in favor of a class
2544 $solutionoutput = $question_gui->getSolutionOutput(
2545 $this->test_session->getActiveId(), #active_id
2546 $this->test_session->getPass(), #pass
2547 false, #graphical_output
2548 $show_question_inline_score, #result_output
2549 true, #show_question_only
2550 false, #show_feedback
2551 true, #show_correct_solution
2552 false, #show_manual_scoring
2553 false #show_question_text
2554 );
2555 $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
2556 $this->populateSolutionBlock($solutionoutput);
2557 $response_available = true;
2558 $jump_to_response = true;
2559 }
2560
2561 $reachedPoints = $question_gui->getObject()->getAdjustedReachedPoints(
2562 $this->test_session->getActiveId(),
2563 ilObjTest::_getPass($this->test_session->getActiveId()),
2564 $authorizedSolution
2565 );
2566
2567 $maxPoints = $question_gui->getObject()->getMaximumPoints();
2568
2569 $solutionCorrect = ($reachedPoints == $maxPoints);
2570
2571 // This controls if the score should be shown.
2572 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
2573 if ($this->object->getAnswerFeedbackPoints()) {
2574 $this->populateScoreBlock($reachedPoints, $maxPoints);
2575 $response_available = true;
2576 $jump_to_response = true;
2577 }
2578
2579 // This controls if the generic feedback should be shown.
2580 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2581 if ($this->object->getGenericAnswerFeedback()) {
2582 if ($this->populateGenericFeedbackBlock($question_gui, $solutionCorrect)) {
2583 $response_available = true;
2584 $jump_to_response = true;
2585 }
2586 }
2587
2588 // This controls if the specific feedback should be shown.
2589 // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
2590 if ($this->object->getSpecificAnswerFeedback()) {
2591 if ($question_gui->hasInlineFeedback()) {
2592 // Don't jump to the feedback below the question if some feedback is shown within the question
2593 $jump_to_response = false;
2594 } elseif ($this->populateSpecificFeedbackBlock($question_gui)) {
2595 $response_available = true;
2596 $jump_to_response = true;
2597 }
2598 }
2599
2600 $this->populateFeedbackBlockHeader($jump_to_response);
2601 if (!$response_available) {
2602 if ($question_gui->hasInlineFeedback()) {
2603 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_is_given_inline'));
2604 } else {
2605 $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_not_available_for_answer'));
2606 }
2607 }
2608 }
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 2476 of file class.ilTestPlayerAbstractGUI.php.

2476 : void
2477 {
2478 $question_gui->setNavigationGUI(null);
2479 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
2480
2481 $answer_feedback_enabled = $this->object->getSpecificAnswerFeedback();
2482
2483 $solutionoutput = $question_gui->getSolutionOutput(
2484 $this->test_session->getActiveId(), #active_id
2485 $this->test_session->getPass(), #pass
2486 false, #graphical_output
2487 false, #result_output
2488 true, #show_question_only
2489 $answer_feedback_enabled, #show_feedback
2490 false, #show_correct_solution
2491 false, #show_manual_scoring
2492 true #show_question_text
2493 );
2494
2495 $pageoutput = $question_gui->outQuestionPage(
2496 "",
2497 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
2498 $this->test_session->getActiveId(),
2499 $solutionoutput
2500 );
2501
2502 $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'components/ILIAS/Test');
2503
2504 // populate the instant response blocks in the
2505 $saved_tpl = $this->tpl;
2506 $this->tpl = $tpl;
2507 $this->populateInstantResponseBlocks($question_gui, true);
2508 $this->tpl = $saved_tpl;
2509
2510 $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
2511 $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $this->getQuestionFeedbackModalHtml($tpl, $nav_url));
2512 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
special template class to simplify handling of ITX/PEAR
getQuestionFeedbackModalHtml(ilTemplate $tpl, string $nav_url)
populateInstantResponseBlocks(assQuestionGUI $question_gui, $authorizedSolution)
setVariable(string $variable, $value='')
Sets the given variable to the given value.

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

+ Here is the call graph for this function:

◆ populateLowerNextButtonBlock()

ilTestPlayerAbstractGUI::populateLowerNextButtonBlock (   $primary_next)
protected

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

515 : void
516 {
517 $button = $this->buildNextButtonInstance($primary_next);
518
519 $this->tpl->setCurrentBlock("next_bottom");
520 $this->tpl->setVariable("BTN_NEXT_BOTTOM", $this->ui_renderer->render($button));
521 $this->tpl->parseCurrentBlock();
522 }

◆ populateLowerPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateLowerPreviousButtonBlock ( )
protected

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

534 {
535 $button = $this->buildPreviousButtonInstance();
536
537 $this->tpl->setCurrentBlock("prev_bottom");
538 $this->tpl->setVariable("BTN_PREV_BOTTOM", $this->ui_renderer->render($button));
539 $this->tpl->parseCurrentBlock();
540 }

◆ populateMessageContent()

ilTestPlayerAbstractGUI::populateMessageContent ( string  $content_html)
protected

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

2789 : void
2790 {
2791 if ($this->object->getKioskMode()) {
2792 $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "components/ILIAS/Test");
2793 $this->tpl->setContent($content_html);
2794 return;
2795 }
2796 $this->tpl->setVariable($this->getContentBlockName(), $content_html);
2797 }

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

2802 : array
2803 {
2804 $signals = [self::DISCARD_MODAL => $this->populateDiscardSolutionModal()];
2805
2806 if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2809 }
2810
2811 return $signals;
2812 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ populateNextButtons()

ilTestPlayerAbstractGUI::populateNextButtons (   $primary_next)
protected

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

509 : void
510 {
511 $this->populateUpperNextButtonBlock($primary_next);
512 $this->populateLowerNextButtonBlock($primary_next);
513 }

◆ populateNextLocksChangedModal()

ilTestPlayerAbstractGUI::populateNextLocksChangedModal ( )
protected

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

2842 : Signal
2843 {
2844 $empty_signal = new \ILIAS\UI\Implementation\Component\Signal('');
2846 return $empty_signal;
2847 }
2848
2849 $modal_message = $this->ui_factory->messageBox()->confirmation(
2850 $this->lng->txt('tst_nav_next_locks_current_answer_confirm')
2851 );
2852 $modal_checkbox = $this->ui_factory->input()->field()->checkbox(
2853 $this->lng->txt('tst_dont_show_msg_again_in_current_session')
2854 )->withDedicatedName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2855
2856 $modal = $this->ui_factory->modal()->roundtrip(
2857 $this->lng->txt('tst_nav_next_locks_current_answer_header'),
2858 $modal_message,
2859 [ $modal_checkbox ],
2860 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksChanged()'
2861 )->withSubmitLabel($this->lng->txt('tst_proceed'));
2862
2863 $this->tpl->setCurrentBlock('next_locks_changed_modal');
2864 $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $this->ui_renderer->render($modal));
2865 $this->tpl->parseCurrentBlock();
2866 return $modal->getShowSignal();
2867 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

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

2828 : Signal
2829 {
2830 $modal = $this->ui_factory->modal()->interruptive(
2831 $this->lng->txt('tst_nav_next_locks_empty_answer_header'),
2832 $this->lng->txt('tst_nav_next_locks_empty_answer_confirm'),
2833 'javascript:il.TestPlayerQuestionEditControl.confirmNextLocksUnchanged()'
2834 )->withActionButtonLabel($this->lng->txt('tst_proceed'));
2835
2836 $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2837 $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $this->ui_renderer->render($modal));
2838 $this->tpl->parseCurrentBlock();
2839 return $modal->getShowSignal();
2840 }

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

2885 : void
2886 {
2887 $config = [];
2888 $state = $question_gui->getObject()->lookupForExistingSolutions($this->test_session->getActiveId(), $this->test_session->getPass());
2889 $config['isAnswered'] = $state['authorized'];
2890 $config['isAnswerChanged'] = $state['intermediate'] || $this->getAnswerChangedParameter();
2891 $config['isAnswerFixed'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2892 $config['saveOnTimeReachedUrl'] = str_replace('&amp;', '&', $this->ctrl->getFormAction($this, ilTestPlayerCommands::AUTO_SAVE_ON_TIME_LIMIT));
2893
2894 $config['autosaveUrl'] = '';
2895 $config['autosaveInterval'] = 0;
2896 if ($question_gui->getObject() instanceof QuestionAutosaveable && $this->object->getAutosave()) {
2897 $config['autosaveUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AUTO_SAVE, '', true);
2898 $config['autosaveInterval'] = $this->object->getMainSettings()->getQuestionBehaviourSettings()->getAutosaveInterval();
2899 }
2900
2901 $question_config = $question_gui->getObject()->getTestPresentationConfig();
2902
2903 $config['withFormChangeDetection'] = $question_config->isFormChangeDetectionEnabled();
2904
2905 // Flash and Java questions: changes are directly sent to ilias and have to be polled from there
2906 $config['withBackgroundChangeDetection'] = $question_config->isBackgroundChangeDetectionEnabled();
2907 $config['backgroundDetectorUrl'] = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::DETECT_CHANGES, '', true);
2908
2909 // Forced feedback will change the navigation saving command
2910 $config['forcedInstantFeedback'] = $this->object->isForceInstantFeedbackEnabled();
2911 $config['questionLocked'] = $this->isParticipantsAnswerFixed($question_gui->getObject()->getId());
2912 $config['nextQuestionLocks'] = $this->object->isFollowupQuestionAnswerFixationEnabled();
2913 $config['autosaveFailureMessage'] = $this->lng->txt('autosave_failed');
2914
2915 // Add the modal signals and parameter name for the follow-up question locks confirmation
2916 $config['modalSignals'] = array_map(fn(Signal $signal) => $signal->getId(), $this->modal_signals);
2917 $config['preventConfirmationParam'] = self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM;
2918
2919 $this->tpl->addJavascript('assets/js/ilTestPlayerQuestionEditControl.js');
2920 $this->tpl->addOnLoadCode('il.TestPlayerQuestionEditControl.init(' . json_encode($config) . ')');
2921 }
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 492 of file class.ilTestPlayerAbstractGUI.php.

492 : void
493 {
494 if (!$this->isFirstQuestionInSequence($sequence_element)) {
496 }
497
498 if (!$this->isLastQuestionInSequence($sequence_element)) {
499 $this->populateNextButtons($primary_next);
500 }
501 }

◆ populateQuestionOptionalMessage()

ilTestPlayerAbstractGUI::populateQuestionOptionalMessage ( )
abstractprotected

◆ populateScoreBlock()

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

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

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

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

659 {
660 if (strlen($solutionoutput)) {
661 $this->tpl->setCurrentBlock("solution_output");
662 $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
663 $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
664 $this->tpl->parseCurrentBlock();
665 }
666 }

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

602 : bool
603 {
604 $solutionValues = $question_gui->getObject()->getSolutionValues(
605 $this->test_session->getActiveId(),
606 null
607 );
608
609 $feedback = $question_gui->getSpecificFeedbackOutput(
610 $question_gui->getObject()->fetchIndexedValuesFromValuePairs($solutionValues)
611 );
612
613 if (!empty($feedback)) {
614 $this->tpl->setCurrentBlock("specific_feedback");
615 $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
616 $this->tpl->parseCurrentBlock();
617 return true;
618 }
619 return false;
620 }
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 668 of file class.ilTestPlayerAbstractGUI.php.

669 {
670 $this->tpl->setCurrentBlock("SyntaxStyle");
671 $this->tpl->setVariable(
672 "LOCATION_SYNTAX_STYLESHEET",
674 );
675 $this->tpl->parseCurrentBlock();
676 }

References ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ populateTestNavigationToolbar()

ilTestPlayerAbstractGUI::populateTestNavigationToolbar ( ilTestNavigationToolbarGUI  $toolbar_gui)
protected

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

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

◆ populateUpperNextButtonBlock()

ilTestPlayerAbstractGUI::populateUpperNextButtonBlock (   $primaryNext)
protected

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

525 {
526 $button = $this->buildNextButtonInstance($primaryNext);
527
528 $this->tpl->setCurrentBlock("next");
529 $this->tpl->setVariable("BTN_NEXT", $this->ui_renderer->render($button));
530 $this->tpl->parseCurrentBlock();
531 }

◆ populateUpperPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateUpperPreviousButtonBlock ( )
protected

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

543 {
544 $button = $this->buildPreviousButtonInstance();
545
546 $this->tpl->setCurrentBlock("prev");
547 $this->tpl->setVariable("BTN_PREV", $this->ui_renderer->render($button));
548 $this->tpl->parseCurrentBlock();
549 }

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

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

2211 {
2212 $this->tpl->addBlockFile(
2213 $this->getContentBlockName(),
2214 'adm_content',
2215 'tpl.il_as_tst_question_summary.html',
2216 'components/ILIAS/Test'
2217 );
2218 }

◆ prepareTestPage()

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

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

1152 {
1153 $this->navigation_history->addItem(
1154 $this->test_session->getRefId(),
1155 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::RESUME_PLAYER),
1156 'tst'
1157 );
1158
1159 $this->initTestPageTemplate();
1161 $this->populateSyntaxStyleBlock();
1162
1163 if ($this->isMaxProcessingTimeReached()) {
1165 return;
1166 }
1167
1168 if ($this->object->endingTimeReached()) {
1169 $this->endingTimeReached();
1170 return;
1171 }
1172
1173 if ($this->isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)) {
1174 $this->ctrl->setParameter($this, "sequence", $sequenceElement);
1176 return;
1177 }
1178
1179 $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId());
1180 $this->tpl->setVariable("LOGIN", $this->user->getLogin());
1181
1182 $this->tpl->setVariable("SEQ_ID", $sequenceElement);
1183 $this->tpl->setVariable("QUEST_ID", $question_id);
1184
1185 if ($this->object->getEnableProcessingTime()) {
1186 $this->outProcessingTime($this->test_session->getActiveId(), false);
1187 }
1188
1189 $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1190
1191 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
1192 $this->tpl->setCurrentBlock('exam_id_footer');
1193 $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1194 $this->test_session->getActiveId(),
1195 $this->test_session->getPass(),
1196 $this->object->getId()
1197 ));
1198 $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1199 $this->tpl->parseCurrentBlock();
1200 }
1201
1202 if ($this->object->getListOfQuestions()) {
1203 $this->showSideList($sequenceElement);
1204 }
1205 }
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 2192 of file class.ilTestPlayerAbstractGUI.php.

2193 {
2194 $this->handleCheckTestPassValid();
2195
2196 $sequence_element = $this->test_sequence->getPreviousSequence(
2198 );
2199
2200 if (!$this->isValidSequenceElement($sequence_element)) {
2201 $sequence_element = $this->test_sequence->getLastSequence();
2202 }
2203
2204 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
2205 $this->ctrl->setParameter($this, 'pmode', '');
2206
2207 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2208 }

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

845 : void
846 {
847 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_DURATION);
848
849 $this->redirectAfterFinish();
850 }

◆ redirectAfterFinish()

ilTestPlayerAbstractGUI::redirectAfterFinish ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ redirectAfterQuestionListCmd()

ilTestPlayerAbstractGUI::redirectAfterQuestionListCmd ( )

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

852 : void
853 {
854 $this->performTestPassFinishedTasks(StatusOfAttempt::FINISHED_BY_DURATION);
855
856 $this->redirectAfterFinish();
857 }

◆ redirectBackCmd()

ilTestPlayerAbstractGUI::redirectBackCmd ( )

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

1107 : void
1108 {
1109 $testPassesSelector = new ilTestPassesSelector($this->db, $this->object);
1110 $testPassesSelector->setActiveId($this->test_session->getActiveId());
1111 $testPassesSelector->setLastFinishedPass($this->test_session->getLastFinishedPass());
1112
1113 if (count($testPassesSelector->getReportablePasses())) {
1114 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1115 $this->ctrl->redirectByClass(['ilTestResultsGUI', 'ilTestEvalObjectiveOrientedGUI']);
1116 }
1117
1118 $this->ctrl->redirectByClass([ilTestResultsGUI::class, ilMyTestResultsGUI::class, ilTestEvaluationGUI::class]);
1119 }
1120
1121 $this->ctrl->redirectByClass(TestScreenGUI::class, TestScreenGUI::DEFAULT_CMD);
1122 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl ( string  $forced_feedback_nav_url)
protected

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

2929 : void
2930 {
2931 if (ilSession::get('forced_feedback_navigation_url') == null) {
2932 ilSession::set('forced_feedback_navigation_url', []);
2933 }
2934 $forced_feeback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2935 $forced_feeback_navigation_url[$this->test_session->getActiveId()] = $forced_feedback_nav_url;
2936 ilSession::set('forced_feedback_navigation_url', $forced_feeback_navigation_url);
2937 }

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

+ Here is the call graph for this function:

◆ removeIntermediateSolution()

ilTestPlayerAbstractGUI::removeIntermediateSolution ( )

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

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

References getCurrentQuestionId(), and getQuestionInstance().

+ Here is the call graph for this function:

◆ resumePlayerCmd()

ilTestPlayerAbstractGUI::resumePlayerCmd ( )
protected

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

739 {
740 $this->handleUserSettings();
741
742 $active_id = $this->test_session->getActiveId();
743 $this->ctrl->setParameter($this, "active_id", $active_id);
744
745 $active_time_id = $this->object->startWorkingTime($active_id, $this->test_session->getPass());
746 ilSession::set("active_time_id", $active_time_id);
747 ilSession::set('tst_pass_finish', 0);
748
749 if ($this->object->isRandomTest()) {
750 if (!$this->test_sequence->hasRandomQuestionsForPass($active_id, $this->test_session->getPass())) {
751 // create a new set of random questions
753 }
754 }
755
756 $shuffle = $this->object->getShuffleQuestions();
757 if ($this->object->isRandomTest()) {
758 $shuffle = false;
759 }
760
761 $this->test_result_repository->updateTestAttemptResult(
762 $active_id,
763 $this->test_session->getPass(),
764 null,
765 $this->object->getId()
766 );
767
768 // ensure existing test sequence
769 if (!$this->test_sequence->hasSequence()) {
770 $this->test_sequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
771 $this->test_sequence->saveToDb();
772 }
773
774 if ($this->object->getListOfQuestionsStart()) {
775 $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY);
776 }
777
778 $this->ctrl->setParameter($this, 'sequence', $this->test_session->getLastSequence());
779 $this->ctrl->setParameter($this, 'pmode', '');
780 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
781 }
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 1563 of file class.ilTestPlayerAbstractGUI.php.

1564 {
1566 $this->setAnswerChangedParameter(false);
1567 $this->ctrl->saveParameter($this, 'sequence');
1568 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1569 }

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

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

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

+ Here is the call graph for this function:

◆ saveNavigationPreventConfirmation()

ilTestPlayerAbstractGUI::saveNavigationPreventConfirmation ( )
protected

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

2712 : void
2713 {
2714 if ($this->testrequest->retrieveBoolFromPost('save_on_navigation_prevent_confirmation')) {
2715 ilSession::set('save_on_navigation_prevent_confirmation', true);
2716 }
2717
2718 if ($this->testrequest->retrieveBoolFromPost(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM)) {
2719 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2720 }
2721 }

References ilSession\set().

+ Here is the call graph for this function:

◆ saveQuestionSolution()

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

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

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

◆ saveTagsCmd()

ilTestPlayerAbstractGUI::saveTagsCmd ( )

Save tags for tagging gui.

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

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

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

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

+ Here is the call graph for this function:

◆ sendNewPassFinishedNotificationEmailIfActivated()

ilTestPlayerAbstractGUI::sendNewPassFinishedNotificationEmailIfActivated ( int  $active_id,
int  $pass 
)
protected

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

1043 {
1044 $notification_type = $this->object->getMainSettings()->getFinishingSettings()->getMailNotificationContentType();
1045
1046 if ($notification_type === 0
1047 || !$this->object->getMainSettings()->getFinishingSettings()->getAlwaysSendMailNotification()
1048 && $pass !== $this->object->getNrOfTries() - 1) {
1049 return;
1050 }
1051
1052 switch ($this->object->getMainSettings()->getFinishingSettings()->getMailNotificationContentType()) {
1053 case 1:
1054 $this->object->sendSimpleNotification($active_id);
1055 break;
1056 case 2:
1057 $this->object->sendAdvancedNotification($active_id);
1058 break;
1059 }
1060 }

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setAnswerChangedParameter()

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

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

2698 {
2699 $this->ctrl->setParameter($this, 'test_answer_changed', $changed ? '1' : '0');
2700 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

2872 {
2873 ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2874 }

References ilSession\set().

+ Here is the call graph for this function:

◆ showAnswerOptionalQuestionsConfirmation()

ilTestPlayerAbstractGUI::showAnswerOptionalQuestionsConfirmation ( )
protected

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

2339 {
2340 $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
2341
2342 $confirmation->setFormAction($this->ctrl->getFormAction($this));
2343 $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
2344 $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
2345
2346 $confirmation->build($this->object->isFixedTest());
2347
2348 $this->populateHelperGuiContent($confirmation);
2349 }

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

1128 {
1129 $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
1131 $this->object->getTitle() . ' - ' . $this->lng->txt('final_statement')
1132 );
1133
1134 $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1135 $this->ctrl->setParameterByClass(ilTestPageGUI::class, 'page_type', 'concludingremarkspage');
1136 $this->ctrl->setParameterByClass(static::class, 'skipfinalstatement', 1);
1137 $this->tpl->setVariable(
1138 $this->getContentBlockName(),
1139 $this->ui_renderer->render([
1140 $this->ui_factory->legacy()->content(
1141 $this->object->prepareTextareaOutput($this->object->getFinalStatement(), true)
1142 ),
1143 $this->ui_factory->button()->standard(
1144 $this->lng->txt('btn_next'),
1145 $this->ctrl->getLinkTargetByClass(static::class, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED)
1146 )
1147 ])
1148 );
1149 }

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

2120 {
2121 $question_id = $this->test_sequence->getQuestionForSequence(
2123 );
2124
2125 if (!$this->isParticipantsAnswerFixed($question_id)) {
2126 if ($this->saveQuestionSolution(true)) {
2128 $this->setAnswerChangedParameter(false);
2129 } else {
2130 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2131 }
2132 $this->test_sequence->setQuestionChecked($question_id);
2133 $this->test_sequence->saveToDb();
2134 } elseif ($this->object->isForceInstantFeedbackEnabled()) {
2135 $this->test_sequence->setQuestionChecked($question_id);
2136 $this->test_sequence->saveToDb();
2137 }
2138
2139 $this->ctrl->setParameter($this, 'instresp', 1);
2140
2141 // fau: testNav - handle navigation after feedback
2142 if ($this->getNavigationUrlParameter()) {
2145 }
2146 // fau.
2147 $this->ctrl->redirectByClass(static::class, ilTestPlayerCommands::SHOW_QUESTION);
2148 }
registerForcedFeedbackNavUrl(string $forced_feedback_nav_url)

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

+ Here is the call graph for this function:

◆ showListOfAnswers()

ilTestPlayerAbstractGUI::showListOfAnswers (   $active_id,
  $pass = null,
  $top_data = "",
  $bottom_data = "" 
)

Creates an output of the list of answers for a test participant during the test (only the actual pass will be shown)

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

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

1994 {
1995 $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "components/ILIAS/Test");
1996
1997 $result_array = $this->object->getTestResult(
1998 $active_id,
1999 $pass,
2000 false,
2001 !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
2002 );
2003
2004 $counter = 1;
2005 // output of questions with solutions
2006 foreach ($result_array as $question_data) {
2007 $question = $question_data["qid"];
2008 if (is_numeric($question)) {
2009 $this->tpl->setCurrentBlock("printview_question");
2010 $question_gui = $this->object->createQuestionGUI("", $question);
2011 $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "components/ILIAS/TestQuestionPool");
2012 $template->setVariable("COUNTER_QUESTION", $counter . ". ");
2013 $template->setVariable("QUESTION_TITLE", $question_gui->getObject()->getTitleForHTMLOutput());
2014
2015 $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
2016 $result_output = $question_gui->getSolutionOutput(
2017 $active_id,
2018 $pass,
2019 false,
2020 false,
2021 $show_question_only,
2022 $this->object->getShowSolutionFeedback()
2023 );
2024 $template->setVariable("SOLUTION_OUTPUT", $result_output);
2025 $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
2026 $this->tpl->parseCurrentBlock();
2027 $counter++;
2028 }
2029 }
2030
2031 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css"), "print");
2032 if ($this->object->getShowSolutionAnswersOnly()) {
2033 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css"), "print");
2034 }
2035 if (strlen($top_data)) {
2036 $this->tpl->setCurrentBlock("top_data");
2037 $this->tpl->setVariable("TOP_DATA", $top_data);
2038 $this->tpl->parseCurrentBlock();
2039 }
2040
2041 if (strlen($bottom_data)) {
2042 $this->tpl->setCurrentBlock("bottom_data");
2043 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
2044 $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
2045 $this->tpl->parseCurrentBlock();
2046 }
2047
2048 $this->tpl->setCurrentBlock("adm_content");
2049 $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
2050 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($this->test_session, $active_id, true);
2051 $signature = $this->getResultsSignature();
2052 $this->tpl->setVariable("USER_DETAILS", $user_data);
2053 $this->tpl->setVariable("SIGNATURE", $signature);
2054 $this->tpl->setVariable("TITLE", $this->object->getTitle());
2055 $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
2056 $invited_user = &$this->object->getInvitedUsers($this->user->getId());
2057 $pagetitle = $this->object->getTitle() . ' - ' . $this->lng->txt('clientip') .
2058 ': ' . $_SERVER['REMOTE_ADDR'] . ' - ' .
2059 $this->lng->txt('matriculation') . ': ' .
2060 $invited_user[$this->user->getId()]['matriculation'];
2061 $this->tpl->setVariable('PAGETITLE', $pagetitle);
2062 $this->tpl->parseCurrentBlock();
2063 }
getResultsSignature()
Returns HTML code for a signature field.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$counter

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

+ Here is the call graph for this function:

◆ showQuestionCmd()

ilTestPlayerAbstractGUI::showQuestionCmd ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ showQuestionEditable()

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

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

1276 : void {
1277 $question_navigation_gui = $this->buildEditableStateQuestionNavigationGUI($question_gui->getObject()->getId());
1278 $question_navigation_gui->setQuestionWorkedThrough($is_question_worked_through);
1279 if ($is_question_worked_through) {
1280 $question_navigation_gui->setDiscardSolutionButtonEnabled(true);
1281 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
1282 } elseif ($this->object->isPostponingEnabled()) {
1283 $question_navigation_gui->setSkipQuestionLinkTarget(
1284 $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION)
1285 );
1286 }
1287 $question_gui->setNavigationGUI($question_navigation_gui);
1288
1289 $user_post_solution = false;
1290 if ($this->testrequest->isset('save_error')
1291 && $this->testrequest->int('save_error') === 1
1292 && ilSession::get('previouspost') !== null) {
1293 $user_post_solution = ilSession::get('previouspost');
1294 ilSession::clear('previouspost');
1295 }
1296
1297 $question_config = $question_gui->getObject()->getTestPresentationConfig();
1298
1299 if ($question_gui instanceof assMultipleChoiceGUI) {
1300 $question_config->setWorkedThrough($is_question_worked_through);
1301 }
1302
1303 if ($question_config->isPreviousPassSolutionReuseAllowed()) {
1304 $pass_index = $this->determineSolutionPassIndex($question_gui);
1305 if ($pass_index < $this->test_session->getPass()) {
1306 $question_config->setSolutionInitiallyPrefilled(true);
1307 }
1308 } else {
1309 $pass_index = $this->test_session->getPass();
1310 }
1311
1312
1313 $this->modal_signals = $this->populateModals();
1314 $question_navigation_gui->setShowDiscardModalSignal($this->modal_signals[self::DISCARD_MODAL]);
1315
1316 $question_gui->outQuestionForTest(
1317 $form_action,
1318 $this->test_session->getActiveId(),
1319 $pass_index,
1320 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
1321 $user_post_solution,
1322 $instant_response && $this->object->getSpecificAnswerFeedback()
1323 );
1324
1325 $this->populateQuestionEditControl($question_gui);
1326 }
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 1227 of file class.ilTestPlayerAbstractGUI.php.

1232 : void {
1233 $question_navigation_gui = $this->buildReadOnlyStateQuestionNavigationGUI($question_gui->getObject()->getId());
1234 $question_navigation_gui->setQuestionWorkedThrough($is_question_worked_through);
1235 $question_gui->setNavigationGUI($question_navigation_gui);
1236 $question_gui->getQuestionHeaderBlockBuilder()->setQuestionAnswered($is_question_worked_through);
1237
1238 $solutionoutput = $question_gui->getSolutionOutput(
1239 $this->test_session->getActiveId(),
1240 $this->test_session->getPass(),
1241 false,
1242 false,
1243 true,
1244 $instant_response && $this->object->getSpecificAnswerFeedback(),
1245 false,
1246 false,
1247 true
1248 );
1249
1250 $pageoutput = $question_gui->outQuestionPage(
1251 '',
1252 $this->isShowingPostponeStatusReguired($question_gui->getObject()->getId()),
1253 $this->test_session->getActiveId(),
1254 $solutionoutput
1255 );
1256
1257 $this->tpl->setVariable(
1258 'LOCKSTATE_INFOBOX',
1259 $this->ui_renderer->render(
1260 $this->ui_factory->messageBox()->info($this->lng->txt('tst_player_answer_saved_and_locked'))
1261 )
1262 );
1263 $this->tpl->parseCurrentBlock();
1264 $this->tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
1265 $this->tpl->setVariable('FORMACTION', $form_action);
1266 $this->tpl->setVariable('ENCTYPE', 'enctype="' . $question_gui->getFormEncodingType() . '"');
1267 $this->tpl->setVariable('FORM_TIMESTAMP', time());
1268 $this->populateQuestionEditControl($question_gui);
1269 }

◆ showSideList()

ilTestPlayerAbstractGUI::showSideList (   $current_sequence_element)
protected

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

1845 : void
1846 {
1847 $question_summary_data = $this->service->getQuestionSummaryData($this->test_sequence);
1848 $questions = [];
1849 $active = 0;
1850
1851 foreach ($question_summary_data as $idx => $row) {
1852 $title = htmlspecialchars($row['title'], ENT_QUOTES, null, false);
1853 $description = '';
1854 if ($row['description'] !== '') {
1855 $description = htmlspecialchars($row['description'], ENT_QUOTES, null, false);
1856 }
1857
1858 if (!$row['disabled']) {
1859 $this->ctrl->setParameter($this, 'pmode', '');
1860 $this->ctrl->setParameter($this, 'sequence', $row['sequence']);
1861 $action = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SHOW_QUESTION);
1862 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1863 $this->ctrl->setParameter($this, 'sequence', $this->getCurrentSequenceElement($current_sequence_element));
1864 }
1865
1867
1868 if (
1869 ($row['worked_through'] || $row['isAnswered'])
1870 && $row['has_authorized_answer']
1871 ) {
1873 }
1874
1875 $questions[] = $this->ui_factory->listing()->workflow()
1876 ->step($title, $description, $action)
1877 ->withStatus($status);
1878 $active = $row['sequence'] == $current_sequence_element ? $idx : $active;
1879 }
1880
1881 $question_listing = $this->ui_factory->listing()->workflow()->linear(
1882 $this->lng->txt('mainbar_button_label_questionlist'),
1883 $questions
1884 )->withActive($active);
1885
1886
1887 $this->global_screen->tool()->context()->current()->addAdditionalData(
1889 $question_listing
1890 );
1891 }

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

1608 {
1609 $current_sequence_element = $this->getCurrentSequenceElement();
1610 $next_sequence_element = $this->test_sequence->getNextSequence($current_sequence_element);
1611
1612 if (!$this->isValidSequenceElement($next_sequence_element)) {
1613 $next_sequence_element = $this->test_sequence->getFirstSequence();
1614 }
1615
1616 if ($this->object->isPostponingEnabled()) {
1617 $this->test_sequence->postponeSequence($current_sequence_element);
1618 $this->test_sequence->saveToDb();
1619 }
1620
1621 if ($this->logger->isLoggingEnabled()
1622 && !$this->getObject()->getAnonymity()) {
1623 $this->logger->logParticipantInteraction(
1624 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1625 $this->object->getRefId(),
1626 $this->test_sequence->getQuestionForSequence($current_sequence_element),
1627 $this->user->getId(),
1628 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1629 TestParticipantInteractionTypes::QUESTION_SKIPPED,
1630 []
1631 )
1632 );
1633 }
1634
1635 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
1636 $this->ctrl->setParameter($this, 'pmode', '');
1637
1638 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1639 }

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

+ Here is the call graph for this function:

◆ startPlayerCmd()

ilTestPlayerAbstractGUI::startPlayerCmd ( )
protected

Start a test for the first time.

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

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

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

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

+ Here is the call graph for this function:

◆ startTestCmd()

ilTestPlayerAbstractGUI::startTestCmd ( )
protected

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

1642 {
1643 ilSession::set('tst_pass_finish', 0);
1644
1645 // ensure existing test session
1646 $this->test_session->setUserId($this->user->getId());
1647 $access_code = ilSession::get('tst_access_code');
1648 if ($access_code != null && isset($access_code[$this->object->getTestId()])) {
1649 $this->test_session->setAnonymousId($access_code[$this->object->getTestId()]);
1650 }
1651 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1652 $this->test_session->setObjectiveOrientedContainerId($this->getObjectiveOrientedContainer()->getObjId());
1653 }
1654 $this->test_session->saveToDb();
1655
1656 $active_id = $this->test_session->getActiveId();
1657 $this->ctrl->setParameter($this, "active_id", $active_id);
1658
1659 $shuffle = $this->object->getShuffleQuestions();
1660 if ($this->object->isRandomTest()) {
1662
1663 $this->object->loadQuestions();
1664 $shuffle = false; // shuffle is already done during the creation of the random questions
1665 }
1666
1667 $this->test_result_repository->updateTestAttemptResult(
1668 $active_id,
1669 $this->test_session->getPass(),
1670 null,
1671 $this->object->getId()
1672 );
1673
1674 // ensure existing test sequence
1675 if (!$this->test_sequence->hasSequence()) {
1676 $this->test_sequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
1677 $this->test_sequence->saveToDb();
1678 }
1679
1680 $this->test_sequence->loadFromDb();
1681 $this->test_sequence->loadQuestions();
1682
1683 if ($this->test_session->isObjectiveOriented()) {
1684 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->test_session);
1685
1686 $objectivesAdapter->notifyTestStart($this->test_session, $this->object->getId());
1687 $objectivesAdapter->prepareTestPass($this->test_session, $this->test_sequence);
1688
1689 $objectivesAdapter->buildQuestionRelatedObjectiveList(
1690 $this->test_sequence,
1691 $this->question_related_objectives_list
1692 );
1693
1694 if ($this->test_sequence->hasOptionalQuestions()) {
1696
1697 $this->test_sequence->reorderOptionalQuestionsToSequenceEnd();
1698 $this->test_sequence->saveToDb();
1699 }
1700 }
1701
1702 $active_time_id = $this->object->startWorkingTime(
1703 $this->test_session->getActiveId(),
1704 $this->test_session->getPass()
1705 );
1706 ilSession::set("active_time_id", $active_time_id);
1707
1709
1710 $sequence_element = $this->test_sequence->getFirstSequence();
1711
1712 $this->ctrl->setParameter($this, 'sequence', $sequence_element);
1713 $this->ctrl->setParameter($this, 'pmode', '');
1714
1715 if ($this->logger->isLoggingEnabled()
1716 && !$this->getObject()->getAnonymity()) {
1717 $this->logger->logParticipantInteraction(
1718 $this->logger->getInteractionFactory()->buildParticipantInteraction(
1719 $this->object->getRefId(),
1720 null,
1721 $this->user->getId(),
1722 $this->logger->isIPLoggingEnabled() ? $_SERVER['REMOTE_ADDR'] : '',
1723 TestParticipantInteractionTypes::TEST_RUN_STARTED,
1724 []
1725 )
1726 );
1727 }
1728
1729 if ($this->object->getListOfQuestionsStart()) {
1730 $this->ctrl->setParameterByClass(static::class, 'first', '1');
1731 $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY);
1732 }
1733
1734 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1735 }

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

+ Here is the call graph for this function:

◆ submitIntermediateSolutionCmd()

ilTestPlayerAbstractGUI::submitIntermediateSolutionCmd ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ submitSolutionAndNextCmd()

ilTestPlayerAbstractGUI::submitSolutionAndNextCmd ( )
protected

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

2995 : void
2996 {
2997 if ($this->object->isForceInstantFeedbackEnabled()) {
2998 $this->submitSolutionCmd();
2999 return;
3000 }
3001
3002 if ($this->saveQuestionSolution(true, false)) {
3003 $this->test_sequence->getQuestionForSequence(
3005 );
3006
3008
3009 $next_sequence_element = $this->test_sequence->getNextSequence($this->getCurrentSequenceElement());
3010
3011 if (!$this->isValidSequenceElement($next_sequence_element)) {
3012 $next_sequence_element = $this->test_sequence->getFirstSequence();
3013 }
3014
3015 $this->test_session->setLastSequence($next_sequence_element ?? 0);
3016 $this->test_session->saveToDb();
3017
3018 $this->ctrl->setParameter($this, 'sequence', $next_sequence_element);
3019 $this->ctrl->setParameter($this, 'pmode', '');
3020 }
3021
3022 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
3023 }

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

1519 {
1520 if ($this->saveQuestionSolution(true, false)) {
1521 $question_id = $this->test_sequence->getQuestionForSequence(
1523 );
1524
1526
1527 if ($this->object->isForceInstantFeedbackEnabled()) {
1528 $this->ctrl->setParameter($this, 'instresp', 1);
1529
1530 $this->test_sequence->setQuestionChecked($question_id);
1531 $this->test_sequence->saveToDb();
1532 }
1533
1534 if ($this->getNextCommandParameter()) {
1535 if ($this->getNextSequenceParameter()) {
1536 $this->ctrl->setParameter($this, 'sequence', $this->getNextSequenceParameter());
1537 $this->ctrl->setParameter($this, 'pmode', '');
1538 }
1539
1540 $this->ctrl->redirect($this, $this->getNextCommandParameter());
1541 }
1542
1543 $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1544 } else {
1545 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1546 }
1547
1548 // fau: testNav - remember to prevent the navigation confirmation
1550 // fau.
1551
1552 // fau: testNav - handle navigation after saving
1553 if ($this->getNavigationUrlParameter()) {
1555 } else {
1556 $this->ctrl->saveParameter($this, 'sequence');
1557 }
1558 // fau.
1559 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1560 }

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

447 {
448 $this->ctrl->redirectByClass(TestScreenGUI::class, TestScreenGUI::DEFAULT_CMD);
449 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

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

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

◆ unmarkQuestionCmd()

ilTestPlayerAbstractGUI::unmarkQuestionCmd ( )
protected

Set a question unsolved.

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

983 {
984 $question_id = $this->test_sequence->getQuestionForSequence(
986 );
987
988 $this->object->setQuestionSetSolved(0, $question_id, $this->test_session->getUserId());
989
990 $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
991 }

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

+ Here is the call graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

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

2957 : void
2958 {
2959 $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2960 if (isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2961 unset($forced_feedback_navigation_url[$this->test_session->getActiveId()]);
2962 ilSession::set('forced_feedback_navigation_url', $forced_feedback_navigation_url);
2963 }
2964 }

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

+ Here is the call graph for this function:

◆ updateLearningProgressOnTestStart()

ilTestPlayerAbstractGUI::updateLearningProgressOnTestStart ( )
protected

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

2973 : void
2974 {
2975 ilLPStatusWrapper::_updateStatus($this->object->getId(), $this->user->getId());
2976 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

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

+ Here is the call graph for this function:

◆ updateWorkingTime()

ilTestPlayerAbstractGUI::updateWorkingTime ( )

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

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

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

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

+ Here is the call graph for this function:

Field Documentation

◆ $ass_settings

ilSetting ilTestPlayerAbstractGUI::$ass_settings = null
protected

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

◆ $cached_question_guis

array ilTestPlayerAbstractGUI::$cached_question_guis = []
private

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

◆ $cached_question_objects

array ilTestPlayerAbstractGUI::$cached_question_objects = []
private

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

◆ $ending_time_reached

bool ilTestPlayerAbstractGUI::$ending_time_reached

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

◆ $finish_test_modal

InterruptiveModal ilTestPlayerAbstractGUI::$finish_test_modal = null
protected

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

◆ $max_processing_time_reached

bool ilTestPlayerAbstractGUI::$max_processing_time_reached

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

◆ $modal_signals

array ilTestPlayerAbstractGUI::$modal_signals = []
protected

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

◆ $password_checker

ilTestPasswordChecker ilTestPlayerAbstractGUI::$password_checker
protected

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

◆ $process_locker

ilTestProcessLocker ilTestPlayerAbstractGUI::$process_locker
protected

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

◆ $question_related_objectives_list

ilTestQuestionRelatedObjectivesList ilTestPlayerAbstractGUI::$question_related_objectives_list
protected

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

◆ $ref_id

int ilTestPlayerAbstractGUI::$ref_id

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

◆ $test_sequence

ilTestSequence ilTestPlayerAbstractGUI::$test_sequence = null
protected

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

◆ $test_session

ilTestSession ilTestPlayerAbstractGUI::$test_session = null
protected

◆ DISCARD_MODAL

const ilTestPlayerAbstractGUI::DISCARD_MODAL = "discard_modal"
protected

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

◆ FINISH_TEST_CMD

const ilTestPlayerAbstractGUI::FINISH_TEST_CMD = 'finishTest'
protected

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

◆ FIXED_SHUFFLER_SEED_MIN_LENGTH

const ilTestPlayerAbstractGUI::FIXED_SHUFFLER_SEED_MIN_LENGTH = 8

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

◆ FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM

const ilTestPlayerAbstractGUI::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'

Definition at line 2869 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: