ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestPlayerAbstractGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ($a_object)
 ilTestOutputGUI constructor More...
 
 saveTagsCmd ()
 Save tags for tagging gui. More...
 
 updateWorkingTime ()
 updates working time and stores state saveresult to see if question has to be stored or not More...
 
 removeIntermediateSolution ()
 remove an auto-saved solution of the current question More...
 
 saveQuestionSolution ($authorized=true, $force=false)
 saves the user input of a question More...
 
 suspendTestCmd ()
 
 isMaxProcessingTimeReached ()
 Checks wheather the maximum processing time is reached or not. More...
 
 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...
 
 redirectAfterDashboardCmd ()
 
 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...
 
 toggleSideListCmd ()
 Toggle side list. More...
 
 finishTestCmd ($requires_confirmation=true)
 
 redirectBackCmd ()
 
 getKioskHead ()
 
 checkOnlineTestAccess ()
 check access restrictions like client ip, partipating user etc. More...
 
 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...
 
 outProcessingTime ($active_id)
 
 checkWorkingTimeCmd ()
 This is asynchronously called by tpl.workingtime.js to check for changes in the user's processing time for a test. More...
 
 outQuestionSummaryCmd ($fullpage=true, $contextFinishTest=false, $obligationsInfo=false, $obligationsFilter=false)
 Output of a summary of all test questions for test participants. More...
 
 outQuestionSummaryWithObligationsInfoCmd ()
 
 outObligationsOnlySummaryCmd ()
 
 showMaximumAllowedUsersReachedMessage ()
 
 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 ($contextResultPresentation)
 
 __construct (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
 setParticipantData ($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 $objectiveOrientedContainer)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 buildPassOverviewTableGUI ($targetGUI)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=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 $objectivesList=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getResultsOfUserOutput ($testSession, $active_id, $pass, $targetGUI, $show_pass_details=true, $show_answers=true, $show_question_only=false, $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 ($question_id, $test_id)
 Creates a HTML representation for the results of a given question in a test. More...
 
 populatePassFinishDate ($tpl, $passFinishDate)
 
 populateExamId (ilTemplate $tpl, int $activeId, int $pass)
 
 getObject ()
 

Data Fields

const PRESENTATION_MODE_VIEW = 'view'
 
const PRESENTATION_MODE_EDIT = 'edit'
 
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
 $ref_id
 
 $saveResult
 
 $sequence
 
 $cmdCtrl
 
 $maxProcessingTimeReached
 
 $endingTimeReached
 
const FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'
 
- Data Fields inherited from ilTestServiceGUI
 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 

Protected Member Functions

 checkReadAccess ()
 
 checkTestExecutable ()
 
 checkTestSessionUser (ilTestSession $testSession)
 
 ensureExistingTestSession (ilTestSession $testSession)
 
 initProcessLocker ($activeId)
 
 canSaveResult ()
 
 determineInlineScoreDisplay ()
 
 populateTestNavigationToolbar (ilTestNavigationToolbarGUI $toolbarGUI)
 
 populateQuestionNavigation ($sequenceElement, $disabled, $primaryNext)
 
 populatePreviousButtons ($disabled)
 
 populateNextButtons ($disabled, $primaryNext)
 
 populateLowerNextButtonBlock ($disabled, $primaryNext)
 
 populateUpperNextButtonBlock ($disabled, $primaryNext)
 
 populateLowerPreviousButtonBlock ($disabled)
 
 populateUpperPreviousButtonBlock ($disabled)
 
 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...
 
 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...
 
 confirmFinishCmd ()
 The final submission of a test was confirmed. More...
 
 performTestPassFinishedTasks ($finishedPass)
 
 afterTestPassFinishedCmd ()
 
 archiveParticipantSubmission ($active, $pass)
 
 backToInfoScreenCmd ()
 
 prepareTestPage ($presentationMode, $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 ($presentationMode, $currentSequenceElement)
 
 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 ()
 
 populateKioskHead ()
 
 handlePasswordProtectionRedirect ()
 
 isParticipantsAnswerFixed ($questionId)
 
 getIntroductionPageButtonLabel ()
 
 initAssessmentSettings ()
 
 handleSkillTriggering (ilTestSession $testSession)
 
 buildTestPassQuestionList ()
 
 showAnswerOptionalQuestionsConfirmation ()
 
 confirmAnswerOptionalQuestionsCmd ()
 
 cancelAnswerOptionalQuestionsCmd ()
 
 populateHelperGuiContent ($helperGui)
 
 populateCharSelectorIfRequired ()
 
 getTestNavigationToolbarGUI ()
 
 buildReadOnlyStateQuestionNavigationGUI ($questionId)
 
 buildEditableStateQuestionNavigationGUI ($questionId, $charSelectorAvailable)
 
 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 ($questionId, $fromCache=true)
 
 initTestQuestionConfig (assQuestion $questionOBJ)
 
 handleTearsAndAngerQuestionIsNull ($questionId, $sequenceElement)
 
 populateMessageContent ($contentHTML)
 
 populateModals ()
 
 populateDiscardSolutionModal ()
 
 populateNavWhenChangedModal ()
 
 populateNextLocksUnchangedModal ()
 
 populateNextLocksChangedModal ()
 
 setFollowUpQuestionLocksConfirmationPrevented ()
 
 isFollowUpQuestionLocksConfirmationPrevented ()
 
 getQuestionsDefaultPresentationMode ($isQuestionWorkedThrough)
 
 registerForcedFeedbackNavUrl ($forcedFeedbackNavUrl)
 
 getRegisteredForcedFeedbackNavUrl ()
 
 isForcedFeedbackNavUrlRegistered ()
 
 unregisterForcedFeedbackNavUrl ()
 
 handleFileUploadCmd ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 buildQuestionAnswerShuffler (int $question_id, int $active_id, int $pass_id)
 
 buildFixedShufflerSeed (int $question_id, int $pass_id, int $active_id)
 
 getPassDetailsOverviewTableGUI ( $result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

 $passwordChecker
 
 $processLocker
 
 $testSession
 
 $assSettings
 
 $testSequence = null
 
- Protected Attributes inherited from ilTestServiceGUI
ILIAS Test InternalRequestService $testrequest
 
 $db
 
Refinery $refinery
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Member Functions

 buildNextButtonInstance ($disabled, $primaryNext)
 
 buildPreviousButtonInstance ($disabled)
 

Private Attributes

 $cachedQuestionGuis = array()
 
 $cachedQuestionObjects = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 35 of file class.ilTestPlayerAbstractGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerAbstractGUI::__construct (   $a_object)

ilTestOutputGUI constructor

Parameters
ilObjTest$a_object

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

References $DIC, $ilUser, ilTestServiceGUI\$lng, and ILIAS\GlobalScreen\Provider\__construct().

80  {
81  parent::__construct($a_object);
82  $this->ref_id = $this->testrequest->getRefId();
83 
84  global $DIC;
85  $rbacsystem = $DIC['rbacsystem'];
86  $ilUser = $DIC['ilUser'];
87  $lng = $DIC['lng'];
88  $this->passwordChecker = new ilTestPasswordChecker($rbacsystem, $ilUser, $this->object, $lng);
89 
90  $this->processLocker = null;
91  $this->testSession = null;
92  $this->assSettings = null;
93  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

Member Function Documentation

◆ accessCodeConfirmedCmd()

ilTestPlayerAbstractGUI::accessCodeConfirmedCmd ( )

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

References $DIC, ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\object(), ilUtil\redirect(), REDIRECT_KIOSK, redirectBackCmd(), and ilTestPlayerCommands\SHOW_FINAL_STATMENT.

844  {
845  $activeId = $this->testSession->getActiveId();
846  $lastFinishedPass = $this->testSession->getLastFinishedPass();
847 
848  // handle test signature
849  if ($this->isTestSignRedirectRequired($activeId, $lastFinishedPass)) {
850  $this->ctrl->redirectByClass('ilTestSignatureGUI', 'invokeSignaturePlugin');
851  }
852 
853  // show final statement
854  if (!$this->testrequest->isset('skipfinalstatement')) {
855  if ($this->object->getShowFinalStatement()) {
856  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_FINAL_STATMENT);
857  }
858  }
859 
860  // redirect after test
861  $redirection_mode = $this->object->getRedirectionMode();
862  $redirection_url = $this->object->getRedirectionUrl();
863  if ($redirection_url && $redirection_mode) {
864  if ($redirection_mode == REDIRECT_KIOSK) {
865  if ($this->object->getKioskMode()) {
866  ilUtil::redirect($redirection_url);
867  }
868  } else {
869  ilUtil::redirect($redirection_url);
870  }
871  }
872 
873  // default redirect (pass overview when enabled, otherwise infoscreen)
874  $this->redirectBackCmd();
875  }
const REDIRECT_KIOSK
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ archiveParticipantSubmission()

ilTestPlayerAbstractGUI::archiveParticipantSubmission (   $active,
  $pass 
)
protected
Parameters
$active
Returns
void

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

References $DIC, $filename, ilTestServiceGUI\$ilias, $ilSetting, $path, $results, $testSequence, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestArchiver\DIR_SEP, ilTestPDFGenerator\generatePDF(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilFileUtils\getWebspaceDir(), ILIAS\Repository\lng(), ilFileUtils\makeDirParents(), ILIAS\Repository\object(), and ilTestPDFGenerator\PDF_OUTPUT_FILE.

899  {
900  global $DIC;
901  $ilObjDataCache = $DIC['ilObjDataCache'];
902 
903  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
904 
905  $objectivesList = null;
906 
907  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
908  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
909  $testSequence->loadFromDb();
910  $testSequence->loadQuestions();
911 
912  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
913 
914  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
915  $objectivesList->loadObjectivesTitles();
916 
917  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
918  $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
919  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
920  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
921  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
922  }
923 
924  $results = $this->object->getTestResult(
925  $active,
926  $pass,
927  false,
928  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
929  );
930 
931  $testevaluationgui = new ilTestEvaluationGUI($this->object);
932  $results_output = $testevaluationgui->getPassListOfAnswers(
933  $results,
934  $active,
935  $pass,
936  false,
937  false,
938  false,
939  false,
940  false,
941  $objectivesList,
942  $testResultHeaderLabelBuilder
943  );
944 
945  global $DIC;
946  $ilSetting = $DIC['ilSetting'];
947  $inst_id = $ilSetting->get('inst_id', null);
948  $archiver = new ilTestArchiver($this->object->getId());
949 
950  $path = ilFileUtils::getWebspaceDir() . '/assessment/' . $this->object->getId() . '/exam_pdf';
951  if (!is_dir($path)) {
953  }
954  $filename = realpath($path) . '/exam_N' . $inst_id . '-' . $this->object->getId()
955  . '-' . $active . '-' . $pass . '.pdf';
956 
958  //$template->setVariable("PDF_FILE_LOCATION", $filename);
959  // Participant submission
960  $archiver->handInParticipantSubmission($active, $pass, $filename, $results_output);
961  //$archiver->handInParticipantMisc( $active, $pass, 'signature_gedoens.sig', $filename );
962  //$archiver->handInParticipantQuestionMaterial( $active, $pass, 123, 'file_upload.pdf', $filename );
963 
964  global $DIC;
965  $ilias = $DIC['ilias'];
966  $questions = $this->object->getQuestions();
967  foreach ($questions as $question_id) {
968  $question_object = $this->object->getQuestionDataset($question_id);
969  if ($question_object->type_tag == 'assFileUpload') {
970  // Pfad: /data/default/assessment/tst_2/14/21/files/file_14_4_1370417414.png
971  // /data/ - klar
972  // /assessment/ - Konvention
973  // /tst_2/ = /tst_<test_id> (ilObjTest)
974  // /14/ = /<active_fi>/
975  // /21/ = /<question_id>/ (question_object)
976  // /files/ - Konvention
977  // file_14_4_1370417414.png = file_<active_fi>_<pass>_<some timestamp>.<ext>
978 
979  $candidate_path =
980  $ilias->ini_ilias->readVariable('server', 'absolute_path') . ilTestArchiver::DIR_SEP
981  . $ilias->ini_ilias->readVariable('clients', 'path') . ilTestArchiver::DIR_SEP
982  . $ilias->client_id . ilTestArchiver::DIR_SEP
983  . 'assessment' . ilTestArchiver::DIR_SEP
984  . 'tst_' . $this->object->test_id . ilTestArchiver::DIR_SEP
985  . $active . ilTestArchiver::DIR_SEP
986  . $question_id . ilTestArchiver::DIR_SEP
987  . 'files' . ilTestArchiver::DIR_SEP;
988  $handle = opendir($candidate_path);
989  while ($handle != false && ($file = readdir($handle)) !== false) {
990  if ($file != null) {
991  $filename_start = 'file_' . $active . '_' . $pass . '_';
992 
993  if (strpos($file, $filename_start) === 0) {
994  $archiver->handInParticipantQuestionMaterial($active, $pass, $question_id, $file, $file);
995  }
996  }
997  }
998  }
999  }
1000  $passdata = $this->object->getTestResult(
1001  $active,
1002  $pass,
1003  false,
1004  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1005  );
1006  $overview = $testevaluationgui->getPassListOfAnswers(
1007  $passdata,
1008  $active,
1009  $pass,
1010  true,
1011  false,
1012  false,
1013  true,
1014  false,
1015  $objectivesList,
1016  $testResultHeaderLabelBuilder
1017  );
1018  $filename = realpath(ilFileUtils::getWebspaceDir()) . '/assessment/scores-' . $this->object->getId() . '-' . $active . '-' . $pass . '.pdf';
1020  $archiver->handInTestResult($active, $pass, $filename);
1021  unlink($filename);
1022 
1023  return;
1024  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$results
$filename
Definition: buildRTE.php:78
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilSetting
Definition: privfeed.php:17
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
+ 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 604 of file class.ilTestPlayerAbstractGUI.php.

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

605  {
606  $result = "";
607  if (is_countable($_POST) && count($_POST) > 0) {
608  if (!$this->canSaveResult() || $this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
609  $result = '-IGNORE-';
610  } else {
611  $authorize = !$this->getAnswerChangedParameter();
612  $res = $this->saveQuestionSolution($authorize, true);
613 
614  if ($res) {
615  $result = $this->lng->txt("autosave_success");
616  } else {
617  $result = $this->lng->txt("autosave_failed");
618  }
619  }
620  }
621  echo $result;
622  exit;
623  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
$res
Definition: ltiservices.php:69
exit
Definition: login.php:28
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:

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

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

630  {
631  if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
632  $this->saveQuestionSolution(false, true);
633  }
634  $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
635  }
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 1685 of file class.ilTestPlayerAbstractGUI.php.

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

+ Here is the call graph for this function:

◆ backToInfoScreenCmd()

ilTestPlayerAbstractGUI::backToInfoScreenCmd ( )
protected

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

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

Referenced by ilTestOutputGUI\handleCheckTestPassValid(), ilTestOutputGUI\handleTearsAndAngerNoObjectiveOrientedQuestion(), and redirectBackCmd().

1043  {
1044  $this->ctrl->redirectByClass('ilObjTestGUI', 'redirectToInfoScreen');
1045  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEditableStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildEditableStateQuestionNavigationGUI (   $questionId,
  $charSelectorAvailable 
)
protected

Definition at line 2120 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().

2121  {
2122  $navigationGUI = new ilTestQuestionNavigationGUI($this->lng);
2123 
2124  if ($this->object->isForceInstantFeedbackEnabled()) {
2125  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2126  } else {
2127  // fau: testNav - use simple "submitSolution" button instead of "submitSolutionAndNext"
2128  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2129  // fau.
2130  }
2131 
2132  // fau: testNav - add a 'revert changes' link for editable question
2133  $navigationGUI->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
2134  // fau.
2135 
2136 
2137  // feedback
2138  switch (1) {
2139  case $this->object->getSpecificAnswerFeedback():
2140  case $this->object->getGenericAnswerFeedback():
2141  case $this->object->getAnswerFeedbackPoints():
2142  case $this->object->getInstantFeedbackSolution():
2143 
2144  $navigationGUI->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
2145 
2146  if ($this->object->isForceInstantFeedbackEnabled()) {
2147  $navigationGUI->setForceInstantResponseEnabled(true);
2148  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2149  } else {
2150  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
2151  }
2152  }
2153 
2154  // hints
2155  if ($this->object->isOfferingQuestionHintsEnabled()) {
2156  $activeId = $this->testSession->getActiveId();
2157  $pass = $this->testSession->getPass();
2158 
2159  $questionHintTracking = new ilAssQuestionHintTracking($questionId, $activeId, $pass);
2160 
2161  if ($questionHintTracking->requestsPossible()) {
2162  $navigationGUI->setRequestHintCommand(ilTestPlayerCommands::CONFIRM_HINT_REQUEST);
2163  }
2164 
2165  if ($questionHintTracking->requestsExist()) {
2166  $navigationGUI->setShowHintsCommand(ilTestPlayerCommands::SHOW_REQUESTED_HINTS_LIST);
2167  }
2168  }
2169 
2170  $navigationGUI->setCharSelectorEnabled($charSelectorAvailable);
2171 
2172  if ($this->object->getShowMarker()) {
2173  $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $questionId);
2174  $solved = 0;
2175 
2176  if (count($solved_array) > 0) {
2177  $solved = array_pop($solved_array);
2178  $solved = $solved["solved"];
2179  }
2180 
2181  // fau: testNav - change question mark command to link target
2182  if ($solved == 1) {
2183  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
2184  $navigationGUI->setQuestionMarked(true);
2185  } else {
2186  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
2187  $navigationGUI->setQuestionMarked(false);
2188  }
2189  }
2190  // fau.
2191  return $navigationGUI;
2192  }
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:

◆ buildNextButtonInstance()

ilTestPlayerAbstractGUI::buildNextButtonInstance (   $disabled,
  $primaryNext 
)
private
Parameters
bool$disabled
bool$primaryNext
Returns
ilButtonBase|ilLinkButton|ilTestPlayerNavButton

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

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

Referenced by populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

319  {
321  // fau: testNav - set glyphicon and primary
322  $button->setPrimary($primaryNext);
323  $button->setRightGlyph('glyphicon glyphicon-arrow-right');
324  // fau.
325  $button->setNextCommand(ilTestPlayerCommands::NEXT_QUESTION);
326  $button->setUrl($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::NEXT_QUESTION));
327  $button->setCaption('next_question');
328  $button->addCSSClass('ilTstNavElem');
329  //$button->setDisabled($disabled);
330  return $button;
331  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPreviousButtonInstance()

ilTestPlayerAbstractGUI::buildPreviousButtonInstance (   $disabled)
private
Parameters
$disabled
Returns
ilTestPlayerNavButton

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

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

Referenced by populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

338  {
340  // fau: testNav - set glyphicon and primary
341  $button->setLeftGlyph('glyphicon glyphicon-arrow-left');
342  // fau.
343  $button->setNextCommand(ilTestPlayerCommands::PREVIOUS_QUESTION);
344  $button->setUrl($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::PREVIOUS_QUESTION));
345  $button->setCaption('previous_question');
346  $button->addCSSClass('ilTstNavElem');
347  //$button->setDisabled($disabled);
348  return $button;
349  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildReadOnlyStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildReadOnlyStateQuestionNavigationGUI (   $questionId)
protected

Definition at line 2090 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().

2091  {
2092  $navigationGUI = new ilTestQuestionNavigationGUI($this->lng);
2093 
2094  if (!$this->isParticipantsAnswerFixed($questionId)) {
2095  $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
2096  }
2097 
2098  if ($this->object->getShowMarker()) {
2099  $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $questionId);
2100  $solved = 0;
2101 
2102  if (count($solved_array) > 0) {
2103  $solved = array_pop($solved_array);
2104  $solved = $solved["solved"];
2105  }
2106  // fau: testNav - change question mark command to link target
2107  if ($solved == 1) {
2108  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
2109  $navigationGUI->setQuestionMarked(true);
2110  } else {
2111  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
2112  $navigationGUI->setQuestionMarked(false);
2113  }
2114  }
2115  // fau.
2116 
2117  return $navigationGUI;
2118  }
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 2025 of file class.ilTestPlayerAbstractGUI.php.

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

2026  {
2027  if ($this->object->getListOfQuestions()) {
2028  $this->ctrl->setParameter($this, 'activecommand', 'summary');
2029  } else {
2030  $this->ctrl->setParameter($this, 'activecommand', 'previous');
2031  }
2032 
2033  $this->ctrl->redirect($this, 'redirectQuestion');
2034  }
+ 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 ( )

check access restrictions like client ip, partipating user etc.

check access restrictions like client ip, partipating user etc.

public

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

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

1362  {
1363  global $DIC;
1364  $ilUser = $DIC['ilUser'];
1365 
1366  // check if user is invited to participate
1367  $user = $this->object->getInvitedUsers($ilUser->getId());
1368  if (!is_array($user) || count($user) != 1) {
1369  $this->tpl->setOnScreenMessage('info', $this->lng->txt("user_not_invited"), true);
1370  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1371  }
1372 
1373  $user = array_pop($user);
1374  // check if client ip is set and if current remote addr is equal to stored client-ip
1375  if (strcmp($user["clientip"], "") != 0 && strcmp($user["clientip"], $_SERVER["REMOTE_ADDR"]) != 0) {
1376  $this->tpl->setOnScreenMessage('info', $this->lng->txt("user_wrong_clientip"), true);
1377  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1378  }
1379  }
global $DIC
Definition: feed.php:28
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ checkReadAccess()

ilTestPlayerAbstractGUI::checkReadAccess ( )
protected

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

References $DIC, and ILIAS\Repository\lng().

Referenced by ilTestOutputGUI\executeCommand().

96  {
97  global $DIC;
98  $rbacsystem = $DIC['rbacsystem'];
99 
100  if (!$rbacsystem->checkAccess("read", $this->object->getRefId())) {
101  // only with read access it is possible to run the test
102  $this->ilias->raiseError($this->lng->txt("cannot_execute_test"), $this->ilias->error_obj->MESSAGE);
103  }
104  }
global $DIC
Definition: feed.php:28
header include for all ilias files.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTestExecutable()

ilTestPlayerAbstractGUI::checkTestExecutable ( )
protected

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

References ILIAS\Repository\ctrl().

Referenced by ilTestOutputGUI\executeCommand().

107  {
108  $executable = $this->object->isExecutable($this->testSession, $this->testSession->getUserId());
109 
110  if (!$executable['executable']) {
111  $this->tpl->setOnScreenMessage('info', $executable['errormessage'], true);
112  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
113  }
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTestSessionUser()

ilTestPlayerAbstractGUI::checkTestSessionUser ( ilTestSession  $testSession)
protected

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

References $DIC, and ilTestSession\getUserId().

Referenced by ilTestOutputGUI\executeCommand().

117  {
118  global $DIC; /* @var ILIAS\DI\Container $DIC */
119 
120  if ($testSession->getUserId() != $DIC->user()->getId()) {
121  throw new ilTestException('active id given does not relate to current user!');
122  }
123  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
+ 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 1551 of file class.ilTestPlayerAbstractGUI.php.

References exit.

1551  : void
1552  {
1553  $active_id = $this->testSession->getActiveId();
1554  echo (string) $this->object->getProcessingTimeInSeconds($active_id);
1555  exit;
1556  }
exit
Definition: login.php:28

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

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

References ILIAS\Repository\ctrl().

2017  {
2018  $this->testSequence->setAnsweringOptionalQuestionsConfirmed(true);
2019  $this->testSequence->saveToDb();
2020 
2021  $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
2022  $this->ctrl->redirect($this, 'redirectQuestion');
2023  }
+ Here is the call graph for this function:

◆ confirmFinishCmd()

ilTestPlayerAbstractGUI::confirmFinishCmd ( )
protected

The final submission of a test was confirmed.

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

References $DIC, $ilUser, ilTestPlayerCommands\BACK_FROM_FINISHING, ILIAS\Repository\ctrl(), finishTestCmd(), ILIAS\Repository\lng(), and populateHelperGuiContent().

730  {
731  $this->finishTestCmd(false);
732  }
finishTestCmd($requires_confirmation=true)
+ Here is the call graph for this function:

◆ confirmHintRequestCmd()

ilTestPlayerAbstractGUI::confirmHintRequestCmd ( )
protected

Go to hint request confirmation.

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

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

1843  {
1844  // fau: testNav - handle intermediate submit for confirming hint requests
1845  $this->handleIntermediateSubmit();
1846  // fau.
1847 
1848  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1849 
1850  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_CONFIRM_REQUEST);
1851  }
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 1433 of file class.ilTestPlayerAbstractGUI.php.

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

1434  {
1435  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "Modules/Test");
1436  $this->tpl->setCurrentBlock("adm_content");
1437  if ($this->object->isTestFinished($this->testSession->getActiveId())) {
1438  $this->tpl->setCurrentBlock("not_submit_allowed");
1439  $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1440  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1441  } else {
1442  $this->tpl->setCurrentBlock("submit_allowed");
1443  $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1444  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1445  }
1446  $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1447  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1448  $this->tpl->parseCurrentBlock();
1449  }
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 644 of file class.ilTestPlayerAbstractGUI.php.

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

645  {
646  $questionId = $this->getCurrentQuestionId();
647  $state = $this->getQuestionInstance($questionId)->lookupForExistingSolutions(
648  $this->testSession->getActiveId(),
649  $this->testSession->getPass()
650  );
651  $result = array();
652  $result['isAnswered'] = $state['authorized'];
653  $result['isAnswerChanged'] = $state['intermediate'];
654 
655  echo json_encode($result);
656  exit;
657  }
exit
Definition: login.php:28
getQuestionInstance($questionId, $fromCache=true)
+ Here is the call graph for this function:

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

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

References ILIAS\Repository\object().

Referenced by populateInstantResponseBlocks().

233  : bool
234  {
235  $show_question_inline_score = false;
236  if ($this->object->getAnswerFeedbackPoints()) {
237  $show_question_inline_score = true;
238  return $show_question_inline_score;
239  }
240  return $show_question_inline_score;
241  }
+ 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 1304 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by showQuestionEditable().

1304  : int
1305  {
1306  if ($this->object->isPreviousSolutionReuseEnabled($this->testSession->getActiveId())) {
1307  $currentSolutionAvailable = $questionGui->object->authorizedOrIntermediateSolutionExists(
1308  $this->testSession->getActiveId(),
1309  $this->testSession->getPass()
1310  );
1311 
1312  if (!$currentSolutionAvailable) {
1313  $previousPass = $questionGui->object->getSolutionMaxPass(
1314  $this->testSession->getActiveId()
1315  );
1316 
1317  $previousSolutionAvailable = $questionGui->object->authorizedSolutionExists(
1318  $this->testSession->getActiveId(),
1319  $previousPass
1320  );
1321 
1322  if ($previousSolutionAvailable) {
1323  return $previousPass;
1324  }
1325 
1326  }
1327  }
1328 
1329  return $this->testSession->getPass();
1330  }
+ 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 522 of file class.ilTestPlayerAbstractGUI.php.

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

523  {
524  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "Modules/Test");
525  $this->tpl->setCurrentBlock("adm_content");
526  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
527  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->testSession->getAccessCodeFromSession());
528  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
529  $this->tpl->setVariable("CMD_CONFIRM", ilTestPlayerCommands::ACCESS_CODE_CONFIRMED);
530  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("continue_work"));
531  $this->tpl->parseCurrentBlock();
532  }
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 1406 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by prepareTestPage().

1407  {
1408  $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1409  $this->testSession->increasePass();
1410  $this->testSession->setLastSequence(0);
1411  $this->testSession->saveToDb();
1412 
1413  $this->redirectBackCmd();
1414  }
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  $testSession)
protected

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

References $DIC, $ilUser, ilTestSession\doesAccessCodeInSessionExists(), ilTestSession\getAccessCodeFromSession(), ilTestSession\getActiveId(), ilTestSession\isAnonymousUser(), ilTestSession\saveToDb(), ilTestSession\setAnonymousId(), and ilTestSession\setUserId().

Referenced by ilTestOutputGUI\executeCommand().

126  {
127  if ($testSession->getActiveId()) {
128  return;
129  }
130 
131  global $DIC;
132  $ilUser = $DIC['ilUser'];
133 
134  $testSession->setUserId($ilUser->getId());
135 
136  if ($testSession->isAnonymousUser()) {
137  if (!$testSession->doesAccessCodeInSessionExists()) {
138  return;
139  }
140 
141  $testSession->setAnonymousId($testSession->getAccessCodeFromSession());
142  }
143 
144  $testSession->saveToDb();
145  }
setAnonymousId($anonymous_id)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finishTestCmd()

ilTestPlayerAbstractGUI::finishTestCmd (   $requires_confirmation = true)

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

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

Referenced by confirmFinishCmd().

755  {
756  $this->handleCheckTestPassValid();
757  ilSession::clear("tst_next");
758 
759  $active_id = $this->testSession->getActiveId();
760  $actualpass = ilObjTest::_getPass($active_id);
761 
762  $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass);
763 
764  /*
765  * The following "endgames" are possible prior to actually finishing the test:
766  * - Obligations (Ability to finish the test.)
767  * If not all obligatory questions are answered, the user is presented a list
768  * showing the deficits.
769  * - Examview (Will to finish the test.)
770  * With the examview, the participant can review all answers given in ILIAS or a PDF prior to
771  * commencing to the finished test.
772  * - Last pass allowed (Reassuring the will to finish the test.)
773  * If passes are limited, on the last pass, an additional confirmation is to be displayed.
774  */
775 
776 
777  if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
778  if ($this->object->getListOfQuestions()) {
780  } else {
782  }
783 
784  return;
785  }
786 
787  // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui)
788  if ($this->object->getEnableExamview() && !$this->testrequest->isset('reviewed') && $requires_confirmation) {
789  $this->ctrl->redirectByClass('ilTestSubmissionReviewGUI', "show");
790  return;
791  }
792 
793  // Last try in limited tries & !confirmed
794  if (($requires_confirmation) && ($actualpass == $this->object->getNrOfTries() - 1)) {
795  // show confirmation page
796  $this->confirmFinishTestCmd();
797  return;
798  }
799 
800  // Last try in limited tries & confirmed?
801  if (($actualpass == $this->object->getNrOfTries() - 1) && (!$requires_confirmation)) {
802  // @todo: php7 ask mister test
803  #$ilAuth->setIdle(ilSession::getIdleValue(), false);
804  #$ilAuth->setExpire(0);
805  switch ($this->object->getMailNotification()) {
806  case 1:
807  $this->object->sendSimpleNotification($active_id);
808  break;
809  case 2:
810  $this->object->sendAdvancedNotification($active_id);
811  break;
812  }
813  }
814 
815  // Non-last try finish
816  if (ilSession::get('tst_pass_finish') == null) {
817  ilSession::set('tst_pass_finish', 1);
818  if ($this->object->getMailNotificationType() == 1) {
819  switch ($this->object->getMailNotification()) {
820  case 1:
821  $this->object->sendSimpleNotification($active_id);
822  break;
823  case 2:
824  $this->object->sendAdvancedNotification($active_id);
825  break;
826  }
827  }
828  }
829 
830  // no redirect request loops after test pass finished tasks has been performed
831 
832  $this->performTestPassFinishedTasks($actualpass);
833 
834  $this->ctrl->redirect($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED);
835  }
static get(string $a_var)
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static clear(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:

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

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

2451  : bool
2452  {
2453  return !empty($this->testrequest->raw('test_answer_changed'));
2454  }
+ 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 1804 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\object().

Referenced by backToInfoScreenCmd(), confirmSubmitAnswers(), displayAccessCodeCmd(), initTestPageTemplate(), outQuestionSummaryCmd(), populateHelperGuiContent(), populateMessageContent(), prepareSummaryPage(), redirectAfterAutosaveCmd(), redirectAfterDashboardCmd(), showListOfAnswers(), and showMaximumAllowedUsersReachedMessage().

1804  : string
1805  {
1806  return "ADM_CONTENT";
1807 
1808  if ($this->object->getKioskMode()) {
1809  $this->tpl->setBodyClass("kiosk");
1810  $this->tpl->hideFooter();
1811  return "CONTENT";
1812  } else {
1813  return "ADM_CONTENT";
1814  }
1815  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentQuestionId()

ilTestPlayerAbstractGUI::getCurrentQuestionId ( )
abstractprotected

◆ getCurrentSequenceElement()

ilTestPlayerAbstractGUI::getCurrentSequenceElement ( )
protected

◆ getFinishTestCommand()

ilTestPlayerAbstractGUI::getFinishTestCommand ( )
protected
Returns
string

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

References ilObjTest\allObligationsAnswered(), and ILIAS\Repository\object().

Referenced by getTestNavigationToolbarGUI().

2197  : string
2198  {
2199  if (!$this->object->getListOfQuestionsEnd()) {
2200  return 'finishTest';
2201  }
2202 
2203  if ($this->object->areObligationsEnabled()) {
2204  $allObligationsAnswered = ilObjTest::allObligationsAnswered(
2205  $this->testSession->getTestId(),
2206  $this->testSession->getActiveId(),
2207  $this->testSession->getPass()
2208  );
2209 
2210  if (!$allObligationsAnswered) {
2211  return 'outQuestionSummaryWithObligationsInfo';
2212  }
2213  }
2214 
2215  return 'outQuestionSummary';
2216  }
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstantResponseParameter()

ilTestPlayerAbstractGUI::getInstantResponseParameter ( )
protected

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2401  {
2402  if ($this->testrequest->isset('instresp')) {
2403  return $this->testrequest->raw('instresp');
2404  }
2405 
2406  return null;
2407  }
+ Here is the caller graph for this function:

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

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

References ILIAS\Repository\lng().

1963  : string
1964  {
1965  return $this->lng->txt("save_introduction");
1966  }
+ Here is the call graph for this function:

◆ getKioskHead()

ilTestPlayerAbstractGUI::getKioskHead ( )

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

References $DIC, $ilUser, ilObjTest\buildExamId(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by outQuestionSummaryCmd(), and populateKioskHead().

1067  : string
1068  {
1069  global $DIC;
1070  $ilUser = $DIC['ilUser'];
1071 
1072  //this is an abomination for release_8!
1073  //proper "kiosk-handling" is _very_ much encouraged for 9.
1074  $this->tpl->addCSS('Modules/Test/templates/default/test_kiosk_header.css');
1075  //end of hack
1076 
1077  $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test');
1078  if ($this->object->getShowKioskModeTitle()) {
1079  $template->setCurrentBlock("kiosk_show_title");
1080  $template->setVariable("TEST_TITLE", $this->object->getTitle());
1081  $template->parseCurrentBlock();
1082  }
1083  if ($this->object->getShowKioskModeParticipant()) {
1084  $template->setCurrentBlock("kiosk_show_participant");
1085  $template->setVariable("PARTICIPANT_NAME_TXT", $this->lng->txt("login_as"));
1086  $template->setVariable("PARTICIPANT_NAME", $ilUser->getFullname());
1087  $template->setVariable("PARTICIPANT_LOGIN", $ilUser->getLogin());
1088  $template->setVariable("PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1089  $template->setVariable("PARTICIPANT_EMAIL", $ilUser->getEmail());
1090  $template->parseCurrentBlock();
1091  }
1092  if ($this->object->isShowExamIdInTestPassEnabled()) {
1093  $exam_id = ilObjTest::buildExamId(
1094  $this->testSession->getActiveId(),
1095  $this->testSession->getPass(),
1096  $this->object->getId()
1097  );
1098 
1099  $template->setCurrentBlock("kiosk_show_exam_id");
1100  $template->setVariable("EXAM_ID_TXT", $this->lng->txt("exam_id"));
1101  $template->setVariable("EXAM_ID", $exam_id);
1102  $template->parseCurrentBlock();
1103  }
1104  return $template->get();
1105  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
static buildExamId($active_id, $pass, $test_obj_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLockParameter()

ilTestPlayerAbstractGUI::getLockParameter ( )

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

References resumePlayerCmd().

Referenced by handlePasswordProtectionRedirect(), and startPlayerCmd().

482  {
483  if ($this->testrequest->isset('lock') && strlen($this->testrequest->raw('lock'))) {
484  return $this->testrequest->raw('lock');
485  }
486 
487  return null;
488  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

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

References ilUtil\_getHttpPath().

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

2428  : ?string
2429  {
2430  if (isset($_POST['test_player_navigation_url'])) {
2431  $navigation_url = $_POST['test_player_navigation_url'];
2432 
2433  $navigation_url_parts = parse_url($navigation_url);
2434  $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2435 
2436  if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2437  return $navigation_url;
2438  }
2439  }
2440 
2441  return null;
2442  }
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 2409 of file class.ilTestPlayerAbstractGUI.php.

Referenced by ilTestOutputGUI\submitSolutionCmd().

2410  {
2411  if (isset($_POST['nextcmd']) && strlen($_POST['nextcmd'])) {
2412  return $_POST['nextcmd'];
2413  }
2414 
2415  return null;
2416  }
+ Here is the caller graph for this function:

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

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

Referenced by ilTestOutputGUI\submitSolutionCmd().

2418  : ?int
2419  {
2420  if (isset($_POST['nextseq']) && is_numeric($_POST['nextseq'])) {
2421  return (int) $_POST['nextseq'];
2422  }
2423 
2424  return null;
2425  }
+ Here is the caller graph for this function:

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

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

2392  {
2393  if ($this->testrequest->isset('pmode')) {
2394  return $this->testrequest->raw('pmode');
2395  }
2396 
2397  return null;
2398  }

◆ getQuestionGuiInstance()

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

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2508  : object
2509  {
2510  $tpl = $this->tpl;
2511 
2512  if (!$fromCache || !isset($this->cachedQuestionGuis[$question_id])) {
2513  $question_gui = $this->object->createQuestionGUI("", $question_id);
2514  $question_gui->setTargetGui($this);
2515  $question_gui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2516  $question_gui->object->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2517  $question_gui->populateJavascriptFilesRequiredForWorkForm($tpl);
2518  $question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
2519  $question_gui->object->setShuffler($this->buildQuestionAnswerShuffler(
2520  (string) $question_id,
2521  (string) $this->testSession->getActiveId(),
2522  (string) $this->testSession->getPass()
2523  ));
2524 
2525  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2526  $this->initTestQuestionConfig($question_gui->object);
2527  // hey.
2528 
2529  $this->cachedQuestionGuis[$question_id] = $question_gui;
2530  }
2531 
2532  return $this->cachedQuestionGuis[$question_id];
2533  }
const OUTPUT_JAVASCRIPT
initTestQuestionConfig(assQuestion $questionOBJ)
buildQuestionAnswerShuffler(int $question_id, int $active_id, int $pass_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionInstance()

ilTestPlayerAbstractGUI::getQuestionInstance (   $questionId,
  $fromCache = true 
)
protected
Parameters
$questionId
Returns
assQuestion

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

References $assSettings, $DIC, $ilDB, $ilUser, ilObjAssessmentFolder\_enabledAssessmentLogging(), assQuestion\_instantiateQuestion(), initTestQuestionConfig(), ILIAS\Repository\object(), and OUTPUT_JAVASCRIPT.

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

2544  : assQuestion
2545  {
2546  global $DIC;
2547  $ilDB = $DIC['ilDB'];
2548  $ilUser = $DIC['ilUser'];
2549 
2550  if (!$fromCache || !isset($this->cachedQuestionObjects[$questionId])) {
2551  $questionOBJ = assQuestion::_instantiateQuestion($questionId);
2552 
2553  $assSettings = new ilSetting('assessment');
2554  $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
2555  $processLockerFactory->setQuestionId($questionOBJ->getId());
2556  $processLockerFactory->setUserId($ilUser->getId());
2557  $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
2558  $questionOBJ->setProcessLocker($processLockerFactory->getLocker());
2559 
2560  $questionOBJ->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2561  $questionOBJ->setOutputType(OUTPUT_JAVASCRIPT);
2562 
2563  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2564  $this->initTestQuestionConfig($questionOBJ);
2565  // hey.
2566 
2567  $this->cachedQuestionObjects[$questionId] = $questionOBJ;
2568  }
2569 
2570  return $this->cachedQuestionObjects[$questionId];
2571  }
Abstract basic class which is to be extended by the concrete assessment question type classes...
const OUTPUT_JAVASCRIPT
global $DIC
Definition: feed.php:28
initTestQuestionConfig(assQuestion $questionOBJ)
static _instantiateQuestion(int $question_id)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsDefaultPresentationMode()

ilTestPlayerAbstractGUI::getQuestionsDefaultPresentationMode (   $isQuestionWorkedThrough)
protected

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

2839  : string
2840  {
2841  // fau: testNav - always set default presentation mode to "edit"
2842  return self::PRESENTATION_MODE_EDIT;
2843  // fau.
2844  }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

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

References ilSession\get().

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

2857  {
2858  if (ilSession::get('forced_feedback_navigation_url') == null) {
2859  return null;
2860  }
2861  $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2862  if (!isset($forced_feedback_navigation_url[$this->testSession->getActiveId()])) {
2863  return null;
2864  }
2865 
2866  return $forced_feedback_navigation_url[$this->testSession->getActiveId()];
2867  }
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 2382 of file class.ilTestPlayerAbstractGUI.php.

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

2383  {
2384  if ($this->testrequest->isset('sequence')) {
2385  return $this->testrequest->raw('sequence');
2386  }
2387 
2388  return null;
2389  }
+ Here is the caller graph for this function:

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

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

References $DIC, $ilUser, ILIAS\Repository\ctrl(), getFinishTestCommand(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by ilTestOutputGUI\showQuestionCmd().

2075  {
2076  global $DIC;
2077  $ilUser = $DIC['ilUser'];
2078 
2079  $navigationToolbarGUI = new ilTestNavigationToolbarGUI($this->ctrl, $this->lng, $this);
2080 
2081  $navigationToolbarGUI->setSuspendTestButtonEnabled($this->object->getShowCancel());
2082  $navigationToolbarGUI->setQuestionTreeButtonEnabled($this->object->getListOfQuestions());
2083  $navigationToolbarGUI->setQuestionTreeVisible((bool) $ilUser->getPref('side_list_of_questions'));
2084  $navigationToolbarGUI->setQuestionListButtonEnabled($this->object->getListOfQuestions());
2085  $navigationToolbarGUI->setFinishTestCommand($this->getFinishTestCommand());
2086 
2087  return $navigationToolbarGUI;
2088  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleFileUploadCmd()

ilTestPlayerAbstractGUI::handleFileUploadCmd ( )
protected

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

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

2884  {
2885  $this->updateWorkingTime();
2886  $this->saveQuestionSolution(false);
2887  $this->ctrl->redirect($this, ilTestPlayerCommands::SUBMIT_SOLUTION);
2888  }
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 2471 of file class.ilTestPlayerAbstractGUI.php.

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

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

2472  {
2473  if ($this->getAnswerChangedParameter()) {
2474  $this->saveQuestionSolution(false);
2475  } else {
2476  $this->removeIntermediateSolution();
2477  }
2479  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
removeIntermediateSolution()
remove an auto-saved solution of the current 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 1919 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by ilTestOutputGUI\executeCommand().

1920  {
1927  if ($this->testSession->isPasswordChecked() === true) {
1928  return;
1929  }
1930 
1931  if ($this->ctrl->getNextClass() == 'iltestpasswordprotectiongui') {
1932  return;
1933  }
1934 
1935  if (!$this->passwordChecker->isPasswordProtectionPageRedirectRequired()) {
1936  $this->testSession->setPasswordChecked(true);
1937  return;
1938  }
1939 
1940  $this->ctrl->setParameter($this, 'lock', $this->getLockParameter());
1941 
1942  $nextCommand = $this->ctrl->getCmdClass() . '::' . $this->ctrl->getCmd();
1943  $this->ctrl->setParameterByClass('ilTestPasswordProtectionGUI', 'nextCommand', $nextCommand);
1944  $this->ctrl->redirectByClass('ilTestPasswordProtectionGUI', 'showPasswordForm');
1945  }
+ 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  $testSession)
protected
Parameters
ilTestSession$testSession

Definition at line 1976 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().

1977  {
1978  $questionList = $this->buildTestPassQuestionList();
1979  $questionList->load();
1980 
1981  $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true);
1982 
1983  $skillEvaluation = new ilTestSkillEvaluation($this->db, $this->object->getTestId(), $this->object->getRefId());
1984 
1985  $skillEvaluation->setUserId($testSession->getUserId());
1986  $skillEvaluation->setActiveId($testSession->getActiveId());
1987  $skillEvaluation->setPass($testSession->getPass());
1988 
1989  $skillEvaluation->setNumRequiredBookingsForSkillTriggering($this->assSettings->get(
1990  'ass_skl_trig_num_answ_barrier',
1992  ));
1993 
1994 
1995  $skillEvaluation->init($questionList);
1996  $skillEvaluation->evaluate($testResults);
1997 
1998  $skillEvaluation->handleSkillTriggering();
1999  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleTearsAndAngerQuestionIsNull()

ilTestPlayerAbstractGUI::handleTearsAndAngerQuestionIsNull (   $questionId,
  $sequenceElement 
)
protected
Parameters
$sequence
$questionId
$ilLog

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2587  {
2588  global $DIC;
2589  $ilLog = $DIC['ilLog'];
2590 
2591  $ilLog->write(
2592  "INV SEQ:"
2593  . "active={$this->testSession->getActiveId()} "
2594  . "qId=$questionId seq=$sequenceElement "
2595  . serialize($this->testSequence)
2596  );
2597 
2598  $ilLog->logStack('INV SEQ');
2599 
2600  $this->ctrl->setParameter($this, 'sequence', $this->testSequence->getFirstSequence());
2601  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2602  }
global $DIC
Definition: feed.php:28
+ 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 542 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, $ilUser, $post_array, and ILIAS\Repository\object().

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

543  {
544  global $DIC;
545  $ilUser = $DIC['ilUser'];
546  $post_array = $_POST;
547  if (!is_array($post_array)) {
548  $request = $DIC->http()->request();
549  $post_array = $request->getParsedBody();
550  }
551 
552  $tst_javascript = array_key_exists("chb_javascript", $post_array) ? 1 : 0;
553  $ilUser->writePref("tst_javascript", $tst_javascript);
554 
555  if ($this->object->getNrOfTries() != 1
556  && $this->object->getUsePreviousAnswers() == 1
557  ) {
558  $chb_use_previous_answers = array_key_exists("chb_use_previous_answers", $post_array) ? 1 : 0;
559  $ilUser->writePref("tst_use_previous_answers", $chb_use_previous_answers);
560  }
561  }
$post_array
Definition: webdav.php:31
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAssessmentSettings()

ilTestPlayerAbstractGUI::initAssessmentSettings ( )
protected

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

Referenced by ilTestOutputGUI\executeCommand().

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

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

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

References ilTestServiceGUI\$db, and $ilDB.

Referenced by ilTestOutputGUI\executeCommand().

148  {
149  $ilDB = $this->db;
150  $processLockerFactory = new ilTestProcessLockerFactory($this->assSettings, $ilDB);
151  $this->processLocker = $processLockerFactory->withContextId((int) $activeId)->getLocker();
152  }
+ 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 498 of file class.ilTestPlayerAbstractGUI.php.

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

499  {
500  if ($this->object->checkMaximumAllowedUsers() == false) {
502  return;
503  }
504 
505  if ($this->testSession->isAnonymousUser()
506  && !$this->testSession->doesAccessCodeInSessionExists()) {
507  $accessCode = $this->testSession->createNewAccessCode();
508 
509  $this->testSession->setAccessCodeToSession($accessCode);
510  $this->testSession->setAnonymousId($accessCode);
511  $this->testSession->saveToDb();
512 
513  $this->ctrl->redirect($this, ilTestPlayerCommands::DISPLAY_ACCESS_CODE);
514  }
515 
516  if (!$this->testSession->isAnonymousUser()) {
517  $this->testSession->unsetAccessCodeInSession();
518  }
519  $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
520  }
+ Here is the call graph for this function:

◆ initTestPageTemplate()

ilTestPlayerAbstractGUI::initTestPageTemplate ( )
protected

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

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

Referenced by prepareTestPage().

1881  {
1882  $onload_js = <<<JS
1883  let key_event = (event) => {
1884  if( event.key === 13 && event.target.tagName.toLowerCase() === "a" ) {
1885  return;
1886  }
1887  if (event.key === 13 &&
1888  event.target.tagName.toLowerCase() !== "textarea" &&
1889  (event.target.tagName.toLowerCase() !== "input" || event.target.type.toLowerCase() !== "submit")) {
1890  event.preventDefault();
1891  }
1892  };
1893 
1894  let form = document.getElementById('taForm');
1895  form.onkeyup = key_event;
1896  form.onkeydown = key_event;
1897  form.onkeypress = key_event;
1898 JS;
1899  $this->tpl->addOnLoadCode($onload_js);
1900  $this->tpl->addBlockFile(
1901  $this->getContentBlockName(),
1902  'adm_content',
1903  'tpl.il_as_tst_output.html',
1904  'Modules/Test'
1905  );
1906  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
form( $class_path, string $cmd)
+ 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 2574 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by getQuestionGuiInstance(), and getQuestionInstance().

2575  {
2576  $questionOBJ->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2577  $this->object->isPreviousSolutionReuseEnabled($this->testSession->getActiveId())
2578  );
2579  }
+ 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 2777 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by populateNextLocksChangedModal().

2778  {
2779  if (ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM) == null) {
2780  return false;
2781  }
2782 
2783  return ilSession::get(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2784  }
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 2869 of file class.ilTestPlayerAbstractGUI.php.

References getRegisteredForcedFeedbackNavUrl().

Referenced by ilTestOutputGUI\showQuestionCmd().

2869  : bool
2870  {
2871  return !empty($this->getRegisteredForcedFeedbackNavUrl());
2872  }
+ 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 ( )

Checks wheather the maximum processing time is reached or not.

Checks wheather the maximum processing time is reached or not

Returns
bool TRUE if the maximum processing time is reached, FALSE otherwise

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

References $DIC, and $ilUser.

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

220  : bool
221  {
222  global $DIC;
223  $ilUser = $DIC['ilUser'];
224  $active_id = $this->testSession->getActiveId();
225  $starting_time = $this->object->getStartingTimeOfUser($active_id);
226  if ($starting_time === false) {
227  return false;
228  } else {
229  return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
230  }
231  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

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

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

1396  : bool
1397  {
1398  return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->testSession->getPass());
1399  }
+ 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 1947 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\object().

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

1947  : bool
1948  {
1949  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->testSequence->isQuestionChecked($questionId)) {
1950  return true;
1951  }
1952 
1953  if ($this->object->isFollowupQuestionAnswerFixationEnabled() && $this->testSequence->isNextQuestionPresented($questionId)) {
1954  return true;
1955  }
1956 
1957  return false;
1958  }
+ 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 1385 of file class.ilTestPlayerAbstractGUI.php.

References isMaxProcessingTimeReached(), and isNrOfTriesReached().

1385  : bool
1386  {
1387  return !$this->isNrOfTriesReached()
1388  and !$this->isMaxProcessingTimeReached()
1389  and $this->object->startingTimeReached()
1390  and !$this->object->endingTimeReached();
1391  }
endingTimeReached()
handle endingTimeReached
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
+ Here is the call graph for this function:

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and markQuestionCmd().

683  {
684  // fau: testNav - handle intermediate submit when marking the question
685  $this->handleIntermediateSubmit();
686  // fau.
687  $this->markQuestionCmd();
688  }
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 693 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by markQuestionAndSaveIntermediateCmd().

694  {
695  $questionId = $this->testSequence->getQuestionForSequence(
697  );
698 
699  $this->object->setQuestionSetSolved(1, $questionId, $this->testSession->getUserId());
700 
701  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
702  }
+ 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 1423 of file class.ilTestPlayerAbstractGUI.php.

References suspendTestCmd().

Referenced by prepareTestPage().

1424  {
1425  $this->suspendTestCmd();
1426  }
+ 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.

public

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

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

1696  {
1697  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1698 
1699  $this->tpl->setCurrentBlock("ContentStyle");
1700  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1701  $this->tpl->parseCurrentBlock();
1702 
1703  $this->tpl->setCurrentBlock("SyntaxStyle");
1704  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1705  $this->tpl->parseCurrentBlock();
1706 
1707  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1708  if ($this->object->getShowSolutionAnswersOnly()) {
1709  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1710  }
1711 
1712  $this->tpl->setCurrentBlock("adm_content");
1713  $solution = $this->getCorrectSolutionOutput($this->testrequest->raw("evaluation"), $this->testrequest->raw("active_id"), $this->testrequest->raw("pass"));
1714  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1715  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1716  $this->ctrl->saveParameter($this, "pass");
1717  $this->ctrl->saveParameter($this, "active_id");
1718  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1719  $this->tpl->parseCurrentBlock();
1720  }
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 $objectivesList=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 1668 of file class.ilTestPlayerAbstractGUI.php.

References outQuestionSummaryCmd().

1669  {
1670  $this->outQuestionSummaryCmd(true, true, true, true);
1671  }
outQuestionSummaryCmd($fullpage=true, $contextFinishTest=false, $obligationsInfo=false, $obligationsFilter=false)
Output of a summary of all test questions for test participants.
+ Here is the call graph for this function:

◆ outProcessingTime()

ilTestPlayerAbstractGUI::outProcessingTime (   $active_id)

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

References $DIC, $ilUser, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_FKT_GETDATE, IL_CAL_TIMESTAMP, IL_CAL_UNIX, iljQueryUtil\initjQuery(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by outQuestionSummaryCmd(), and prepareTestPage().

1452  {
1453  global $DIC;
1454  $ilUser = $DIC['ilUser'];
1455 
1456  $starting_time = $this->object->getStartingTimeOfUser($active_id);
1457  $processing_time = $this->object->getProcessingTimeInSeconds($active_id);
1458  $processing_time_minutes = floor($processing_time / 60);
1459  $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1460  $str_processing_time = "";
1461  if ($processing_time_minutes > 0) {
1462  $str_processing_time = $processing_time_minutes . " " . ($processing_time_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1463  }
1464  if ($processing_time_seconds > 0) {
1465  if (strlen($str_processing_time) > 0) {
1466  $str_processing_time .= " " . $this->lng->txt("and") . " ";
1467  }
1468  $str_processing_time .= $processing_time_seconds . " " . ($processing_time_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1469  }
1470  $time_left = $starting_time + $processing_time - time();
1471  $time_left_minutes = floor($time_left / 60);
1472  $time_left_seconds = $time_left - $time_left_minutes * 60;
1473  $str_time_left = "";
1474  if ($time_left_minutes > 0) {
1475  $str_time_left = $time_left_minutes . " " . ($time_left_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1476  }
1477  if ($time_left < 300) {
1478  if ($time_left_seconds > 0) {
1479  if (strlen($str_time_left) > 0) {
1480  $str_time_left .= " " . $this->lng->txt("and") . " ";
1481  }
1482  $str_time_left .= $time_left_seconds . " " . ($time_left_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1483  }
1484  }
1485  $date = getdate($starting_time);
1486  $formattedStartingTime = ilDatePresentation::formatDate(new ilDateTime($date, IL_CAL_FKT_GETDATE));
1487  $datenow = getdate();
1488  $this->tpl->setCurrentBlock("enableprocessingtime");
1489  $this->tpl->setVariable(
1490  "USER_WORKING_TIME",
1491  sprintf(
1492  $this->lng->txt("tst_time_already_spent"),
1493  $formattedStartingTime,
1494  $str_processing_time
1495  )
1496  );
1497  $this->tpl->setVariable("USER_REMAINING_TIME", sprintf($this->lng->txt("tst_time_already_spent_left"), $str_time_left));
1498  $this->tpl->parseCurrentBlock();
1499 
1500  // jQuery is required by tpl.workingtime.js
1502  $template = new ilTemplate("tpl.workingtime.js", true, true, 'Modules/Test');
1503  $template->setVariable("STRING_MINUTE", $this->lng->txt("minute"));
1504  $template->setVariable("STRING_MINUTES", $this->lng->txt("minutes"));
1505  $template->setVariable("STRING_SECOND", $this->lng->txt("second"));
1506  $template->setVariable("STRING_SECONDS", $this->lng->txt("seconds"));
1507  $template->setVariable("STRING_TIMELEFT", $this->lng->txt("tst_time_already_spent_left"));
1508  $template->setVariable("AND", strtolower($this->lng->txt("and")));
1509  $template->setVariable("YEAR", $date["year"]);
1510  $template->setVariable("MONTH", $date["mon"] - 1);
1511  $template->setVariable("DAY", $date["mday"]);
1512  $template->setVariable("HOUR", $date["hours"]);
1513  $template->setVariable("MINUTE", $date["minutes"]);
1514  $template->setVariable("SECOND", $date["seconds"]);
1515  if ($this->object->isEndingTimeEnabled()) {
1516  $date_time = new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX);
1517  preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $date_time->get(IL_CAL_TIMESTAMP), $matches);
1518  if (!empty($matches)) {
1519  $template->setVariable("ENDYEAR", $matches[1]);
1520  $template->setVariable("ENDMONTH", $matches[2] - 1);
1521  $template->setVariable("ENDDAY", $matches[3]);
1522  $template->setVariable("ENDHOUR", $matches[4]);
1523  $template->setVariable("ENDMINUTE", $matches[5]);
1524  $template->setVariable("ENDSECOND", $matches[6]);
1525  }
1526  }
1527  $template->setVariable("YEARNOW", $datenow["year"]);
1528  $template->setVariable("MONTHNOW", $datenow["mon"] - 1);
1529  $template->setVariable("DAYNOW", $datenow["mday"]);
1530  $template->setVariable("HOURNOW", $datenow["hours"]);
1531  $template->setVariable("MINUTENOW", $datenow["minutes"]);
1532  $template->setVariable("SECONDNOW", $datenow["seconds"]);
1533  $template->setVariable("PTIME_M", $processing_time_minutes);
1534  $template->setVariable("PTIME_S", $processing_time_seconds);
1535  if ($this->ctrl->getCmd() == 'outQuestionSummary') {
1536  $template->setVariable("REDIRECT_URL", $this->ctrl->getFormAction($this, 'redirectAfterDashboardCmd'));
1537  } else {
1538  $template->setVariable("REDIRECT_URL", "");
1539  }
1540  $template->setVariable("CHECK_URL", $this->ctrl->getLinkTarget($this, 'checkWorkingTime', '', true));
1541  $this->tpl->addOnLoadCode($template->get());
1542  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
const IL_CAL_FKT_GETDATE
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$ilUser
Definition: imgupload.php:34
const IL_CAL_TIMESTAMP
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionSummaryCmd()

ilTestPlayerAbstractGUI::outQuestionSummaryCmd (   $fullpage = true,
  $contextFinishTest = false,
  $obligationsInfo = false,
  $obligationsFilter = false 
)

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

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

References $DIC, ilObjTest\allObligationsAnswered(), ILIAS\Repository\ctrl(), getContentBlockName(), getKioskHead(), ilTestServiceGUI\getObject(), isQuestionSummaryFinishTestButtonRequired(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), outProcessingTime(), and ilTestPlayerLayoutProvider\TEST_PLAYER_TITLE.

Referenced by outObligationsOnlySummaryCmd(), and outQuestionSummaryWithObligationsInfoCmd().

1588  {
1589  global $DIC;
1590  $help = $DIC->help();
1591 
1592  $help->setScreenIdComponent("tst");
1593  $help->setScreenId("assessment");
1594  $help->setSubScreenId("question_summary");
1595 
1596  $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
1598  $this->getObject()->getTitle() . ' - ' . $this->lng->txt('question_summary')
1599  );
1600 
1601  if ($fullpage) {
1602  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_question_summary.html", "Modules/Test");
1603  }
1604 
1605  $obligationsFulfilled = \ilObjTest::allObligationsAnswered(
1606  $this->object->getId(),
1607  $this->testSession->getActiveId(),
1608  $this->testSession->getPass()
1609  );
1610 
1611  if ($obligationsInfo && $this->object->areObligationsEnabled() && !$obligationsFulfilled) {
1612  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('not_all_obligations_answered'));
1613  }
1614 
1615  if ($this->object->getKioskMode() && $fullpage) {
1616  $head = $this->getKioskHead();
1617  if (strlen($head)) {
1618  $this->tpl->setCurrentBlock("kiosk_options");
1619  $this->tpl->setVariable("KIOSK_HEAD", $head);
1620  $this->tpl->parseCurrentBlock();
1621  }
1622  }
1623 
1624 
1625  $active_id = $this->testSession->getActiveId();
1626  $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, $obligationsFilter);
1627 
1628  $this->ctrl->setParameter($this, "sequence", $this->testrequest->raw("sequence"));
1629 
1630  if ($fullpage) {
1631  $table_gui = new ilListOfQuestionsTableGUI($this, 'showQuestion');
1632 
1633  $table_gui->setShowPointsEnabled(!$this->object->getTitleOutput());
1634  $table_gui->setShowMarkerEnabled($this->object->getShowMarker());
1635  $table_gui->setObligationsNotAnswered(!$obligationsFulfilled);
1636  $table_gui->setShowObligationsEnabled($this->object->areObligationsEnabled());
1637  $table_gui->setObligationsFilterEnabled($obligationsFilter);
1638  $table_gui->setFinishTestButtonEnabled($this->isQuestionSummaryFinishTestButtonRequired());
1639 
1640  $table_gui->init();
1641 
1642  $table_gui->setData($questionSummaryData);
1643 
1644  $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1645 
1646  if ($this->object->getEnableProcessingTime()) {
1647  $this->outProcessingTime($active_id);
1648  }
1649 
1650  if ($this->object->isShowExamIdInTestPassEnabled()) {
1651  $this->tpl->setCurrentBlock('exam_id_footer');
1652  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1653  $this->testSession->getActiveId(),
1654  $this->testSession->getPass(),
1655  $this->object->getId()
1656  ));
1657  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1658  $this->tpl->parseCurrentBlock();
1659  }
1660  }
1661  }
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
global $DIC
Definition: feed.php:28
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 1663 of file class.ilTestPlayerAbstractGUI.php.

References outQuestionSummaryCmd().

1664  {
1665  $this->outQuestionSummaryCmd(true, true, true, false);
1666  }
outQuestionSummaryCmd($fullpage=true, $contextFinishTest=false, $obligationsInfo=false, $obligationsFilter=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 1817 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\ctrl().

1818  {
1819  $this->ctrl->redirectByClass(
1820  array('ilRepositoryGUI', 'ilObjTestGUI', 'ilTestEvaluationGUI'),
1821  "outUserResultsOverview"
1822  );
1823  }
+ Here is the call graph for this function:

◆ performTestPassFinishedTasks()

ilTestPlayerAbstractGUI::performTestPassFinishedTasks (   $finishedPass)
protected

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

References ilTestPassFinishTasks\performFinishTasks().

Referenced by finishTestCmd(), redirectAfterAutosaveCmd(), and redirectAfterDashboardCmd().

838  {
839  $finishTasks = new ilTestPassFinishTasks($this->testSession->getActiveId(), $this->object->getId());
840  $finishTasks->performFinishTasks($this->processLocker);
841  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
performFinishTasks(ilTestProcessLocker $processLocker)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateCharSelectorIfRequired()

ilTestPlayerAbstractGUI::populateCharSelectorIfRequired ( )
protected
Returns
bool $charSelectorAvailable

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

References $DIC, $ilSetting, ilCharSelectorGUI\_getCurrentGUI(), and ilCharSelectorConfig\ENABLED.

Referenced by showQuestionEditable().

2054  : bool
2055  {
2056  global $DIC;
2057  $ilSetting = $DIC['ilSetting'];
2058 
2059  if ($ilSetting->get('char_selector_availability') > 0) {
2060  $char_selector = ilCharSelectorGUI::_getCurrentGUI($this->object);
2061  if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
2062  $char_selector->addToPage();
2063  $this->tpl->setCurrentBlock('char_selector');
2064  $this->tpl->setVariable("CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
2065  $this->tpl->parseCurrentBlock();
2066 
2067  return true;
2068  }
2069  }
2070 
2071  return false;
2072  }
global $DIC
Definition: feed.php:28
static _getCurrentGUI(ilObjTest $a_test_obj=null)
Get the GUI that is used for the currently available selector (other GUI instances may exist for conf...
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

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

References ilObjStyleSheet\getContentStylePath().

Referenced by prepareTestPage().

431  {
432  $this->tpl->setCurrentBlock("ContentStyle");
433  $this->tpl->setVariable(
434  "LOCATION_CONTENT_STYLESHEET",
436  );
437  $this->tpl->parseCurrentBlock();
438  }
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 2631 of file class.ilTestPlayerAbstractGUI.php.

References ilTestServiceGUI\$tpl, ilTestPlayerCommands\DISCARD_SOLUTION, ilSubmitButton\getInstance(), ilLinkButton\getInstance(), ilModalGUI\getInstance(), and ILIAS\Repository\lng().

Referenced by populateModals().

2632  {
2633  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2634 
2635  $tpl->setVariable('CONFIRMATION_TEXT', $this->lng->txt('discard_answer_confirmation'));
2636 
2637  $button = ilSubmitButton::getInstance();
2638  $button->setCommand(ilTestPlayerCommands::DISCARD_SOLUTION);
2639  $button->setCaption('discard_answer');
2640  $tpl->setCurrentBlock('buttons');
2641  $tpl->setVariable('BUTTON', $button->render());
2642  $tpl->parseCurrentBlock();
2643 
2644  $button = ilLinkButton::getInstance();
2645  $button->setId('tst_cancel_discard_button');
2646  $button->setCaption('cancel');
2647  $button->setPrimary(true);
2648  $tpl->setCurrentBlock('buttons');
2649  $tpl->setVariable('BUTTON', $button->render());
2650  $tpl->parseCurrentBlock();
2651 
2652  $modal = ilModalGUI::getInstance();
2653  $modal->setId('tst_discard_solution_modal');
2654  $modal->setHeading($this->lng->txt('discard_answer'));
2655  $modal->setBody($tpl->get());
2656 
2657  $this->tpl->setCurrentBlock('discard_solution_modal');
2658  $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $modal->getHTML());
2659  $this->tpl->parseCurrentBlock();
2660  }
static getInstance()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

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

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

2353  {
2354  if ($withFocusAnchor) {
2355  $this->tpl->setCurrentBlock('inst_resp_id');
2356  $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
2357  $this->tpl->parseCurrentBlock();
2358  }
2359 
2360  $this->tpl->setCurrentBlock('instant_response_header');
2361  $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
2362  $this->tpl->parseCurrentBlock();
2363  }
+ 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 2365 of file class.ilTestPlayerAbstractGUI.php.

Referenced by populateInstantResponseBlocks().

2366  {
2367  $this->tpl->setCurrentBlock('instant_response_message');
2368  $this->tpl->setVariable('INSTANT_RESPONSE_MESSAGE', $a_message);
2369  $this->tpl->parseCurrentBlock();
2370  }
+ 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 377 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by populateInstantResponseBlocks().

377  : bool
378  {
379  // fix #031263: add pass
380  $feedback = $question_gui->getGenericFeedbackOutput($this->testSession->getActiveId(), $this->testSession->getPass());
381 
382  if (strlen($feedback)) {
383  $cssClass = (
384  $solutionCorrect ?
386  );
387 
388  $this->tpl->setCurrentBlock("answer_feedback");
389  $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
390  $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
391  $this->tpl->parseCurrentBlock();
392  return true;
393  }
394  return false;
395  }
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 2039 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by confirmFinishCmd(), and showAnswerOptionalQuestionsConfirmation().

2040  {
2041  if ($this->object->getKioskMode()) {
2042  //$this->tpl->setBodyClass("kiosk");
2043  $this->tpl->hideFooter();
2044  $this->tpl->addBlockfile('CONTENT', 'adm_content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
2045  $this->tpl->setContent($this->ctrl->getHTML($helperGui));
2046  } else {
2047  $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
2048  }
2049  }
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 2275 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().

2276  {
2277  $response_available = false;
2278  $jump_to_response = false;
2279 
2280  // This controls if the solution should be shown.
2281  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2282  if ($this->object->getInstantFeedbackSolution()) {
2283  $show_question_inline_score = $this->determineInlineScoreDisplay();
2284 
2285  // Notation of the params prior to getting rid of this crap in favor of a class
2286  $solutionoutput = $questionGui->getSolutionOutput(
2287  $this->testSession->getActiveId(), #active_id
2288  null, #pass
2289  false, #graphical_output
2290  $show_question_inline_score, #result_output
2291  true, #show_question_only
2292  false, #show_feedback
2293  true, #show_correct_solution
2294  false, #show_manual_scoring
2295  false #show_question_text
2296  );
2297  $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
2298  $this->populateSolutionBlock($solutionoutput);
2299  $response_available = true;
2300  $jump_to_response = true;
2301  }
2302 
2303  $reachedPoints = $questionGui->object->getAdjustedReachedPoints(
2304  $this->testSession->getActiveId(),
2305  ilObjTest::_getPass($this->testSession->getActiveId()),
2306  $authorizedSolution
2307  );
2308 
2309  $maxPoints = $questionGui->object->getMaximumPoints();
2310 
2311  $solutionCorrect = ($reachedPoints == $maxPoints);
2312 
2313  // This controls if the score should be shown.
2314  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
2315  if ($this->object->getAnswerFeedbackPoints()) {
2316  $this->populateScoreBlock($reachedPoints, $maxPoints);
2317  $response_available = true;
2318  $jump_to_response = true;
2319  }
2320 
2321  // This controls if the generic feedback should be shown.
2322  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2323  if ($this->object->getGenericAnswerFeedback()) {
2324  if ($this->populateGenericFeedbackBlock($questionGui, $solutionCorrect)) {
2325  $response_available = true;
2326  $jump_to_response = true;
2327  }
2328  }
2329 
2330  // This controls if the specific feedback should be shown.
2331  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
2332  if ($this->object->getSpecificAnswerFeedback()) {
2333  if ($questionGui->hasInlineFeedback()) {
2334  // Don't jump to the feedback below the question if some feedback is shown within the question
2335  $jump_to_response = false;
2336  } elseif ($this->populateSpecificFeedbackBlock($questionGui)) {
2337  $response_available = true;
2338  $jump_to_response = true;
2339  }
2340  }
2341 
2342  $this->populateFeedbackBlockHeader($jump_to_response);
2343  if (!$response_available) {
2344  if ($questionGui->hasInlineFeedback()) {
2345  $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_is_given_inline'));
2346  } else {
2347  $this->populateFeedbackBlockMessage($this->lng->txt('tst_feedback_not_available_for_answer'));
2348  }
2349  }
2350  }
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 2218 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2219  {
2220  $questionGui->setNavigationGUI(null);
2221  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
2222 
2223  $answerFeedbackEnabled = $this->object->getSpecificAnswerFeedback();
2224 
2225  $solutionoutput = $questionGui->getSolutionOutput(
2226  $this->testSession->getActiveId(), #active_id
2227  $this->testSession->getPass(), #pass
2228  false, #graphical_output
2229  false, #result_output
2230  true, #show_question_only
2231  $answerFeedbackEnabled, #show_feedback
2232  false, #show_correct_solution
2233  false, #show_manual_scoring
2234  true #show_question_text
2235  );
2236 
2237  $pageoutput = $questionGui->outQuestionPage(
2238  "",
2239  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
2240  $this->testSession->getActiveId(),
2241  $solutionoutput
2242  );
2243 
2244  $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'Modules/Test');
2245 
2246  // populate the instant response blocks in the
2247  $saved_tpl = $this->tpl;
2248  $this->tpl = $tpl;
2249  $this->populateInstantResponseBlocks($questionGui, true);
2250  $this->tpl = $saved_tpl;
2251 
2252  $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
2253 
2254  $button = ilLinkButton::getInstance();
2255  $button->setId('tst_confirm_feedback');
2256  $button->setUrl($navUrl);
2257  $button->setCaption('proceed');
2258  $button->setPrimary(true);
2259  $tpl->setVariable('BUTTON', $button->render());
2260 
2261  $modal = ilModalGUI::getInstance();
2262  $modal->setType(ilModalGUI::TYPE_LARGE);
2263  $modal->setId('tst_question_feedback_modal');
2264  $modal->setHeading($this->lng->txt('tst_instant_feedback'));
2265  $modal->setBody($tpl->get());
2266 
2267  $this->tpl->addOnLoadCode("$('#tst_question_feedback_modal').modal('show');");
2268  $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $modal->getHTML());
2269  }
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:

◆ populateKioskHead()

ilTestPlayerAbstractGUI::populateKioskHead ( )
protected

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

References getKioskHead().

Referenced by prepareSummaryPage(), and prepareTestPage().

1909  {
1910  $head = $this->getKioskHead();
1911 
1912  if (strlen($head)) {
1913  $this->tpl->setCurrentBlock("kiosk_options");
1914  $this->tpl->setVariable("KIOSK_HEAD", $head);
1915  $this->tpl->parseCurrentBlock();
1916  }
1917  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateLowerNextButtonBlock()

ilTestPlayerAbstractGUI::populateLowerNextButtonBlock (   $disabled,
  $primaryNext 
)
protected

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

References buildNextButtonInstance().

Referenced by populateNextButtons().

274  {
275  $button = $this->buildNextButtonInstance($disabled, $primaryNext);
276  $button->setId('bottomnextbutton');
277 
278  $this->tpl->setCurrentBlock("next_bottom");
279  $this->tpl->setVariable("BTN_NEXT_BOTTOM", $button->render());
280  $this->tpl->parseCurrentBlock();
281  }
buildNextButtonInstance($disabled, $primaryNext)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateLowerPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateLowerPreviousButtonBlock (   $disabled)
protected

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

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

294  {
295  $button = $this->buildPreviousButtonInstance($disabled);
296  $button->setId('bottomprevbutton');
297 
298  $this->tpl->setCurrentBlock("prev_bottom");
299  $this->tpl->setVariable("BTN_PREV_BOTTOM", $button->render());
300  $this->tpl->parseCurrentBlock();
301  }
+ 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 2607 of file class.ilTestPlayerAbstractGUI.php.

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

2608  {
2609  if ($this->object->getKioskMode()) {
2610  $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
2611  $this->tpl->setContent($contentHTML);
2612  } else {
2613  $this->tpl->setVariable($this->getContentBlockName(), $contentHTML);
2614  }
2615  }
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 2617 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by showQuestionEditable().

2618  {
2620  // fau: testNav - populateNavWhenChangedModal instead of populateNavWhileEditModal
2621  $this->populateNavWhenChangedModal();
2622  // fau.
2623 
2624  if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2626 
2628  }
2629  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNavWhenChangedModal()

ilTestPlayerAbstractGUI::populateNavWhenChangedModal ( )
protected

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

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

Referenced by populateModals().

2663  {
2664  return; // usibility fix: get rid of popup
2665 
2666  if (ilSession::get('save_on_navigation_prevent_confirmation') == null) {
2667  return;
2668  }
2669 
2670  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2671 
2672  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->object->isForceInstantFeedbackEnabled()) {
2673  $text = $this->lng->txt('save_on_navigation_locked_confirmation');
2674  } else {
2675  $text = $this->lng->txt('save_on_navigation_confirmation');
2676  }
2677  if ($this->object->isForceInstantFeedbackEnabled()) {
2678  $text .= " " . $this->lng->txt('save_on_navigation_forced_feedback_hint');
2679  }
2680  $tpl->setVariable('CONFIRMATION_TEXT', $text);
2681 
2682 
2683  $button = ilLinkButton::getInstance();
2684  $button->setId('tst_save_on_navigation_button');
2685  $button->setUrl('#');
2686  $button->setCaption('tst_save_and_proceed');
2687  $button->setPrimary(true);
2688  $tpl->setCurrentBlock('buttons');
2689  $tpl->setVariable('BUTTON', $button->render());
2690  $tpl->parseCurrentBlock();
2691 
2692  $button = ilLinkButton::getInstance();
2693  $button->setId('tst_cancel_on_navigation_button');
2694  $button->setUrl('#');
2695  $button->setCaption('cancel');
2696  $button->setPrimary(false);
2697  $tpl->setCurrentBlock('buttons');
2698  $tpl->setVariable('BUTTON', $button->render());
2699  $tpl->parseCurrentBlock();
2700 
2701  $tpl->setCurrentBlock('checkbox');
2702  $tpl->setVariable('CONFIRMATION_CHECKBOX_NAME', 'save_on_navigation_prevent_confirmation');
2703  $tpl->setVariable('CONFIRMATION_CHECKBOX_LABEL', $this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2704  $tpl->parseCurrentBlock();
2705 
2706  $modal = ilModalGUI::getInstance();
2707  $modal->setId('tst_save_on_navigation_modal');
2708  $modal->setHeading($this->lng->txt('save_on_navigation'));
2709  $modal->setBody($tpl->get());
2710 
2711  $this->tpl->setCurrentBlock('nav_while_edit_modal');
2712  $this->tpl->setVariable('NAV_WHILE_EDIT_MODAL', $modal->getHTML());
2713  $this->tpl->parseCurrentBlock();
2714  }
static get(string $a_var)
static getInstance()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextButtons()

ilTestPlayerAbstractGUI::populateNextButtons (   $disabled,
  $primaryNext 
)
protected

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

References populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

Referenced by populateQuestionNavigation().

268  {
269  $this->populateUpperNextButtonBlock($disabled, $primaryNext);
270  $this->populateLowerNextButtonBlock($disabled, $primaryNext);
271  }
populateLowerNextButtonBlock($disabled, $primaryNext)
populateUpperNextButtonBlock($disabled, $primaryNext)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextLocksChangedModal()

ilTestPlayerAbstractGUI::populateNextLocksChangedModal ( )
protected

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

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

Referenced by populateModals().

2741  {
2743  return;
2744  }
2745 
2746  $modal = new ilTestPlayerConfirmationModal();
2747  $modal->setModalId('tst_next_locks_changed_modal');
2748 
2749  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_current_answer_header'));
2750  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_current_answer_confirm'));
2751 
2752  $modal->setConfirmationCheckboxName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2753  $modal->setConfirmationCheckboxLabel($this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2754 
2755  $button = $modal->buildModalButtonInstance('tst_nav_next_changed_answer_button');
2756  $button->setCaption('tst_save_and_proceed');
2757  $button->setPrimary(true);
2758  $modal->addButton($button);
2759 
2760  $button = $modal->buildModalButtonInstance('tst_cancel_next_changed_answer_button');
2761  $button->setCaption('cancel');
2762  $button->setPrimary(false);
2763  $modal->addButton($button);
2764 
2765  $this->tpl->setCurrentBlock('next_locks_changed_modal');
2766  $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $modal->getHTML());
2767  $this->tpl->parseCurrentBlock();
2768  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

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

References ILIAS\Repository\lng().

Referenced by populateModals().

2718  {
2719  $modal = new ilTestPlayerConfirmationModal();
2720  $modal->setModalId('tst_next_locks_unchanged_modal');
2721 
2722  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_empty_answer_header'));
2723  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_empty_answer_confirm'));
2724 
2725  $button = $modal->buildModalButtonInstance('tst_nav_next_empty_answer_button');
2726  $button->setCaption('tst_proceed');
2727  $button->setPrimary(false);
2728  $modal->addButton($button);
2729 
2730  $button = $modal->buildModalButtonInstance('tst_cancel_next_empty_answer_button');
2731  $button->setCaption('cancel');
2732  $button->setPrimary(true);
2733  $modal->addButton($button);
2734 
2735  $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2736  $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $modal->getHTML());
2737  $this->tpl->parseCurrentBlock();
2738  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populatePreviousButtons()

ilTestPlayerAbstractGUI::populatePreviousButtons (   $disabled)
protected

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

References populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

Referenced by populateQuestionNavigation().

262  {
263  $this->populateUpperPreviousButtonBlock($disabled);
264  $this->populateLowerPreviousButtonBlock($disabled);
265  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateQuestionNavigation()

ilTestPlayerAbstractGUI::populateQuestionNavigation (   $sequenceElement,
  $disabled,
  $primaryNext 
)
protected

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

251  {
252  if (!$this->isFirstQuestionInSequence($sequenceElement)) {
253  $this->populatePreviousButtons($disabled);
254  }
255 
256  if (!$this->isLastQuestionInSequence($sequenceElement)) {
257  $this->populateNextButtons($disabled, $primaryNext);
258  }
259  }
isFirstQuestionInSequence($sequenceElement)
isLastQuestionInSequence($sequenceElement)
populateNextButtons($disabled, $primaryNext)
+ 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 397 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

398  {
399  $scoreInformation = sprintf(
400  $this->lng->txt("you_received_a_of_b_points"),
401  $reachedPoints,
402  $maxPoints
403  );
404 
405  $this->tpl->setCurrentBlock("received_points_information");
406  $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
407  $this->tpl->parseCurrentBlock();
408  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

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

References ILIAS\Repository\lng().

Referenced by populateInstantResponseBlocks().

411  {
412  if (strlen($solutionoutput)) {
413  $this->tpl->setCurrentBlock("solution_output");
414  $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
415  $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
416  $this->tpl->parseCurrentBlock();
417  }
418  }
+ 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 354 of file class.ilTestPlayerAbstractGUI.php.

References assQuestionGUI\getSpecificFeedbackOutput().

Referenced by populateInstantResponseBlocks().

354  : bool
355  {
356  $solutionValues = $question_gui->object->getSolutionValues(
357  $this->testSession->getActiveId(),
358  null
359  );
360 
361  $feedback = $question_gui->getSpecificFeedbackOutput(
362  $question_gui->object->fetchIndexedValuesFromValuePairs($solutionValues)
363  );
364 
365  if (!empty($feedback)) {
366  $this->tpl->setCurrentBlock("specific_feedback");
367  $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
368  $this->tpl->parseCurrentBlock();
369  return true;
370  }
371  return false;
372  }
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 420 of file class.ilTestPlayerAbstractGUI.php.

References ilObjStyleSheet\getSyntaxStylePath().

Referenced by prepareTestPage().

421  {
422  $this->tpl->setCurrentBlock("SyntaxStyle");
423  $this->tpl->setVariable(
424  "LOCATION_SYNTAX_STYLESHEET",
426  );
427  $this->tpl->parseCurrentBlock();
428  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateTestNavigationToolbar()

ilTestPlayerAbstractGUI::populateTestNavigationToolbar ( ilTestNavigationToolbarGUI  $toolbarGUI)
protected

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

Referenced by ilTestOutputGUI\showQuestionCmd().

244  {
245  $this->tpl->setCurrentBlock('test_nav_toolbar');
246  $this->tpl->setVariable('TEST_NAV_TOOLBAR', $toolbarGUI->getHTML());
247  $this->tpl->parseCurrentBlock();
248  }
+ Here is the caller graph for this function:

◆ populateUpperNextButtonBlock()

ilTestPlayerAbstractGUI::populateUpperNextButtonBlock (   $disabled,
  $primaryNext 
)
protected

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

References buildNextButtonInstance().

Referenced by populateNextButtons().

284  {
285  $button = $this->buildNextButtonInstance($disabled, $primaryNext);
286  $button->setId('nextbutton');
287 
288  $this->tpl->setCurrentBlock("next");
289  $this->tpl->setVariable("BTN_NEXT", $button->render());
290  $this->tpl->parseCurrentBlock();
291  }
buildNextButtonInstance($disabled, $primaryNext)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateUpperPreviousButtonBlock()

ilTestPlayerAbstractGUI::populateUpperPreviousButtonBlock (   $disabled)
protected

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

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

304  {
305  $button = $this->buildPreviousButtonInstance($disabled);
306  $button->setId('prevbutton');
307 
308  $this->tpl->setCurrentBlock("prev");
309  $this->tpl->setVariable("BTN_PREV", $button->render());
310  $this->tpl->parseCurrentBlock();
311  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

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

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

1867  {
1868  $this->tpl->addBlockFile(
1869  $this->getContentBlockName(),
1870  'adm_content',
1871  'tpl.il_as_tst_question_summary.html',
1872  'Modules/Test'
1873  );
1874 
1875  if ($this->object->getKioskMode()) {
1876  $this->populateKioskHead();
1877  }
1878  }
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 (   $presentationMode,
  $sequenceElement,
  $questionId 
)
protected

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

1108  {
1109  global $DIC;
1110  $ilUser = $DIC['ilUser'];
1111  $ilNavigationHistory = $DIC['ilNavigationHistory'];
1112 
1113  $ilNavigationHistory->addItem(
1114  $this->testSession->getRefId(),
1115  $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::RESUME_PLAYER),
1116  'tst'
1117  );
1118 
1119  $this->initTestPageTemplate();
1120  $this->populateContentStyleBlock();
1121  $this->populateSyntaxStyleBlock();
1122 
1123  if ($this->isMaxProcessingTimeReached()) {
1124  $this->maxProcessingTimeReached();
1125  return;
1126  }
1127 
1128  if ($this->object->endingTimeReached()) {
1129  $this->endingTimeReached();
1130  return;
1131  }
1132 
1133  if ($this->isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)) {
1134  $this->ctrl->setParameter($this, "sequence", $sequenceElement);
1136  return;
1137  }
1138 
1139  if ($this->object->getKioskMode()) {
1140  $this->populateKioskHead();
1141  }
1142 
1143  $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId());
1144  $this->tpl->setVariable("LOGIN", $ilUser->getLogin());
1145  $this->tpl->setVariable("SEQ_ID", $sequenceElement);
1146  $this->tpl->setVariable("QUEST_ID", $questionId);
1147 
1148  if ($this->object->getEnableProcessingTime()) {
1149  $this->outProcessingTime($this->testSession->getActiveId());
1150  }
1151 
1152  $this->tpl->setVariable("PAGETITLE", "- " . $this->object->getTitle());
1153 
1154  if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
1155  $this->tpl->setCurrentBlock('exam_id_footer');
1156  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1157  $this->testSession->getActiveId(),
1158  $this->testSession->getPass(),
1159  $this->object->getId()
1160  ));
1161  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1162  $this->tpl->parseCurrentBlock();
1163  }
1164 
1165  if ($this->object->getListOfQuestions()) {
1166  $this->showSideList($presentationMode, $sequenceElement);
1167  }
1168  }
maxProcessingTimeReached()
Outputs a message when the maximum processing time is reached.
global $DIC
Definition: feed.php:28
showSideList($presentationMode, $currentSequenceElement)
endingTimeReached()
handle endingTimeReached
isOptionalQuestionAnsweringConfirmationRequired($sequenceElement)
$ilUser
Definition: imgupload.php:34
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
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 567 of file class.ilTestPlayerAbstractGUI.php.

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

568  {
569  $active_id = $this->testSession->getActiveId();
570  $actualpass = ilObjTest::_getPass($active_id);
571 
572  $this->performTestPassFinishedTasks($actualpass);
573 
574  $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
575 
576  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
577  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
578  $this->tpl->setVariable("URL", $url);
579  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
$url
+ Here is the call graph for this function:

◆ redirectAfterDashboardCmd()

ilTestPlayerAbstractGUI::redirectAfterDashboardCmd ( )

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

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

582  {
583  $active_id = $this->testSession->getActiveId();
584  $actualpass = ilObjTest::_getPass($active_id);
585 
586  $this->performTestPassFinishedTasks($actualpass);
587 
588  $this->testSession->setLastFinishedPass($this->testSession->getPass());
589  $this->testSession->increaseTestPass();
590 
591  $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
592 
593  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
594  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
595  $this->tpl->setVariable("URL", $url);
596  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
$url
+ Here is the call graph for this function:

◆ redirectBackCmd()

ilTestPlayerAbstractGUI::redirectBackCmd ( )

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

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

Referenced by afterTestPassFinishedCmd(), and endingTimeReached().

1026  {
1027  $testPassesSelector = new ilTestPassesSelector($this->db, $this->object);
1028  $testPassesSelector->setActiveId($this->testSession->getActiveId());
1029  $testPassesSelector->setLastFinishedPass($this->testSession->getLastFinishedPass());
1030 
1031  if (count($testPassesSelector->getReportablePasses())) {
1032  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1033  $this->ctrl->redirectByClass(array('ilTestResultsGUI', 'ilTestEvalObjectiveOrientedGUI'));
1034  }
1035 
1036  $this->ctrl->redirectByClass(array('ilTestResultsGUI', 'ilMyTestResultsGUI', 'ilTestEvaluationGUI'));
1037  }
1038 
1039  $this->backToInfoScreenCmd();
1040  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl (   $forcedFeedbackNavUrl)
protected

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

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

Referenced by ilTestOutputGUI\showInstantResponseCmd().

2847  {
2848  if (ilSession::get('forced_feedback_navigation_url') == null) {
2849  ilSession::set('forced_feedback_navigation_url', array());
2850  }
2851  $forced_feeback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2852  $forced_feeback_navigation_url[$this->testSession->getActiveId()] = $forcedFeedbackNavUrl;
2853  ilSession::set('forced_feedback_navigation_url', $forced_feeback_navigation_url);
2854  }
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 ( )

remove an auto-saved solution of the current question

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

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

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

191  {
192  $questionId = $this->getCurrentQuestionId();
193 
194  $this->getQuestionInstance($questionId)->removeIntermediateSolution(
195  $this->testSession->getActiveId(),
196  $this->testSession->getPass()
197  );
198  }
getQuestionInstance($questionId, $fromCache=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 1340 of file class.ilTestPlayerAbstractGUI.php.

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

1341  {
1342  $this->removeIntermediateSolution();
1343  $this->setAnswerChangedParameter(false);
1344  $this->ctrl->saveParameter($this, 'sequence');
1345  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1346  }
removeIntermediateSolution()
remove an auto-saved solution of the current question
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 2486 of file class.ilTestPlayerAbstractGUI.php.

References ilSession\set().

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

2487  {
2488  if (!empty($_POST['save_on_navigation_prevent_confirmation'])) {
2489  ilSession::set('save_on_navigation_prevent_confirmation', true);
2490  }
2491 
2492  if (!empty($_POST[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM])) {
2493  ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2494  }
2495  }
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 160 of file class.ilTestPlayerAbstractGUI.php.

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

161  {
162  $tagging_gui = new ilTaggingGUI();
163  $tagging_gui->setObject($this->object->getId(), $this->object->getType());
164  $tagging_gui->saveInput();
165  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
166  }
Class ilTaggingGUI.
+ Here is the call graph for this function:

◆ setAnonymousIdCmd()

ilTestPlayerAbstractGUI::setAnonymousIdCmd ( )

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

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

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

References ILIAS\Repository\ctrl().

446  {
447  if ($this->testSession->isAnonymousUser()) {
448  $this->testSession->setAccessCodeToSession($_POST['anonymous_id']);
449  }
450 
451  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
452  }
+ 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 2460 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\ctrl().

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

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

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

References ilSession\set().

2773  {
2774  ilSession::set(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM, true);
2775  }
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 2003 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by prepareTestPage().

2004  {
2005  $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
2006 
2007  $confirmation->setFormAction($this->ctrl->getFormAction($this));
2008  $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
2009  $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
2010 
2011  $confirmation->build($this->object->isFixedTest());
2012 
2013  $this->populateHelperGuiContent($confirmation);
2014  }
+ Here is the call graph for this function:
+ Here is the caller 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 1731 of file class.ilTestPlayerAbstractGUI.php.

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

1732  {
1733  global $DIC;
1734  $ilUser = $DIC['ilUser'];
1735 
1736  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "Modules/Test");
1737 
1738  $result_array = &$this->object->getTestResult(
1739  $active_id,
1740  $pass,
1741  false,
1742  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1743  );
1744 
1745  $counter = 1;
1746  // output of questions with solutions
1747  foreach ($result_array as $question_data) {
1748  $question = $question_data["qid"];
1749  if (is_numeric($question)) {
1750  $this->tpl->setCurrentBlock("printview_question");
1751  $question_gui = $this->object->createQuestionGUI("", $question);
1752  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "Modules/TestQuestionPool");
1753  $template->setVariable("COUNTER_QUESTION", $counter . ". ");
1754  $template->setVariable("QUESTION_TITLE", $question_gui->object->getTitleForHTMLOutput());
1755 
1756  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
1757  $result_output = $question_gui->getSolutionOutput($active_id, $pass, false, false, $show_question_only, $this->object->getShowSolutionFeedback());
1758  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1759  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1760  $this->tpl->parseCurrentBlock();
1761  $counter++;
1762  }
1763  }
1764 
1765  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1766  if ($this->object->getShowSolutionAnswersOnly()) {
1767  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1768  }
1769  if (strlen($top_data)) {
1770  $this->tpl->setCurrentBlock("top_data");
1771  $this->tpl->setVariable("TOP_DATA", $top_data);
1772  $this->tpl->parseCurrentBlock();
1773  }
1774 
1775  if (strlen($bottom_data)) {
1776  $this->tpl->setCurrentBlock("bottom_data");
1777  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1778  $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
1779  $this->tpl->parseCurrentBlock();
1780  }
1781 
1782  $this->tpl->setCurrentBlock("adm_content");
1783  $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
1784  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($this->testSession, $active_id, true);
1785  $signature = $this->getResultsSignature();
1786  $this->tpl->setVariable("USER_DETAILS", $user_data);
1787  $this->tpl->setVariable("SIGNATURE", $signature);
1788  $this->tpl->setVariable("TITLE", $this->object->getTitle());
1789  $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
1790  $invited_user = &$this->object->getInvitedUsers($ilUser->getId());
1791  $pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
1792  ": " . $invited_user[$ilUser->getId()]["clientip"] . " - " .
1793  $this->lng->txt("matriculation") . ": " .
1794  $invited_user[$ilUser->getId()]["matriculation"];
1795  $this->tpl->setVariable("PAGETITLE", $pagetitle);
1796  $this->tpl->parseCurrentBlock();
1797  }
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) ...
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ showMaximumAllowedUsersReachedMessage()

ilTestPlayerAbstractGUI::showMaximumAllowedUsersReachedMessage ( )

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

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

Referenced by initTestCmd().

1674  {
1675  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_max_allowed_users_reached.html", "Modules/Test");
1676  $this->tpl->setCurrentBlock("adm_content");
1677  $this->tpl->setVariable("MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt("tst_max_allowed_users_message"), $this->object->getAllowedUsersTimeGap()));
1678  $this->tpl->setVariable("MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt("tst_max_allowed_users_heading"), $this->object->getAllowedUsersTimeGap()));
1679  $this->tpl->setVariable("CMD_BACK_TO_INFOSCREEN", ilTestPlayerCommands::BACK_TO_INFO_SCREEN);
1680  $this->tpl->setVariable("TXT_BACK_TO_INFOSCREEN", $this->lng->txt("tst_results_back_introduction"));
1681  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1682  $this->tpl->parseCurrentBlock();
1683  }
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:

◆ showQuestionCmd()

ilTestPlayerAbstractGUI::showQuestionCmd ( )
abstractprotected

Referenced by determineSolutionPassIndex().

+ Here is the caller graph for this function:

◆ showQuestionEditable()

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

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

1227  {
1228  $questionNavigationGUI = $this->buildEditableStateQuestionNavigationGUI(
1229  $questionGui->object->getId(),
1231  );
1232  if ($isQuestionWorkedThrough) {
1233  $questionNavigationGUI->setDiscardSolutionButtonEnabled(true);
1234  // fau: testNav - set answere status in question header
1235  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
1236  // fau.
1237  } elseif ($this->object->isPostponingEnabled()) {
1238  $questionNavigationGUI->setSkipQuestionLinkTarget(
1239  $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION)
1240  );
1241  }
1242  $questionGui->setNavigationGUI($questionNavigationGUI);
1243 
1244  $isPostponed = $this->isShowingPostponeStatusReguired($questionGui->object->getId());
1245 
1246  $answerFeedbackEnabled = (
1247  $instantResponse && $this->object->getSpecificAnswerFeedback()
1248  );
1249 
1250  if ($this->testrequest->isset('save_error') && $this->testrequest->raw('save_error') == 1 && ilSession::get('previouspost') != null) {
1251  $userPostSolution = ilSession::get('previouspost');
1252  ilSession::clear('previouspost');
1253  } else {
1254  $userPostSolution = false;
1255  }
1256 
1257  // fau: testNav - add special checkbox for mc question
1258  // moved to another patch block
1259  // fau.
1260 
1261  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
1262  $qstConfig = $questionGui->object->getTestPresentationConfig();
1263 
1264  if ($questionGui instanceof assMultipleChoiceGUI) {
1265  $qstConfig->setWorkedThrough($isQuestionWorkedThrough);
1266  }
1267 
1268  if ($qstConfig->isPreviousPassSolutionReuseAllowed()) {
1269  $passIndex = $this->determineSolutionPassIndex($questionGui); // last pass having solution stored
1270  if ($passIndex < $this->testSession->getPass()) { // it's the previous pass if current pass is higher
1271  $qstConfig->setSolutionInitiallyPrefilled(true);
1272  }
1273  } else {
1274  $passIndex = $this->testSession->getPass();
1275  }
1276  // hey.
1277 
1278  // Answer specific feedback is rendered into the display of the test question with in the concrete question types outQuestionForTest-method.
1279  // Notation of the params prior to getting rid of this crap in favor of a class
1280  $questionGui->outQuestionForTest(
1281  $formAction, #form_action
1282  $this->testSession->getActiveId(), #active_id
1283  // hey: prevPassSolutions - prepared pass index having no, current or previous solution
1284  $passIndex, #pass
1285  // hey.
1286  $isPostponed, #is_postponed
1287  $userPostSolution, #user_post_solution
1288  $answerFeedbackEnabled #answer_feedback == inline_specific_feedback
1289  );
1290  // The display of specific inline feedback and specific feedback in an own block is to honor questions, which
1291  // have the possibility to embed the specific feedback into their output while maintaining compatibility to
1292  // questions, which do not have such facilities. E.g. there can be no "specific inline feedback" for essay
1293  // questions, while the multiple-choice questions do well.
1294 
1295 
1296  $this->populateModals();
1297 
1298  // fau: testNav - pouplate the new question edit control instead of the deprecated intermediate solution saver
1299  $this->populateQuestionEditControl($questionGui);
1300  // fau.
1301  }
static get(string $a_var)
determineSolutionPassIndex(assQuestionGUI $questionGui)
buildEditableStateQuestionNavigationGUI($questionId, $charSelectorAvailable)
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 1174 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, Vendor\Package\$f, buildReadOnlyStateQuestionNavigationGUI(), assQuestionGUI\getFormEncodingType(), assQuestionGUI\getQuestionHeaderBlockBuilder(), assQuestionGUI\getSolutionOutput(), isShowingPostponeStatusReguired(), ILIAS\Repository\lng(), assQuestionGUI\outQuestionPage(), and assQuestionGUI\setNavigationGUI().

Referenced by ilTestOutputGUI\showQuestionCmd().

1175  {
1176  $questionNavigationGUI = $this->buildReadOnlyStateQuestionNavigationGUI($questionGui->object->getId());
1177  $questionNavigationGUI->setQuestionWorkedThrough($isQuestionWorkedThrough);
1178  $questionGui->setNavigationGUI($questionNavigationGUI);
1179 
1180  // fau: testNav - set answere status in question header
1181  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered($isQuestionWorkedThrough);
1182  // fau.
1183 
1184  $answerFeedbackEnabled = (
1185  $instantResponse && $this->object->getSpecificAnswerFeedback()
1186  );
1187 
1188  $solutionoutput = $questionGui->getSolutionOutput(
1189  $this->testSession->getActiveId(), #active_id
1190  $this->testSession->getPass(), #pass
1191  false, #graphical_output
1192  false, #result_output
1193  true, #show_question_only
1194  $answerFeedbackEnabled, #show_feedback
1195  false, #show_correct_solution
1196  false, #show_manual_scoring
1197  true #show_question_text
1198  );
1199 
1200  $pageoutput = $questionGui->outQuestionPage(
1201  "",
1202  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
1203  $this->testSession->getActiveId(),
1204  $solutionoutput
1205  );
1206 
1207  //$this->tpl->setCurrentBlock('readonly_css_class');
1208  //$this->tpl->touchBlock('readonly_css_class');
1209  global $DIC;
1210  $f = $DIC->ui()->factory();
1211  $renderer = $DIC->ui()->renderer();
1212 
1213  $this->tpl->setVariable(
1214  'LOCKSTATE_INFOBOX',
1215  $renderer->render($f->messageBox()->info($this->lng->txt("tst_player_answer_saved_and_locked")))
1216  );
1217  $this->tpl->parseCurrentBlock();
1218 
1219  $this->tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
1220 
1221  $this->tpl->setVariable("FORMACTION", $formAction);
1222  $this->tpl->setVariable("ENCTYPE", 'enctype="' . $questionGui->getFormEncodingType() . '"');
1223  $this->tpl->setVariable("FORM_TIMESTAMP", time());
1224  }
global $DIC
Definition: feed.php:28
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 1828 of file class.ilTestPlayerAbstractGUI.php.

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

1829  {
1830  // fau: testNav - handle intermediate submit for viewing requested hints
1831  $this->handleIntermediateSubmit();
1832  // fau.
1833 
1834  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1835 
1836  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST);
1837  }
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 (   $presentationMode,
  $currentSequenceElement 
)
protected

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

References $DIC, $ilUser, ILIAS\Repository\ctrl(), isQuestionSummaryFinishTestButtonRequired(), ILIAS\Repository\lng(), and PRESENTATION_MODE_VIEW.

Referenced by prepareTestPage().

1559  {
1560  global $DIC;
1561  $ilUser = $DIC['ilUser'];
1562 
1563  $sideListActive = $ilUser->getPref('side_list_of_questions');
1564 
1565  if ($sideListActive) {
1566  $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, false);
1567 
1568  $questionSideListGUI = new ilTestQuestionSideListGUI($this->ctrl, $this->lng);
1569  $questionSideListGUI->setTargetGUI($this);
1570  $questionSideListGUI->setQuestionSummaryData($questionSummaryData);
1571  $questionSideListGUI->setCurrentSequenceElement($currentSequenceElement);
1572  // fau: testNav - set side list presentation mode to "view" to allow navigation when question is in edit mode
1573  $questionSideListGUI->setCurrentPresentationMode(ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1574  $questionSideListGUI->setDisabled(false);
1575  // $questionSideListGUI->setCurrentPresentationMode($presentationMode);
1576  // $questionSideListGUI->setDisabled($presentationMode == self::PRESENTATION_MODE_EDIT);
1577  // fau.
1578  $this->tpl->setVariable('LIST_OF_QUESTIONS', $questionSideListGUI->getHTML());
1579  }
1580  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ 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 460 of file class.ilTestPlayerAbstractGUI.php.

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

461  {
462  $testStartLock = $this->getLockParameter();
463  $isFirstTestStartRequest = false;
464 
465  $this->processLocker->executeTestStartLockOperation(function () use ($testStartLock, &$isFirstTestStartRequest) {
466  if ($this->testSession->lookupTestStartLock() != $testStartLock) {
467  $this->testSession->persistTestStartLock($testStartLock);
468  $isFirstTestStartRequest = true;
469  }
470  });
471 
472  if ($isFirstTestStartRequest) {
473  $this->handleUserSettings();
474  $this->ctrl->redirect($this, ilTestPlayerCommands::INIT_TEST);
475  }
476 
477  $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
478  $this->ctrl->redirectByClass("ilobjtestgui", "redirectToInfoScreen");
479  }
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 660 of file class.ilTestPlayerAbstractGUI.php.

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

661  {
662  $this->saveQuestionSolution(false, true);
663  // fau: testNav - set the 'answer changed' parameter when an intermediate solution is submitted
664  $this->setAnswerChangedParameter(true);
665  // fau.
666  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
667  }
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 208 of file class.ilTestPlayerAbstractGUI.php.

References ILIAS\Repository\ctrl().

Referenced by maxProcessingTimeReached().

209  {
210  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
211  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggleSideListCmd()

ilTestPlayerAbstractGUI::toggleSideListCmd ( )

Toggle side list.

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

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

673  {
674  global $DIC;
675  $ilUser = $DIC['ilUser'];
676 
677  $show_side_list = $ilUser->getPref('side_list_of_questions');
678  $ilUser->writePref('side_list_of_questions', !$show_side_list);
679  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
680  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and unmarkQuestionCmd().

705  {
706  // fau: testNav - handle intermediate submit when unmarking the question
707  $this->handleIntermediateSubmit();
708  // fau.
709  $this->unmarkQuestionCmd();
710  }
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 715 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by unmarkQuestionAndSaveIntermediateCmd().

716  {
717  $questionId = $this->testSequence->getQuestionForSequence(
719  );
720 
721  $this->object->setQuestionSetSolved(0, $questionId, $this->testSession->getUserId());
722 
723  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
724  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

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

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

Referenced by ilTestOutputGUI\showQuestionCmd().

2875  {
2876  $forced_feedback_navigation_url = ilSession::get('forced_feedback_navigation_url');
2877  if (isset($forced_feedback_navigation_url[$this->testSession->getActiveId()])) {
2878  unset($forced_feedback_navigation_url[$this->testSession->getActiveId()]);
2879  ilSession::set('forced_feedback_navigation_url', $forced_feedback_navigation_url);
2880  }
2881  }
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 171 of file class.ilTestPlayerAbstractGUI.php.

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

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

172  {
173  if (ilSession::get("active_time_id") != null) {
174  $this->object->updateWorkingTime(ilSession::get("active_time_id"));
175  }
176 
178  "active_time_id",
179  $this->object->startWorkingTime(
180  $this->testSession->getActiveId(),
181  $this->testSession->getPass()
182  )
183  );
184  }
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

ilTestPlayerAbstractGUI::$assSettings
protected

◆ $cachedQuestionGuis

ilTestPlayerAbstractGUI::$cachedQuestionGuis = array()
private

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

◆ $cachedQuestionObjects

ilTestPlayerAbstractGUI::$cachedQuestionObjects = array()
private

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

◆ $cmdCtrl

ilTestPlayerAbstractGUI::$cmdCtrl

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

◆ $endingTimeReached

ilTestPlayerAbstractGUI::$endingTimeReached

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

◆ $maxProcessingTimeReached

ilTestPlayerAbstractGUI::$maxProcessingTimeReached

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

◆ $passwordChecker

ilTestPlayerAbstractGUI::$passwordChecker
protected

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

◆ $processLocker

ilTestPlayerAbstractGUI::$processLocker
protected

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

◆ $ref_id

ilTestPlayerAbstractGUI::$ref_id

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

◆ $saveResult

ilTestPlayerAbstractGUI::$saveResult

◆ $sequence

ilTestPlayerAbstractGUI::$sequence

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

◆ $testSequence

ilTestPlayerAbstractGUI::$testSequence = null
protected

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

Referenced by archiveParticipantSubmission().

◆ $testSession

ilTestPlayerAbstractGUI::$testSession
protected

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

◆ FIXED_SHUFFLER_SEED_MIN_LENGTH

const ilTestPlayerAbstractGUI::FIXED_SHUFFLER_SEED_MIN_LENGTH = 8

◆ FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM

const ilTestPlayerAbstractGUI::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'

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