ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestPlayerAbstractGUI Class Reference

Output class for assessment test execution. More...

+ Inheritance diagram for ilTestPlayerAbstractGUI:
+ Collaboration diagram for ilTestPlayerAbstractGUI:

Public Member Functions

 __construct (ilObjTest $object)
 
 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 ($authorized=true, $force=false)
 saves the user input of a question More...
 
 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 ()
 
 checkOnlineTestAccess ()
 
 isTestAccessible ()
 test accessible returns true if the user can perform the test More...
 
 isNrOfTriesReached ()
 nr of tries exceeded More...
 
 endingTimeReached ()
 handle endingTimeReached More...
 
 maxProcessingTimeReached ()
 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 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 (bool $obligations_info=false, bool $obligations_filter=false)
 Output of a summary of all test questions for test participants. More...
 
 outQuestionSummaryWithObligationsInfoCmd ()
 
 outObligationsOnlySummaryCmd ()
 
 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 $testSession, $passes, $withResults)
 This method uses the data of a given test pass to create an evaluation for displaying into a table used in the ilTestEvaluationGUI. More...
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objective_oriented_container)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl 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, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
 Returns the list of answers of a users test pass. More...
 
 getPassListOfAnswersWithScoring (&$result_array, $active_id, $pass, $show_solutions=false)
 Returns the list of answers of a users test pass and offers a scoring option. 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...
 
 getResultsOfUserOutput (ilTestSession $testSession, int $active_id, int $pass, ilParticipantsTestResultsGUI $target_gui, bool $show_pass_details=true, bool $show_answers=true, bool $show_question_only=false, bool $show_reached_points=false)
 Output of the pass overview for a test called by a test participant. More...
 
 getResultsHeadUserAndPass ($active_id, $pass)
 Returns the user and pass data for a test results output. More...
 
 getQuestionResultForTestUsers (int $question_id, int $test_id)
 
 getObject ()
 

Data Fields

const PRESENTATION_MODE_VIEW = 'view'
 
const PRESENTATION_MODE_EDIT = 'edit'
 
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
bool $maxProcessingTimeReached
 
bool $endingTimeReached
 
int $ref_id
 
const FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'
 

Protected Member Functions

 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 ()
 Resume a test at the last position. More...
 
 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 ()
 
 sendNewPassFinishedNotificationEmailIfActivated (int $active_id, int $pass)
 
 afterTestPassFinishedCmd ()
 
 prepareTestPage ($sequenceElement, $questionId)
 
 isOptionalQuestionAnsweringConfirmationRequired ($sequenceElement)
 
 isShowingPostponeStatusReguired ($questionId)
 
 showQuestionViewable (assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
 
 showQuestionEditable (assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
 
 determineSolutionPassIndex (assQuestionGUI $questionGui)
 
 showQuestionCmd ()
 
 editSolutionCmd ()
 
 submitSolutionCmd ()
 
 revertChangesCmd ()
 
 discardSolutionCmd ()
 
 skipQuestionCmd ()
 
 startTestCmd ()
 
 showSideList ($current_sequence_element)
 
 isQuestionSummaryFinishTestButtonRequired ()
 
 showRequestedHintListCmd ()
 Go to requested hint list. More...
 
 confirmHintRequestCmd ()
 Go to hint request confirmation. More...
 
 isFirstQuestionInSequence ($sequenceElement)
 
 isLastQuestionInSequence ($sequenceElement)
 
 handleQuestionActionCmd ()
 
 showInstantResponseCmd ()
 
 nextQuestionCmd ()
 
 previousQuestionCmd ()
 
 prepareSummaryPage ()
 
 initTestPageTemplate ()
 
 handlePasswordProtectionRedirect ()
 
 isParticipantsAnswerFixed ($questionId)
 
 getIntroductionPageButtonLabel ()
 
 initAssessmentSettings ()
 
 handleSkillTriggering (ilTestSession $test_session)
 
 buildTestPassQuestionList ()
 
 showAnswerOptionalQuestionsConfirmation ()
 
 confirmAnswerOptionalQuestionsCmd ()
 
 cancelAnswerOptionalQuestionsCmd ()
 
 populateHelperGuiContent ($helperGui)
 
 getTestNavigationToolbarGUI ()
 
 buildReadOnlyStateQuestionNavigationGUI ($questionId)
 
 buildEditableStateQuestionNavigationGUI ($questionId)
 
 getFinishTestCommand ()
 
 populateInstantResponseModal (assQuestionGUI $questionGui, $navUrl)
 
 populateInstantResponseBlocks (assQuestionGUI $questionGui, $authorizedSolution)
 
 populateFeedbackBlockHeader ($withFocusAnchor)
 
 populateFeedbackBlockMessage (string $a_message)
 
 getCurrentSequenceElement ()
 
 getSequenceElementParameter ()
 
 getPresentationModeParameter ()
 
 getInstantResponseParameter ()
 
 getNextCommandParameter ()
 
 getNextSequenceParameter ()
 
 getNavigationUrlParameter ()
 
 getAnswerChangedParameter ()
 Get the 'answer changed' status from the current request It may be set by ilTestPlayerNavigationControl.js or by a previousRequest. More...
 
 setAnswerChangedParameter ($changed=true)
 Set the 'answer changed' url parameter for generated links. More...
 
 handleIntermediateSubmit ()
 Check the 'answer changed' parameter when a question form is intermediately submitted. More...
 
 saveNavigationPreventConfirmation ()
 Save the save the switch to prevent the navigation confirmation. More...
 
 getQuestionGuiInstance ($question_id, $fromCache=true)
 
 getQuestionInstance (int $question_id, bool $from_cache=true)
 
 initTestQuestionConfig (assQuestion $questionOBJ)
 
 handleTearsAndAngerQuestionIsNull (int $question_id, $sequence_element)
 
 populateMessageContent ($contentHTML)
 
 populateModals ()
 
 populateDiscardSolutionModal ()
 
 populateNavWhenChangedModal ()
 
 populateNextLocksUnchangedModal ()
 
 populateNextLocksChangedModal ()
 
 setFollowUpQuestionLocksConfirmationPrevented ()
 
 isFollowUpQuestionLocksConfirmationPrevented ()
 
 getQuestionsDefaultPresentationMode ($isQuestionWorkedThrough)
 
 registerForcedFeedbackNavUrl ($forcedFeedbackNavUrl)
 
 getRegisteredForcedFeedbackNavUrl ()
 
 isForcedFeedbackNavUrlRegistered ()
 
 unregisterForcedFeedbackNavUrl ()
 
 handleFileUploadCmd ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 getPassDetailsOverviewTableGUI (array $result_array, int $active_id, int $pass, ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd, ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
 
 buildPassDetailsOverviewTableGUI (ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder (int $active_id)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
 
 getFilteredTestResult (int $active_id, int $pass, bool $considerHiddenQuestions, bool $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 
 populatePassFinishDate (ilTemplate $tpl, ?int $pass_finish_date)
 
 populateExamId (ilTemplate $tpl, int $active_id, int $pass)
 

Protected Attributes

ilTestPasswordChecker $passwordChecker
 
ilTestProcessLocker $processLocker
 
ilTestSession $test_session = null
 
ilSetting $assSettings = null
 
ilTestSequence $testSequence = null
 
InterruptiveModal $finish_test_modal = null
 
- Protected Attributes inherited from ilTestServiceGUI
InternalRequestService $testrequest
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ilTestService $service = null
 
ilDBInterface $db
 
ilLanguage $lng
 
LoggingServices $logging_services
 
ilHelpGUI $help
 
ilRbacSystem $rbac_system
 
ilGlobalTemplateInterface ilTemplate $tpl
 sk 2023-08-01: We need this union type, even if it is wrong! To change this More...
 
ContentStyle $content_style
 
ilErrorHandling $error
 
ilAccess $access
 
HTTPServices $http
 
ilCtrl $ctrl
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilObjectDataCache $obj_cache
 
ilComponentRepository $component_repository
 
ilObjUser $user
 
ArrayBasedRequestWrapper $post_wrapper
 
ilNavigationHistory $navigation_history
 
Refinery $refinery
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
SkillService $skills_service
 
ilTestShuffler $shuffler
 
ilTestResultsFactory $results_factory
 
ilTestResultsPresentationFactory $results_presentation_factory
 
ILIAS $ilias
 
ilSetting $settings
 
GlobalScreenServices $global_screen
 
ilTree $tree
 
int $ref_id
 
ilTestSessionFactory $testSessionFactory = null
 
ilTestSequenceFactory $testSequenceFactory = null
 
ilTestParticipantData $participantData = null
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Private Member Functions

 buildNextButtonInstance ($primaryNext)
 
 buildPreviousButtonInstance ()
 
 getOnLoadCodeForNavigationButtons (string $target, string $cmd)
 
 outProcessingTime (int $active_id, bool $verbose)
 

Private Attributes

 $cachedQuestionGuis = []
 
 $cachedQuestionObjects = []
 

Detailed Description

Output class for assessment test execution.

The ilTestOutputGUI class creates the output for the ilObjTestGUI class when learners execute a test. This saves some heap space because the ilObjTestGUI class will be much smaller then

Author
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

ModulesTest

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

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerAbstractGUI::__construct ( ilObjTest  $object)

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

References ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

60  {
61  parent::__construct($object);
62  $this->ref_id = $this->testrequest->getRefId();
63  $this->passwordChecker = new ilTestPasswordChecker($this->rbac_system, $this->user, $this->object, $this->lng);
64  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ accessCodeConfirmedCmd()

ilTestPlayerAbstractGUI::accessCodeConfirmedCmd ( )

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

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

+ Here is the call graph for this function:

◆ afterTestPassFinishedCmd()

ilTestPlayerAbstractGUI::afterTestPassFinishedCmd ( )
protected

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), ilUtil\redirect(), ilObjTest\REDIRECT_NONE, redirectBackCmd(), and ilTestPlayerCommands\SHOW_FINAL_STATMENT.

752  {
753  // show final statement
754  if (!$this->testrequest->isset('skipfinalstatement')) {
755  if ($this->object->getMainSettings()->getFinishingSettings()->getConcludingRemarksEnabled()) {
756  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_FINAL_STATMENT);
757  }
758  }
759 
760  // redirect after test
761  $redirection_url = $this->object->getMainSettings()->getFinishingSettings()->getRedirectionUrl();
762  if (!empty($redirection_url)
763  && !$this->object->canShowTestResults($this->test_session)
764  && $this->object->getMainSettings()->getFinishingSettings()->getRedirectionMode() !== ilObjTest::REDIRECT_NONE) {
765  if ($this->object->isRedirectModeKiosk()) {
766  if ($this->object->getKioskMode()) {
767  ilUtil::redirect($redirection_url);
768  }
769  } else {
770  ilUtil::redirect($redirection_url);
771  }
772  }
773 
774  // default redirect (pass overview when enabled, otherwise testscreen)
775  $this->redirectBackCmd();
776  }
const REDIRECT_NONE
static redirect(string $a_script)
+ 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 557 of file class.ilTestPlayerAbstractGUI.php.

References $res, ILIAS\Repository\access(), canSaveResult(), exit, getAnswerChangedParameter(), getCurrentQuestionId(), isParticipantsAnswerFixed(), ILIAS\Repository\lng(), and saveQuestionSolution().

557  : void
558  {
559  if (!$this->access->checkAccess('read', '', $this->ref_id)) {
560  echo $this->lng->txt('autosave_failed') . ': ' . $this->lng->txt('msg_no_perm_read_item');
561  exit;
562  }
563  $test_can_run = $this->object->isExecutable($this->test_session, $this->test_session->getUserId());
564  if (!$test_can_run['executable']) {
565  echo $test_can_run['errormessage'];
566  exit;
567  }
568  if (!is_countable($_POST) || count($_POST) === 0) {
569  echo '';
570  exit;
571  }
572 
573  if (!$this->canSaveResult() || $this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
574  echo '-IGNORE-';
575  exit;
576  }
577 
578  $authorize = !$this->getAnswerChangedParameter();
579  $res = $this->saveQuestionSolution($authorize, true);
580 
581  if ($res) {
582  echo $this->lng->txt("autosave_success");
583  exit;
584  }
585 
586  echo $this->lng->txt("autosave_failed");
587  exit;
588  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
$res
Definition: ltiservices.php:69
exit
Definition: login.php:29
getAnswerChangedParameter()
Get the 'answer changed' status from the current request It may be set by ilTestPlayerNavigationContr...
+ 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 594 of file class.ilTestPlayerAbstractGUI.php.

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

595  {
596  if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
597  $this->saveQuestionSolution(false, true);
598  }
599  $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
600  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
+ Here is the call graph for this function:

◆ backFromFinishingCmd()

ilTestPlayerAbstractGUI::backFromFinishingCmd ( )

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

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

+ Here is the call graph for this function:

◆ buildEditableStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildEditableStateQuestionNavigationGUI (   $questionId)
protected

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

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

Referenced by showQuestionEditable().

1724  {
1725  $navigationGUI = new ilTestQuestionNavigationGUI(
1726  $this->lng,
1727  $this->ui_factory,
1728  $this->ui_renderer
1729  );
1730 
1731  if ($this->object->isForceInstantFeedbackEnabled()) {
1732  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
1733  } else {
1734  // fau: testNav - use simple "submitSolution" button instead of "submitSolutionAndNext"
1735  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
1736  // fau.
1737  }
1738 
1739  // fau: testNav - add a 'revert changes' link for editable question
1740  $navigationGUI->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
1741  // fau.
1742 
1743 
1744  // feedback
1745  switch (1) {
1746  case $this->object->getSpecificAnswerFeedback():
1747  case $this->object->getGenericAnswerFeedback():
1748  case $this->object->getAnswerFeedbackPoints():
1749  case $this->object->getInstantFeedbackSolution():
1750 
1751  $navigationGUI->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
1752 
1753  if ($this->object->isForceInstantFeedbackEnabled()) {
1754  $navigationGUI->setForceInstantResponseEnabled(true);
1755  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
1756  } else {
1757  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
1758  }
1759  }
1760 
1761  // hints
1762  if ($this->object->isOfferingQuestionHintsEnabled()) {
1763  $activeId = $this->test_session->getActiveId();
1764  $pass = $this->test_session->getPass();
1765 
1766  $questionHintTracking = new ilAssQuestionHintTracking($questionId, $activeId, $pass);
1767 
1768  if ($questionHintTracking->requestsPossible()) {
1769  $navigationGUI->setRequestHintCommand(ilTestPlayerCommands::CONFIRM_HINT_REQUEST);
1770  }
1771 
1772  if ($questionHintTracking->requestsExist()) {
1773  $navigationGUI->setShowHintsCommand(ilTestPlayerCommands::SHOW_REQUESTED_HINTS_LIST);
1774  }
1775  }
1776 
1777  if ($this->object->getShowMarker()) {
1778  $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $questionId);
1779  $solved = 0;
1780 
1781  if (count($solved_array) > 0) {
1782  $solved = array_pop($solved_array);
1783  $solved = $solved["solved"];
1784  }
1785 
1786  // fau: testNav - change question mark command to link target
1787  if ($solved == 1) {
1788  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
1789  $navigationGUI->setQuestionMarked(true);
1790  } else {
1791  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
1792  $navigationGUI->setQuestionMarked(false);
1793  }
1794  }
1795  // fau.
1796  return $navigationGUI;
1797  }
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFinishTestModal()

ilTestPlayerAbstractGUI::buildFinishTestModal ( )

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

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

Referenced by finishTestCmd().

779  {
780  $class = get_class($this);
781  $this->ctrl->setParameterByClass($class, 'finalization_confirmed', 'confirmed');
782  $next_url = $this->ctrl->getLinkTargetByClass($class, ilTestPlayerCommands::FINISH_TEST);
783  $this->ctrl->clearParameterByClass($class, 'finalization_confirmed');
784 
785  $message = $this->lng->txt('tst_finish_confirmation_question');
786  if (($this->object->getNrOfTries() - 1) === $this->test_session->getPass()) {
787  $message = $this->lng->txt('tst_finish_confirmation_question_no_attempts_left');
788  }
789 
790  return $this->ui_factory->modal()->interruptive(
791  $this->lng->txt('finish_test'),
792  $message,
793  $next_url
794  )->withActionButtonLabel($this->lng->txt('tst_finish_confirm_button'));
795  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNextButtonInstance()

ilTestPlayerAbstractGUI::buildNextButtonInstance (   $primaryNext)
private
Parameters
bool$primaryNext
Returns

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

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

Referenced by populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

281  {
282  $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::NEXT_QUESTION);
283  if ($primaryNext) {
284  $button = $this->ui_factory->button()->primary(
285  $this->lng->txt('next_question') . '<span class="glyphicon glyphicon-arrow-right"></span> ',
286  ''
287  )->withUnavailableAction(true)
289  } else {
290  $button = $this->ui_factory->button()->standard(
291  $this->lng->txt('next_question') . '<span class="glyphicon glyphicon-arrow-right"></span> ',
292  ''
293  )->withUnavailableAction(true)
295  }
296  return $button;
297  }
getOnLoadCodeForNavigationButtons(string $target, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPreviousButtonInstance()

ilTestPlayerAbstractGUI::buildPreviousButtonInstance ( )
private
Parameters
$disabled
Returns

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

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

Referenced by populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

304  {
305  $target = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::PREVIOUS_QUESTION);
306  $button = $this->ui_factory->button()->standard(
307  '<span class="glyphicon glyphicon-arrow-left"></span> ' . $this->lng->txt('previous_question'),
308  ''
309  )->withUnavailableAction(true)
311  return $button;
312  }
getOnLoadCodeForNavigationButtons(string $target, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildReadOnlyStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildReadOnlyStateQuestionNavigationGUI (   $questionId)
protected

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

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

Referenced by showQuestionViewable().

1690  {
1691  $navigationGUI = new ilTestQuestionNavigationGUI(
1692  $this->lng,
1693  $this->ui_factory,
1694  $this->ui_renderer
1695  );
1696 
1697  if (!$this->isParticipantsAnswerFixed($questionId)) {
1698  $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
1699  }
1700 
1701  if ($this->object->getShowMarker()) {
1702  $solved_array = ilObjTest::_getSolvedQuestions($this->test_session->getActiveId(), $questionId);
1703  $solved = 0;
1704 
1705  if (count($solved_array) > 0) {
1706  $solved = array_pop($solved_array);
1707  $solved = $solved["solved"];
1708  }
1709  // fau: testNav - change question mark command to link target
1710  if ($solved == 1) {
1711  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
1712  $navigationGUI->setQuestionMarked(true);
1713  } else {
1714  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
1715  $navigationGUI->setQuestionMarked(false);
1716  }
1717  }
1718  // fau.
1719 
1720  return $navigationGUI;
1721  }
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTestPassQuestionList()

ilTestPlayerAbstractGUI::buildTestPassQuestionList ( )
abstractprotected

Referenced by handleSkillTriggering().

+ Here is the caller graph for this function:

◆ cancelAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::cancelAnswerOptionalQuestionsCmd ( )
protected

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

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

1655  {
1656  if ($this->object->getListOfQuestions()) {
1657  $this->ctrl->setParameter($this, 'activecommand', 'summary');
1658  } else {
1659  $this->ctrl->setParameter($this, 'activecommand', 'previous');
1660  }
1661 
1662  $this->ctrl->redirect($this, 'redirectQuestion');
1663  }
+ Here is the call graph for this function:

◆ canSaveResult()

ilTestPlayerAbstractGUI::canSaveResult ( )
abstractprotected

Referenced by autosaveCmd(), and removeIntermediateSolution().

+ Here is the caller graph for this function:

◆ checkOnlineTestAccess()

ilTestPlayerAbstractGUI::checkOnlineTestAccess ( )

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

References $_SERVER, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

1069  {
1070  $user_filtered_for_invitation = $this->object->getInvitedUsers($this->user->getId());
1071  if ($user_filtered_for_invitation === []) {
1072  $this->tpl->setOnScreenMessage('info', $this->lng->txt('user_not_invited'), true);
1073  $this->ctrl->redirectByClass('ilobjtestgui', 'backToRepository');
1074  }
1075 
1076  $client_ip = $user_filtered_for_invitation['client_ip'];
1077  if ($client_ip !== ''
1078  && $client_ip !== $_SERVER['REMOTE_ADDR']) {
1079  $this->tpl->setOnScreenMessage('info', $this->lng->txt('user_wrong_clientip'), true);
1080  $this->ctrl->redirectByClass('ilobjtestgui', 'backToRepository');
1081  }
1082  }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
+ Here is the call graph for this function:

◆ checkReadAccess()

ilTestPlayerAbstractGUI::checkReadAccess ( )
protected

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

References ilObjTestAccess\_lookupOnlineTestAccess(), ILIAS\Survey\Mode\getId(), ilTestServiceGUI\getObject(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by ilTestOutputGUI\executeCommand().

66  : bool|string
67  {
68  if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
69  return $this->lng->txt('cannot_execute_test');
70  }
71 
72  if (ilObjTestAccess::_lookupOnlineTestAccess($this->getObject()->getId(), $this->user->getId()) !== true) {
73  return $this->lng->txt('user_wrong_clientip');
74  }
75 
76  return true;
77  }
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTestExecutable()

ilTestPlayerAbstractGUI::checkTestExecutable ( )
protected

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

References ILIAS\Repository\ctrl(), and ilTestScreenGUI\DEFAULT_CMD.

Referenced by ilTestOutputGUI\executeCommand().

80  {
81  $executable = $this->object->isExecutable($this->test_session, $this->test_session->getUserId());
82 
83  if (!$executable['executable']) {
84  $this->tpl->setOnScreenMessage('info', $executable['errormessage'], true);
85  $this->ctrl->redirectByClass(ilTestScreenGUI::class, ilTestScreenGUI::DEFAULT_CMD);
86  }
87  }
+ 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 89 of file class.ilTestPlayerAbstractGUI.php.

References ilTestSession\getUserId(), and ILIAS\Repository\user().

Referenced by ilTestOutputGUI\executeCommand().

89  : void
90  {
91  if ($test_session->getUserId() != $this->user->getId()) {
92  throw new ilTestException('active id given does not relate to current user!');
93  }
94  }
Base Exception for all Exceptions relating to Modules/Test.
+ 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 1186 of file class.ilTestPlayerAbstractGUI.php.

References exit.

1186  : void
1187  {
1188  $active_id = $this->test_session->getActiveId();
1189  echo (string) $this->object->getProcessingTimeInSeconds($active_id);
1190  exit;
1191  }
exit
Definition: login.php:29

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

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

References ILIAS\Repository\ctrl().

1646  {
1647  $this->testSequence->setAnsweringOptionalQuestionsConfirmed(true);
1648  $this->testSequence->saveToDb();
1649 
1650  $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
1651  $this->ctrl->redirect($this, 'redirectQuestion');
1652  }
+ Here is the call graph for this function:

◆ confirmHintRequestCmd()

ilTestPlayerAbstractGUI::confirmHintRequestCmd ( )
protected

Go to hint request confirmation.

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

References ilAssQuestionHintRequestGUI\CMD_CONFIRM_REQUEST, ILIAS\Repository\ctrl(), handleIntermediateSubmit(), handleQuestionActionCmd(), isFirstQuestionInSequence(), isLastQuestionInSequence(), nextQuestionCmd(), previousQuestionCmd(), and showInstantResponseCmd().

1480  {
1481  // fau: testNav - handle intermediate submit for confirming hint requests
1482  $this->handleIntermediateSubmit();
1483  // fau.
1484 
1485  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1486 
1487  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_CONFIRM_REQUEST);
1488  }
handleIntermediateSubmit()
Check the &#39;answer changed&#39; parameter when a question form is intermediately submitted.
+ 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 public

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

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

1137  {
1138  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "Modules/Test");
1139  $this->tpl->setCurrentBlock("adm_content");
1140  if ($this->object->isTestFinished($this->test_session->getActiveId())) {
1141  $this->tpl->setCurrentBlock("not_submit_allowed");
1142  $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1143  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1144  } else {
1145  $this->tpl->setCurrentBlock("submit_allowed");
1146  $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1147  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1148  }
1149  $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1150  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1151  $this->tpl->parseCurrentBlock();
1152  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ 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 609 of file class.ilTestPlayerAbstractGUI.php.

References exit, getCurrentQuestionId(), and getQuestionInstance().

610  {
611  $questionId = $this->getCurrentQuestionId();
612  $state = $this->getQuestionInstance($questionId)->lookupForExistingSolutions(
613  $this->test_session->getActiveId(),
614  $this->test_session->getPass()
615  );
616  $result = [];
617  $result['isAnswered'] = $state['authorized'];
618  $result['isAnswerChanged'] = $state['intermediate'];
619 
620  echo json_encode($result);
621  exit;
622  }
getQuestionInstance(int $question_id, bool $from_cache=true)
exit
Definition: login.php:29
+ Here is the call graph for this function:

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

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

References ILIAS\Repository\object().

Referenced by populateInstantResponseBlocks().

187  : bool
188  {
189  $show_question_inline_score = false;
190  if ($this->object->getAnswerFeedbackPoints()) {
191  $show_question_inline_score = true;
192  return $show_question_inline_score;
193  }
194  return $show_question_inline_score;
195  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineSolutionPassIndex()

ilTestPlayerAbstractGUI::determineSolutionPassIndex ( assQuestionGUI  $questionGui)
protected

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

References editSolutionCmd(), ILIAS\Repository\object(), showQuestionCmd(), and submitSolutionCmd().

Referenced by showQuestionEditable().

1017  : int
1018  {
1019  if ($this->object->isPreviousSolutionReuseEnabled($this->test_session->getActiveId())) {
1020  $currentSolutionAvailable = $questionGui->object->authorizedOrIntermediateSolutionExists(
1021  $this->test_session->getActiveId(),
1022  $this->test_session->getPass()
1023  );
1024 
1025  if (!$currentSolutionAvailable) {
1026  $previousPass = $questionGui->object->getSolutionMaxPass(
1027  $this->test_session->getActiveId()
1028  );
1029 
1030  $previousSolutionAvailable = $questionGui->object->authorizedSolutionExists(
1031  $this->test_session->getActiveId(),
1032  $previousPass
1033  );
1034 
1035  if ($previousSolutionAvailable) {
1036  return $previousPass;
1037  }
1038 
1039  }
1040  }
1041 
1042  return $this->test_session->getPass();
1043  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ discardSolutionCmd()

ilTestPlayerAbstractGUI::discardSolutionCmd ( )
abstractprotected

Referenced by revertChangesCmd().

+ Here is the caller graph for this function:

◆ displayAccessCodeCmd()

ilTestPlayerAbstractGUI::displayAccessCodeCmd ( )

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

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

491  {
492  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "Modules/Test");
493  $this->tpl->setCurrentBlock("adm_content");
494  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
495  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->test_session->getAccessCodeFromSession());
496  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
497  $this->tpl->setVariable("CMD_CONFIRM", ilTestPlayerCommands::ACCESS_CODE_CONFIRMED);
498  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("continue_work"));
499  $this->tpl->parseCurrentBlock();
500  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ editSolutionCmd()

ilTestPlayerAbstractGUI::editSolutionCmd ( )
abstractprotected

Referenced by determineSolutionPassIndex().

+ Here is the caller graph for this function:

◆ endingTimeReached()

ilTestPlayerAbstractGUI::endingTimeReached ( )

handle endingTimeReached

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

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

Referenced by prepareTestPage().

1110  {
1111  $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1112  $this->test_session->increasePass();
1113  $this->test_session->setLastSequence(0);
1114  $this->test_session->saveToDb();
1115 
1116  $this->redirectBackCmd();
1117  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureExistingTestSession()

ilTestPlayerAbstractGUI::ensureExistingTestSession ( ilTestSession  $test_session)
protected

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

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

Referenced by ilTestOutputGUI\executeCommand().

96  : void
97  {
98  if ($test_session->getActiveId()) {
99  return;
100  }
101 
102  $test_session->setUserId($this->user->getId());
103 
104  if ($test_session->isAnonymousUser()) {
105  if (!$test_session->doesAccessCodeInSessionExists()) {
106  return;
107  }
108 
109  $test_session->setAnonymousId($test_session->getAccessCodeFromSession());
110  }
111 
112  $test_session->saveToDb();
113  }
setUserId(int $user_id)
setAnonymousId(string $anonymous_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finishTestCmd()

ilTestPlayerAbstractGUI::finishTestCmd ( )

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

References ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, buildFinishTestModal(), ilSession\clear(), ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\object(), performTestPassFinishedTasks(), ilTestPlayerCommands\QUESTION_SUMMARY_INC_OBLIGATIONS, ilTestPlayerCommands\QUESTION_SUMMARY_OBLIGATIONS_ONLY, ilSession\set(), and showQuestionCmd().

677  {
678  $this->handleCheckTestPassValid();
679  ilSession::clear("tst_next");
680 
681  $all_obligations_answered = $this->object->allObligationsAnswered();
682 
683  /*
684  * The following "endgames" are possible prior to actually finishing the test:
685  * - Obligations (Ability to finish the test.)
686  * If not all obligatory questions are answered, the user is presented a list
687  * showing the deficits.
688  * - Examview (Will to finish the test.)
689  * With the examview, the participant can review all answers given in ILIAS or a PDF prior to
690  * commencing to the finished test.
691  * - Last pass allowed (Reassuring the will to finish the test.)
692  * If passes are limited, on the last pass, an additional confirmation is to be displayed.
693  */
694 
695  if ($this->object->areObligationsEnabled() && !$all_obligations_answered) {
696  if ($this->object->getListOfQuestions()) {
698  return;
699  }
700 
702  return;
703  }
704 
705  if ($this->testrequest->strVal('finalization_confirmed') !== 'confirmed') {
706  $this->finish_test_modal = $this->buildFinishTestModal();
707  $this->showQuestionCmd();
708  return;
709  }
710 
711  // Non-last try finish
712  if (ilSession::get('tst_pass_finish') === null) {
713  ilSession::set('tst_pass_finish', 1);
714  }
715 
717 
718  $this->ctrl->redirect($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED);
719  }
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ getAnswerChangedParameter()

ilTestPlayerAbstractGUI::getAnswerChangedParameter ( )
protected

Get the 'answer changed' status from the current request It may be set by ilTestPlayerNavigationControl.js or by a previousRequest.

Returns
bool

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

Referenced by autosaveCmd(), ilTestOutputGUI\executeCommand(), handleIntermediateSubmit(), and isFollowUpQuestionLocksConfirmationPrevented().

2046  : bool
2047  {
2048  return !empty($this->testrequest->raw('test_answer_changed'));
2049  }
+ Here is the caller graph for this function:

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

References ILIAS\Repository\object().

Referenced by confirmSubmitAnswers(), displayAccessCodeCmd(), initTestPageTemplate(), outQuestionSummaryCmd(), populateHelperGuiContent(), populateMessageContent(), prepareSummaryPage(), redirectAfterFinish(), showFinalStatementCmd(), and showListOfAnswers().

1441  : string
1442  {
1443  return "ADM_CONTENT";
1444 
1445  if ($this->object->getKioskMode()) {
1446  $this->tpl->setBodyClass("kiosk");
1447  $this->tpl->hideFooter();
1448  return "CONTENT";
1449  } else {
1450  return "ADM_CONTENT";
1451  }
1452  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentQuestionId()

ilTestPlayerAbstractGUI::getCurrentQuestionId ( )
abstractprotected

Referenced by autosaveCmd(), autosaveOnTimeLimitCmd(), detectChangesCmd(), redirectAfterFinish(), and removeIntermediateSolution().

+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestPlayerAbstractGUI::getCurrentSequenceElement ( )
protected

◆ getFinishTestCommand()

ilTestPlayerAbstractGUI::getFinishTestCommand ( )
protected
Returns
string

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

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

Referenced by getTestNavigationToolbarGUI().

1802  : string
1803  {
1804  if (!$this->object->getListOfQuestionsEnd()) {
1806  }
1807 
1808  if ($this->object->areObligationsEnabled()
1809  && !$this->object->allObligationsAnswered()) {
1811  }
1812 
1814  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstantResponseParameter()

ilTestPlayerAbstractGUI::getInstantResponseParameter ( )
protected

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

Referenced by ilTestOutputGUI\showQuestionCmd().

1995  {
1996  if ($this->testrequest->isset('instresp')) {
1997  return $this->testrequest->raw('instresp');
1998  }
1999 
2000  return null;
2001  }
+ Here is the caller graph for this function:

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

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

References ILIAS\Repository\lng().

1585  : string
1586  {
1587  return $this->lng->txt("save_introduction");
1588  }
+ Here is the call graph for this function:

◆ getLockParameter()

ilTestPlayerAbstractGUI::getLockParameter ( )

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

References resumePlayerCmd().

Referenced by handlePasswordProtectionRedirect(), and startPlayerCmd().

455  {
456  if ($this->testrequest->isset('lock') && strlen($this->testrequest->raw('lock'))) {
457  return $this->testrequest->raw('lock');
458  }
459 
460  return null;
461  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

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

References ilUtil\_getHttpPath().

Referenced by ilTestOutputGUI\showInstantResponseCmd(), and ilTestOutputGUI\submitSolutionCmd().

2023  : ?string
2024  {
2025  if (isset($_POST['test_player_navigation_url'])) {
2026  $navigation_url = $_POST['test_player_navigation_url'];
2027 
2028  $navigation_url_parts = parse_url($navigation_url);
2029  $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2030 
2031  if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2032  return $navigation_url;
2033  }
2034  }
2035 
2036  return null;
2037  }
static _getHttpPath()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextCommandParameter()

ilTestPlayerAbstractGUI::getNextCommandParameter ( )
protected

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

Referenced by ilTestOutputGUI\submitSolutionCmd().

2004  {
2005  $nextcmd = '';
2006  if ($this->testrequest->isset('nextcmd')) {
2007  $nextcmd = $this->testrequest->strVal('nextcmd');
2008  }
2009 
2010  return $nextcmd !== '' ? $nextcmd : null;
2011  }
+ Here is the caller graph for this function:

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

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

Referenced by ilTestOutputGUI\submitSolutionCmd().

2013  : ?int
2014  {
2015  if (isset($_POST['nextseq']) && is_numeric($_POST['nextseq'])) {
2016  return (int) $_POST['nextseq'];
2017  }
2018 
2019  return null;
2020  }
+ Here is the caller graph for this function:

◆ getOnLoadCodeForNavigationButtons()

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

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

References $id.

Referenced by buildNextButtonInstance(), and buildPreviousButtonInstance().

314  : Closure
315  {
316  return static function (string $id) use ($target, $cmd): string {
317  return "document.getElementById('{$id}').addEventListener('click', "
318  . "(e) => {il.TestPlayerQuestionEditControl.checkNavigation('{$target}', '{$cmd}', e);}"
319  . "); "
320  . "document.getElementById('{$id}').removeAttribute('disabled');";
321  };
322  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

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

1986  {
1987  if ($this->testrequest->isset('pmode')) {
1988  return $this->testrequest->raw('pmode');
1989  }
1990 
1991  return null;
1992  }

◆ getQuestionGuiInstance()

ilTestPlayerAbstractGUI::getQuestionGuiInstance (   $question_id,
  $fromCache = true 
)
protected
Parameters
$questionId
$sequenceElement
Returns
object

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

References ilTestServiceGUI\$tpl, initTestQuestionConfig(), ILIAS\Repository\object(), and assQuestionGUI\PRESENTATION_CONTEXT_TEST.

Referenced by ilTestOutputGUI\showQuestionCmd().

2103  : object
2104  {
2105  $tpl = $this->tpl;
2106 
2107  if (!$fromCache || !isset($this->cachedQuestionGuis[$question_id])) {
2108  $question_gui = $this->object->createQuestionGUI("", $question_id);
2109  $question_gui->setTargetGui($this);
2110  $question_gui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2111  $question_gui->object->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2112  $question_gui->populateJavascriptFilesRequiredForWorkForm($tpl);
2113  $question_gui->object->setShuffler($this->shuffler->getAnswerShuffleFor(
2114  $question_id,
2115  $this->test_session->getActiveId(),
2116  $this->test_session->getPass()
2117  ));
2118 
2119  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2120  $this->initTestQuestionConfig($question_gui->object);
2121  // hey.
2122 
2123  $this->cachedQuestionGuis[$question_id] = $question_gui;
2124  }
2125 
2126  return $this->cachedQuestionGuis[$question_id];
2127  }
ilGlobalTemplateInterface ilTemplate $tpl
sk 2023-08-01: We need this union type, even if it is wrong! To change this
initTestQuestionConfig(assQuestion $questionOBJ)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionInstance()

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

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

References ilObjAssessmentFolder\_enabledAssessmentLogging(), initTestQuestionConfig(), assQuestion\instantiateQuestion(), ILIAS\Repository\object(), and ILIAS\Repository\user().

Referenced by detectChangesCmd(), ilTestOutputGUI\discardSolutionCmd(), removeIntermediateSolution(), and ilTestOutputGUI\saveQuestionSolution().

2131  : assQuestion
2132  {
2133  if ($from_cache && isset($this->cachedQuestionObjects[$question_id])) {
2134  return $this->cachedQuestionObjects[$question_id];
2135  }
2136  $question = assQuestion::instantiateQuestion($question_id);
2137  $ass_settings = new ilSetting('assessment');
2138 
2139  $process_locker_factory = new ilAssQuestionProcessLockerFactory($ass_settings, $this->db);
2140  $process_locker_factory->setQuestionId($question->getId());
2141  $process_locker_factory->setUserId($this->user->getId());
2142  $process_locker_factory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
2143  $question->setProcessLocker($process_locker_factory->getLocker());
2144 
2145  $question->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2146 
2147  $this->initTestQuestionConfig($question);
2148 
2149  $this->cachedQuestionObjects[$question_id] = $question;
2150  return $question;
2151  }
Abstract basic class which is to be extended by the concrete assessment question type classes...
static instantiateQuestion(int $question_id)
initTestQuestionConfig(assQuestion $questionOBJ)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsDefaultPresentationMode()

ilTestPlayerAbstractGUI::getQuestionsDefaultPresentationMode (   $isQuestionWorkedThrough)
protected

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

2404  : string
2405  {
2406  // fau: testNav - always set default presentation mode to "edit"
2407  return self::PRESENTATION_MODE_EDIT;
2408  // fau.
2409  }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

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

References ilSession\get().

Referenced by isForcedFeedbackNavUrlRegistered(), and ilTestOutputGUI\showQuestionCmd().

2422  {
2423  if (ilSession::get('forced_feedback_navigation_url') == null) {
2424  return null;
2425  }
2426  $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2427  if (!isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2428  return null;
2429  }
2430 
2431  return $forced_feedback_navigation_url[$this->test_session->getActiveId()];
2432  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSequenceElementParameter()

ilTestPlayerAbstractGUI::getSequenceElementParameter ( )
protected

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

Referenced by ilTestOutputGUI\executeCommand(), and getCurrentSequenceElement().

1976  : ?int
1977  {
1978  if ($this->testrequest->isset('sequence')) {
1979  return $this->testrequest->int('sequence');
1980  }
1981 
1982  return null;
1983  }
+ Here is the caller graph for this function:

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

1681  {
1682  $navigation_toolbar = new ilTestNavigationToolbarGUI($this->ctrl, $this);
1683  $navigation_toolbar->setSuspendTestButtonEnabled($this->object->getShowCancel());
1684  $navigation_toolbar->setUserPassOverviewEnabled($this->object->getUsrPassOverviewEnabled());
1685  $navigation_toolbar->setFinishTestCommand($this->getFinishTestCommand());
1686  return $navigation_toolbar;
1687  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleFileUploadCmd()

ilTestPlayerAbstractGUI::handleFileUploadCmd ( )
protected

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

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

2449  {
2450  $this->updateWorkingTime();
2451  $this->saveQuestionSolution(false);
2452  $this->ctrl->redirect($this, ilTestPlayerCommands::SUBMIT_SOLUTION);
2453  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not ...
+ Here is the call graph for this function:

◆ handleIntermediateSubmit()

ilTestPlayerAbstractGUI::handleIntermediateSubmit ( )
protected

Check the 'answer changed' parameter when a question form is intermediately submitted.

  • save or delete the intermediate solution
  • save the parameter for the next request

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

References getAnswerChangedParameter(), removeIntermediateSolution(), saveQuestionSolution(), and setAnswerChangedParameter().

Referenced by confirmHintRequestCmd(), markQuestionAndSaveIntermediateCmd(), showRequestedHintListCmd(), and unmarkQuestionAndSaveIntermediateCmd().

2067  {
2068  if ($this->getAnswerChangedParameter()) {
2069  $this->saveQuestionSolution(false);
2070  } else {
2071  $this->removeIntermediateSolution();
2072  }
2074  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
setAnswerChangedParameter($changed=true)
Set the &#39;answer changed&#39; url parameter for generated links.
getAnswerChangedParameter()
Get the &#39;answer changed&#39; status from the current request It may be set by ilTestPlayerNavigationContr...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Referenced by ilTestOutputGUI\executeCommand().

1542  {
1549  if ($this->test_session->isPasswordChecked() === true) {
1550  return;
1551  }
1552 
1553  if ($this->ctrl->getNextClass() === 'iltestpasswordprotectiongui') {
1554  return;
1555  }
1556 
1557  if (!$this->passwordChecker->isPasswordProtectionPageRedirectRequired()) {
1558  $this->test_session->setPasswordChecked(true);
1559  return;
1560  }
1561 
1562  $this->ctrl->setParameterByClass(self::class, 'lock', $this->getLockParameter());
1563 
1564  $next_command = $this->ctrl->getCmdClass() . '::' . ilTestPlayerCommands::START_TEST;
1565  $this->ctrl->setParameterByClass(ilTestPasswordProtectionGUI::class, 'nextCommand', $next_command);
1566  $this->ctrl->redirectByClass(ilTestPasswordProtectionGUI::class, 'showPasswordForm');
1567  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleQuestionActionCmd()

ilTestPlayerAbstractGUI::handleQuestionActionCmd ( )
abstractprotected

Referenced by confirmHintRequestCmd().

+ Here is the caller graph for this function:

◆ handleSkillTriggering()

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

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

References buildTestPassQuestionList(), ilObjAssessmentFolder\DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER, ilTestSession\getActiveId(), ilTestSession\getPass(), ilTestSession\getUserId(), ILIAS\Repository\object(), and ilTestSkillEvaluation\setUserId().

Referenced by ilTestOutputGUI\saveQuestionSolution().

1599  {
1600  $questionList = $this->buildTestPassQuestionList();
1601  $questionList->load();
1602 
1603  $testResults = $this->object->getTestResult($test_session->getActiveId(), $test_session->getPass(), true);
1604 
1605  $skillEvaluation = new ilTestSkillEvaluation(
1606  $this->db,
1607  $this->logging_services,
1608  $this->object->getTestId(),
1609  $this->object->getRefId(),
1610  $this->skills_service->profile(),
1611  $this->skills_service->personal()
1612  );
1613 
1614  $skillEvaluation->setUserId($test_session->getUserId());
1615  $skillEvaluation->setActiveId($test_session->getActiveId());
1616  $skillEvaluation->setPass($test_session->getPass());
1617 
1618  $skillEvaluation->setNumRequiredBookingsForSkillTriggering((int) $this->assSettings->get(
1619  'ass_skl_trig_num_answ_barrier',
1621  ));
1622 
1623 
1624  $skillEvaluation->init($questionList);
1625  $skillEvaluation->evaluate($testResults);
1626 
1627  $skillEvaluation->handleSkillTriggering();
1628  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleTearsAndAngerQuestionIsNull()

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

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2161  : void
2162  {
2163  $this->logging_services->root()->write(
2164  "INV SEQ:"
2165  . "active={$this->test_session->getActiveId()} "
2166  . "qId=$question_id seq=$sequence_element "
2167  . serialize($this->testSequence)
2168  );
2169 
2170  $this->logging_services->root()->logStack(ilLogLevel::ERROR);
2171 
2172  $this->ctrl->setParameter($this, 'sequence', $this->testSequence->getFirstSequence());
2173  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2174  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleUserSettings()

ilTestPlayerAbstractGUI::handleUserSettings ( )

Handles some form parameters on starting and resuming a test.

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

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

Referenced by ilTestOutputGUI\resumePlayerCmd(), and startPlayerCmd().

511  {
512  if ($this->object->getNrOfTries() != 1
513  && $this->object->getUsePreviousAnswers() == 1
514  ) {
515  $chb_use_previous_answers = 0;
516  if ($this->post_wrapper->has('chb_use_previous_answers')) {
517  $chb_use_previous_answers = $this->post_wrapper->retrieve(
518  'chb_use_previous_answers',
519  $this->refinery->kindlyTo()->int()
520  );
521  }
522  $this->user->writePref("tst_use_previous_answers", (string) $chb_use_previous_answers);
523  }
524  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAssessmentSettings()

ilTestPlayerAbstractGUI::initAssessmentSettings ( )
protected

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

Referenced by ilTestOutputGUI\executeCommand().

1591  {
1592  $this->assSettings = new ilSetting('assessment');
1593  }
+ Here is the caller graph for this function:

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

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

References ilTestServiceGUI\$db, and $ilDB.

Referenced by ilTestOutputGUI\executeCommand().

116  {
117  $ilDB = $this->db;
118  $processLockerFactory = new ilTestProcessLockerFactory($this->assSettings, $ilDB);
119  $this->processLocker = $processLockerFactory->withContextId((int) $activeId)->getLocker();
120  }
+ 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 471 of file class.ilTestPlayerAbstractGUI.php.

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

472  {
473  if ($this->test_session->isAnonymousUser()
474  && !$this->test_session->doesAccessCodeInSessionExists()) {
475  $accessCode = $this->test_session->createNewAccessCode();
476 
477  $this->test_session->setAccessCodeToSession($accessCode);
478  $this->test_session->setAnonymousId($accessCode);
479  $this->test_session->saveToDb();
480 
481  $this->ctrl->redirect($this, ilTestPlayerCommands::DISPLAY_ACCESS_CODE);
482  }
483 
484  if (!$this->test_session->isAnonymousUser()) {
485  $this->test_session->unsetAccessCodeInSession();
486  }
487  $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
488  }
+ Here is the call graph for this function:

◆ initTestPageTemplate()

ilTestPlayerAbstractGUI::initTestPageTemplate ( )
protected

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

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

Referenced by prepareTestPage().

1514  {
1515  $onload_js = <<<JS
1516  let key_event = (event) => {
1517  if( event.key === 13 && event.target.tagName.toLowerCase() === "a" ) {
1518  return;
1519  }
1520  if (event.key === 13 &&
1521  event.target.tagName.toLowerCase() !== "textarea" &&
1522  (event.target.tagName.toLowerCase() !== "input" || event.target.type.toLowerCase() !== "submit")) {
1523  event.preventDefault();
1524  }
1525  };
1526 
1527  let form = document.getElementById('taForm');
1528  form.onkeyup = key_event;
1529  form.onkeydown = key_event;
1530  form.onkeypress = key_event;
1531 JS;
1532  $this->tpl->addOnLoadCode($onload_js);
1533  $this->tpl->addBlockFile(
1534  $this->getContentBlockName(),
1535  'adm_content',
1536  'tpl.il_as_tst_output.html',
1537  'Modules/Test'
1538  );
1539  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTestQuestionConfig()

ilTestPlayerAbstractGUI::initTestQuestionConfig ( assQuestion  $questionOBJ)
protected

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

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

Referenced by getQuestionGuiInstance(), and getQuestionInstance().

2155  {
2156  $questionOBJ->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2157  $this->object->isPreviousSolutionReuseEnabled($this->test_session->getActiveId())
2158  );
2159  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFirstQuestionInSequence()

ilTestPlayerAbstractGUI::isFirstQuestionInSequence (   $sequenceElement)
abstractprotected

Referenced by confirmHintRequestCmd(), and populateQuestionNavigation().

+ Here is the caller graph for this function:

◆ isFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::isFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

References ilTestPlayerCommands\AUTO_SAVE, ilTestPlayerCommands\AUTO_SAVE_ON_TIME_LIMIT, ILIAS\Repository\ctrl(), ilTestPlayerCommands\DETECT_CHANGES, ilSession\get(), getAnswerChangedParameter(), isParticipantsAnswerFixed(), and ILIAS\Repository\lng().

Referenced by populateNextLocksChangedModal().

2356  {
2357  if (ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM) == null) {
2358  return false;
2359  }
2360 
2361  return ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2362  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isForcedFeedbackNavUrlRegistered()

ilTestPlayerAbstractGUI::isForcedFeedbackNavUrlRegistered ( )
protected

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

References getRegisteredForcedFeedbackNavUrl().

Referenced by ilTestOutputGUI\showQuestionCmd().

2434  : bool
2435  {
2436  return !empty($this->getRegisteredForcedFeedbackNavUrl());
2437  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLastQuestionInSequence()

ilTestPlayerAbstractGUI::isLastQuestionInSequence (   $sequenceElement)
abstractprotected

Referenced by confirmHintRequestCmd(), and populateQuestionNavigation().

+ Here is the caller graph for this function:

◆ isMaxProcessingTimeReached()

ilTestPlayerAbstractGUI::isMaxProcessingTimeReached ( )

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

Referenced by ilTestOutputGUI\canSaveResult(), isTestAccessible(), and prepareTestPage().

176  : bool
177  {
178  $active_id = $this->test_session->getActiveId();
179  $starting_time = $this->object->getStartingTimeOfUser($active_id);
180  if ($starting_time === false) {
181  return false;
182  } else {
183  return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
184  }
185  }
+ Here is the caller graph for this function:

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

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

Referenced by ilTestOutputGUI\canSaveResult(), isTestAccessible(), and ilTestOutputGUI\saveQuestionSolution().

1099  : bool
1100  {
1101  return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->test_session->getPass());
1102  }
+ Here is the caller graph for this function:

◆ isOptionalQuestionAnsweringConfirmationRequired()

ilTestPlayerAbstractGUI::isOptionalQuestionAnsweringConfirmationRequired (   $sequenceElement)
abstractprotected

Referenced by prepareTestPage().

+ Here is the caller graph for this function:

◆ isParticipantsAnswerFixed()

ilTestPlayerAbstractGUI::isParticipantsAnswerFixed (   $questionId)
protected

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

References ILIAS\Repository\object().

Referenced by autosaveCmd(), autosaveOnTimeLimitCmd(), buildReadOnlyStateQuestionNavigationGUI(), ilTestOutputGUI\handleQuestionActionCmd(), isFollowUpQuestionLocksConfirmationPrevented(), ilTestOutputGUI\saveQuestionSolution(), ilTestOutputGUI\showInstantResponseCmd(), and ilTestOutputGUI\showQuestionCmd().

1569  : bool
1570  {
1571  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->testSequence->isQuestionChecked($questionId)) {
1572  return true;
1573  }
1574 
1575  if ($this->object->isFollowupQuestionAnswerFixationEnabled() && $this->testSequence->isNextQuestionPresented($questionId)) {
1576  return true;
1577  }
1578 
1579  return false;
1580  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionSummaryFinishTestButtonRequired()

ilTestPlayerAbstractGUI::isQuestionSummaryFinishTestButtonRequired ( )
abstractprotected

Referenced by outQuestionSummaryCmd(), and showSideList().

+ Here is the caller graph for this function:

◆ isShowingPostponeStatusReguired()

ilTestPlayerAbstractGUI::isShowingPostponeStatusReguired (   $questionId)
abstractprotected

Referenced by populateInstantResponseModal(), prepareTestPage(), showQuestionEditable(), and showQuestionViewable().

+ Here is the caller graph for this function:

◆ isTestAccessible()

ilTestPlayerAbstractGUI::isTestAccessible ( )

test accessible returns true if the user can perform the test

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

References isMaxProcessingTimeReached(), and isNrOfTriesReached().

1088  : bool
1089  {
1090  return !$this->isNrOfTriesReached()
1091  and !$this->isMaxProcessingTimeReached()
1092  and $this->object->startingTimeReached()
1093  and !$this->object->endingTimeReached();
1094  }
endingTimeReached()
handle endingTimeReached
+ Here is the call graph for this function:

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and markQuestionCmd().

634  : void
635  {
636  $this->handleIntermediateSubmit();
637  $this->markQuestionCmd();
638  }
markQuestionCmd()
Set a question solved.
handleIntermediateSubmit()
Check the &#39;answer changed&#39; parameter when a question form is intermediately submitted.
+ Here is the call graph for this function:

◆ markQuestionCmd()

ilTestPlayerAbstractGUI::markQuestionCmd ( )
protected

Set a question solved.

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

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

Referenced by markQuestionAndSaveIntermediateCmd().

643  : void
644  {
645  $questionId = $this->testSequence->getQuestionForSequence(
647  );
648 
649  $this->object->setQuestionSetSolved(1, $questionId, $this->test_session->getUserId());
650 
651  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
652  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maxProcessingTimeReached()

ilTestPlayerAbstractGUI::maxProcessingTimeReached ( )

Outputs a message when the maximum processing time is reached.

Outputs a message when the maximum processing time is reached

public

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

References suspendTestCmd().

Referenced by prepareTestPage().

1127  {
1128  $this->suspendTestCmd();
1129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextQuestionCmd()

ilTestPlayerAbstractGUI::nextQuestionCmd ( )
abstractprotected

Referenced by confirmHintRequestCmd().

+ Here is the caller graph for this function:

◆ outCorrectSolution()

ilTestPlayerAbstractGUI::outCorrectSolution ( )

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

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

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

1328  : void
1329  {
1330  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1331 
1332  $this->tpl->setCurrentBlock("ContentStyle");
1333  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1334  $this->tpl->parseCurrentBlock();
1335 
1336  $this->tpl->setCurrentBlock("SyntaxStyle");
1337  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1338  $this->tpl->parseCurrentBlock();
1339 
1340  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1341  if ($this->object->getShowSolutionAnswersOnly()) {
1342  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1343  }
1344 
1345  $this->tpl->setCurrentBlock("adm_content");
1346  $solution = $this->getCorrectSolutionOutput($this->testrequest->raw("evaluation"), $this->testrequest->raw("active_id"), $this->testrequest->raw("pass"));
1347  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1348  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1349  $this->ctrl->saveParameter($this, "pass");
1350  $this->ctrl->saveParameter($this, "active_id");
1351  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1352  $this->tpl->parseCurrentBlock();
1353  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
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 getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
+ Here is the call graph for this function:

◆ outObligationsOnlySummaryCmd()

ilTestPlayerAbstractGUI::outObligationsOnlySummaryCmd ( )

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

References outQuestionSummaryCmd().

1316  {
1317  $this->outQuestionSummaryCmd(true, true);
1318  }
outQuestionSummaryCmd(bool $obligations_info=false, bool $obligations_filter=false)
Output of a summary of all test questions for test participants.
+ Here is the call graph for this function:

◆ outProcessingTime()

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

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

References ILIAS\Repository\ctrl(), ilTestServiceGUI\getObject(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Test\Presentation\WorkingTime\prepareWorkingTimeJsTemplate(), and ilTestPlayerCommands\REDIRECT_AFTER_QUESTION_LIST.

Referenced by outQuestionSummaryCmd(), and prepareTestPage().

1154  : void
1155  {
1156  $starting_time = $this->object->getStartingTimeOfUser($active_id);
1157  $working_time = new WorkingTime(
1158  $this->lng,
1159  $this->ui_factory,
1160  $this->ui_renderer,
1161  $starting_time,
1162  $this->object->getProcessingTimeInSeconds($active_id)
1163  );
1164 
1165  $this->tpl->setCurrentBlock('enableprocessingtime');
1166  $this->tpl->setVariable('USER_WORKING_TIME_MESSAGE_BOX', $working_time->getMessageBox($verbose));
1167  $this->tpl->parseCurrentBlock();
1168 
1169  $working_time_js_template = $working_time->prepareWorkingTimeJsTemplate(
1170  $this->getObject(),
1171  getdate($starting_time),
1172  $this->ctrl->getLinkTarget($this, 'checkWorkingTime', '', true),
1173  $this->ctrl->getFormAction($this, ilTestPlayerCommands::REDIRECT_AFTER_QUESTION_LIST)
1174  );
1175 
1176  $this->tpl->addOnLoadCode($working_time_js_template->get());
1177  }
prepareWorkingTimeJsTemplate(ilObjTest $object, array $date, string $check_url, string $redirect_url)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionSummaryCmd()

ilTestPlayerAbstractGUI::outQuestionSummaryCmd ( bool  $obligations_info = false,
bool  $obligations_filter = false 
)

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

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

References ILIAS\Repository\ctrl(), getContentBlockName(), ilTestServiceGUI\getObject(), ILIAS\Repository\help(), isQuestionSummaryFinishTestButtonRequired(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), outProcessingTime(), and ilTestPlayerLayoutProvider\TEST_PLAYER_VIEW_TITLE.

Referenced by outObligationsOnlySummaryCmd(), and outQuestionSummaryWithObligationsInfoCmd().

1249  {
1250  $this->help->setScreenIdComponent("tst");
1251  $this->help->setScreenId("assessment");
1252  $this->help->setSubScreenId("question_summary");
1253 
1254  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_question_summary.html", "Modules/Test");
1255 
1256  $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
1258  $this->getObject()->getTitle() . ' - ' . $this->lng->txt('question_summary')
1259  );
1260 
1261  if ($obligations_info
1262  && $this->object->areObligationsEnabled()
1263  && !$this->object->allObligationsAnswered()) {
1264  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('not_all_obligations_answered'));
1265  }
1266 
1267  $active_id = $this->test_session->getActiveId();
1268  $question_summary_data = $this->service->getQuestionSummaryData($this->testSequence, $obligations_filter);
1269 
1270  $this->ctrl->setParameter($this, "sequence", $this->testrequest->raw("sequence"));
1271 
1272  $table_gui = new ilListOfQuestionsTableGUI(
1273  $this,
1274  'showQuestion',
1275  $this->ui_factory,
1276  $this->ui_renderer
1277  );
1278  if (($this->object->getNrOfTries() - 1) === $this->test_session->getPass()) {
1279  $table_gui->setUserHasAttemptsLeft(false);
1280  }
1281  $table_gui->setShowPointsEnabled(!$this->object->getTitleOutput());
1282  $table_gui->setShowMarkerEnabled($this->object->getShowMarker());
1283  $table_gui->setObligationsNotAnswered(!$this->object->allObligationsAnswered());
1284  $table_gui->setShowObligationsEnabled($this->object->areObligationsEnabled());
1285  $table_gui->setObligationsFilterEnabled($obligations_filter);
1286  $table_gui->setFinishTestButtonEnabled($this->isQuestionSummaryFinishTestButtonRequired());
1287 
1288  $table_gui->init();
1289 
1290  $table_gui->setData($question_summary_data);
1291 
1292  $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1293 
1294  if ($this->object->getEnableProcessingTime()) {
1295  $this->outProcessingTime($active_id, true);
1296  }
1297 
1298  if ($this->object->isShowExamIdInTestPassEnabled()) {
1299  $this->tpl->setCurrentBlock('exam_id_footer');
1300  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1301  $this->test_session->getActiveId(),
1302  $this->test_session->getPass(),
1303  $this->object->getId()
1304  ));
1305  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1306  $this->tpl->parseCurrentBlock();
1307  }
1308  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
outProcessingTime(int $active_id, bool $verbose)
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionSummaryWithObligationsInfoCmd()

ilTestPlayerAbstractGUI::outQuestionSummaryWithObligationsInfoCmd ( )

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

References outQuestionSummaryCmd().

1311  {
1312  $this->outQuestionSummaryCmd(true, false);
1313  }
outQuestionSummaryCmd(bool $obligations_info=false, bool $obligations_filter=false)
Output of a summary of all test questions for test participants.
+ Here is the call graph for this function:

◆ outUserResultsOverviewCmd()

ilTestPlayerAbstractGUI::outUserResultsOverviewCmd ( )

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

References ILIAS\Repository\ctrl().

1455  {
1456  $this->ctrl->redirectByClass(
1457  ['ilRepositoryGUI', 'ilObjTestGUI', 'ilTestEvaluationGUI'],
1458  "outUserResultsOverview"
1459  );
1460  }
+ Here is the call graph for this function:

◆ performTestPassFinishedTasks()

ilTestPlayerAbstractGUI::performTestPassFinishedTasks ( )
protected

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

References sendNewPassFinishedNotificationEmailIfActivated().

Referenced by finishTestCmd(), and redirectAfterFinish().

721  : void
722  {
723  (new ilTestPassFinishTasks($this->test_session, $this->object))->performFinishTasks($this->processLocker);
724 
726  $this->test_session->getActiveId(),
727  $this->test_session->getPass()
728  );
729  }
Class ilTestPassFinishTasks.
sendNewPassFinishedNotificationEmailIfActivated(int $active_id, int $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

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

References ilObjStyleSheet\getContentStylePath().

Referenced by prepareTestPage().

404  {
405  $this->tpl->setCurrentBlock("ContentStyle");
406  $this->tpl->setVariable(
407  "LOCATION_CONTENT_STYLESHEET",
409  );
410  $this->tpl->parseCurrentBlock();
411  }
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateDiscardSolutionModal()

ilTestPlayerAbstractGUI::populateDiscardSolutionModal ( )
protected

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

References $id, ilTestServiceGUI\$tpl, ilGlobalTemplateInterface\get(), ilModalGUI\getInstance(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

Referenced by populateModals().

2204  {
2205  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2206 
2207  $tpl->setVariable('CONFIRMATION_TEXT', $this->lng->txt('discard_answer_confirmation'));
2208 
2209  $button = $this->ui_factory->button()->standard($this->lng->txt('discard_answer'), '#')
2211  fn($id) => "document.getElementById('$id').addEventListener(
2212  'click',
2213  (event)=>{
2214  event.target.name = 'cmd[discardSolution]';
2215  event.target.form.requestSubmit(event.target);
2216  }
2217  )"
2218  );
2219 
2220  $tpl->setCurrentBlock('buttons');
2221  $tpl->setVariable('BUTTON', $this->ui_renderer->render($button));
2223 
2224  $button = $this->ui_factory->button()->primary($this->lng->txt('cancel'), '#')
2226  fn($id) => "document.getElementById('$id').addEventListener(
2227  'click',
2228  ()=>$('#tst_discard_solution_modal').modal('hide')
2229  );"
2230  );
2231  $tpl->setCurrentBlock('buttons');
2232  $tpl->setVariable('BUTTON', $this->ui_renderer->render($button));
2234 
2235  $modal = ilModalGUI::getInstance();
2236  $modal->setId('tst_discard_solution_modal');
2237  $modal->setHeading($this->lng->txt('discard_answer'));
2238  $modal->setBody($tpl->get());
2239 
2240  $this->tpl->setCurrentBlock('discard_solution_modal');
2241  $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $modal->getHTML());
2242  $this->tpl->parseCurrentBlock();
2243  }
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.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static getInstance()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

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

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

1947  {
1948  if ($withFocusAnchor) {
1949  $this->tpl->setCurrentBlock('inst_resp_id');
1950  $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
1951  $this->tpl->parseCurrentBlock();
1952  }
1953 
1954  $this->tpl->setCurrentBlock('instant_response_header');
1955  $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
1956  $this->tpl->parseCurrentBlock();
1957  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFeedbackBlockMessage()

ilTestPlayerAbstractGUI::populateFeedbackBlockMessage ( string  $a_message)
protected

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

Referenced by populateInstantResponseBlocks().

1960  {
1961  $this->tpl->setCurrentBlock('instant_response_message');
1962  $this->tpl->setVariable('INSTANT_RESPONSE_MESSAGE', $a_message);
1963  $this->tpl->parseCurrentBlock();
1964  }
+ Here is the caller graph for this function:

◆ populateGenericFeedbackBlock()

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

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

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

Referenced by populateInstantResponseBlocks().

350  : bool
351  {
352  // fix #031263: add pass
353  $feedback = $question_gui->getGenericFeedbackOutput($this->test_session->getActiveId(), $this->test_session->getPass());
354 
355  if (strlen($feedback)) {
356  $cssClass = (
357  $solutionCorrect ?
359  );
360 
361  $this->tpl->setCurrentBlock("answer_feedback");
362  $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
363  $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
364  $this->tpl->parseCurrentBlock();
365  return true;
366  }
367  return false;
368  }
getGenericFeedbackOutput(int $active_id, ?int $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateHelperGuiContent()

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

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

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

Referenced by showAnswerOptionalQuestionsConfirmation().

1669  {
1670  if ($this->object->getKioskMode()) {
1671  //$this->tpl->setBodyClass("kiosk");
1672  $this->tpl->hideFooter();
1673  $this->tpl->addBlockfile('CONTENT', 'adm_content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
1674  $this->tpl->setContent($this->ctrl->getHTML($helperGui));
1675  } else {
1676  $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
1677  }
1678  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateInstantResponseBlocks()

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

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

References ilObjTest\_getPass(), determineInlineScoreDisplay(), assQuestionGUI\getSolutionOutput(), assQuestionGUI\hasInlineFeedback(), ILIAS\Repository\lng(), ILIAS\Repository\object(), populateFeedbackBlockHeader(), populateFeedbackBlockMessage(), populateGenericFeedbackBlock(), populateScoreBlock(), populateSolutionBlock(), and populateSpecificFeedbackBlock().

Referenced by populateInstantResponseModal(), and ilTestOutputGUI\showQuestionCmd().

1870  {
1871  $response_available = false;
1872  $jump_to_response = false;
1873 
1874  // This controls if the solution should be shown.
1875  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
1876  if ($this->object->getInstantFeedbackSolution()) {
1877  $show_question_inline_score = $this->determineInlineScoreDisplay();
1878 
1879  // Notation of the params prior to getting rid of this crap in favor of a class
1880  $solutionoutput = $questionGui->getSolutionOutput(
1881  $this->test_session->getActiveId(), #active_id
1882  $this->test_session->getPass(), #pass
1883  false, #graphical_output
1884  $show_question_inline_score, #result_output
1885  true, #show_question_only
1886  false, #show_feedback
1887  true, #show_correct_solution
1888  false, #show_manual_scoring
1889  false #show_question_text
1890  );
1891  $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
1892  $this->populateSolutionBlock($solutionoutput);
1893  $response_available = true;
1894  $jump_to_response = true;
1895  }
1896 
1897  $reachedPoints = $questionGui->object->getAdjustedReachedPoints(
1898  $this->test_session->getActiveId(),
1899  ilObjTest::_getPass($this->test_session->getActiveId()),
1900  $authorizedSolution
1901  );
1902 
1903  $maxPoints = $questionGui->object->getMaximumPoints();
1904 
1905  $solutionCorrect = ($reachedPoints == $maxPoints);
1906 
1907  // This controls if the score should be shown.
1908  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
1909  if ($this->object->getAnswerFeedbackPoints()) {
1910  $this->populateScoreBlock($reachedPoints, $maxPoints);
1911  $response_available = true;
1912  $jump_to_response = true;
1913  }
1914 
1915  // This controls if the generic feedback should be shown.
1916  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
1917  if ($this->object->getGenericAnswerFeedback()) {
1918  if ($this->populateGenericFeedbackBlock($questionGui, $solutionCorrect)) {
1919  $response_available = true;
1920  $jump_to_response = true;
1921  }
1922  }
1923 
1924  // This controls if the specific feedback should be shown.
1925  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
1926  if ($this->object->getSpecificAnswerFeedback()) {
1927  if ($questionGui->hasInlineFeedback()) {
1928  // Don't jump to the feedback below the question if some feedback is shown within the question
1929  $jump_to_response = false;
1930  } elseif ($this->populateSpecificFeedbackBlock($questionGui)) {
1931  $response_available = true;
1932  $jump_to_response = true;
1933  }
1934  }
1935 
1936  $this->populateFeedbackBlockHeader($jump_to_response);
1937  if (!$response_available) {
1938  if ($questionGui->hasInlineFeedback()) {
1939  $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_is_given_inline'));
1940  } else {
1941  $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_not_available_for_answer'));
1942  }
1943  }
1944  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
populateSpecificFeedbackBlock(assQuestionGUI $question_gui)
populateGenericFeedbackBlock(assQuestionGUI $question_gui, $solutionCorrect)
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
populateScoreBlock($reachedPoints, $maxPoints)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateInstantResponseModal()

ilTestPlayerAbstractGUI::populateInstantResponseModal ( assQuestionGUI  $questionGui,
  $navUrl 
)
protected

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

References ilTestServiceGUI\$tpl, ilGlobalTemplateInterface\get(), ilModalGUI\getInstance(), assQuestionGUI\getQuestionHeaderBlockBuilder(), assQuestionGUI\getSolutionOutput(), isShowingPostponeStatusReguired(), ILIAS\Repository\lng(), assQuestionGUI\outQuestionPage(), populateInstantResponseBlocks(), assQuestionGUI\setNavigationGUI(), ilGlobalTemplateInterface\setVariable(), and ilModalGUI\TYPE_LARGE.

Referenced by ilTestOutputGUI\showQuestionCmd().

1817  {
1818  $questionGui->setNavigationGUI(null);
1819  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
1820 
1821  $answerFeedbackEnabled = $this->object->getSpecificAnswerFeedback();
1822 
1823  $solutionoutput = $questionGui->getSolutionOutput(
1824  $this->test_session->getActiveId(), #active_id
1825  $this->test_session->getPass(), #pass
1826  false, #graphical_output
1827  false, #result_output
1828  true, #show_question_only
1829  $answerFeedbackEnabled, #show_feedback
1830  false, #show_correct_solution
1831  false, #show_manual_scoring
1832  true #show_question_text
1833  );
1834 
1835  $pageoutput = $questionGui->outQuestionPage(
1836  "",
1837  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
1838  $this->test_session->getActiveId(),
1839  $solutionoutput
1840  );
1841 
1842  $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'Modules/Test');
1843 
1844  // populate the instant response blocks in the
1845  $saved_tpl = $this->tpl;
1846  $this->tpl = $tpl;
1847  $this->populateInstantResponseBlocks($questionGui, true);
1848  $this->tpl = $saved_tpl;
1849 
1850  $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
1851 
1852  $button = $this->ui_factory->button()->primary($this->lng->txt('proceed'), $navUrl);
1853  $tpl->setVariable('BUTTON', $this->ui_renderer->render($button));
1854 
1855  $modal = ilModalGUI::getInstance();
1856  $modal->setType(ilModalGUI::TYPE_LARGE);
1857  $modal->setId('tst_question_feedback_modal');
1858  $modal->setHeading($this->lng->txt('tst_instant_feedback'));
1859  $modal->setBody($tpl->get());
1860 
1861  $this->tpl->addOnLoadCode("$('#tst_question_feedback_modal').modal('show');");
1862  $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $modal->getHTML());
1863  }
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.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
populateInstantResponseBlocks(assQuestionGUI $questionGui, $authorizedSolution)
isShowingPostponeStatusReguired($questionId)
static getInstance()
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateLowerNextButtonBlock()

ilTestPlayerAbstractGUI::populateLowerNextButtonBlock (   $primary_next)
protected

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

References buildNextButtonInstance().

Referenced by populateNextButtons().

240  : void
241  {
242  $button = $this->buildNextButtonInstance($primary_next);
243 
244  $this->tpl->setCurrentBlock("next_bottom");
245  $this->tpl->setVariable("BTN_NEXT_BOTTOM", $this->ui_renderer->render($button));
246  $this->tpl->parseCurrentBlock();
247  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateLowerPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateLowerPreviousButtonBlock ( )
protected

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

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

259  {
260  $button = $this->buildPreviousButtonInstance();
261 
262  $this->tpl->setCurrentBlock("prev_bottom");
263  $this->tpl->setVariable("BTN_PREV_BOTTOM", $this->ui_renderer->render($button));
264  $this->tpl->parseCurrentBlock();
265  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateMessageContent()

ilTestPlayerAbstractGUI::populateMessageContent (   $contentHTML)
protected
Parameters
$contentHTML

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

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

2180  {
2181  if ($this->object->getKioskMode()) {
2182  $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
2183  $this->tpl->setContent($contentHTML);
2184  } else {
2185  $this->tpl->setVariable($this->getContentBlockName(), $contentHTML);
2186  }
2187  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ populateModals()

ilTestPlayerAbstractGUI::populateModals ( )
protected

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

References ILIAS\Repository\object(), populateDiscardSolutionModal(), populateNavWhenChangedModal(), populateNextLocksChangedModal(), and populateNextLocksUnchangedModal().

Referenced by showQuestionEditable().

2190  {
2192  // fau: testNav - populateNavWhenChangedModal instead of populateNavWhileEditModal
2193  $this->populateNavWhenChangedModal();
2194  // fau.
2195 
2196  if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2198 
2200  }
2201  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNavWhenChangedModal()

ilTestPlayerAbstractGUI::populateNavWhenChangedModal ( )
protected

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

References ilTestServiceGUI\$tpl, ilGlobalTemplateInterface\get(), ilSession\get(), ilLinkButton\getInstance(), ilModalGUI\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by populateModals().

2246  {
2247  return; // usibility fix: get rid of popup
2248 
2249  if (ilSession::get('save_on_navigation_prevent_confirmation') == null) {
2250  return;
2251  }
2252 
2253  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2254 
2255  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->object->isForceInstantFeedbackEnabled()) {
2256  $text = $this->lng->txt('save_on_navigation_locked_confirmation');
2257  } else {
2258  $text = $this->lng->txt('save_on_navigation_confirmation');
2259  }
2260  if ($this->object->isForceInstantFeedbackEnabled()) {
2261  $text .= " " . $this->lng->txt('save_on_navigation_forced_feedback_hint');
2262  }
2263  $tpl->setVariable('CONFIRMATION_TEXT', $text);
2264 
2265  /*
2266  $button = ilLinkButton::getInstance();
2267  $button->setId('tst_save_on_navigation_button');
2268  $button->setUrl('#');
2269  $button->setCaption('tst_save_and_proceed');
2270  $button->setPrimary(true);
2271  */
2272  $button = $this->ui_factory->button()->primary($this->lng->txt('tst_save_and_proceed'), '#');
2273 
2274  $tpl->setCurrentBlock('buttons');
2275  $tpl->setVariable('BUTTON', $this->ui_renderer->render($button));
2277 
2278  $button = ilLinkButton::getInstance();
2279  $button->setId('tst_cancel_on_navigation_button');
2280  $button->setUrl('#');
2281  $button->setCaption('cancel');
2282  $button->setPrimary(false);
2283  $tpl->setCurrentBlock('buttons');
2284  $tpl->setVariable('BUTTON', $button->render());
2286 
2287  $tpl->setCurrentBlock('checkbox');
2288  $tpl->setVariable('CONFIRMATION_CHECKBOX_NAME', 'save_on_navigation_prevent_confirmation');
2289  $tpl->setVariable('CONFIRMATION_CHECKBOX_LABEL', $this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2291 
2292  $modal = ilModalGUI::getInstance();
2293  $modal->setId('tst_save_on_navigation_modal');
2294  $modal->setHeading($this->lng->txt('save_on_navigation'));
2295  $modal->setBody($tpl->get());
2296 
2297  $this->tpl->setCurrentBlock('nav_while_edit_modal');
2298  $this->tpl->setVariable('NAV_WHILE_EDIT_MODAL', $modal->getHTML());
2299  $this->tpl->parseCurrentBlock();
2300  }
static get(string $a_var)
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.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static getInstance()
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextButtons()

ilTestPlayerAbstractGUI::populateNextButtons (   $primary_next)
protected

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

References populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

Referenced by populateQuestionNavigation().

234  : void
235  {
236  $this->populateUpperNextButtonBlock($primary_next);
237  $this->populateLowerNextButtonBlock($primary_next);
238  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextLocksChangedModal()

ilTestPlayerAbstractGUI::populateNextLocksChangedModal ( )
protected

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

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

Referenced by populateModals().

2323  {
2325  return;
2326  }
2327 
2328  $modal = new ilTestPlayerConfirmationModal($this->ui_renderer);
2329  $modal->setModalId('tst_next_locks_changed_modal');
2330 
2331  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_current_answer_header'));
2332  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_current_answer_confirm'));
2333 
2334  $modal->setConfirmationCheckboxName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2335  $modal->setConfirmationCheckboxLabel($this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2336 
2337  $button = $this->ui_factory->button()->primary($this->lng->txt('tst_save_and_proceed'), '#');
2338  $modal->addButton($button);
2339 
2340  $button = $this->ui_factory->button()->standard($this->lng->txt('cancel'), '#');
2341  $modal->addButton($button);
2342 
2343  $this->tpl->setCurrentBlock('next_locks_changed_modal');
2344  $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $modal->getHTML());
2345  $this->tpl->parseCurrentBlock();
2346  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

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

References ILIAS\Repository\lng().

Referenced by populateModals().

2304  {
2305  $modal = new ilTestPlayerConfirmationModal($this->ui_renderer);
2306  $modal->setModalId('tst_next_locks_unchanged_modal');
2307 
2308  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_empty_answer_header'));
2309  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_empty_answer_confirm'));
2310 
2311  $button = $this->ui_factory->button()->standard($this->lng->txt('tst_proceed'), '#');
2312  $modal->addButton($button);
2313 
2314  $button = $this->ui_factory->button()->primary($this->lng->txt('cancel'), '#');
2315  $modal->addButton($button);
2316 
2317  $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2318  $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $modal->getHTML());
2319  $this->tpl->parseCurrentBlock();
2320  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populatePreviousButtons()

ilTestPlayerAbstractGUI::populatePreviousButtons ( )
protected

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

References populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

Referenced by populateQuestionNavigation().

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

◆ populateQuestionNavigation()

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

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

References isFirstQuestionInSequence(), isLastQuestionInSequence(), populateNextButtons(), and populatePreviousButtons().

Referenced by ilTestOutputGUI\showQuestionCmd().

217  : void
218  {
219  if (!$this->isFirstQuestionInSequence($sequence_element)) {
220  $this->populatePreviousButtons();
221  }
222 
223  if (!$this->isLastQuestionInSequence($sequence_element)) {
224  $this->populateNextButtons($primary_next);
225  }
226  }
isFirstQuestionInSequence($sequenceElement)
isLastQuestionInSequence($sequenceElement)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateScoreBlock()

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

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

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

371  {
372  $scoreInformation = sprintf(
373  $this->lng->txt("you_received_a_of_b_points"),
374  $reachedPoints,
375  $maxPoints
376  );
377 
378  $this->tpl->setCurrentBlock("received_points_information");
379  $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
380  $this->tpl->parseCurrentBlock();
381  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

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

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

384  {
385  if (strlen($solutionoutput)) {
386  $this->tpl->setCurrentBlock("solution_output");
387  $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
388  $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
389  $this->tpl->parseCurrentBlock();
390  }
391  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSpecificFeedbackBlock()

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

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

References assQuestionGUI\getSpecificFeedbackOutput().

Referenced by populateInstantResponseBlocks().

327  : bool
328  {
329  $solutionValues = $question_gui->object->getSolutionValues(
330  $this->test_session->getActiveId(),
331  null
332  );
333 
334  $feedback = $question_gui->getSpecificFeedbackOutput(
335  $question_gui->object->fetchIndexedValuesFromValuePairs($solutionValues)
336  );
337 
338  if (!empty($feedback)) {
339  $this->tpl->setCurrentBlock("specific_feedback");
340  $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
341  $this->tpl->parseCurrentBlock();
342  return true;
343  }
344  return false;
345  }
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSyntaxStyleBlock()

ilTestPlayerAbstractGUI::populateSyntaxStyleBlock ( )
protected

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

References ilObjStyleSheet\getSyntaxStylePath().

Referenced by prepareTestPage().

394  {
395  $this->tpl->setCurrentBlock("SyntaxStyle");
396  $this->tpl->setVariable(
397  "LOCATION_SYNTAX_STYLESHEET",
399  );
400  $this->tpl->parseCurrentBlock();
401  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateTestNavigationToolbar()

ilTestPlayerAbstractGUI::populateTestNavigationToolbar ( ilTestNavigationToolbarGUI  $toolbar_gui)
protected

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

Referenced by ilTestOutputGUI\showQuestionCmd().

197  : void
198  {
199  $this->tpl->setCurrentBlock('test_nav_toolbar');
200  $this->tpl->setVariable('TEST_NAV_TOOLBAR', $toolbar_gui->getHTML());
201  $this->tpl->parseCurrentBlock();
202 
203  if ($this->finish_test_modal === null) {
204  return;
205  }
206 
207  $this->tpl->setCurrentBlock('finish_test_modal');
208  $this->tpl->setVariable(
209  'FINISH_TEST_MODAL',
210  $this->ui_renderer->render(
211  $this->finish_test_modal->withOnLoad($this->finish_test_modal->getShowSignal())
212  )
213  );
214  $this->tpl->parseCurrentBlock();
215  }
+ Here is the caller graph for this function:

◆ populateUpperNextButtonBlock()

ilTestPlayerAbstractGUI::populateUpperNextButtonBlock (   $primaryNext)
protected

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

References buildNextButtonInstance().

Referenced by populateNextButtons().

250  {
251  $button = $this->buildNextButtonInstance($primaryNext);
252 
253  $this->tpl->setCurrentBlock("next");
254  $this->tpl->setVariable("BTN_NEXT", $this->ui_renderer->render($button));
255  $this->tpl->parseCurrentBlock();
256  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateUpperPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateUpperPreviousButtonBlock ( )
protected

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

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

268  {
269  $button = $this->buildPreviousButtonInstance();
270 
271  $this->tpl->setCurrentBlock("prev");
272  $this->tpl->setVariable("BTN_PREV", $this->ui_renderer->render($button));
273  $this->tpl->parseCurrentBlock();
274  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

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

References getContentBlockName().

1504  {
1505  $this->tpl->addBlockFile(
1506  $this->getContentBlockName(),
1507  'adm_content',
1508  'tpl.il_as_tst_question_summary.html',
1509  'Modules/Test'
1510  );
1511  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ prepareTestPage()

ilTestPlayerAbstractGUI::prepareTestPage (   $sequenceElement,
  $questionId 
)
protected

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

References ILIAS\Repository\ctrl(), endingTimeReached(), initTestPageTemplate(), isMaxProcessingTimeReached(), isOptionalQuestionAnsweringConfirmationRequired(), isShowingPostponeStatusReguired(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), maxProcessingTimeReached(), ILIAS\Repository\object(), outProcessingTime(), populateContentStyleBlock(), populateSyntaxStyleBlock(), ilTestPlayerCommands\RESUME_PLAYER, showAnswerOptionalQuestionsConfirmation(), showSideList(), and ILIAS\Repository\user().

Referenced by ilTestOutputGUI\showQuestionCmd().

834  {
835  $this->navigation_history->addItem(
836  $this->test_session->getRefId(),
837  $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::RESUME_PLAYER),
838  'tst'
839  );
840 
841  $this->initTestPageTemplate();
842  $this->populateContentStyleBlock();
843  $this->populateSyntaxStyleBlock();
844 
845  if ($this->isMaxProcessingTimeReached()) {
846  $this->maxProcessingTimeReached();
847  return;
848  }
849 
850  if ($this->object->endingTimeReached()) {
851  $this->endingTimeReached();
852  return;
853  }
854 
855  if ($this->isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)) {
856  $this->ctrl->setParameter($this, "sequence", $sequenceElement);
858  return;
859  }
860 
861  $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId());
862  $this->tpl->setVariable("LOGIN", $this->user->getLogin());
863 
864  $this->tpl->setVariable("SEQ_ID", $sequenceElement);
865  $this->tpl->setVariable("QUEST_ID", $questionId);
866 
867  if ($this->object->getEnableProcessingTime()) {
868  $this->outProcessingTime($this->test_session->getActiveId(), false);
869  }
870 
871  $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
872 
873  if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
874  $this->tpl->setCurrentBlock('exam_id_footer');
875  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
876  $this->test_session->getActiveId(),
877  $this->test_session->getPass(),
878  $this->object->getId()
879  ));
880  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
881  $this->tpl->parseCurrentBlock();
882  }
883 
884  if ($this->object->getListOfQuestions()) {
885  $this->showSideList($sequenceElement);
886  }
887  }
showSideList($current_sequence_element)
maxProcessingTimeReached()
Outputs a message when the maximum processing time is reached.
endingTimeReached()
handle endingTimeReached
outProcessingTime(int $active_id, bool $verbose)
isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ previousQuestionCmd()

ilTestPlayerAbstractGUI::previousQuestionCmd ( )
abstractprotected

Referenced by confirmHintRequestCmd().

+ Here is the caller 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 530 of file class.ilTestPlayerAbstractGUI.php.

References redirectAfterFinish().

530  : void
531  {
532  $this->redirectAfterFinish();
533  }
+ Here is the call graph for this function:

◆ redirectAfterFinish()

ilTestPlayerAbstractGUI::redirectAfterFinish ( )
protected

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

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

Referenced by redirectAfterAutosaveCmd(), and redirectAfterQuestionListCmd().

540  : void
541  {
543 
544  $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
545 
546  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
547  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
548  $this->tpl->setVariable("URL", $url);
549  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
$url
Definition: ltiregstart.php:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectAfterQuestionListCmd()

ilTestPlayerAbstractGUI::redirectAfterQuestionListCmd ( )

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

References redirectAfterFinish().

535  : void
536  {
537  $this->redirectAfterFinish();
538  }
+ Here is the call graph for this function:

◆ redirectBackCmd()

ilTestPlayerAbstractGUI::redirectBackCmd ( )

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

References ILIAS\Repository\ctrl(), ilTestScreenGUI\DEFAULT_CMD, and ilTestServiceGUI\getObjectiveOrientedContainer().

Referenced by afterTestPassFinishedCmd(), and endingTimeReached().

797  : void
798  {
799  $testPassesSelector = new ilTestPassesSelector($this->db, $this->object);
800  $testPassesSelector->setActiveId($this->test_session->getActiveId());
801  $testPassesSelector->setLastFinishedPass($this->test_session->getLastFinishedPass());
802 
803  if (count($testPassesSelector->getReportablePasses())) {
804  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
805  $this->ctrl->redirectByClass(['ilTestResultsGUI', 'ilTestEvalObjectiveOrientedGUI']);
806  }
807 
808  $this->ctrl->redirectByClass(['ilTestResultsGUI', 'ilMyTestResultsGUI', 'ilTestEvaluationGUI']);
809  }
810 
811  $this->ctrl->redirectByClass(ilTestScreenGUI::class, ilTestScreenGUI::DEFAULT_CMD);
812  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl (   $forcedFeedbackNavUrl)
protected

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

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

Referenced by ilTestOutputGUI\showInstantResponseCmd().

2412  {
2413  if (ilSession::get('forced_feedback_navigation_url') == null) {
2414  ilSession::set('forced_feedback_navigation_url', []);
2415  }
2416  $forced_feeback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2417  $forced_feeback_navigation_url[$this->test_session->getActiveId()] = $forcedFeedbackNavUrl;
2418  ilSession::set('forced_feedback_navigation_url', $forced_feeback_navigation_url);
2419  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeIntermediateSolution()

ilTestPlayerAbstractGUI::removeIntermediateSolution ( )

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

References canSaveResult(), getCurrentQuestionId(), getQuestionInstance(), and saveQuestionSolution().

Referenced by handleIntermediateSubmit(), revertChangesCmd(), ilTestOutputGUI\showInstantResponseCmd(), ilTestOutputGUI\submitSolutionAndNextCmd(), and ilTestOutputGUI\submitSolutionCmd().

154  : void
155  {
156  $questionId = $this->getCurrentQuestionId();
157 
158  $this->getQuestionInstance($questionId)->removeIntermediateSolution(
159  $this->test_session->getActiveId(),
160  $this->test_session->getPass()
161  );
162  }
getQuestionInstance(int $question_id, bool $from_cache=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resumePlayerCmd()

ilTestPlayerAbstractGUI::resumePlayerCmd ( )
abstractprotected

Resume a test at the last position.

Referenced by getLockParameter().

+ Here is the caller graph for this function:

◆ revertChangesCmd()

ilTestPlayerAbstractGUI::revertChangesCmd ( )
protected

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

References ILIAS\Repository\ctrl(), discardSolutionCmd(), removeIntermediateSolution(), setAnswerChangedParameter(), ilTestPlayerCommands\SHOW_QUESTION, skipQuestionCmd(), and startTestCmd().

1054  {
1055  $this->removeIntermediateSolution();
1056  $this->setAnswerChangedParameter(false);
1057  $this->ctrl->saveParameter($this, 'sequence');
1058  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1059  }
setAnswerChangedParameter($changed=true)
Set the &#39;answer changed&#39; url parameter for generated links.
+ Here is the call graph for this function:

◆ saveNavigationPreventConfirmation()

ilTestPlayerAbstractGUI::saveNavigationPreventConfirmation ( )
protected

Save the save the switch to prevent the navigation confirmation.

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

References ilSession\set().

Referenced by ilTestOutputGUI\showInstantResponseCmd(), and ilTestOutputGUI\submitSolutionCmd().

2082  {
2083  if (!empty($_POST['save_on_navigation_prevent_confirmation'])) {
2084  ilSession::set('save_on_navigation_prevent_confirmation', true);
2085  }
2086 
2087  if (!empty($_POST[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM])) {
2088  ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2089  }
2090  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveQuestionSolution()

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

saves the user input of a question

Referenced by autosaveCmd(), autosaveOnTimeLimitCmd(), handleFileUploadCmd(), handleIntermediateSubmit(), removeIntermediateSolution(), and submitIntermediateSolutionCmd().

+ Here is the caller graph for this function:

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

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

129  {
130  $tagging_gui = new ilTaggingGUI();
131  $tagging_gui->setObject($this->object->getId(), $this->object->getType());
132  $tagging_gui->saveInput();
133  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
134  }
Class ilTaggingGUI.
+ Here is the call graph for this function:

◆ sendNewPassFinishedNotificationEmailIfActivated()

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

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

References ILIAS\Repository\object().

Referenced by performTestPassFinishedTasks().

732  {
733  $notification_type = $this->object->getMainSettings()->getFinishingSettings()->getMailNotificationContentType();
734 
735  if ($notification_type === 0
736  || !$this->object->getMainSettings()->getFinishingSettings()->getAlwaysSendMailNotification()
737  && $pass !== $this->object->getNrOfTries() - 1) {
738  return;
739  }
740 
741  switch ($this->object->getMainSettings()->getFinishingSettings()->getMailNotificationContentType()) {
742  case 1:
743  $this->object->sendSimpleNotification($active_id);
744  break;
745  case 2:
746  $this->object->sendAdvancedNotification($active_id);
747  break;
748  }
749  }
+ Here is the call graph for this function:
+ Here is the caller 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 418 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\ctrl().

419  {
420  if ($this->test_session->isAnonymousUser()) {
421  $this->test_session->setAccessCodeToSession($_POST['anonymous_id']);
422  }
423 
424  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
425  }
+ Here is the call graph for this function:

◆ setAnswerChangedParameter()

ilTestPlayerAbstractGUI::setAnswerChangedParameter (   $changed = true)
protected

Set the 'answer changed' url parameter for generated links.

Parameters
bool$changed

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

References ILIAS\Repository\ctrl().

Referenced by ilTestOutputGUI\executeCommand(), handleIntermediateSubmit(), ilTestOutputGUI\handleQuestionActionCmd(), revertChangesCmd(), ilTestOutputGUI\showInstantResponseCmd(), and submitIntermediateSolutionCmd().

2056  {
2057  $this->ctrl->setParameter($this, 'test_answer_changed', $changed ? '1' : '0');
2058  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

References ilSession\set().

2351  {
2352  ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2353  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ showAnswerOptionalQuestionsConfirmation()

ilTestPlayerAbstractGUI::showAnswerOptionalQuestionsConfirmation ( )
protected

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

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

Referenced by prepareTestPage().

1633  {
1634  $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
1635 
1636  $confirmation->setFormAction($this->ctrl->getFormAction($this));
1637  $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
1638  $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
1639 
1640  $confirmation->build($this->object->isFixedTest());
1641 
1642  $this->populateHelperGuiContent($confirmation);
1643  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showFinalStatementCmd()

ilTestPlayerAbstractGUI::showFinalStatementCmd ( )

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

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

818  {
819  $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
821  $this->object->getTitle() . ' - ' . $this->lng->txt('final_statement')
822  );
823  $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
824  $this->ctrl->setParameterByClass(ilTestPageGUI::class, 'page_type', 'concludingremarkspage');
825  $template = new ilTemplate("tpl.il_as_tst_final_statement.html", true, true, "Modules/Test");
826  $this->ctrl->setParameter($this, "skipfinalstatement", 1);
827  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED));
828  $template->setVariable("FINALSTATEMENT", $this->object->getFinalStatement());
829  $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
830  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
831  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ showInstantResponseCmd()

ilTestPlayerAbstractGUI::showInstantResponseCmd ( )
abstractprotected

Referenced by confirmHintRequestCmd().

+ Here is the caller 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 public

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

References ILIAS\Repository\ctrl(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getContentBlockName(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getResultsSignature(), ilUtil\getStyleSheetLocation(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

1365  {
1366  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "Modules/Test");
1367 
1368  $result_array = &$this->object->getTestResult(
1369  $active_id,
1370  $pass,
1371  false,
1372  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1373  );
1374 
1375  $counter = 1;
1376  // output of questions with solutions
1377  foreach ($result_array as $question_data) {
1378  $question = $question_data["qid"];
1379  if (is_numeric($question)) {
1380  $this->tpl->setCurrentBlock("printview_question");
1381  $question_gui = $this->object->createQuestionGUI("", $question);
1382  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "Modules/TestQuestionPool");
1383  $template->setVariable("COUNTER_QUESTION", $counter . ". ");
1384  $template->setVariable("QUESTION_TITLE", $question_gui->object->getTitleForHTMLOutput());
1385 
1386  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
1387  $result_output = $question_gui->getSolutionOutput(
1388  $active_id,
1389  $pass,
1390  false,
1391  false,
1392  $show_question_only,
1393  $this->object->getShowSolutionFeedback()
1394  );
1395  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1396  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1397  $this->tpl->parseCurrentBlock();
1398  $counter++;
1399  }
1400  }
1401 
1402  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1403  if ($this->object->getShowSolutionAnswersOnly()) {
1404  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1405  }
1406  if (strlen($top_data)) {
1407  $this->tpl->setCurrentBlock("top_data");
1408  $this->tpl->setVariable("TOP_DATA", $top_data);
1409  $this->tpl->parseCurrentBlock();
1410  }
1411 
1412  if (strlen($bottom_data)) {
1413  $this->tpl->setCurrentBlock("bottom_data");
1414  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1415  $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
1416  $this->tpl->parseCurrentBlock();
1417  }
1418 
1419  $this->tpl->setCurrentBlock("adm_content");
1420  $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
1421  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($this->test_session, $active_id, true);
1422  $signature = $this->getResultsSignature();
1423  $this->tpl->setVariable("USER_DETAILS", $user_data);
1424  $this->tpl->setVariable("SIGNATURE", $signature);
1425  $this->tpl->setVariable("TITLE", $this->object->getTitle());
1426  $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
1427  $invited_user = &$this->object->getInvitedUsers($this->user->getId());
1428  $pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
1429  ": " . $invited_user[$this->user->getId()]["clientip"] . " - " .
1430  $this->lng->txt("matriculation") . ": " .
1431  $invited_user[$this->user->getId()]["matriculation"];
1432  $this->tpl->setVariable("PAGETITLE", $pagetitle);
1433  $this->tpl->parseCurrentBlock();
1434  }
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getResultsSignature()
Returns HTML code for a signature field.
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ showQuestionCmd()

ilTestPlayerAbstractGUI::showQuestionCmd ( )
abstractprotected

Referenced by determineSolutionPassIndex(), and finishTestCmd().

+ Here is the caller graph for this function:

◆ showQuestionEditable()

ilTestPlayerAbstractGUI::showQuestionEditable ( assQuestionGUI  $questionGui,
  $formAction,
  $isQuestionWorkedThrough,
  $instantResponse 
)
protected

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

References buildEditableStateQuestionNavigationGUI(), ilSession\clear(), ILIAS\Repository\ctrl(), determineSolutionPassIndex(), ilSession\get(), assQuestionGUI\getQuestionHeaderBlockBuilder(), isShowingPostponeStatusReguired(), ILIAS\Repository\object(), assQuestionGUI\outQuestionForTest(), populateModals(), assQuestionGUI\setNavigationGUI(), and ilTestPlayerCommands\SKIP_QUESTION.

Referenced by ilTestOutputGUI\showQuestionCmd().

943  {
944  $questionNavigationGUI = $this->buildEditableStateQuestionNavigationGUI($questionGui->object->getId());
945  if ($isQuestionWorkedThrough) {
946  $questionNavigationGUI->setDiscardSolutionButtonEnabled(true);
947  // fau: testNav - set answere status in question header
948  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
949  // fau.
950  } elseif ($this->object->isPostponingEnabled()) {
951  $questionNavigationGUI->setSkipQuestionLinkTarget(
952  $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION)
953  );
954  }
955  $questionGui->setNavigationGUI($questionNavigationGUI);
956 
957  $isPostponed = $this->isShowingPostponeStatusReguired($questionGui->object->getId());
958 
959  $answerFeedbackEnabled = (
960  $instantResponse && $this->object->getSpecificAnswerFeedback()
961  );
962 
963  if ($this->testrequest->isset('save_error') && $this->testrequest->raw('save_error') == 1 && ilSession::get('previouspost') != null) {
964  $userPostSolution = ilSession::get('previouspost');
965  ilSession::clear('previouspost');
966  } else {
967  $userPostSolution = false;
968  }
969 
970  // fau: testNav - add special checkbox for mc question
971  // moved to another patch block
972  // fau.
973 
974  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
975  $qstConfig = $questionGui->object->getTestPresentationConfig();
976 
977  if ($questionGui instanceof assMultipleChoiceGUI) {
978  $qstConfig->setWorkedThrough($isQuestionWorkedThrough);
979  }
980 
981  if ($qstConfig->isPreviousPassSolutionReuseAllowed()) {
982  $passIndex = $this->determineSolutionPassIndex($questionGui); // last pass having solution stored
983  if ($passIndex < $this->test_session->getPass()) { // it's the previous pass if current pass is higher
984  $qstConfig->setSolutionInitiallyPrefilled(true);
985  }
986  } else {
987  $passIndex = $this->test_session->getPass();
988  }
989  // hey.
990 
991  // Answer specific feedback is rendered into the display of the test question with in the concrete question types outQuestionForTest-method.
992  // Notation of the params prior to getting rid of this crap in favor of a class
993  $questionGui->outQuestionForTest(
994  $formAction, #form_action
995  $this->test_session->getActiveId(), #active_id
996  // hey: prevPassSolutions - prepared pass index having no, current or previous solution
997  $passIndex, #pass
998  // hey.
999  $isPostponed, #is_postponed
1000  $userPostSolution, #user_post_solution
1001  $answerFeedbackEnabled #answer_feedback == inline_specific_feedback
1002  );
1003  // The display of specific inline feedback and specific feedback in an own block is to honor questions, which
1004  // have the possibility to embed the specific feedback into their output while maintaining compatibility to
1005  // questions, which do not have such facilities. E.g. there can be no "specific inline feedback" for essay
1006  // questions, while the multiple-choice questions do well.
1007 
1008 
1009  $this->populateModals();
1010 
1011  // fau: testNav - pouplate the new question edit control instead of the deprecated intermediate solution saver
1012  $this->populateQuestionEditControl($questionGui);
1013  // fau.
1014  }
static get(string $a_var)
determineSolutionPassIndex(assQuestionGUI $questionGui)
isShowingPostponeStatusReguired($questionId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static clear(string $a_var)
outQuestionForTest(string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, $user_post_solutions=false, bool $show_specific_inline_feedback=false)
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showQuestionViewable()

ilTestPlayerAbstractGUI::showQuestionViewable ( assQuestionGUI  $questionGui,
  $formAction,
  $isQuestionWorkedThrough,
  $instantResponse 
)
protected

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

References buildReadOnlyStateQuestionNavigationGUI(), assQuestionGUI\getFormEncodingType(), assQuestionGUI\getQuestionHeaderBlockBuilder(), assQuestionGUI\getSolutionOutput(), isShowingPostponeStatusReguired(), ILIAS\Repository\lng(), assQuestionGUI\outQuestionPage(), and assQuestionGUI\setNavigationGUI().

Referenced by ilTestOutputGUI\showQuestionCmd().

894  {
895  $questionNavigationGUI = $this->buildReadOnlyStateQuestionNavigationGUI($questionGui->object->getId());
896  $questionNavigationGUI->setQuestionWorkedThrough($isQuestionWorkedThrough);
897  $questionGui->setNavigationGUI($questionNavigationGUI);
898 
899  // fau: testNav - set answere status in question header
900  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered($isQuestionWorkedThrough);
901  // fau.
902 
903  $answerFeedbackEnabled = (
904  $instantResponse && $this->object->getSpecificAnswerFeedback()
905  );
906 
907  $solutionoutput = $questionGui->getSolutionOutput(
908  $this->test_session->getActiveId(), #active_id
909  $this->test_session->getPass(), #pass
910  false, #graphical_output
911  false, #result_output
912  true, #show_question_only
913  $answerFeedbackEnabled, #show_feedback
914  false, #show_correct_solution
915  false, #show_manual_scoring
916  true #show_question_text
917  );
918 
919  $pageoutput = $questionGui->outQuestionPage(
920  "",
921  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
922  $this->test_session->getActiveId(),
923  $solutionoutput
924  );
925 
926  $this->tpl->setVariable(
927  'LOCKSTATE_INFOBOX',
928  $this->ui_renderer->render(
929  $this->ui_factory->messageBox()->info($this->lng->txt("tst_player_answer_saved_and_locked"))
930  )
931  );
932  $this->tpl->parseCurrentBlock();
933 
934  $this->tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
935 
936  $this->tpl->setVariable("FORMACTION", $formAction);
937  $this->tpl->setVariable("ENCTYPE", 'enctype="' . $questionGui->getFormEncodingType() . '"');
938  $this->tpl->setVariable("FORM_TIMESTAMP", time());
939  $this->populateQuestionEditControl($questionGui);
940  }
isShowingPostponeStatusReguired($questionId)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRequestedHintListCmd()

ilTestPlayerAbstractGUI::showRequestedHintListCmd ( )
protected

Go to requested hint list.

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

References ilAssQuestionHintRequestGUI\CMD_SHOW_LIST, ILIAS\Repository\ctrl(), and handleIntermediateSubmit().

1466  {
1467  // fau: testNav - handle intermediate submit for viewing requested hints
1468  $this->handleIntermediateSubmit();
1469  // fau.
1470 
1471  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1472 
1473  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST);
1474  }
handleIntermediateSubmit()
Check the &#39;answer changed&#39; parameter when a question form is intermediately submitted.
+ Here is the call graph for this function:

◆ showSideList()

ilTestPlayerAbstractGUI::showSideList (   $current_sequence_element)
protected

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

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

Referenced by prepareTestPage().

1193  : void
1194  {
1195  $question_summary_data = $this->service->getQuestionSummaryData($this->testSequence, false);
1196  $questions = [];
1197  $active = 0;
1198 
1199  foreach ($question_summary_data as $idx => $row) {
1200  $title = htmlspecialchars($row['title'], ENT_QUOTES, null, false);
1201  $description = '';
1202  if ($row['description'] !== '') {
1203  $description = htmlspecialchars($row['description'], ENT_QUOTES, null, false);
1204  }
1205 
1206  if (!$row['disabled']) {
1207  $this->ctrl->setParameter($this, 'pmode', '');
1208  $this->ctrl->setParameter($this, 'sequence', $row['sequence']);
1209  $action = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SHOW_QUESTION);
1210  $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1211  $this->ctrl->setParameter($this, 'sequence', $this->getCurrentSequenceElement($current_sequence_element));
1212  }
1213 
1215 
1216  if (
1217  ($row['worked_through'] || $row['isAnswered'])
1218  && $row['has_authorized_answer']
1219  ) {
1221  }
1222 
1223  $questions[] = $this->ui_factory->listing()->workflow()
1224  ->step($title, $description, $action)
1225  ->withStatus($status);
1226  $active = $row['sequence'] == $current_sequence_element ? $idx : $active;
1227  }
1228 
1229  $question_listing = $this->ui_factory->listing()->workflow()->linear(
1230  $this->lng->txt('mainbar_button_label_questionlist'),
1231  $questions
1232  )->withActive($active);
1233 
1234 
1235  $this->global_screen->tool()->context()->current()->addAdditionalData(
1237  $question_listing
1238  );
1239  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skipQuestionCmd()

ilTestPlayerAbstractGUI::skipQuestionCmd ( )
abstractprotected

Referenced by revertChangesCmd().

+ Here is the caller 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 433 of file class.ilTestPlayerAbstractGUI.php.

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

434  {
435  $testStartLock = $this->getLockParameter();
436  $isFirstTestStartRequest = false;
437 
438  $this->processLocker->executeTestStartLockOperation(function () use ($testStartLock, &$isFirstTestStartRequest) {
439  if ($this->test_session->lookupTestStartLock() !== $testStartLock) {
440  $this->test_session->persistTestStartLock($testStartLock);
441  $isFirstTestStartRequest = true;
442  }
443  });
444 
445  if ($isFirstTestStartRequest) {
446  $this->handleUserSettings();
447  $this->ctrl->redirect($this, ilTestPlayerCommands::INIT_TEST);
448  }
449 
450  $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
451  $this->ctrl->redirectByClass("ilobjtestgui", "redirectToInfoScreen");
452  }
handleUserSettings()
Handles some form parameters on starting and resuming a test.
+ Here is the call graph for this function:

◆ startTestCmd()

ilTestPlayerAbstractGUI::startTestCmd ( )
abstractprotected

Referenced by revertChangesCmd().

+ Here is the caller graph for this function:

◆ submitIntermediateSolutionCmd()

ilTestPlayerAbstractGUI::submitIntermediateSolutionCmd ( )
protected

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

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

626  {
627  $this->saveQuestionSolution(false, true);
628  // fau: testNav - set the 'answer changed' parameter when an intermediate solution is submitted
629  $this->setAnswerChangedParameter(true);
630  // fau.
631  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
632  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
setAnswerChangedParameter($changed=true)
Set the &#39;answer changed&#39; url parameter for generated links.
+ Here is the call graph for this function:

◆ submitSolutionCmd()

ilTestPlayerAbstractGUI::submitSolutionCmd ( )
abstractprotected

Referenced by determineSolutionPassIndex().

+ Here is the caller graph for this function:

◆ suspendTestCmd()

ilTestPlayerAbstractGUI::suspendTestCmd ( )

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

References ILIAS\Repository\ctrl(), and ilTestScreenGUI\DEFAULT_CMD.

Referenced by maxProcessingTimeReached().

172  {
173  $this->ctrl->redirectByClass(ilTestScreenGUI::class, ilTestScreenGUI::DEFAULT_CMD);
174  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and unmarkQuestionCmd().

655  {
656  // fau: testNav - handle intermediate submit when unmarking the question
657  $this->handleIntermediateSubmit();
658  // fau.
659  $this->unmarkQuestionCmd();
660  }
handleIntermediateSubmit()
Check the &#39;answer changed&#39; parameter when a question form is intermediately submitted.
unmarkQuestionCmd()
Set a question unsolved.
+ Here is the call graph for this function:

◆ unmarkQuestionCmd()

ilTestPlayerAbstractGUI::unmarkQuestionCmd ( )
protected

Set a question unsolved.

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

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

Referenced by unmarkQuestionAndSaveIntermediateCmd().

666  {
667  $questionId = $this->testSequence->getQuestionForSequence(
669  );
670 
671  $this->object->setQuestionSetSolved(0, $questionId, $this->test_session->getUserId());
672 
673  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
674  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2440  {
2441  $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2442  if (isset($forced_feedback_navigation_url[$this->test_session->getActiveId()])) {
2443  unset($forced_feedback_navigation_url[$this->test_session->getActiveId()]);
2444  ilSession::set('forced_feedback_navigation_url', $forced_feedback_navigation_url);
2445  }
2446  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller 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 139 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by handleFileUploadCmd(), ilTestOutputGUI\handleQuestionActionCmd(), and ilTestOutputGUI\saveQuestionSolution().

140  {
141  if (ilSession::get("active_time_id") != null) {
142  $this->object->updateWorkingTime(ilSession::get("active_time_id"));
143  }
144 
146  "active_time_id",
147  $this->object->startWorkingTime(
148  $this->test_session->getActiveId(),
149  $this->test_session->getPass()
150  )
151  );
152  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assSettings

ilSetting ilTestPlayerAbstractGUI::$assSettings = null
protected

◆ $cachedQuestionGuis

ilTestPlayerAbstractGUI::$cachedQuestionGuis = []
private

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

◆ $cachedQuestionObjects

ilTestPlayerAbstractGUI::$cachedQuestionObjects = []
private

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

◆ $endingTimeReached

bool ilTestPlayerAbstractGUI::$endingTimeReached

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

◆ $finish_test_modal

InterruptiveModal ilTestPlayerAbstractGUI::$finish_test_modal = null
protected

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

◆ $maxProcessingTimeReached

bool ilTestPlayerAbstractGUI::$maxProcessingTimeReached

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

◆ $passwordChecker

ilTestPasswordChecker ilTestPlayerAbstractGUI::$passwordChecker
protected

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

◆ $processLocker

ilTestProcessLocker ilTestPlayerAbstractGUI::$processLocker
protected

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

◆ $ref_id

int ilTestPlayerAbstractGUI::$ref_id

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

◆ $test_session

ilTestSession ilTestPlayerAbstractGUI::$test_session = null
protected

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

◆ $testSequence

ilTestSequence ilTestPlayerAbstractGUI::$testSequence = null
protected

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

◆ PRESENTATION_MODE_EDIT

const ilTestPlayerAbstractGUI::PRESENTATION_MODE_EDIT = 'edit'

◆ PRESENTATION_MODE_VIEW

const ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW = 'view'

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