ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestPlayerAbstractGUI Class Reference

Output class for assessment test execution. 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 ()
 
 showFinalStatementCmd ()
 
 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)
 
 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)
 
 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)
 

Data Fields

const PRESENTATION_MODE_VIEW = 'view'
 
const PRESENTATION_MODE_EDIT = 'edit'
 
 $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 ()
 
 isTestSignRedirectRequired ($activeId, $lastFinishedPass)
 
 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)
 
 getCurrentSequenceElement ()
 
 resetSequenceElementParameter ()
 
 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 ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 buildQuestionAnswerShuffler (string $question_id, string $active_id, string $active_pass)
 
 buildFixedShufflerSeedFromBasicSeed (string $basic_seed)
 
 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
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
 $db
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Output class for assessment test execution.

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

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

ModulesTest

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

Constructor & Destructor Documentation

◆ __construct()

ilTestPlayerAbstractGUI::__construct (   $a_object)

ilTestOutputGUI constructor

Parameters
ilObjTest$a_object

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

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

68  {
69  parent::__construct($a_object);
70  $this->ref_id = $_GET["ref_id"];
71 
72  global $DIC;
73  $rbacsystem = $DIC['rbacsystem'];
74  $ilUser = $DIC['ilUser'];
75  $lng = $DIC['lng'];
76  require_once 'Modules/Test/classes/class.ilTestPasswordChecker.php';
77  $this->passwordChecker = new ilTestPasswordChecker($rbacsystem, $ilUser, $this->object, $lng);
78 
79  $this->processLocker = null;
80  $this->testSession = null;
81  $this->assSettings = null;
82  }
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ accessCodeConfirmedCmd()

ilTestPlayerAbstractGUI::accessCodeConfirmedCmd ( )

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

References ilTestPlayerCommands\START_TEST.

512  {
513  $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
514  }

◆ afterTestPassFinishedCmd()

ilTestPlayerAbstractGUI::afterTestPassFinishedCmd ( )
protected

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

References $_GET, isTestSignRedirectRequired(), ilUtil\redirect(), REDIRECT_KIOSK, redirectBackCmd(), and ilTestPlayerCommands\SHOW_FINAL_STATMENT.

836  {
837  $activeId = $this->testSession->getActiveId();
838  $lastFinishedPass = $this->testSession->getLastFinishedPass();
839 
840  // handle test signature
841  if ($this->isTestSignRedirectRequired($activeId, $lastFinishedPass)) {
842  $this->ctrl->redirectByClass('ilTestSignatureGUI', 'invokeSignaturePlugin');
843  }
844 
845  // show final statement
846  if (!$_GET['skipfinalstatement']) {
847  if ($this->object->getShowFinalStatement()) {
848  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_FINAL_STATMENT);
849  }
850  }
851 
852  // redirect after test
853  $redirection_mode = $this->object->getRedirectionMode();
854  $redirection_url = $this->object->getRedirectionUrl();
855  if ($redirection_url && $redirection_mode) {
856  if ($redirection_mode == REDIRECT_KIOSK) {
857  if ($this->object->getKioskMode()) {
858  ilUtil::redirect($redirection_url);
859  }
860  } else {
861  ilUtil::redirect($redirection_url);
862  }
863  }
864 
865  // default redirect (pass overview when enabled, otherwise infoscreen)
866  $this->redirectBackCmd();
867  }
$_GET["client_id"]
isTestSignRedirectRequired($activeId, $lastFinishedPass)
const REDIRECT_KIOSK
static redirect($a_script)
+ Here is the call graph for this function:

◆ archiveParticipantSubmission()

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

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

References $DIC, $filename, ilTestServiceGUI\$ilias, $ilSetting, $pass, $results, $testSequence, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestArchiver\DIR_SEP, ilTestPDFGenerator\generatePDF(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilUtil\getWebspaceDir(), ilUtil\makeDirParents(), and ilTestPDFGenerator\PDF_OUTPUT_FILE.

897  {
898  global $DIC;
899  $ilObjDataCache = $DIC['ilObjDataCache'];
900 
901  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
902  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
903 
904  $objectivesList = null;
905 
906  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
907  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
908  $testSequence->loadFromDb();
909  $testSequence->loadQuestions();
910 
911  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
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  require_once 'class.ilTestEvaluationGUI.php';
932  $testevaluationgui = new ilTestEvaluationGUI($this->object);
933  $results_output = $testevaluationgui->getPassListOfAnswers(
934  $results,
935  $active,
936  $pass,
937  false,
938  false,
939  false,
940  false,
941  false,
942  $objectivesList,
943  $testResultHeaderLabelBuilder
944  );
945 
946  require_once './Modules/Test/classes/class.ilTestArchiver.php';
947  global $DIC;
948  $ilSetting = $DIC['ilSetting'];
949  $inst_id = $ilSetting->get('inst_id', null);
950  $archiver = new ilTestArchiver($this->object->getId());
951 
952  $path = ilUtil::getWebspaceDir() . '/assessment/' . $this->object->getId() . '/exam_pdf';
953  if (!is_dir($path)) {
954  ilUtil::makeDirParents($path);
955  }
956  $filename = realpath($path) . '/exam_N' . $inst_id . '-' . $this->object->getId()
957  . '-' . $active . '-' . $pass . '.pdf';
958 
960  //$template->setVariable("PDF_FILE_LOCATION", $filename);
961  // Participant submission
962  $archiver->handInParticipantSubmission($active, $pass, $filename, $results_output);
963  //$archiver->handInParticipantMisc( $active, $pass, 'signature_gedoens.sig', $filename );
964  //$archiver->handInParticipantQuestionMaterial( $active, $pass, 123, 'file_upload.pdf', $filename );
965 
966  global $DIC;
967  $ilias = $DIC['ilias'];
968  $questions = $this->object->getQuestions();
969  foreach ($questions as $question_id) {
970  $question_object = $this->object->getQuestionDataset($question_id);
971  if ($question_object->type_tag == 'assFileUpload') {
972  // Pfad: /data/default/assessment/tst_2/14/21/files/file_14_4_1370417414.png
973  // /data/ - klar
974  // /assessment/ - Konvention
975  // /tst_2/ = /tst_<test_id> (ilObjTest)
976  // /14/ = /<active_fi>/
977  // /21/ = /<question_id>/ (question_object)
978  // /files/ - Konvention
979  // file_14_4_1370417414.png = file_<active_fi>_<pass>_<some timestamp>.<ext>
980 
981  $candidate_path =
982  $ilias->ini_ilias->readVariable('server', 'absolute_path') . ilTestArchiver::DIR_SEP
983  . $ilias->ini_ilias->readVariable('clients', 'path') . ilTestArchiver::DIR_SEP
984  . $ilias->client_id . ilTestArchiver::DIR_SEP
985  . 'assessment' . ilTestArchiver::DIR_SEP
986  . 'tst_' . $this->object->test_id . ilTestArchiver::DIR_SEP
987  . $active . ilTestArchiver::DIR_SEP
988  . $question_id . ilTestArchiver::DIR_SEP
989  . 'files' . ilTestArchiver::DIR_SEP;
990  $handle = opendir($candidate_path);
991  while ($handle !== false && ($file = readdir($handle)) !== false) {
992  if ($file != null) {
993  $filename_start = 'file_' . $active . '_' . $pass . '_';
994 
995  if (strpos($file, $filename_start) === 0) {
996  $archiver->handInParticipantQuestionMaterial($active, $pass, $question_id, $file, $file);
997  }
998  }
999  }
1000  }
1001  }
1002  $passdata = $this->object->getTestResult(
1003  $active,
1004  $pass,
1005  false,
1006  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1007  );
1008  $overview = $testevaluationgui->getPassListOfAnswers(
1009  $passdata,
1010  $active,
1011  $pass,
1012  true,
1013  false,
1014  false,
1015  true,
1016  false,
1017  $objectivesList,
1018  $testResultHeaderLabelBuilder
1019  );
1020  $filename = realpath(ilUtil::getWebspaceDir()) . '/assessment/scores-' . $this->object->getId() . '-' . $active . '-' . $pass . '.pdf';
1022  $archiver->handInTestResult($active, $pass, $filename);
1023  unlink($filename);
1024 
1025  return;
1026  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
Output class for assessment test evaluation.
$results
$filename
Definition: buildRTE.php:89
Class ilTestArchiver.
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static getWebspaceDir($mode="filesystem")
get webspace directory
+ 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 586 of file class.ilTestPlayerAbstractGUI.php.

References $_POST, $res, $result, canSaveResult(), exit, getAnswerChangedParameter(), getCurrentQuestionId(), isParticipantsAnswerFixed(), removeIntermediateSolution(), and saveQuestionSolution().

587  {
588  $result = "";
589  if (is_array($_POST) && count($_POST) > 0) {
590  if (!$this->canSaveResult() || $this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
591  $result = '-IGNORE-';
592  } else {
593  // answer is changed from authorized solution, so save the change as intermediate solution
594  if ($this->getAnswerChangedParameter()) {
595  $res = $this->saveQuestionSolution(false, true);
596  }
597  // answer is not changed from authorized solution, so delete an intermediate solution
598  else {
599  $db_res = $this->removeIntermediateSolution();
600  $res = is_int($db_res);
601  }
602  if ($res) {
603  $result = $this->lng->txt("autosave_success");
604  } else {
605  $result = $this->lng->txt("autosave_failed");
606  }
607  }
608  }
609  echo $result;
610  exit;
611  }
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
removeIntermediateSolution()
remove an auto-saved solution of the current question
exit
Definition: login.php:29
$result
foreach($_POST as $key=> $value) $res
getAnswerChangedParameter()
Get the &#39;answer changed&#39; status from the current request It may be set by ilTestPlayerNavigationContr...
$_POST["username"]
+ 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 617 of file class.ilTestPlayerAbstractGUI.php.

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

618  {
619  if (!$this->isParticipantsAnswerFixed($this->getCurrentQuestionId())) {
620  // time limit saves the user solution as authorized
621  $this->saveQuestionSolution(true, true);
622  }
623  $this->ctrl->redirect($this, ilTestPlayerCommands::REDIRECT_ON_TIME_LIMIT);
624  }
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 1653 of file class.ilTestPlayerAbstractGUI.php.

References ilTestPlayerCommands\SHOW_QUESTION.

1654  {
1655  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1656  }

◆ backToInfoScreenCmd()

ilTestPlayerAbstractGUI::backToInfoScreenCmd ( )
protected

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

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

1047  {
1048  $this->ctrl->redirectByClass('ilObjTestGUI', 'redirectToInfoScreen');
1049  }
+ Here is the caller graph for this function:

◆ buildEditableStateQuestionNavigationGUI()

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

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

References $pass, ilObjTest\_getSolvedQuestions(), ilTestPlayerCommands\CONFIRM_HINT_REQUEST, ilTestPlayerCommands\MARK_QUESTION_SAVE, ilTestPlayerCommands\REVERT_CHANGES, ilTestPlayerCommands\SHOW_INSTANT_RESPONSE, ilTestPlayerCommands\SHOW_REQUESTED_HINTS_LIST, ilTestPlayerCommands\SUBMIT_SOLUTION, and ilTestPlayerCommands\UNMARK_QUESTION_SAVE.

Referenced by showQuestionEditable().

2071  {
2072  require_once 'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
2073  $navigationGUI = new ilTestQuestionNavigationGUI($this->lng);
2074 
2075  if ($this->object->isForceInstantFeedbackEnabled()) {
2076  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2077  } else {
2078  // fau: testNav - use simple "submitSolution" button instead of "submitSolutionAndNext"
2079  $navigationGUI->setSubmitSolutionCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2080  // fau.
2081  }
2082 
2083  // fau: testNav - add a 'revert changes' link for editable question
2084  $navigationGUI->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES));
2085  // fau.
2086 
2087 
2088  // feedback
2089  switch (1) {
2090  case $this->object->getSpecificAnswerFeedback():
2091  case $this->object->getGenericAnswerFeedback():
2092  case $this->object->getAnswerFeedbackPoints():
2093  case $this->object->getInstantFeedbackSolution():
2094 
2095  $navigationGUI->setAnswerFreezingEnabled($this->object->isInstantFeedbackAnswerFixationEnabled());
2096 
2097  if ($this->object->isForceInstantFeedbackEnabled()) {
2098  $navigationGUI->setForceInstantResponseEnabled(true);
2099  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SUBMIT_SOLUTION);
2100  } else {
2101  $navigationGUI->setInstantFeedbackCommand(ilTestPlayerCommands::SHOW_INSTANT_RESPONSE);
2102  }
2103  }
2104 
2105  // hints
2106  if ($this->object->isOfferingQuestionHintsEnabled()) {
2107  $activeId = $this->testSession->getActiveId();
2108  $pass = $this->testSession->getPass();
2109 
2110  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
2111  $questionHintTracking = new ilAssQuestionHintTracking($questionId, $activeId, $pass);
2112 
2113  if ($questionHintTracking->requestsPossible()) {
2114  $navigationGUI->setRequestHintCommand(ilTestPlayerCommands::CONFIRM_HINT_REQUEST);
2115  }
2116 
2117  if ($questionHintTracking->requestsExist()) {
2118  $navigationGUI->setShowHintsCommand(ilTestPlayerCommands::SHOW_REQUESTED_HINTS_LIST);
2119  }
2120  }
2121 
2122  $navigationGUI->setCharSelectorEnabled($charSelectorAvailable);
2123 
2124  if ($this->object->getShowMarker()) {
2125  include_once "./Modules/Test/classes/class.ilObjTest.php";
2126  $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $questionId);
2127  $solved = 0;
2128 
2129  if (count($solved_array) > 0) {
2130  $solved = array_pop($solved_array);
2131  $solved = $solved["solved"];
2132  }
2133 
2134  // fau: testNav - change question mark command to link target
2135  if ($solved == 1) {
2136  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION_SAVE));
2137  $navigationGUI->setQuestionMarked(true);
2138  } else {
2139  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION_SAVE));
2140  $navigationGUI->setQuestionMarked(false);
2141  }
2142  }
2143  // fau.
2144  return $navigationGUI;
2145  }
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 309 of file class.ilTestPlayerAbstractGUI.php.

References ilTestPlayerNavButton\getInstance(), and ilTestPlayerCommands\NEXT_QUESTION.

Referenced by populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

310  {
312  // fau: testNav - set glyphicon and primary
313  $button->setPrimary($primaryNext);
314  $button->setRightGlyph('glyphicon glyphicon-arrow-right');
315  // fau.
316  $button->setNextCommand(ilTestPlayerCommands::NEXT_QUESTION);
317  $button->setUrl($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::NEXT_QUESTION));
318  $button->setCaption('next_question');
319  $button->addCSSClass('ilTstNavElem');
320  //$button->setDisabled($disabled);
321  return $button;
322  }
+ 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 328 of file class.ilTestPlayerAbstractGUI.php.

References ilTestPlayerNavButton\getInstance(), and ilTestPlayerCommands\PREVIOUS_QUESTION.

Referenced by populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

329  {
331  // fau: testNav - set glyphicon and primary
332  $button->setLeftGlyph('glyphicon glyphicon-arrow-left');
333  // fau.
334  $button->setNextCommand(ilTestPlayerCommands::PREVIOUS_QUESTION);
335  $button->setUrl($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::PREVIOUS_QUESTION));
336  $button->setCaption('previous_question');
337  $button->addCSSClass('ilTstNavElem');
338  //$button->setDisabled($disabled);
339  return $button;
340  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildReadOnlyStateQuestionNavigationGUI()

ilTestPlayerAbstractGUI::buildReadOnlyStateQuestionNavigationGUI (   $questionId)
protected

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

References ilObjTest\_getSolvedQuestions(), ilTestPlayerCommands\EDIT_SOLUTION, isParticipantsAnswerFixed(), ilTestPlayerCommands\MARK_QUESTION, and ilTestPlayerCommands\UNMARK_QUESTION.

Referenced by showQuestionViewable().

2039  {
2040  require_once 'Modules/Test/classes/class.ilTestQuestionNavigationGUI.php';
2041  $navigationGUI = new ilTestQuestionNavigationGUI($this->lng);
2042 
2043  if (!$this->isParticipantsAnswerFixed($questionId)) {
2044  $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION);
2045  }
2046 
2047  if ($this->object->getShowMarker()) {
2048  include_once "./Modules/Test/classes/class.ilObjTest.php";
2049  $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $questionId);
2050  $solved = 0;
2051 
2052  if (count($solved_array) > 0) {
2053  $solved = array_pop($solved_array);
2054  $solved = $solved["solved"];
2055  }
2056  // fau: testNav - change question mark command to link target
2057  if ($solved == 1) {
2058  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::UNMARK_QUESTION));
2059  $navigationGUI->setQuestionMarked(true);
2060  } else {
2061  $navigationGUI->setQuestionMarkLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::MARK_QUESTION));
2062  $navigationGUI->setQuestionMarked(false);
2063  }
2064  }
2065  // fau.
2066 
2067  return $navigationGUI;
2068  }
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 1971 of file class.ilTestPlayerAbstractGUI.php.

1972  {
1973  if ($this->object->getListOfQuestions()) {
1974  $this->ctrl->setParameter($this, 'activecommand', 'summary');
1975  } else {
1976  $this->ctrl->setParameter($this, 'activecommand', 'previous');
1977  }
1978 
1979  $this->ctrl->redirect($this, 'redirectQuestion');
1980  }

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

References $_SERVER, $DIC, $ilUser, and ilUtil\sendInfo().

1351  {
1352  global $DIC;
1353  $ilUser = $DIC['ilUser'];
1354 
1355  // check if user is invited to participate
1356  $user = $this->object->getInvitedUsers($ilUser->getId());
1357  if (!is_array($user) || count($user) != 1) {
1358  ilUtil::sendInfo($this->lng->txt("user_not_invited"), true);
1359  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1360  }
1361 
1362  $user = array_pop($user);
1363  // check if client ip is set and if current remote addr is equal to stored client-ip
1364  if (strcmp($user["clientip"], "") != 0 && strcmp($user["clientip"], $_SERVER["REMOTE_ADDR"]) != 0) {
1365  ilUtil::sendInfo($this->lng->txt("user_wrong_clientip"), true);
1366  $this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
1367  }
1368  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ checkReadAccess()

ilTestPlayerAbstractGUI::checkReadAccess ( )
protected

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

References $DIC.

Referenced by ilTestOutputGUI\executeCommand().

85  {
86  global $DIC;
87  $rbacsystem = $DIC['rbacsystem'];
88 
89  if (!$rbacsystem->checkAccess("read", $this->object->getRefId())) {
90  // only with read access it is possible to run the test
91  $this->ilias->raiseError($this->lng->txt("cannot_execute_test"), $this->ilias->error_obj->MESSAGE);
92  }
93  }
redirection script todo: (a better solution should control the processing via a xml file) ...
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ checkTestExecutable()

ilTestPlayerAbstractGUI::checkTestExecutable ( )
protected

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

References ilUtil\sendInfo().

Referenced by ilTestOutputGUI\executeCommand().

96  {
97  $executable = $this->object->isExecutable($this->testSession, $this->testSession->getUserId());
98 
99  if (!$executable['executable']) {
100  ilUtil::sendInfo($executable['errormessage'], true);
101  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
102  }
103  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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 105 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, and ilTestSession\getUserId().

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

106  {
107  global $DIC; /* @var ILIAS\DI\Container $DIC */
108 
109  if ($testSession->getUserId() != $DIC->user()->getId()) {
110  throw new ilTestException('active id given does not relate to current user!');
111  }
112  }
Base Exception for all Exceptions relating to Modules/Test.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmAnswerOptionalQuestionsCmd()

ilTestPlayerAbstractGUI::confirmAnswerOptionalQuestionsCmd ( )
protected

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

1963  {
1964  $this->testSequence->setAnsweringOptionalQuestionsConfirmed(true);
1965  $this->testSequence->saveToDb();
1966 
1967  $this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
1968  $this->ctrl->redirect($this, 'redirectQuestion');
1969  }

◆ confirmFinishCmd()

ilTestPlayerAbstractGUI::confirmFinishCmd ( )
protected

The final submission of a test was confirmed.

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

References $DIC, $ilUser, ilTestPlayerCommands\BACK_FROM_FINISHING, finishTestCmd(), and populateHelperGuiContent().

719  {
720  $this->finishTestCmd(false);
721  }
finishTestCmd($requires_confirmation=true)
+ Here is the call graph for this function:

◆ confirmHintRequestCmd()

ilTestPlayerAbstractGUI::confirmHintRequestCmd ( )
protected

Go to hint request confirmation.

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

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

1813  {
1814  // fau: testNav - handle intermediate submit for confirming hint requests
1815  $this->handleIntermediateSubmit();
1816  // fau.
1817 
1818  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1819 
1820  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1821  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_CONFIRM_REQUEST);
1822  }
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 1422 of file class.ilTestPlayerAbstractGUI.php.

References getContentBlockName().

1423  {
1424  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", "Modules/Test");
1425  $this->tpl->setCurrentBlock("adm_content");
1426  if ($this->object->isTestFinished($this->testSession->getActiveId())) {
1427  $this->tpl->setCurrentBlock("not_submit_allowed");
1428  $this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
1429  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
1430  } else {
1431  $this->tpl->setCurrentBlock("submit_allowed");
1432  $this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
1433  $this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
1434  }
1435  $this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
1436  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "finalSubmission"));
1437  $this->tpl->parseCurrentBlock();
1438  }
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 633 of file class.ilTestPlayerAbstractGUI.php.

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

634  {
635  $questionId = $this->getCurrentQuestionId();
636  $state = $this->getQuestionInstance($questionId)->lookupForExistingSolutions(
637  $this->testSession->getActiveId(),
638  $this->testSession->getPass()
639  );
640  $result = array();
641  $result['isAnswered'] = $state['authorized'];
642  $result['isAnswerChanged'] = $state['intermediate'];
643 
644  echo json_encode($result);
645  exit;
646  }
exit
Definition: login.php:29
$result
getQuestionInstance($questionId, $fromCache=true)
+ Here is the call graph for this function:

◆ determineInlineScoreDisplay()

ilTestPlayerAbstractGUI::determineInlineScoreDisplay ( )
protected

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

Referenced by populateInstantResponseBlocks().

225  {
226  $show_question_inline_score = false;
227  if ($this->object->getAnswerFeedbackPoints()) {
228  $show_question_inline_score = true;
229  return $show_question_inline_score;
230  }
231  return $show_question_inline_score;
232  }
+ Here is the caller graph for this function:

◆ determineSolutionPassIndex()

ilTestPlayerAbstractGUI::determineSolutionPassIndex ( assQuestionGUI  $questionGui)
protected

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

References ilObjTest\_getUsePreviousAnswers(), editSolutionCmd(), showQuestionCmd(), and submitSolutionCmd().

Referenced by showQuestionEditable().

1293  {
1294  require_once './Modules/Test/classes/class.ilObjTest.php';
1295 
1296  if (ilObjTest::_getUsePreviousAnswers($this->testSession->getActiveId(), true)) {
1297  $currentSolutionAvailable = $questionGui->object->authorizedOrIntermediateSolutionExists(
1298  $this->testSession->getActiveId(),
1299  $this->testSession->getPass()
1300  );
1301 
1302  if (!$currentSolutionAvailable) {
1303  $previousPass = $questionGui->object->getSolutionMaxPass(
1304  $this->testSession->getActiveId()
1305  );
1306 
1307  $previousSolutionAvailable = $questionGui->object->authorizedSolutionExists(
1308  $this->testSession->getActiveId(),
1309  $previousPass
1310  );
1311 
1312  if ($previousSolutionAvailable) {
1313  return $previousPass;
1314  }
1315  }
1316  }
1317 
1318  return $this->testSession->getPass();
1319  }
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
+ 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 499 of file class.ilTestPlayerAbstractGUI.php.

References ilTestPlayerCommands\ACCESS_CODE_CONFIRMED, and getContentBlockName().

500  {
501  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_anonymous_code_presentation.html", "Modules/Test");
502  $this->tpl->setCurrentBlock("adm_content");
503  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE_CREATED", $this->lng->txt("tst_access_code_created"));
504  $this->tpl->setVariable("TEXT_ANONYMOUS_CODE", $this->testSession->getAccessCodeFromSession());
505  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
506  $this->tpl->setVariable("CMD_CONFIRM", ilTestPlayerCommands::ACCESS_CODE_CONFIRMED);
507  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("continue_work"));
508  $this->tpl->parseCurrentBlock();
509  }
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 1395 of file class.ilTestPlayerAbstractGUI.php.

References ilDatePresentation\formatDate(), IL_CAL_UNIX, redirectBackCmd(), and ilUtil\sendInfo().

Referenced by prepareTestPage().

1396  {
1397  ilUtil::sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilDatePresentation::formatDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX))));
1398  $this->testSession->increasePass();
1399  $this->testSession->setLastSequence(0);
1400  $this->testSession->saveToDb();
1401 
1402  $this->redirectBackCmd();
1403  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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 114 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(), and ilTestPlayerDynamicQuestionSetGUI\executeCommand().

115  {
116  if ($testSession->getActiveId()) {
117  return;
118  }
119 
120  global $DIC;
121  $ilUser = $DIC['ilUser'];
122 
123  $testSession->setUserId($ilUser->getId());
124 
125  if ($testSession->isAnonymousUser()) {
126  if (!$testSession->doesAccessCodeInSessionExists()) {
127  return;
128  }
129 
130  $testSession->setAnonymousId($testSession->getAccessCodeFromSession());
131  }
132 
133  $testSession->saveToDb();
134  }
setAnonymousId($anonymous_id)
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ 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 744 of file class.ilTestPlayerAbstractGUI.php.

References $_GET, $_SESSION, ilObjTest\_getPass(), ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, ilObjTest\allObligationsAnswered(), performTestPassFinishedTasks(), ilTestPlayerCommands\QUESTION_SUMMARY_INC_OBLIGATIONS, and ilTestPlayerCommands\QUESTION_SUMMARY_OBLIGATIONS_ONLY.

Referenced by confirmFinishCmd().

745  {
746  unset($_SESSION["tst_next"]);
747 
748  $active_id = $this->testSession->getActiveId();
749  $actualpass = ilObjTest::_getPass($active_id);
750 
751  $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass);
752 
753  /*
754  * The following "endgames" are possible prior to actually finishing the test:
755  * - Obligations (Ability to finish the test.)
756  * If not all obligatory questions are answered, the user is presented a list
757  * showing the deficits.
758  * - Examview (Will to finish the test.)
759  * With the examview, the participant can review all answers given in ILIAS or a PDF prior to
760  * commencing to the finished test.
761  * - Last pass allowed (Reassuring the will to finish the test.)
762  * If passes are limited, on the last pass, an additional confirmation is to be displayed.
763  */
764 
765 
766  if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
767  if ($this->object->getListOfQuestions()) {
768  $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY_INC_OBLIGATIONS);
769  } else {
770  $this->ctrl->redirect($this, ilTestPlayerCommands::QUESTION_SUMMARY_OBLIGATIONS_ONLY);
771  }
772 
773  return;
774  }
775 
776  // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui)
777  if ($this->object->getEnableExamview() && !isset($_GET['reviewed']) && $requires_confirmation) {
778  $this->ctrl->redirectByClass('ilTestSubmissionReviewGUI', "show");
779  return;
780  }
781 
782  // Last try in limited tries & !confirmed
783  if (($requires_confirmation) && ($actualpass == $this->object->getNrOfTries() - 1)) {
784  // show confirmation page
785  return $this->confirmFinishTestCmd();
786  }
787 
788  // Last try in limited tries & confirmed?
789  if (($actualpass == $this->object->getNrOfTries() - 1) && (!$requires_confirmation)) {
790  // @todo: php7 ask mister test
791  #$ilAuth->setIdle(ilSession::getIdleValue(), false);
792  #$ilAuth->setExpire(0);
793  switch ($this->object->getMailNotification()) {
794  case 1:
795  $this->object->sendSimpleNotification($active_id);
796  break;
797  case 2:
798  $this->object->sendAdvancedNotification($active_id);
799  break;
800  }
801  }
802 
803  // Non-last try finish
804  if (!$_SESSION['tst_pass_finish']) {
805  if (!$_SESSION['tst_pass_finish']) {
806  $_SESSION['tst_pass_finish'] = 1;
807  }
808  if ($this->object->getMailNotificationType() == 1) {
809  switch ($this->object->getMailNotification()) {
810  case 1:
811  $this->object->sendSimpleNotification($active_id);
812  break;
813  case 2:
814  $this->object->sendAdvancedNotification($active_id);
815  break;
816  }
817  }
818  }
819 
820  // no redirect request loops after test pass finished tasks has been performed
821 
822  $this->performTestPassFinishedTasks($actualpass);
823 
824  $this->ctrl->redirect($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED);
825  }
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.
$_SESSION["AccountId"]
$_GET["client_id"]
+ 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 2408 of file class.ilTestPlayerAbstractGUI.php.

References $_GET.

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

2409  {
2410  return !empty($_GET['test_answer_changed']);
2411  }
$_GET["client_id"]
+ 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 1773 of file class.ilTestPlayerAbstractGUI.php.

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

1774  {
1775  return "ADM_CONTENT";
1776 
1777  if ($this->object->getKioskMode()) {
1778  $this->tpl->setBodyClass("kiosk");
1779  $this->tpl->hideFooter();
1780  return "CONTENT";
1781  } else {
1782  return "ADM_CONTENT";
1783  }
1784  }
+ 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 2150 of file class.ilTestPlayerAbstractGUI.php.

References ilObjTest\allObligationsAnswered().

Referenced by getTestNavigationToolbarGUI().

2151  {
2152  if (!$this->object->getListOfQuestionsEnd()) {
2153  return 'finishTest';
2154  }
2155 
2156  if ($this->object->areObligationsEnabled()) {
2157  $allObligationsAnswered = ilObjTest::allObligationsAnswered(
2158  $this->testSession->getTestId(),
2159  $this->testSession->getActiveId(),
2160  $this->testSession->getPass()
2161  );
2162 
2163  if (!$allObligationsAnswered) {
2164  return 'outQuestionSummaryWithObligationsInfo';
2165  }
2166  }
2167 
2168  return 'outQuestionSummary';
2169  }
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 2357 of file class.ilTestPlayerAbstractGUI.php.

References $_GET.

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

2358  {
2359  if (isset($_GET['instresp'])) {
2360  return $_GET['instresp'];
2361  }
2362 
2363  return null;
2364  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getIntroductionPageButtonLabel()

ilTestPlayerAbstractGUI::getIntroductionPageButtonLabel ( )
protected
Returns
string

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

1908  {
1909  return $this->lng->txt("save_introduction");
1910  }

◆ getKioskHead()

ilTestPlayerAbstractGUI::getKioskHead ( )

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

References $DIC, $ilUser, and ilObjTest\buildExamId().

Referenced by outQuestionSummaryCmd(), and populateKioskHead().

1065  {
1066  global $DIC;
1067  $ilUser = $DIC['ilUser'];
1068 
1069  $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test');
1070  if ($this->object->getShowKioskModeTitle()) {
1071  $template->setCurrentBlock("kiosk_show_title");
1072  $template->setVariable("TEST_TITLE", $this->object->getTitle());
1073  $template->parseCurrentBlock();
1074  }
1075  if ($this->object->getShowKioskModeParticipant()) {
1076  $template->setCurrentBlock("kiosk_show_participant");
1077  $template->setVariable("PARTICIPANT_NAME_TXT", $this->lng->txt("login_as"));
1078  $template->setVariable("PARTICIPANT_NAME", $ilUser->getFullname());
1079  $template->setVariable("PARTICIPANT_LOGIN", $ilUser->getLogin());
1080  $template->setVariable("PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
1081  $template->setVariable("PARTICIPANT_EMAIL", $ilUser->getEmail());
1082  $template->parseCurrentBlock();
1083  }
1084  if ($this->object->isShowExamIdInTestPassEnabled()) {
1085  $exam_id = ilObjTest::buildExamId(
1086  $this->testSession->getActiveId(),
1087  $this->testSession->getPass(),
1088  $this->object->getId()
1089  );
1090 
1091  $template->setCurrentBlock("kiosk_show_exam_id");
1092  $template->setVariable("EXAM_ID_TXT", $this->lng->txt("exam_id"));
1093  $template->setVariable("EXAM_ID", $exam_id);
1094  $template->parseCurrentBlock();
1095  }
1096  return $template->get();
1097  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
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 460 of file class.ilTestPlayerAbstractGUI.php.

References $_GET, $_POST, and resumePlayerCmd().

Referenced by handlePasswordProtectionRedirect(), and startPlayerCmd().

461  {
462  if (isset($_POST['lock']) && strlen($_POST['lock'])) {
463  return $_POST['lock'];
464  } elseif (isset($_GET['lock']) && strlen($_GET['lock'])) {
465  return $_GET['lock'];
466  }
467 
468  return null;
469  }
$_GET["client_id"]
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavigationUrlParameter()

ilTestPlayerAbstractGUI::getNavigationUrlParameter ( )
protected

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

References $_POST, and ilUtil\_getHttpPath().

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

2386  {
2387  if (isset($_POST['test_player_navigation_url'])) {
2388  $navigation_url = $_POST['test_player_navigation_url'];
2389 
2390  $navigation_url_parts = parse_url($navigation_url);
2391  $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
2392 
2393  if (!isset($navigation_url_parts['host']) || ($ilias_url_parts['host'] === $navigation_url_parts['host'])) {
2394  return $navigation_url;
2395  }
2396  }
2397 
2398  return null;
2399  }
static _getHttpPath()
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextCommandParameter()

ilTestPlayerAbstractGUI::getNextCommandParameter ( )
protected

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

References $_POST.

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

2367  {
2368  if (isset($_POST['nextcmd']) && strlen($_POST['nextcmd'])) {
2369  return $_POST['nextcmd'];
2370  }
2371 
2372  return null;
2373  }
$_POST["username"]
+ Here is the caller graph for this function:

◆ getNextSequenceParameter()

ilTestPlayerAbstractGUI::getNextSequenceParameter ( )
protected

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

References $_POST.

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

2376  {
2377  if (isset($_POST['nextseq']) && is_numeric($_POST['nextseq'])) {
2378  return (int) $_POST['nextseq'];
2379  }
2380 
2381  return null;
2382  }
$_POST["username"]
+ Here is the caller graph for this function:

◆ getPresentationModeParameter()

ilTestPlayerAbstractGUI::getPresentationModeParameter ( )
protected

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

References $_GET.

2349  {
2350  if (isset($_GET['pmode'])) {
2351  return $_GET['pmode'];
2352  }
2353 
2354  return null;
2355  }
$_GET["client_id"]

◆ getQuestionGuiInstance()

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

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

References $DIC, ilTestServiceGUI\$tpl, ilTestServiceGUI\buildQuestionAnswerShuffler(), initTestQuestionConfig(), OUTPUT_JAVASCRIPT, and assQuestionGUI\PRESENTATION_CONTEXT_TEST.

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

2466  {
2467  global $DIC;
2468  $tpl = $DIC['tpl'];
2469 
2470  if (!$fromCache || !isset($this->cachedQuestionGuis[$question_id])) {
2471  $questionGui = $this->object->createQuestionGUI("", $question_id);
2472  $questionGui->setTargetGui($this);
2473  $questionGui->setPresentationContext(assQuestionGUI::PRESENTATION_CONTEXT_TEST);
2474  $questionGui->object->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2475  $questionGui->populateJavascriptFilesRequiredForWorkForm($tpl);
2476  $questionGui->object->setOutputType(OUTPUT_JAVASCRIPT);
2477  $questionGui->object->setShuffler($this->buildQuestionAnswerShuffler((string) $question_id, (string) $this->testSession->getActiveId(), (string) $this->testSession->getPass()));
2478 
2479  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2480  $this->initTestQuestionConfig($questionGui->object);
2481  // hey.
2482 
2483  $this->cachedQuestionGuis[$question_id] = $questionGui;
2484  }
2485 
2486  return $this->cachedQuestionGuis[$question_id];
2487  }
const OUTPUT_JAVASCRIPT
initTestQuestionConfig(assQuestion $questionOBJ)
$DIC
Definition: xapitoken.php:46
buildQuestionAnswerShuffler(string $question_id, string $active_id, string $active_pass)
+ 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 2498 of file class.ilTestPlayerAbstractGUI.php.

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

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

2499  {
2500  global $DIC;
2501  $ilDB = $DIC['ilDB'];
2502  $ilUser = $DIC['ilUser'];
2503 
2504  if (!$fromCache || !isset($this->cachedQuestionObjects[$questionId])) {
2505  $questionOBJ = assQuestion::_instantiateQuestion($questionId);
2506 
2507  $assSettings = new ilSetting('assessment');
2508  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
2509  $processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
2510  $processLockerFactory->setQuestionId($questionOBJ->getId());
2511  $processLockerFactory->setUserId($ilUser->getId());
2512  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
2513  $processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
2514  $questionOBJ->setProcessLocker($processLockerFactory->getLocker());
2515 
2516  $questionOBJ->setObligationsToBeConsidered($this->object->areObligationsEnabled());
2517  $questionOBJ->setOutputType(OUTPUT_JAVASCRIPT);
2518 
2519  // hey: prevPassSolutions - determine solution pass index and configure gui accordingly
2520  $this->initTestQuestionConfig($questionOBJ);
2521  // hey.
2522 
2523  $this->cachedQuestionObjects[$questionId] = $questionOBJ;
2524  }
2525 
2526  return $this->cachedQuestionObjects[$questionId];
2527  }
const OUTPUT_JAVASCRIPT
initTestQuestionConfig(assQuestion $questionOBJ)
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
$ilUser
Definition: imgupload.php:18
static _instantiateQuestion($question_id)
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsDefaultPresentationMode()

ilTestPlayerAbstractGUI::getQuestionsDefaultPresentationMode (   $isQuestionWorkedThrough)
protected

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

2863  {
2864  // fau: testNav - always set default presentation mode to "edit"
2865  return self::PRESENTATION_MODE_EDIT;
2866  // fau.
2867  }

◆ getRegisteredForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::getRegisteredForcedFeedbackNavUrl ( )
protected

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

References $_SESSION.

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

2879  {
2880  if (!isset($_SESSION['forced_feedback_navigation_url'])) {
2881  return null;
2882  }
2883 
2884  if (!isset($_SESSION['forced_feedback_navigation_url'][$this->testSession->getActiveId()])) {
2885  return null;
2886  }
2887 
2888  return $_SESSION['forced_feedback_navigation_url'][$this->testSession->getActiveId()];
2889  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ getSequenceElementParameter()

ilTestPlayerAbstractGUI::getSequenceElementParameter ( )
protected

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

References $_GET.

Referenced by getCurrentSequenceElement(), and ilTestPlayerDynamicQuestionSetGUI\getQuestionIdParameter().

2340  {
2341  if (isset($_GET['sequence'])) {
2342  return $_GET['sequence'];
2343  }
2344 
2345  return null;
2346  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getTestNavigationToolbarGUI()

ilTestPlayerAbstractGUI::getTestNavigationToolbarGUI ( )
protected

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

References $DIC, $ilUser, and getFinishTestCommand().

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

2022  {
2023  global $DIC;
2024  $ilUser = $DIC['ilUser'];
2025 
2026  require_once 'Modules/Test/classes/class.ilTestNavigationToolbarGUI.php';
2027  $navigationToolbarGUI = new ilTestNavigationToolbarGUI($this->ctrl, $this->lng, $this);
2028 
2029  $navigationToolbarGUI->setSuspendTestButtonEnabled($this->object->getShowCancel());
2030  $navigationToolbarGUI->setQuestionTreeButtonEnabled($this->object->getListOfQuestions());
2031  $navigationToolbarGUI->setQuestionTreeVisible($ilUser->getPref('side_list_of_questions'));
2032  $navigationToolbarGUI->setQuestionListButtonEnabled($this->object->getListOfQuestions());
2033  $navigationToolbarGUI->setFinishTestCommand($this->getFinishTestCommand());
2034 
2035  return $navigationToolbarGUI;
2036  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller 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 2428 of file class.ilTestPlayerAbstractGUI.php.

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

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

2429  {
2430  if ($this->getAnswerChangedParameter()) {
2431  $this->saveQuestionSolution(false);
2432  } else {
2433  $this->removeIntermediateSolution();
2434  }
2436  }
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

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

References getLockParameter().

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

1875  {
1876  if ($this->ctrl->getNextClass() == 'iltestpasswordprotectiongui') {
1877  return;
1878  }
1879 
1880  if (!$this->passwordChecker->isPasswordProtectionPageRedirectRequired()) {
1881  return;
1882  }
1883 
1884  $this->ctrl->setParameter($this, 'lock', $this->getLockParameter());
1885 
1886  $nextCommand = $this->ctrl->getCmdClass() . '::' . $this->ctrl->getCmd();
1887  $this->ctrl->setParameterByClass('ilTestPasswordProtectionGUI', 'nextCommand', $nextCommand);
1888  $this->ctrl->redirectByClass('ilTestPasswordProtectionGUI', 'showPasswordForm');
1889  }
+ 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 1920 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by ilTestOutputGUI\saveQuestionSolution(), and ilTestPlayerDynamicQuestionSetGUI\saveQuestionSolution().

1921  {
1922  $questionList = $this->buildTestPassQuestionList();
1923  $questionList->load();
1924 
1925  $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true);
1926 
1927  require_once 'Modules/Test/classes/class.ilTestSkillEvaluation.php';
1928  $skillEvaluation = new ilTestSkillEvaluation($this->db, $this->object->getTestId(), $this->object->getRefId());
1929 
1930  $skillEvaluation->setUserId($testSession->getUserId());
1931  $skillEvaluation->setActiveId($testSession->getActiveId());
1932  $skillEvaluation->setPass($testSession->getPass());
1933 
1934  $skillEvaluation->setNumRequiredBookingsForSkillTriggering($this->assSettings->get(
1935  'ass_skl_trig_num_answ_barrier',
1937  ));
1938 
1939 
1940  $skillEvaluation->init($questionList);
1941  $skillEvaluation->evaluate($testResults);
1942 
1943  $skillEvaluation->handleSkillTriggering();
1944  }
+ 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 2542 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, $ilLog, and ilTestPlayerCommands\SHOW_QUESTION.

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

2543  {
2544  global $DIC;
2545  $ilLog = $DIC['ilLog'];
2546 
2547  $ilLog->write(
2548  "INV SEQ:"
2549  . "active={$this->testSession->getActiveId()} "
2550  . "qId=$questionId seq=$sequenceElement "
2551  . serialize($this->testSequence)
2552  );
2553 
2554  $ilLog->logStack('INV SEQ');
2555 
2556  $this->ctrl->setParameter($this, 'sequence', $this->testSequence->getFirstSequence());
2557  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
2558  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ handleUserSettings()

ilTestPlayerAbstractGUI::handleUserSettings ( )

Handles some form parameters on starting and resuming a test.

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

References $_POST, $DIC, and $ilUser.

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

520  {
521  global $DIC;
522  $ilUser = $DIC['ilUser'];
523 
524  if ($_POST["chb_javascript"]) {
525  $ilUser->writePref("tst_javascript", 1);
526  } else {
527  $ilUser->writePref("tst_javascript", 0);
528  }
529 
530  // hide previous results
531  if ($this->object->getNrOfTries() != 1) {
532  if ($this->object->getUsePreviousAnswers() == 1) {
533  if ($_POST["chb_use_previous_answers"]) {
534  $ilUser->writePref("tst_use_previous_answers", 1);
535  } else {
536  $ilUser->writePref("tst_use_previous_answers", 0);
537  }
538  }
539  }
540  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
$_POST["username"]
+ Here is the caller graph for this function:

◆ initAssessmentSettings()

ilTestPlayerAbstractGUI::initAssessmentSettings ( )
protected

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

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

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

◆ initProcessLocker()

ilTestPlayerAbstractGUI::initProcessLocker (   $activeId)
protected

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

References $DIC, and $ilDB.

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

137  {
138  global $DIC;
139  $ilDB = $DIC['ilDB'];
140 
141  require_once 'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
142  $processLockerFactory = new ilTestProcessLockerFactory($this->assSettings, $ilDB);
143  $this->processLocker = $processLockerFactory->withContextId((int) $activeId)->getLocker();
144  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ 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 479 of file class.ilTestPlayerAbstractGUI.php.

References ilTestPlayerCommands\DISPLAY_ACCESS_CODE, showMaximumAllowedUsersReachedMessage(), and ilTestPlayerCommands\START_TEST.

480  {
481  if ($this->object->checkMaximumAllowedUsers() == false) {
483  }
484 
485  if ($this->testSession->isAnonymousUser() && !$this->testSession->getActiveId()) {
486  $accessCode = $this->testSession->createNewAccessCode();
487 
488  $this->testSession->setAccessCodeToSession($accessCode);
489  $this->testSession->setAnonymousId($accessCode);
490  $this->testSession->saveToDb();
491 
492  $this->ctrl->redirect($this, ilTestPlayerCommands::DISPLAY_ACCESS_CODE);
493  }
494 
495  $this->testSession->unsetAccessCodeInSession();
496  $this->ctrl->redirect($this, ilTestPlayerCommands::START_TEST);
497  }
+ Here is the call graph for this function:

◆ initTestPageTemplate()

ilTestPlayerAbstractGUI::initTestPageTemplate ( )
protected

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

References getContentBlockName().

Referenced by prepareTestPage().

1852  {
1853  $this->tpl->addBlockFile(
1854  $this->getContentBlockName(),
1855  'adm_content',
1856  'tpl.il_as_tst_output.html',
1857  'Modules/Test'
1858  );
1859  }
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:

◆ initTestQuestionConfig()

ilTestPlayerAbstractGUI::initTestQuestionConfig ( assQuestion  $questionOBJ)
protected

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

References assQuestion\getTestPresentationConfig().

Referenced by getQuestionGuiInstance(), and getQuestionInstance().

2531  {
2532  $questionOBJ->getTestPresentationConfig()->setPreviousPassSolutionReuseAllowed(
2533  $this->object->isPreviousSolutionReuseEnabled($this->testSession->getActiveId())
2534  );
2535  }
getTestPresentationConfig()
Get the test question configuration (initialised once)
+ 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 2801 of file class.ilTestPlayerAbstractGUI.php.

References $_SESSION, $config, ilTestPlayerCommands\AUTO_SAVE, ilTestPlayerCommands\AUTO_SAVE_ON_TIME_LIMIT, ilTestPlayerCommands\DETECT_CHANGES, and getAnswerChangedParameter().

Referenced by populateNextLocksChangedModal().

2802  {
2803  if (!isset($_SESSION[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM])) {
2804  return false;
2805  }
2806 
2807  return $_SESSION[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM];
2808  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isForcedFeedbackNavUrlRegistered()

ilTestPlayerAbstractGUI::isForcedFeedbackNavUrlRegistered ( )
protected

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

References getRegisteredForcedFeedbackNavUrl().

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

2892  {
2893  return !empty($this->getRegisteredForcedFeedbackNavUrl());
2894  }
+ 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 211 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, and $ilUser.

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

212  {
213  global $DIC;
214  $ilUser = $DIC['ilUser'];
215  $active_id = $this->testSession->getActiveId();
216  $starting_time = $this->object->getStartingTimeOfUser($active_id);
217  if ($starting_time === false) {
218  return false;
219  } else {
220  return $this->object->isMaxProcessingTimeReached($starting_time, $active_id);
221  }
222  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ isNrOfTriesReached()

ilTestPlayerAbstractGUI::isNrOfTriesReached ( )

nr of tries exceeded

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

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

1386  {
1387  return $this->object->hasNrOfTriesRestriction() && $this->object->isNrOfTriesReached($this->testSession->getPass());
1388  }
+ 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 1891 of file class.ilTestPlayerAbstractGUI.php.

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

1892  {
1893  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->testSequence->isQuestionChecked($questionId)) {
1894  return true;
1895  }
1896 
1897  if ($this->object->isFollowupQuestionAnswerFixationEnabled() && $this->testSequence->isNextQuestionPresented($questionId)) {
1898  return true;
1899  }
1900 
1901  return false;
1902  }
+ 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 1374 of file class.ilTestPlayerAbstractGUI.php.

References isMaxProcessingTimeReached(), and isNrOfTriesReached().

1375  {
1376  return !$this->isNrOfTriesReached()
1377  and !$this->isMaxProcessingTimeReached()
1378  and $this->object->startingTimeReached()
1379  and !$this->object->endingTimeReached();
1380  }
endingTimeReached()
handle endingTimeReached
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
+ Here is the call graph for this function:

◆ isTestSignRedirectRequired()

ilTestPlayerAbstractGUI::isTestSignRedirectRequired (   $activeId,
  $lastFinishedPass 
)
protected

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

References $DIC, ilSession\get(), and IL_COMP_MODULE.

Referenced by afterTestPassFinishedCmd().

870  {
871  if (!$this->object->getSignSubmission()) {
872  return false;
873  }
874 
875  if (!is_null(ilSession::get("signed_{$activeId}_{$lastFinishedPass}"))) {
876  return false;
877  }
878 
879  global $DIC;
880  $ilPluginAdmin = $DIC['ilPluginAdmin'];
881 
882  $activePlugins = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig');
883 
884  if (!count($activePlugins)) {
885  return false;
886  }
887 
888  return true;
889  }
static get($a_var)
Get a value.
const IL_COMP_MODULE
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ markQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::markQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and markQuestionCmd().

672  {
673  // fau: testNav - handle intermediate submit when marking the question
674  $this->handleIntermediateSubmit();
675  // fau.
676  $this->markQuestionCmd();
677  }
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 682 of file class.ilTestPlayerAbstractGUI.php.

References getCurrentSequenceElement(), and ilTestPlayerCommands\SHOW_QUESTION.

Referenced by markQuestionAndSaveIntermediateCmd().

683  {
684  $questionId = $this->testSequence->getQuestionForSequence(
686  );
687 
688  $this->object->setQuestionSetSolved(1, $questionId, $this->testSession->getUserId());
689 
690  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
691  }
+ 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 1412 of file class.ilTestPlayerAbstractGUI.php.

References suspendTestCmd().

Referenced by prepareTestPage().

1413  {
1414  $this->suspendTestCmd();
1415  }
+ 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 1663 of file class.ilTestPlayerAbstractGUI.php.

References $_GET, ilObjStyleSheet\getContentStylePath(), ilTestServiceGUI\getCorrectSolutionOutput(), ilUtil\getStyleSheetLocation(), and ilObjStyleSheet\getSyntaxStylePath().

1664  {
1665  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1666 
1667  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1668  $this->tpl->setCurrentBlock("ContentStyle");
1669  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1670  $this->tpl->parseCurrentBlock();
1671 
1672  $this->tpl->setCurrentBlock("SyntaxStyle");
1673  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1674  $this->tpl->parseCurrentBlock();
1675 
1676  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1677  if ($this->object->getShowSolutionAnswersOnly()) {
1678  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1679  }
1680 
1681  $this->tpl->setCurrentBlock("adm_content");
1682  $solution = $this->getCorrectSolutionOutput($_GET["evaluation"], $_GET["active_id"], $_GET["pass"]);
1683  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1684  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1685  $this->ctrl->saveParameter($this, "pass");
1686  $this->ctrl->saveParameter($this, "active_id");
1687  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1688  $this->tpl->parseCurrentBlock();
1689  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
static getSyntaxStylePath()
get syntax style path
+ Here is the call graph for this function:

◆ outObligationsOnlySummaryCmd()

ilTestPlayerAbstractGUI::outObligationsOnlySummaryCmd ( )

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

References outQuestionSummaryCmd().

1637  {
1638  return $this->outQuestionSummaryCmd(true, true, true, true);
1639  }
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 1440 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, $ilUser, ilDatePresentation\formatDate(), IL_CAL_FKT_GETDATE, IL_CAL_TIMESTAMP, IL_CAL_UNIX, and iljQueryUtil\initjQuery().

Referenced by outQuestionSummaryCmd(), prepareTestPage(), and ilTestPlayerDynamicQuestionSetGUI\showQuestionSelectionCmd().

1441  {
1442  global $DIC;
1443  $ilUser = $DIC['ilUser'];
1444 
1445  $starting_time = $this->object->getStartingTimeOfUser($active_id);
1446  $processing_time = $this->object->getProcessingTimeInSeconds($active_id);
1447  $processing_time_minutes = floor($processing_time / 60);
1448  $processing_time_seconds = $processing_time - $processing_time_minutes * 60;
1449  $str_processing_time = "";
1450  if ($processing_time_minutes > 0) {
1451  $str_processing_time = $processing_time_minutes . " " . ($processing_time_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1452  }
1453  if ($processing_time_seconds > 0) {
1454  if (strlen($str_processing_time) > 0) {
1455  $str_processing_time .= " " . $this->lng->txt("and") . " ";
1456  }
1457  $str_processing_time .= $processing_time_seconds . " " . ($processing_time_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1458  }
1459  $time_left = $starting_time + $processing_time - time();
1460  $time_left_minutes = floor($time_left / 60);
1461  $time_left_seconds = $time_left - $time_left_minutes * 60;
1462  $str_time_left = "";
1463  if ($time_left_minutes > 0) {
1464  $str_time_left = $time_left_minutes . " " . ($time_left_minutes == 1 ? $this->lng->txt("minute") : $this->lng->txt("minutes"));
1465  }
1466  if ($time_left < 300) {
1467  if ($time_left_seconds > 0) {
1468  if (strlen($str_time_left) > 0) {
1469  $str_time_left .= " " . $this->lng->txt("and") . " ";
1470  }
1471  $str_time_left .= $time_left_seconds . " " . ($time_left_seconds == 1 ? $this->lng->txt("second") : $this->lng->txt("seconds"));
1472  }
1473  }
1474  $date = getdate($starting_time);
1475  $formattedStartingTime = ilDatePresentation::formatDate(new ilDateTime($date, IL_CAL_FKT_GETDATE));
1476  $datenow = getdate();
1477  $this->tpl->setCurrentBlock("enableprocessingtime");
1478  $this->tpl->setVariable(
1479  "USER_WORKING_TIME",
1480  sprintf(
1481  $this->lng->txt("tst_time_already_spent"),
1482  $formattedStartingTime,
1483  $str_processing_time
1484  )
1485  );
1486  $this->tpl->setVariable("USER_REMAINING_TIME", sprintf($this->lng->txt("tst_time_already_spent_left"), $str_time_left));
1487  $this->tpl->parseCurrentBlock();
1488 
1489  // jQuery is required by tpl.workingtime.js
1490  require_once "./Services/jQuery/classes/class.iljQueryUtil.php";
1492  $template = new ilTemplate("tpl.workingtime.js", true, true, 'Modules/Test');
1493  $template->setVariable("STRING_MINUTE", $this->lng->txt("minute"));
1494  $template->setVariable("STRING_MINUTES", $this->lng->txt("minutes"));
1495  $template->setVariable("STRING_SECOND", $this->lng->txt("second"));
1496  $template->setVariable("STRING_SECONDS", $this->lng->txt("seconds"));
1497  $template->setVariable("STRING_TIMELEFT", $this->lng->txt("tst_time_already_spent_left"));
1498  $template->setVariable("AND", strtolower($this->lng->txt("and")));
1499  $template->setVariable("YEAR", $date["year"]);
1500  $template->setVariable("MONTH", $date["mon"] - 1);
1501  $template->setVariable("DAY", $date["mday"]);
1502  $template->setVariable("HOUR", $date["hours"]);
1503  $template->setVariable("MINUTE", $date["minutes"]);
1504  $template->setVariable("SECOND", $date["seconds"]);
1505  if ($this->object->isEndingTimeEnabled()) {
1506  $date_time = new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX);
1507  preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $date_time->get(IL_CAL_TIMESTAMP), $matches);
1508  $template->setVariable("ENDYEAR", $matches[1]);
1509  $template->setVariable("ENDMONTH", $matches[2] - 1);
1510  $template->setVariable("ENDDAY", $matches[3]);
1511  $template->setVariable("ENDHOUR", $matches[4]);
1512  $template->setVariable("ENDMINUTE", $matches[5]);
1513  $template->setVariable("ENDSECOND", $matches[6]);
1514  }
1515  $template->setVariable("YEARNOW", $datenow["year"]);
1516  $template->setVariable("MONTHNOW", $datenow["mon"] - 1);
1517  $template->setVariable("DAYNOW", $datenow["mday"]);
1518  $template->setVariable("HOURNOW", $datenow["hours"]);
1519  $template->setVariable("MINUTENOW", $datenow["minutes"]);
1520  $template->setVariable("SECONDNOW", $datenow["seconds"]);
1521  $template->setVariable("PTIME_M", $processing_time_minutes);
1522  $template->setVariable("PTIME_S", $processing_time_seconds);
1523  if ($this->ctrl->getCmd() == 'outQuestionSummary') {
1524  $template->setVariable("REDIRECT_URL", $this->ctrl->getFormAction($this, 'redirectAfterDashboard'));
1525  } else {
1526  $template->setVariable("REDIRECT_URL", "");
1527  }
1528  $this->tpl->addOnLoadCode($template->get());
1529  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$ilUser
Definition: imgupload.php:18
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
$DIC
Definition: xapitoken.php:46
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 1566 of file class.ilTestPlayerAbstractGUI.php.

References $_GET, ilObjTest\allObligationsAnswered(), getContentBlockName(), getKioskHead(), isQuestionSummaryFinishTestButtonRequired(), ilObjTest\lookupExamId(), outProcessingTime(), and ilUtil\sendFailure().

Referenced by outObligationsOnlySummaryCmd(), and outQuestionSummaryWithObligationsInfoCmd().

1567  {
1568  if ($fullpage) {
1569  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_question_summary.html", "Modules/Test");
1570  }
1571 
1572  $obligationsFulfilled = \ilObjTest::allObligationsAnswered(
1573  $this->object->getId(),
1574  $this->testSession->getActiveId(),
1575  $this->testSession->getPass()
1576  );
1577 
1578  if ($obligationsInfo && $this->object->areObligationsEnabled() && !$obligationsFulfilled) {
1579  ilUtil::sendFailure($this->lng->txt('not_all_obligations_answered'));
1580  }
1581 
1582  if ($this->object->getKioskMode() && $fullpage) {
1583  $head = $this->getKioskHead();
1584  if (strlen($head)) {
1585  $this->tpl->setCurrentBlock("kiosk_options");
1586  $this->tpl->setVariable("KIOSK_HEAD", $head);
1587  $this->tpl->parseCurrentBlock();
1588  }
1589  }
1590 
1591 
1592  $active_id = $this->testSession->getActiveId();
1593  $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, $obligationsFilter);
1594 
1595  $this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
1596 
1597  if ($fullpage) {
1598  include_once "./Modules/Test/classes/tables/class.ilListOfQuestionsTableGUI.php";
1599  $table_gui = new ilListOfQuestionsTableGUI($this, 'showQuestion');
1600 
1601  $table_gui->setShowPointsEnabled(!$this->object->getTitleOutput());
1602  $table_gui->setShowMarkerEnabled($this->object->getShowMarker());
1603  $table_gui->setObligationsNotAnswered(!$obligationsFulfilled);
1604  $table_gui->setShowObligationsEnabled($this->object->areObligationsEnabled());
1605  $table_gui->setObligationsFilterEnabled($obligationsFilter);
1606  $table_gui->setFinishTestButtonEnabled($this->isQuestionSummaryFinishTestButtonRequired());
1607 
1608  $table_gui->init();
1609 
1610  $table_gui->setData($questionSummaryData);
1611 
1612  $this->tpl->setVariable('TABLE_LIST_OF_QUESTIONS', $table_gui->getHTML());
1613 
1614  if ($this->object->getEnableProcessingTime()) {
1615  $this->outProcessingTime($active_id);
1616  }
1617 
1618  if ($this->object->isShowExamIdInTestPassEnabled()) {
1619  $this->tpl->setCurrentBlock('exam_id_footer');
1620  $this->tpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1621  $this->testSession->getActiveId(),
1622  $this->testSession->getPass(),
1623  $this->object->getId()
1624  ));
1625  $this->tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1626  $this->tpl->parseCurrentBlock();
1627  }
1628  }
1629  }
static allObligationsAnswered($test_id, $active_id, $pass)
checks wether all questions marked as obligatory were answered within the test pass with given testId...
$_GET["client_id"]
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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 1631 of file class.ilTestPlayerAbstractGUI.php.

References outQuestionSummaryCmd().

1632  {
1633  return $this->outQuestionSummaryCmd(true, true, true, false);
1634  }
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 1786 of file class.ilTestPlayerAbstractGUI.php.

1787  {
1788  $this->ctrl->redirectByClass(
1789  array('ilRepositoryGUI', 'ilObjTestGUI', 'ilTestEvaluationGUI'),
1790  "outUserResultsOverview"
1791  );
1792  }

◆ performTestPassFinishedTasks()

ilTestPlayerAbstractGUI::performTestPassFinishedTasks (   $finishedPass)
protected

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

References ilTestPassFinishTasks\performFinishTasks().

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

828  {
829  require_once 'Modules/Test/classes/class.ilTestPassFinishTasks.php';
830 
831  $finishTasks = new ilTestPassFinishTasks($this->testSession->getActiveId(), $this->object->getId());
832  $finishTasks->performFinishTasks($this->processLocker);
833  }
Class ilTestPassFinishTasks.
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 2000 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by showQuestionEditable().

2001  {
2002  global $DIC;
2003  $ilSetting = $DIC['ilSetting'];
2004 
2005  if ($ilSetting->get('char_selector_availability') > 0) {
2006  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
2007  $char_selector = ilCharSelectorGUI::_getCurrentGUI($this->object);
2008  if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
2009  $char_selector->addToPage();
2010  $this->tpl->setCurrentBlock('char_selector');
2011  $this->tpl->setVariable("CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
2012  $this->tpl->parseCurrentBlock();
2013 
2014  return true;
2015  }
2016  }
2017 
2018  return false;
2019  }
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
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateContentStyleBlock()

ilTestPlayerAbstractGUI::populateContentStyleBlock ( )
protected

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

References ilObjStyleSheet\getContentStylePath().

Referenced by prepareTestPage().

409  {
410  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
411  $this->tpl->setCurrentBlock("ContentStyle");
412  $this->tpl->setVariable(
413  "LOCATION_CONTENT_STYLESHEET",
415  );
416  $this->tpl->parseCurrentBlock();
417  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateDiscardSolutionModal()

ilTestPlayerAbstractGUI::populateDiscardSolutionModal ( )
protected

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

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

Referenced by populateModals().

2592  {
2593  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2594 
2595  $tpl->setVariable('CONFIRMATION_TEXT', $this->lng->txt('discard_answer_confirmation'));
2596 
2597  $button = ilSubmitButton::getInstance();
2598  $button->setCommand(ilTestPlayerCommands::DISCARD_SOLUTION);
2599  $button->setCaption('discard_answer');
2600  $tpl->setCurrentBlock('buttons');
2601  $tpl->setVariable('BUTTON', $button->render());
2602  $tpl->parseCurrentBlock();
2603 
2604  $button = ilLinkButton::getInstance();
2605  $button->setId('tst_cancel_discard_button');
2606  $button->setCaption('cancel');
2607  $button->setPrimary(true);
2608  $tpl->setCurrentBlock('buttons');
2609  $tpl->setVariable('BUTTON', $button->render());
2610  $tpl->parseCurrentBlock();
2611 
2612  $modal = ilModalGUI::getInstance();
2613  $modal->setId('tst_discard_solution_modal');
2614  $modal->setHeading($this->lng->txt('discard_answer'));
2615  $modal->setBody($tpl->get());
2616 
2617  $this->tpl->setCurrentBlock('discard_solution_modal');
2618  $this->tpl->setVariable('DISCARD_SOLUTION_MODAL', $modal->getHTML());
2619  $this->tpl->parseCurrentBlock();
2620 
2621  // fau: testNav - the discard solution modal is now handled by ilTestPlayerNavigationControl.js
2622 // $this->tpl->addJavaScript('Modules/Test/js/ilTestPlayerDiscardSolutionModal.js', true);
2623 // fau.
2624  }
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFeedbackBlockHeader()

ilTestPlayerAbstractGUI::populateFeedbackBlockHeader (   $withFocusAnchor)
protected

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

Referenced by populateInstantResponseBlocks().

2312  {
2313  if ($withFocusAnchor) {
2314  $this->tpl->setCurrentBlock('inst_resp_id');
2315  $this->tpl->setVariable('INSTANT_RESPONSE_FOCUS_ID', 'focus');
2316  $this->tpl->parseCurrentBlock();
2317  }
2318 
2319  $this->tpl->setCurrentBlock('instant_response_header');
2320  $this->tpl->setVariable('INSTANT_RESPONSE_HEADER', $this->lng->txt('tst_feedback'));
2321  $this->tpl->parseCurrentBlock();
2322  }
+ Here is the caller graph for this function:

◆ populateGenericFeedbackBlock()

ilTestPlayerAbstractGUI::populateGenericFeedbackBlock ( assQuestionGUI  $question_gui,
  $solutionCorrect 
)
protected

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

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

Referenced by populateInstantResponseBlocks().

359  {
360  $feedback = $question_gui->getGenericFeedbackOutput($this->testSession->getActiveId(), null);
361 
362  if (strlen($feedback)) {
363  $cssClass = (
364  $solutionCorrect ?
366  );
367 
368  $this->tpl->setCurrentBlock("answer_feedback");
369  $this->tpl->setVariable("ANSWER_FEEDBACK", $feedback);
370  $this->tpl->setVariable("ILC_FB_CSS_CLASS", $cssClass);
371  $this->tpl->parseCurrentBlock();
372  }
373  }
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
+ 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 1985 of file class.ilTestPlayerAbstractGUI.php.

References getContentBlockName().

Referenced by confirmFinishCmd(), and showAnswerOptionalQuestionsConfirmation().

1986  {
1987  if ($this->object->getKioskMode()) {
1988  //$this->tpl->setBodyClass("kiosk");
1989  $this->tpl->hideFooter();
1990  $this->tpl->addBlockfile('CONTENT', 'adm_content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
1991  $this->tpl->setContent($this->ctrl->getHTML($helperGui));
1992  } else {
1993  $this->tpl->setVariable($this->getContentBlockName(), $this->ctrl->getHTML($helperGui));
1994  }
1995  }
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
Parameters
assQuestionGUI$questionGui

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

References determineInlineScoreDisplay(), assQuestionGUI\getSolutionOutput(), assQuestionGUI\hasInlineFeedback(), populateFeedbackBlockHeader(), populateGenericFeedbackBlock(), populateScoreBlock(), populateSolutionBlock(), and populateSpecificFeedbackBlock().

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

2256  {
2258  !$this->object->getSpecificAnswerFeedback() || !$questionGui->hasInlineFeedback()
2259  );
2260 
2261  // This controls if the solution should be shown.
2262  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2263  if ($this->object->getInstantFeedbackSolution()) {
2264  $show_question_inline_score = $this->determineInlineScoreDisplay();
2265 
2266  // Notation of the params prior to getting rid of this crap in favor of a class
2267  $solutionoutput = $questionGui->getSolutionOutput(
2268  $this->testSession->getActiveId(), #active_id
2269  null, #pass
2270  false, #graphical_output
2271  $show_question_inline_score, #result_output
2272  true, #show_question_only
2273  false, #show_feedback
2274  true, #show_correct_solution
2275  false, #show_manual_scoring
2276  false #show_question_text
2277  );
2278  $solutionoutput = str_replace('<h1 class="ilc_page_title_PageTitle"></h1>', '', $solutionoutput);
2279  $this->populateSolutionBlock($solutionoutput);
2280  }
2281 
2282  $reachedPoints = $questionGui->object->getAdjustedReachedPoints(
2283  $this->testSession->getActiveId(),
2284  null,
2285  $authorizedSolution
2286  );
2287 
2288  $maxPoints = $questionGui->object->getMaximumPoints();
2289 
2290  $solutionCorrect = ($reachedPoints == $maxPoints);
2291 
2292  // This controls if the score should be shown.
2293  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
2294  if ($this->object->getAnswerFeedbackPoints()) {
2295  $this->populateScoreBlock($reachedPoints, $maxPoints);
2296  }
2297 
2298  // This controls if the generic feedback should be shown.
2299  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
2300  if ($this->object->getGenericAnswerFeedback()) {
2301  $this->populateGenericFeedbackBlock($questionGui, $solutionCorrect);
2302  }
2303 
2304  // This controls if the specific feedback should be shown.
2305  // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
2306  if ($this->object->getSpecificAnswerFeedback()) {
2307  $this->populateSpecificFeedbackBlock($questionGui);
2308  }
2309  }
populateSpecificFeedbackBlock(assQuestionGUI $question_gui)
hasInlineFeedback()
this method can be overwritten per question type
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
Parameters
assQuestionGUI$questionGui

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

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

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

2196  {
2197  $questionGui->setNavigationGUI(null);
2198  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true);
2199 
2200  $answerFeedbackEnabled = $this->object->getSpecificAnswerFeedback();
2201 
2202  $solutionoutput = $questionGui->getSolutionOutput(
2203  $this->testSession->getActiveId(), #active_id
2204  $this->testSession->getPass(), #pass
2205  false, #graphical_output
2206  false, #result_output
2207  true, #show_question_only
2208  $answerFeedbackEnabled, #show_feedback
2209  false, #show_correct_solution
2210  false, #show_manual_scoring
2211  true #show_question_text
2212  );
2213 
2214  $pageoutput = $questionGui->outQuestionPage(
2215  "",
2216  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
2217  $this->testSession->getActiveId(),
2218  $solutionoutput
2219  );
2220 
2221  $tpl = new ilTemplate('tpl.tst_player_response_modal.html', true, true, 'Modules/Test');
2222 
2223  // populate the instant response blocks in the
2224  $saved_tpl = $this->tpl;
2225  $this->tpl = $tpl;
2226  $this->populateInstantResponseBlocks($questionGui, true);
2227  $this->tpl = $saved_tpl;
2228 
2229  $tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
2230 
2231  $button = ilLinkButton::getInstance();
2232  $button->setId('tst_confirm_feedback');
2233  $button->setUrl($navUrl);
2234  $button->setCaption('proceed');
2235  $button->setPrimary(true);
2236  $tpl->setVariable('BUTTON', $button->render());
2237 
2238 
2239  require_once('Services/UIComponent/Modal/classes/class.ilModalGUI.php');
2240  $modal = ilModalGUI::getInstance();
2241  $modal->setType(ilModalGUI::TYPE_LARGE);
2242  $modal->setId('tst_question_feedback_modal');
2243  $modal->setHeading($this->lng->txt('tst_instant_feedback'));
2244  $modal->setBody($tpl->get());
2245 
2246  $this->tpl->addOnLoadCode("$('#tst_question_feedback_modal').modal('show');");
2247  $this->tpl->setVariable('INSTANT_RESPONSE_MODAL', $modal->getHTML());
2248  }
populateInstantResponseBlocks(assQuestionGUI $questionGui, $authorizedSolution)
isShowingPostponeStatusReguired($questionId)
static getInstance()
Get instance.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
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($navigationGUI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateKioskHead()

ilTestPlayerAbstractGUI::populateKioskHead ( )
protected

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

References getKioskHead(), and ilUtil\sendInfo().

Referenced by prepareSummaryPage(), and prepareTestPage().

1862  {
1863  ilUtil::sendInfo(); // ???
1864 
1865  $head = $this->getKioskHead();
1866 
1867  if (strlen($head)) {
1868  $this->tpl->setCurrentBlock("kiosk_options");
1869  $this->tpl->setVariable("KIOSK_HEAD", $head);
1870  $this->tpl->parseCurrentBlock();
1871  }
1872  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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 264 of file class.ilTestPlayerAbstractGUI.php.

References buildNextButtonInstance().

Referenced by populateNextButtons().

265  {
266  $button = $this->buildNextButtonInstance($disabled, $primaryNext);
267  $button->setId('bottomnextbutton');
268 
269  $this->tpl->setCurrentBlock("next_bottom");
270  $this->tpl->setVariable("BTN_NEXT", $button->render());
271  $this->tpl->parseCurrentBlock();
272  }
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 284 of file class.ilTestPlayerAbstractGUI.php.

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

285  {
286  $button = $this->buildPreviousButtonInstance($disabled);
287  $button->setId('bottomprevbutton');
288 
289  $this->tpl->setCurrentBlock("prev_bottom");
290  $this->tpl->setVariable("BTN_PREV", $button->render());
291  $this->tpl->parseCurrentBlock();
292  }
+ 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 2563 of file class.ilTestPlayerAbstractGUI.php.

References getContentBlockName().

Referenced by ilTestPlayerDynamicQuestionSetGUI\showCheckedQuestionResettingConfirmation().

2564  {
2565  if ($this->object->getKioskMode()) {
2566  $this->tpl->addBlockfile($this->getContentBlockName(), 'content', "tpl.il_as_tst_kiosk_mode_content.html", "Modules/Test");
2567  $this->tpl->setContent($contentHTML);
2568  } else {
2569  $this->tpl->setVariable($this->getContentBlockName(), $contentHTML);
2570  }
2571  }
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:

◆ populateModals()

ilTestPlayerAbstractGUI::populateModals ( )
protected

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

References populateDiscardSolutionModal(), populateNavWhenChangedModal(), populateNextLocksChangedModal(), and populateNextLocksUnchangedModal().

Referenced by showQuestionEditable().

2574  {
2575  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
2576  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
2577  require_once 'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
2578 
2580  // fau: testNav - populateNavWhenChangedModal instead of populateNavWhileEditModal
2581  $this->populateNavWhenChangedModal();
2582  // fau.
2583 
2584  if ($this->object->isFollowupQuestionAnswerFixationEnabled()) {
2586 
2588  }
2589  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNavWhenChangedModal()

ilTestPlayerAbstractGUI::populateNavWhenChangedModal ( )
protected

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

References $_SESSION, ilTestServiceGUI\$tpl, ilLinkButton\getInstance(), and ilModalGUI\getInstance().

Referenced by populateModals().

2685  {
2686  return; // usibility fix: get rid of popup
2687 
2688  if (!empty($_SESSION['save_on_navigation_prevent_confirmation'])) {
2689  return;
2690  }
2691 
2692  $tpl = new ilTemplate('tpl.tst_player_confirmation_modal.html', true, true, 'Modules/Test');
2693 
2694  if ($this->object->isInstantFeedbackAnswerFixationEnabled() && $this->object->isForceInstantFeedbackEnabled()) {
2695  $text = $this->lng->txt('save_on_navigation_locked_confirmation');
2696  } else {
2697  $text = $this->lng->txt('save_on_navigation_confirmation');
2698  }
2699  if ($this->object->isForceInstantFeedbackEnabled()) {
2700  $text .= " " . $this->lng->txt('save_on_navigation_forced_feedback_hint');
2701  }
2702  $tpl->setVariable('CONFIRMATION_TEXT', $text);
2703 
2704 
2705  $button = ilLinkButton::getInstance();
2706  $button->setId('tst_save_on_navigation_button');
2707  $button->setUrl('#');
2708  $button->setCaption('tst_save_and_proceed');
2709  $button->setPrimary(true);
2710  $tpl->setCurrentBlock('buttons');
2711  $tpl->setVariable('BUTTON', $button->render());
2712  $tpl->parseCurrentBlock();
2713 
2714  $button = ilLinkButton::getInstance();
2715  $button->setId('tst_cancel_on_navigation_button');
2716  $button->setUrl('#');
2717  $button->setCaption('cancel');
2718  $button->setPrimary(false);
2719  $tpl->setCurrentBlock('buttons');
2720  $tpl->setVariable('BUTTON', $button->render());
2721  $tpl->parseCurrentBlock();
2722 
2723  $tpl->setCurrentBlock('checkbox');
2724  $tpl->setVariable('CONFIRMATION_CHECKBOX_NAME', 'save_on_navigation_prevent_confirmation');
2725  $tpl->setVariable('CONFIRMATION_CHECKBOX_LABEL', $this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2726  $tpl->parseCurrentBlock();
2727 
2728  $modal = ilModalGUI::getInstance();
2729  $modal->setId('tst_save_on_navigation_modal');
2730  $modal->setHeading($this->lng->txt('save_on_navigation'));
2731  $modal->setBody($tpl->get());
2732 
2733  $this->tpl->setCurrentBlock('nav_while_edit_modal');
2734  $this->tpl->setVariable('NAV_WHILE_EDIT_MODAL', $modal->getHTML());
2735  $this->tpl->parseCurrentBlock();
2736  }
$_SESSION["AccountId"]
static getInstance()
Get instance.
+ 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 258 of file class.ilTestPlayerAbstractGUI.php.

References populateLowerNextButtonBlock(), and populateUpperNextButtonBlock().

Referenced by populateQuestionNavigation(), and ilTestPlayerDynamicQuestionSetGUI\populateQuestionNavigation().

259  {
260  $this->populateUpperNextButtonBlock($disabled, $primaryNext);
261  $this->populateLowerNextButtonBlock($disabled, $primaryNext);
262  }
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 2763 of file class.ilTestPlayerAbstractGUI.php.

References isFollowUpQuestionLocksConfirmationPrevented().

Referenced by populateModals().

2764  {
2766  return;
2767  }
2768 
2769  require_once 'Modules/Test/classes/class.ilTestPlayerConfirmationModal.php';
2770  $modal = new ilTestPlayerConfirmationModal();
2771  $modal->setModalId('tst_next_locks_changed_modal');
2772 
2773  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_current_answer_header'));
2774  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_current_answer_confirm'));
2775 
2776  $modal->setConfirmationCheckboxName(self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM);
2777  $modal->setConfirmationCheckboxLabel($this->lng->txt('tst_dont_show_msg_again_in_current_session'));
2778 
2779  $button = $modal->buildModalButtonInstance('tst_nav_next_changed_answer_button');
2780  $button->setCaption('tst_save_and_proceed');
2781  $button->setPrimary(true);
2782  $modal->addButton($button);
2783 
2784  $button = $modal->buildModalButtonInstance('tst_cancel_next_changed_answer_button');
2785  $button->setCaption('cancel');
2786  $button->setPrimary(false);
2787  $modal->addButton($button);
2788 
2789  $this->tpl->setCurrentBlock('next_locks_changed_modal');
2790  $this->tpl->setVariable('NEXT_LOCKS_CHANGED_MODAL', $modal->getHTML());
2791  $this->tpl->parseCurrentBlock();
2792  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNextLocksUnchangedModal()

ilTestPlayerAbstractGUI::populateNextLocksUnchangedModal ( )
protected

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

Referenced by populateModals().

2740  {
2741  require_once 'Modules/Test/classes/class.ilTestPlayerConfirmationModal.php';
2742  $modal = new ilTestPlayerConfirmationModal();
2743  $modal->setModalId('tst_next_locks_unchanged_modal');
2744 
2745  $modal->setHeaderText($this->lng->txt('tst_nav_next_locks_empty_answer_header'));
2746  $modal->setConfirmationText($this->lng->txt('tst_nav_next_locks_empty_answer_confirm'));
2747 
2748  $button = $modal->buildModalButtonInstance('tst_nav_next_empty_answer_button');
2749  $button->setCaption('tst_proceed');
2750  $button->setPrimary(false);
2751  $modal->addButton($button);
2752 
2753  $button = $modal->buildModalButtonInstance('tst_cancel_next_empty_answer_button');
2754  $button->setCaption('cancel');
2755  $button->setPrimary(true);
2756  $modal->addButton($button);
2757 
2758  $this->tpl->setCurrentBlock('next_locks_unchanged_modal');
2759  $this->tpl->setVariable('NEXT_LOCKS_UNCHANGED_MODAL', $modal->getHTML());
2760  $this->tpl->parseCurrentBlock();
2761  }
+ Here is the caller graph for this function:

◆ populatePreviousButtons()

ilTestPlayerAbstractGUI::populatePreviousButtons (   $disabled)
protected

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

References populateLowerPreviousButtonBlock(), and populateUpperPreviousButtonBlock().

Referenced by populateQuestionNavigation().

253  {
254  $this->populateUpperPreviousButtonBlock($disabled);
255  $this->populateLowerPreviousButtonBlock($disabled);
256  }
+ 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 241 of file class.ilTestPlayerAbstractGUI.php.

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

Referenced by ilTestOutputGUI\showQuestionCmd().

242  {
243  if (!$this->isFirstQuestionInSequence($sequenceElement)) {
244  $this->populatePreviousButtons($disabled);
245  }
246 
247  if (!$this->isLastQuestionInSequence($sequenceElement)) {
248  $this->populateNextButtons($disabled, $primaryNext);
249  }
250  }
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 375 of file class.ilTestPlayerAbstractGUI.php.

Referenced by populateInstantResponseBlocks().

376  {
377  $scoreInformation = sprintf(
378  $this->lng->txt("you_received_a_of_b_points"),
379  $reachedPoints,
380  $maxPoints
381  );
382 
383  $this->tpl->setCurrentBlock("received_points_information");
384  $this->tpl->setVariable("RECEIVED_POINTS_INFORMATION", $scoreInformation);
385  $this->tpl->parseCurrentBlock();
386  }
+ Here is the caller graph for this function:

◆ populateSolutionBlock()

ilTestPlayerAbstractGUI::populateSolutionBlock (   $solutionoutput)
protected

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

Referenced by populateInstantResponseBlocks().

389  {
390  if (strlen($solutionoutput)) {
391  $this->tpl->setCurrentBlock("solution_output");
392  $this->tpl->setVariable("CORRECT_SOLUTION", $this->lng->txt("tst_best_solution_is"));
393  $this->tpl->setVariable("QUESTION_FEEDBACK", $solutionoutput);
394  $this->tpl->parseCurrentBlock();
395  }
396  }
+ Here is the caller graph for this function:

◆ populateSpecificFeedbackBlock()

ilTestPlayerAbstractGUI::populateSpecificFeedbackBlock ( assQuestionGUI  $question_gui)
protected

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

References assQuestionGUI\getSpecificFeedbackOutput().

Referenced by populateInstantResponseBlocks().

343  {
344  $solutionValues = $question_gui->object->getSolutionValues(
345  $this->testSession->getActiveId(),
346  null
347  );
348 
349  $feedback = $question_gui->getSpecificFeedbackOutput(
350  $question_gui->object->fetchIndexedValuesFromValuePairs($solutionValues)
351  );
352 
353  $this->tpl->setCurrentBlock("specific_feedback");
354  $this->tpl->setVariable("SPECIFIC_FEEDBACK", $feedback);
355  $this->tpl->parseCurrentBlock();
356  }
getSpecificFeedbackOutput($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 398 of file class.ilTestPlayerAbstractGUI.php.

References ilObjStyleSheet\getSyntaxStylePath().

Referenced by prepareTestPage().

399  {
400  $this->tpl->setCurrentBlock("SyntaxStyle");
401  $this->tpl->setVariable(
402  "LOCATION_SYNTAX_STYLESHEET",
404  );
405  $this->tpl->parseCurrentBlock();
406  }
static getSyntaxStylePath()
get syntax style path
+ 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 234 of file class.ilTestPlayerAbstractGUI.php.

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

235  {
236  $this->tpl->setCurrentBlock('test_nav_toolbar');
237  $this->tpl->setVariable('TEST_NAV_TOOLBAR', $toolbarGUI->getHTML());
238  $this->tpl->parseCurrentBlock();
239  }
+ Here is the caller graph for this function:

◆ populateUpperNextButtonBlock()

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

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

References buildNextButtonInstance().

Referenced by populateNextButtons().

275  {
276  $button = $this->buildNextButtonInstance($disabled, $primaryNext);
277  $button->setId('nextbutton');
278 
279  $this->tpl->setCurrentBlock("next");
280  $this->tpl->setVariable("BTN_NEXT", $button->render());
281  $this->tpl->parseCurrentBlock();
282  }
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 294 of file class.ilTestPlayerAbstractGUI.php.

References buildPreviousButtonInstance().

Referenced by populatePreviousButtons().

295  {
296  $button = $this->buildPreviousButtonInstance($disabled);
297  $button->setId('prevbutton');
298 
299  $this->tpl->setCurrentBlock("prev");
300  $this->tpl->setVariable("BTN_PREV", $button->render());
301  $this->tpl->parseCurrentBlock();
302  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareSummaryPage()

ilTestPlayerAbstractGUI::prepareSummaryPage ( )
protected

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

References getContentBlockName(), and populateKioskHead().

Referenced by ilTestPlayerDynamicQuestionSetGUI\showQuestionSelectionCmd().

1838  {
1839  $this->tpl->addBlockFile(
1840  $this->getContentBlockName(),
1841  'adm_content',
1842  'tpl.il_as_tst_question_summary.html',
1843  'Modules/Test'
1844  );
1845 
1846  if ($this->object->getKioskMode()) {
1847  $this->populateKioskHead();
1848  }
1849  }
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:

◆ prepareTestPage()

ilTestPlayerAbstractGUI::prepareTestPage (   $presentationMode,
  $sequenceElement,
  $questionId 
)
protected
Returns
string $formAction

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

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

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

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

References $url, ilObjTest\_getPass(), ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, getContentBlockName(), and performTestPassFinishedTasks().

547  {
548  $active_id = $this->testSession->getActiveId();
549  $actualpass = ilObjTest::_getPass($active_id);
550 
551  $this->performTestPassFinishedTasks($actualpass);
552 
553  $this->testSession->setLastFinishedPass($this->testSession->getPass());
554  $this->testSession->increaseTestPass();
555 
556  $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
557 
558  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
559  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
560  $this->tpl->setVariable("URL", $url);
561  }
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 563 of file class.ilTestPlayerAbstractGUI.php.

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

564  {
565  $active_id = $this->testSession->getActiveId();
566  $actualpass = ilObjTest::_getPass($active_id);
567 
568  $this->performTestPassFinishedTasks($actualpass);
569 
570  $this->testSession->setLastFinishedPass($this->testSession->getPass());
571  $this->testSession->increaseTestPass();
572 
573  $url = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED, '', false, false);
574 
575  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_redirect_autosave.html", "Modules/Test");
576  $this->tpl->setVariable("TEXT_REDIRECT", $this->lng->txt("redirectAfterSave"));
577  $this->tpl->setVariable("URL", $url);
578  }
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 1027 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, backToInfoScreenCmd(), and ilTestServiceGUI\getObjectiveOrientedContainer().

Referenced by afterTestPassFinishedCmd(), and endingTimeReached().

1028  {
1029  global $DIC; /* @var ILIAS\DI\Container $DIC */
1030  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1031  $testPassesSelector = new ilTestPassesSelector($DIC['ilDB'], $this->object);
1032  $testPassesSelector->setActiveId($this->testSession->getActiveId());
1033  $testPassesSelector->setLastFinishedPass($this->testSession->getLastFinishedPass());
1034 
1035  if (count($testPassesSelector->getReportablePasses())) {
1036  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1037  $this->ctrl->redirectByClass(array('ilTestResultsGUI', 'ilTestEvalObjectiveOrientedGUI'));
1038  }
1039 
1040  $this->ctrl->redirectByClass(array('ilTestResultsGUI', 'ilMyTestResultsGUI', 'ilTestEvaluationGUI'));
1041  }
1042 
1043  $this->backToInfoScreenCmd();
1044  }
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::registerForcedFeedbackNavUrl (   $forcedFeedbackNavUrl)
protected

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

References $_SESSION.

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

2870  {
2871  if (!isset($_SESSION['forced_feedback_navigation_url'])) {
2872  $_SESSION['forced_feedback_navigation_url'] = array();
2873  }
2874 
2875  $_SESSION['forced_feedback_navigation_url'][$this->testSession->getActiveId()] = $forcedFeedbackNavUrl;
2876  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ removeIntermediateSolution()

ilTestPlayerAbstractGUI::removeIntermediateSolution ( )

remove an auto-saved solution of the current question

Returns
mixed number of rows or db error

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

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

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

182  {
183  $questionId = $this->getCurrentQuestionId();
184 
185  $this->getQuestionInstance($questionId)->removeIntermediateSolution(
186  $this->testSession->getActiveId(),
187  $this->testSession->getPass()
188  );
189  }
getQuestionInstance($questionId, $fromCache=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetSequenceElementParameter()

ilTestPlayerAbstractGUI::resetSequenceElementParameter ( )
protected

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

References $_GET.

Referenced by ilTestPlayerDynamicQuestionSetGUI\resetQuestionIdParameter().

2334  {
2335  unset($_GET['sequence']);
2336  $this->ctrl->setParameter($this, 'sequence', null);
2337  }
$_GET["client_id"]
+ 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 1329 of file class.ilTestPlayerAbstractGUI.php.

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

1330  {
1331  $this->removeIntermediateSolution();
1332  $this->setAnswerChangedParameter(false);
1333  $this->ctrl->saveParameter($this, 'sequence');
1334  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
1335  }
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 2443 of file class.ilTestPlayerAbstractGUI.php.

References $_POST, and $_SESSION.

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

2444  {
2445  if (!empty($_POST['save_on_navigation_prevent_confirmation'])) {
2446  $_SESSION['save_on_navigation_prevent_confirmation'] = true;
2447  }
2448 
2449  if (!empty($_POST[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM])) {
2450  $_SESSION[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM] = true;
2451  }
2452  }
$_SESSION["AccountId"]
$_POST["username"]
+ 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(), 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 152 of file class.ilTestPlayerAbstractGUI.php.

153  {
154  include_once("./Services/Tagging/classes/class.ilTaggingGUI.php");
155  $tagging_gui = new ilTaggingGUI();
156  $tagging_gui->setObject($this->object->getId(), $this->object->getType());
157  $tagging_gui->saveInput();
158  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
159  }
Class ilTaggingGUI.

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

References $_POST.

425  {
426  if ($this->testSession->isAnonymousUser()) {
427  $this->testSession->setAccessCodeToSession($_POST['anonymous_id']);
428  }
429 
430  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
431  }
$_POST["username"]

◆ setAnswerChangedParameter()

ilTestPlayerAbstractGUI::setAnswerChangedParameter (   $changed = true)
protected

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

Parameters
bool$changed

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

References $changed.

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

2418  {
2419  $this->ctrl->setParameter($this, 'test_answer_changed', $changed ? '1' : '0');
2420  }
+ Here is the caller graph for this function:

◆ setFollowUpQuestionLocksConfirmationPrevented()

ilTestPlayerAbstractGUI::setFollowUpQuestionLocksConfirmationPrevented ( )
protected

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

References $_SESSION.

2797  {
2798  $_SESSION[self::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM] = true;
2799  }
$_SESSION["AccountId"]

◆ showAnswerOptionalQuestionsConfirmation()

ilTestPlayerAbstractGUI::showAnswerOptionalQuestionsConfirmation ( )
protected

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

References populateHelperGuiContent().

Referenced by prepareTestPage().

1949  {
1950  require_once 'Modules/Test/classes/confirmations/class.ilTestAnswerOptionalQuestionsConfirmationGUI.php';
1951  $confirmation = new ilTestAnswerOptionalQuestionsConfirmationGUI($this->lng);
1952 
1953  $confirmation->setFormAction($this->ctrl->getFormAction($this));
1954  $confirmation->setCancelCmd('cancelAnswerOptionalQuestions');
1955  $confirmation->setConfirmCmd('confirmAnswerOptionalQuestions');
1956 
1957  $confirmation->build($this->object->isFixedTest());
1958 
1959  $this->populateHelperGuiContent($confirmation);
1960  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showFinalStatementCmd()

ilTestPlayerAbstractGUI::showFinalStatementCmd ( )

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

References ilTestPlayerCommands\AFTER_TEST_PASS_FINISHED, and getContentBlockName().

1055  {
1056  $template = new ilTemplate("tpl.il_as_tst_final_statement.html", true, true, "Modules/Test");
1057  $this->ctrl->setParameter($this, "skipfinalstatement", 1);
1058  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, ilTestPlayerCommands::AFTER_TEST_PASS_FINISHED));
1059  $template->setVariable("FINALSTATEMENT", $this->object->prepareTextareaOutput($this->object->getFinalStatement(), true));
1060  $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
1061  $this->tpl->setVariable($this->getContentBlockName(), $template->get());
1062  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:

◆ showInstantResponseCmd()

ilTestPlayerAbstractGUI::showInstantResponseCmd ( )
abstractprotected

Referenced by confirmHintRequestCmd().

+ Here is the caller graph for this function:

◆ showListOfAnswers()

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

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

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

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

References $DIC, $ilUser, $pass, ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getContentBlockName(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getResultsSignature(), and ilUtil\getStyleSheetLocation().

1701  {
1702  global $DIC;
1703  $ilUser = $DIC['ilUser'];
1704 
1705  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_finish_list_of_answers.html", "Modules/Test");
1706 
1707  $result_array = &$this->object->getTestResult(
1708  $active_id,
1709  $pass,
1710  false,
1711  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1712  );
1713 
1714  $counter = 1;
1715  // output of questions with solutions
1716  foreach ($result_array as $question_data) {
1717  $question = $question_data["qid"];
1718  if (is_numeric($question)) {
1719  $this->tpl->setCurrentBlock("printview_question");
1720  $question_gui = $this->object->createQuestionGUI("", $question);
1721  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "Modules/TestQuestionPool");
1722  $template->setVariable("COUNTER_QUESTION", $counter . ". ");
1723  $template->setVariable("QUESTION_TITLE", $question_gui->object->getTitle());
1724 
1725  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
1726  $result_output = $question_gui->getSolutionOutput($active_id, $pass, false, false, $show_question_only, $this->object->getShowSolutionFeedback());
1727  $template->setVariable("SOLUTION_OUTPUT", $result_output);
1728  $this->tpl->setVariable("QUESTION_OUTPUT", $template->get());
1729  $this->tpl->parseCurrentBlock();
1730  $counter++;
1731  }
1732  }
1733 
1734  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1735  if ($this->object->getShowSolutionAnswersOnly()) {
1736  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1737  }
1738  if (strlen($top_data)) {
1739  $this->tpl->setCurrentBlock("top_data");
1740  $this->tpl->setVariable("TOP_DATA", $top_data);
1741  $this->tpl->parseCurrentBlock();
1742  }
1743 
1744  if (strlen($bottom_data)) {
1745  $this->tpl->setCurrentBlock("bottom_data");
1746  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1747  $this->tpl->setVariable("BOTTOM_DATA", $bottom_data);
1748  $this->tpl->parseCurrentBlock();
1749  }
1750 
1751  $this->tpl->setCurrentBlock("adm_content");
1752  $this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_list_of_answers"));
1753  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($this->testSession, $active_id, true);
1754  $signature = $this->getResultsSignature();
1755  $this->tpl->setVariable("USER_DETAILS", $user_data);
1756  $this->tpl->setVariable("SIGNATURE", $signature);
1757  $this->tpl->setVariable("TITLE", $this->object->getTitle());
1758  $this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
1759  $invited_user = &$this->object->getInvitedUsers($ilUser->getId());
1760  $pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
1761  ": " . $invited_user[$ilUser->getId()]["clientip"] . " - " .
1762  $this->lng->txt("matriculation") . ": " .
1763  $invited_user[$ilUser->getId()]["matriculation"];
1764  $this->tpl->setVariable("PAGETITLE", $pagetitle);
1765  $this->tpl->parseCurrentBlock();
1766  }
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getResultsSignature()
Returns HTML code for a signature field.
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ showMaximumAllowedUsersReachedMessage()

ilTestPlayerAbstractGUI::showMaximumAllowedUsersReachedMessage ( )

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

References ilTestPlayerCommands\BACK_TO_INFO_SCREEN, and getContentBlockName().

Referenced by initTestCmd(), and ilTestPlayerDynamicQuestionSetGUI\resumePlayerCmd().

1642  {
1643  $this->tpl->addBlockFile($this->getContentBlockName(), "adm_content", "tpl.il_as_tst_max_allowed_users_reached.html", "Modules/Test");
1644  $this->tpl->setCurrentBlock("adm_content");
1645  $this->tpl->setVariable("MAX_ALLOWED_USERS_MESSAGE", sprintf($this->lng->txt("tst_max_allowed_users_message"), $this->object->getAllowedUsersTimeGap()));
1646  $this->tpl->setVariable("MAX_ALLOWED_USERS_HEADING", sprintf($this->lng->txt("tst_max_allowed_users_heading"), $this->object->getAllowedUsersTimeGap()));
1647  $this->tpl->setVariable("CMD_BACK_TO_INFOSCREEN", ilTestPlayerCommands::BACK_TO_INFO_SCREEN);
1648  $this->tpl->setVariable("TXT_BACK_TO_INFOSCREEN", $this->lng->txt("tst_results_back_introduction"));
1649  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1650  $this->tpl->parseCurrentBlock();
1651  }
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 1213 of file class.ilTestPlayerAbstractGUI.php.

References $_GET, $_SESSION, buildEditableStateQuestionNavigationGUI(), determineSolutionPassIndex(), assQuestionGUI\getQuestionHeaderBlockBuilder(), isShowingPostponeStatusReguired(), assQuestionGUI\outQuestionForTest(), populateCharSelectorIfRequired(), populateModals(), assQuestionGUI\setNavigationGUI(), and ilTestPlayerCommands\SKIP_QUESTION.

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

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

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

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

1170  {
1171  $questionNavigationGUI = $this->buildReadOnlyStateQuestionNavigationGUI($questionGui->object->getId());
1172  $questionNavigationGUI->setQuestionWorkedThrough($isQuestionWorkedThrough);
1173  $questionGui->setNavigationGUI($questionNavigationGUI);
1174 
1175  // fau: testNav - set answere status in question header
1176  $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered($isQuestionWorkedThrough);
1177  // fau.
1178 
1179  $answerFeedbackEnabled = (
1180  $instantResponse && $this->object->getSpecificAnswerFeedback()
1181  );
1182 
1183  $solutionoutput = $questionGui->getSolutionOutput(
1184  $this->testSession->getActiveId(), #active_id
1185  $this->testSession->getPass(), #pass
1186  false, #graphical_output
1187  false, #result_output
1188  true, #show_question_only
1189  $answerFeedbackEnabled, #show_feedback
1190  false, #show_correct_solution
1191  false, #show_manual_scoring
1192  true #show_question_text
1193  );
1194 
1195  $pageoutput = $questionGui->outQuestionPage(
1196  "",
1197  $this->isShowingPostponeStatusReguired($questionGui->object->getId()),
1198  $this->testSession->getActiveId(),
1199  $solutionoutput
1200  );
1201 
1202  $this->tpl->setCurrentBlock('readonly_css_class');
1203  $this->tpl->touchBlock('readonly_css_class');
1204  $this->tpl->parseCurrentBlock();
1205 
1206  $this->tpl->setVariable('QUESTION_OUTPUT', $pageoutput);
1207 
1208  $this->tpl->setVariable("FORMACTION", $formAction);
1209  $this->tpl->setVariable("ENCTYPE", 'enctype="' . $questionGui->getFormEncodingType() . '"');
1210  $this->tpl->setVariable("FORM_TIMESTAMP", time());
1211  }
isShowingPostponeStatusReguired($questionId)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
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($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 1797 of file class.ilTestPlayerAbstractGUI.php.

References ilAssQuestionHintRequestGUI\CMD_SHOW_LIST, and handleIntermediateSubmit().

1798  {
1799  // fau: testNav - handle intermediate submit for viewing requested hints
1800  $this->handleIntermediateSubmit();
1801  // fau.
1802 
1803  $this->ctrl->setParameter($this, 'pmode', self::PRESENTATION_MODE_EDIT);
1804 
1805  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
1806  $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST);
1807  }
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 1531 of file class.ilTestPlayerAbstractGUI.php.

References $DIC, $ilUser, ilUtil\getStyleSheetLocation(), isQuestionSummaryFinishTestButtonRequired(), and PRESENTATION_MODE_VIEW.

Referenced by prepareTestPage().

1532  {
1533  global $DIC;
1534  $ilUser = $DIC['ilUser'];
1535 
1536  $sideListActive = $ilUser->getPref('side_list_of_questions');
1537 
1538  if ($sideListActive) {
1539  $this->tpl->addCss(
1540  ilUtil::getStyleSheetLocation("output", "ta_split.css", "Modules/Test"),
1541  "screen"
1542  );
1543 
1544  $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, false);
1545 
1546  require_once 'Modules/Test/classes/class.ilTestQuestionSideListGUI.php';
1547  $questionSideListGUI = new ilTestQuestionSideListGUI($this->ctrl, $this->lng);
1548  $questionSideListGUI->setTargetGUI($this);
1549  $questionSideListGUI->setQuestionSummaryData($questionSummaryData);
1550  $questionSideListGUI->setCurrentSequenceElement($currentSequenceElement);
1551  // fau: testNav - set side list presentation mode to "view" to allow navigation when question is in edit mode
1552  $questionSideListGUI->setCurrentPresentationMode(ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW);
1553  $questionSideListGUI->setDisabled(false);
1554  // $questionSideListGUI->setCurrentPresentationMode($presentationMode);
1555  // $questionSideListGUI->setDisabled($presentationMode == self::PRESENTATION_MODE_EDIT);
1556  // fau.
1557  $this->tpl->setVariable('LIST_OF_QUESTIONS', $questionSideListGUI->getHTML());
1558  }
1559  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ 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 439 of file class.ilTestPlayerAbstractGUI.php.

References getLockParameter(), handleUserSettings(), and ilTestPlayerCommands\INIT_TEST.

440  {
441  $testStartLock = $this->getLockParameter();
442  $isFirstTestStartRequest = false;
443 
444  $this->processLocker->executeTestStartLockOperation(function () use ($testStartLock, &$isFirstTestStartRequest) {
445  if ($this->testSession->lookupTestStartLock() != $testStartLock) {
446  $this->testSession->persistTestStartLock($testStartLock);
447  $isFirstTestStartRequest = true;
448  }
449  });
450 
451  if ($isFirstTestStartRequest) {
452  $this->handleUserSettings();
453  $this->ctrl->redirect($this, ilTestPlayerCommands::INIT_TEST);
454  }
455 
456  $this->ctrl->setParameterByClass('ilObjTestGUI', 'lock', $testStartLock);
457  $this->ctrl->redirectByClass("ilobjtestgui", "redirectToInfoScreen");
458  }
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 649 of file class.ilTestPlayerAbstractGUI.php.

References saveQuestionSolution(), setAnswerChangedParameter(), and ilTestPlayerCommands\SHOW_QUESTION.

650  {
651  $this->saveQuestionSolution(false, true);
652  // fau: testNav - set the 'answer changed' parameter when an intermediate solution is submitted
653  $this->setAnswerChangedParameter(true);
654  // fau.
655  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
656  }
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 199 of file class.ilTestPlayerAbstractGUI.php.

Referenced by maxProcessingTimeReached().

200  {
201  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
202  }
+ Here is the caller graph for this function:

◆ toggleSideListCmd()

ilTestPlayerAbstractGUI::toggleSideListCmd ( )

Toggle side list.

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

References $DIC, $ilUser, and ilTestPlayerCommands\SHOW_QUESTION.

662  {
663  global $DIC;
664  $ilUser = $DIC['ilUser'];
665 
666  $show_side_list = $ilUser->getPref('side_list_of_questions');
667  $ilUser->writePref('side_list_of_questions', !$show_side_list);
668  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
669  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46

◆ unmarkQuestionAndSaveIntermediateCmd()

ilTestPlayerAbstractGUI::unmarkQuestionAndSaveIntermediateCmd ( )
protected

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

References handleIntermediateSubmit(), and unmarkQuestionCmd().

694  {
695  // fau: testNav - handle intermediate submit when unmarking the question
696  $this->handleIntermediateSubmit();
697  // fau.
698  $this->unmarkQuestionCmd();
699  }
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 704 of file class.ilTestPlayerAbstractGUI.php.

References getCurrentSequenceElement(), and ilTestPlayerCommands\SHOW_QUESTION.

Referenced by unmarkQuestionAndSaveIntermediateCmd().

705  {
706  $questionId = $this->testSequence->getQuestionForSequence(
708  );
709 
710  $this->object->setQuestionSetSolved(0, $questionId, $this->testSession->getUserId());
711 
712  $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION);
713  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterForcedFeedbackNavUrl()

ilTestPlayerAbstractGUI::unregisterForcedFeedbackNavUrl ( )
protected

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

References $_SESSION.

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

2897  {
2898  if (isset($_SESSION['forced_feedback_navigation_url'][$this->testSession->getActiveId()])) {
2899  unset($_SESSION['forced_feedback_navigation_url'][$this->testSession->getActiveId()]);
2900  }
2901  }
$_SESSION["AccountId"]
+ 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 164 of file class.ilTestPlayerAbstractGUI.php.

References $_SESSION.

Referenced by ilTestOutputGUI\handleQuestionActionCmd(), ilTestOutputGUI\saveQuestionSolution(), and ilTestPlayerDynamicQuestionSetGUI\showQuestionCmd().

165  {
166  if ($_SESSION["active_time_id"]) {
167  $this->object->updateWorkingTime($_SESSION["active_time_id"]);
168  }
169 
170  $_SESSION["active_time_id"] = $this->object->startWorkingTime(
171  $this->testSession->getActiveId(),
172  $this->testSession->getPass()
173  );
174  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

Field Documentation

◆ $assSettings

ilTestPlayerAbstractGUI::$assSettings
protected

◆ $cachedQuestionGuis

ilTestPlayerAbstractGUI::$cachedQuestionGuis = array()
private

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

◆ $cachedQuestionObjects

ilTestPlayerAbstractGUI::$cachedQuestionObjects = array()
private

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

◆ $cmdCtrl

ilTestPlayerAbstractGUI::$cmdCtrl

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

◆ $endingTimeReached

ilTestPlayerAbstractGUI::$endingTimeReached

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

◆ $maxProcessingTimeReached

ilTestPlayerAbstractGUI::$maxProcessingTimeReached

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

◆ $passwordChecker

ilTestPlayerAbstractGUI::$passwordChecker
protected

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

◆ $processLocker

ilTestPlayerAbstractGUI::$processLocker
protected

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

◆ $ref_id

ilTestPlayerAbstractGUI::$ref_id

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

◆ $saveResult

ilTestPlayerAbstractGUI::$saveResult

◆ $sequence

ilTestPlayerAbstractGUI::$sequence

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

◆ $testSequence

ilTestPlayerAbstractGUI::$testSequence = null
protected

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

Referenced by archiveParticipantSubmission().

◆ $testSession

ilTestPlayerAbstractGUI::$testSession
protected

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

◆ FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM

const ilTestPlayerAbstractGUI::FOLLOWUP_QST_LOCKS_PREVENT_CONFIRMATION_PARAM = 'followup_qst_locks_prevent_confirmation'

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

◆ PRESENTATION_MODE_EDIT

◆ PRESENTATION_MODE_VIEW


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