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

Service GUI class for tests. More...

+ Inheritance diagram for ilTestServiceGUI:
+ Collaboration diagram for ilTestServiceGUI:

Public Member Functions

 isContextResultPresentation ()
 
 setContextResultPresentation ($contextResultPresentation)
 
 __construct (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
 setParticipantData ($participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $testSession, $passes, $withResults)
 This method uses the data of a given test pass to create an evaluation for displaying into a table used in the ilTestEvaluationGUI. More...
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 buildPassOverviewTableGUI ($targetGUI)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
 Returns the list of answers of a users test pass. More...
 
 getPassListOfAnswersWithScoring (&$result_array, $active_id, $pass, $show_solutions=false)
 Returns the list of answers of a users test pass and offers a scoring option. More...
 
 getResultsSignature ()
 Returns HTML code for a signature field. More...
 
 getAdditionalUsrDataHtmlAndPopulateWindowTitle ($testSession, $active_id, $overwrite_anonymity=false)
 Returns the user data for a test results output. More...
 
 getCorrectSolutionOutput ($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getResultsOfUserOutput ($testSession, $active_id, $pass, $targetGUI, $show_pass_details=true, $show_answers=true, $show_question_only=false, $show_reached_points=false)
 Output of the pass overview for a test called by a test participant. More...
 
 getResultsHeadUserAndPass ($active_id, $pass)
 Returns the user and pass data for a test results output. More...
 
 getQuestionResultForTestUsers ($question_id, $test_id)
 Creates a HTML representation for the results of a given question in a test. More...
 
 populatePassFinishDate ($tpl, $passFinishDate)
 
 populateExamId (ilTemplate $tpl, int $activeId, int $pass)
 
 getObject ()
 

Data Fields

 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 

Protected Member Functions

 isPdfDeliveryRequest ()
 
 buildQuestionAnswerShuffler (int $question_id, int $active_id, int $pass_id)
 
 buildFixedShufflerSeed (int $question_id, int $pass_id, int $active_id)
 
 getPassDetailsOverviewTableGUI ( $result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

ILIAS Test InternalRequestService $testrequest
 
 $db
 
Refinery $refinery
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Attributes

RandomGroup $randomGroup
 
 $objectiveOrientedContainer
 
 $contextResultPresentation = true
 

Detailed Description

Service GUI class for tests.

This class is the parent class for all service classes which are called from ilObjTestGUI. This is mainly done to reduce the size of ilObjTestGUI to put command service functions into classes that could be called by ilCtrl.

ilTestServiceGUI: ilObjTestGUI

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilTestServiceGUI::__construct ( ilObjTest  $a_object)

The constructor takes the test object reference as parameter.

Parameters
object$a_objectAssociated ilObjTest class public

Definition at line 133 of file class.ilTestServiceGUI.php.

References $DIC, $ilDB, $ilias, $lng, $refinery, $tpl, $tree, ILIAS\Repository\ctrl(), ilObject\getRefId(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\tabs().

134  {
135  global $DIC;
136  $lng = $DIC['lng'];
137  $refinery = $DIC['refinery'];
138  $tpl = $DIC['tpl'];
139  $ilCtrl = $DIC['ilCtrl'];
140  $ilias = $DIC['ilias'];
141  $tree = $DIC['tree'];
142  $ilDB = $DIC['ilDB'];
143  $component_repository = $DIC['component.repository'];
144  $ilTabs = $DIC['ilTabs'];
145  $ilObjDataCache = $DIC['ilObjDataCache'];
146 
147  $lng->loadLanguageModule('cert');
148 
149  $this->db = $ilDB;
150  $this->lng = &$lng;
151  $this->refinery = &$refinery;
152  $this->tpl = &$tpl;
153  $this->ctrl = &$ilCtrl;
154  $this->tabs = $ilTabs;
155  $this->objCache = $ilObjDataCache;
156  $this->ilias = &$ilias;
157  $this->object = &$a_object;
158  $this->tree = &$tree;
159  $this->ref_id = $a_object->getRefId();
160 
161  $this->service = new ilTestService($a_object);
162  $this->testrequest = $DIC->test()->internal()->request();
163  $this->testSessionFactory = new ilTestSessionFactory($this->object);
164 
165  $this->testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $refinery, $component_repository, $this->object);
166  $this->randomGroup = $DIC->refinery()->random();
167  $this->objectiveOrientedContainer = null;
168  }
global $DIC
Definition: feed.php:28
header include for all ilias files.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ buildFixedShufflerSeed()

ilTestServiceGUI::buildFixedShufflerSeed ( int  $question_id,
int  $pass_id,
int  $active_id 
)
protected

Definition at line 529 of file class.ilTestServiceGUI.php.

References ilTestPlayerAbstractGUI\FIXED_SHUFFLER_SEED_MIN_LENGTH.

Referenced by buildQuestionAnswerShuffler().

529  : int
530  {
531  $seed = ($question_id + $pass_id) * $active_id;
532 
533  if (is_float($seed) && is_float($seed = $active_id + $pass_id)) {
534  $seed = $active_id;
535  }
536 
537  $div = ceil((10 ** (ilTestPlayerAbstractGUI::FIXED_SHUFFLER_SEED_MIN_LENGTH - 1)) / $seed);
538 
539  if ($div > 1) {
540  $seed = $seed * ($div + $seed % 10);
541  }
542 
543  return (int) $seed;
544  }
+ Here is the caller graph for this function:

◆ buildPassDetailsOverviewTableGUI()

ilTestServiceGUI::buildPassDetailsOverviewTableGUI (   $targetGUI,
  $targetCMD 
)
protected

◆ buildPassOverviewTableGUI()

ilTestServiceGUI::buildPassOverviewTableGUI (   $targetGUI)
Returns
ilTestPassOverviewTableGUI $tableGUI

Definition at line 343 of file class.ilTestServiceGUI.php.

References getObjectiveOrientedContainer().

Referenced by ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), and ilTestEvaluationGUI\outUserResultsOverview().

344  {
345  require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
346 
347  $table = new ilTestPassOverviewTableGUI($targetGUI, '');
348 
349  $table->setPdfPresentationEnabled(
350  $this->testrequest->isset('pdf') && $this->testrequest->raw('pdf') == 1
351  );
352 
353  $table->setObjectiveOrientedPresentationEnabled(
354  $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
355  );
356 
357  return $table;
358  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionAnswerShuffler()

ilTestServiceGUI::buildQuestionAnswerShuffler ( int  $question_id,
int  $active_id,
int  $pass_id 
)
protected

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

References buildFixedShufflerSeed().

Referenced by getPassListOfAnswers(), and ilTestPlayerAbstractGUI\getQuestionGuiInstance().

523  : Transformation {
524  $fixedSeed = $this->buildFixedShufflerSeed($question_id, $pass_id, $active_id);
525 
526  return $this->randomGroup->shuffleArray(new GivenSeed($fixedSeed));
527  }
buildFixedShufflerSeed(int $question_id, int $pass_id, int $active_id)
A transformation is a function from one datatype to another.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionRelatedObjectivesList()

ilTestServiceGUI::buildQuestionRelatedObjectivesList ( ilLOTestQuestionAdapter  $objectivesAdapter,
ilTestQuestionSequence  $testSequence 
)
protected

Definition at line 1145 of file class.ilTestServiceGUI.php.

References ilLOTestQuestionAdapter\buildQuestionRelatedObjectiveList().

Referenced by ilTestPlayerAbstractGUI\archiveParticipantSubmission(), ilTestSubmissionReviewGUI\buildUserReviewOutput(), getPassOverviewTableData(), getResultsOfUserOutput(), outCorrectSolution(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

1146  {
1147  require_once 'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
1148  $questionRelatedObjectivesList = new ilTestQuestionRelatedObjectivesList();
1149 
1150  $objectivesAdapter->buildQuestionRelatedObjectiveList($testSequence, $questionRelatedObjectivesList);
1151 
1152  return $questionRelatedObjectivesList;
1153  }
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildUserTestResultsToolbarGUI()

ilTestServiceGUI::buildUserTestResultsToolbarGUI ( )
protected
Returns
ilTestResultsToolbarGUI

Definition at line 1225 of file class.ilTestServiceGUI.php.

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

Referenced by ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserPassDetails(), ilTestEvaluationGUI\outUserResultsOverview(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

1226  {
1227  require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1228  $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
1229 
1230  return $toolbar;
1231  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestServiceGUI::executeCommand ( )

execute command

Definition at line 300 of file class.ilTestServiceGUI.php.

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

301  {
302  $cmd = $this->ctrl->getCmd();
303  $next_class = $this->ctrl->getNextClass($this);
304 
305  $cmd = $this->getCommand($cmd);
306  switch ($next_class) {
307  default:
308  $ret = &$this->$cmd();
309  break;
310  }
311  return $ret;
312  }
getCommand($cmd)
Retrieves the ilCtrl command.
+ Here is the call graph for this function:

◆ getAdditionalUsrDataHtmlAndPopulateWindowTitle()

ilTestServiceGUI::getAdditionalUsrDataHtmlAndPopulateWindowTitle (   $testSession,
  $active_id,
  $overwrite_anonymity = false 
)

Returns the user data for a test results output.

Parameters
ilTestSession|ilTestSessionDynamicQuestionSet
integer$user_idThe user ID of the user
boolean$overwrite_anonymityTRUE if the anonymity status should be overwritten, FALSE otherwise
Returns
string HTML code of the user data for the test results public

Definition at line 728 of file class.ilTestServiceGUI.php.

References ilObjUser\_lookupLogin(), getObjectiveOrientedContainer(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), ilTestEvaluationGUI\outUserResultsOverview(), and ilTestPlayerAbstractGUI\showListOfAnswers().

728  : string
729  {
730  if (!is_object($testSession)) {
731  throw new InvalidArgumentException('Not an object, expected ilTestSession|ilTestSessionDynamicQuestionSet');
732  }
733  $template = new ilTemplate("tpl.il_as_tst_results_userdata.html", true, true, "Modules/Test");
734  include_once './Services/User/classes/class.ilObjUser.php';
735  $user_id = $this->object->_getUserIdFromActiveId($active_id);
736  if (strlen(ilObjUser::_lookupLogin($user_id)) > 0) {
737  $user = new ilObjUser($user_id);
738  } else {
739  $user = new ilObjUser();
740  $user->setLastname($this->lng->txt("deleted_user"));
741  }
742  $t = $testSession->getSubmittedTimestamp();
743  if (!$t) {
744  $t = $this->object->_getLastAccess($testSession->getActiveId());
745  }
746 
747  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
748  $uname = $this->object->userLookupFullName($user_id, $overwrite_anonymity);
749  $template->setCurrentBlock("name");
750  $template->setVariable('TXT_USR_NAME', $this->lng->txt("name"));
751  $template->setVariable('VALUE_USR_NAME', $uname);
752  $template->parseCurrentBlock();
753  }
754 
755  $title_matric = "";
756  if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == false) || ($overwrite_anonymity))) {
757  $template->setCurrentBlock("matriculation");
758  $template->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
759  $template->setVariable("VALUE_USR_MATRIC", $user->getMatriculation());
760  $template->parseCurrentBlock();
761  $title_matric = " - " . $this->lng->txt("matriculation") . ": " . $user->getMatriculation();
762  }
763 
764  $invited_user = array_pop($this->object->getInvitedUsers($user_id));
765  $title_client = '';
766  if ($invited_user != null && strlen($invited_user["clientip"])) {
767  $template->setCurrentBlock("client_ip");
768  $template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
769  $template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
770  $template->parseCurrentBlock();
771  $title_client = " - " . $this->lng->txt("clientip") . ": " . $invited_user["clientip"];
772  }
773 
774  $template->setVariable("TXT_TEST_TITLE", $this->lng->txt("title"));
775  $template->setVariable("VALUE_TEST_TITLE", $this->object->getTitle());
776 
777  // change the pagetitle (tab title or title in title bar of window)
778  $pagetitle = $this->object->getTitle() . $title_matric . $title_client;
779  $this->tpl->setHeaderPageTitle($pagetitle);
780 
781  return $template->get();
782  }
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCommand()

ilTestServiceGUI::getCommand (   $cmd)

Retrieves the ilCtrl command.

public

Definition at line 319 of file class.ilTestServiceGUI.php.

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

320  {
321  return $cmd;
322  }
+ Here is the caller graph for this function:

◆ getCorrectSolutionOutput()

ilTestServiceGUI::getCorrectSolutionOutput (   $question_id,
  $active_id,
  $pass,
ilTestQuestionRelatedObjectivesList  $objectivesList = null 
)

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

Parameters
integer$question_idDatabase ID of the question
integer$active_idActive ID of the active user
integer$passTest pass
Returns
string HTML code of the correct solution comparison public

Definition at line 793 of file class.ilTestServiceGUI.php.

References $objectives, ILIAS\Repository\ctrl(), isPdfDeliveryRequest(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and assQuestionGUI\RENDER_PURPOSE_PRINT_PDF.

Referenced by outCorrectSolution(), and ilTestPlayerAbstractGUI\outCorrectSolution().

793  : string
794  {
795  $question_gui = $this->object->createQuestionGUI("", $question_id);
796 
797  if ($this->isPdfDeliveryRequest()) {
798  $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
799  }
800 
801  $template = new ilTemplate("tpl.il_as_tst_correct_solution_output.html", true, true, "Modules/Test");
802  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
803  $result_output = $question_gui->getSolutionOutput($active_id, $pass, true, false, $show_question_only, $this->object->getShowSolutionFeedback(), false, false, true);
804  if ($question_gui instanceof assTextQuestionGUI && $this->object->getAutosave()) {
805  $result_output .= $question_gui->getAutoSavedSolutionOutput(
806  $active_id,
807  $pass,
808  false,
809  false,
810  false,
811  false,
812  false,
813  false,
814  false,
815  true
816  );
817  }
818  $best_output = $question_gui->getSolutionOutput($active_id, $pass, false, false, $show_question_only, false, true, false, false);
819  if ($this->object->getShowSolutionFeedback() && $this->testrequest->raw('cmd') != 'outCorrectSolution') {
820  $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput(
821  $question_gui->object->fetchIndexedValuesFromValuePairs(
822  $question_gui->object->getSolutionValues($active_id, $pass)
823  )
824  );
825  if (strlen($specificAnswerFeedback)) {
826  $template->setCurrentBlock("outline_specific_feedback");
827  $template->setVariable("OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
828  $template->parseCurrentBlock();
829  }
830  }
831  if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output)) {
832  $template->setCurrentBlock("best_solution");
833  $template->setVariable("TEXT_BEST_SOLUTION", $this->lng->txt("tst_best_solution_is"));
834  $template->setVariable("BEST_OUTPUT", $best_output);
835  $template->parseCurrentBlock();
836  }
837  $template->setVariable("TEXT_YOUR_SOLUTION", $this->lng->txt("tst_your_answer_was"));
838  $template->setVariable("TEXT_SOLUTION_OUTPUT", $this->lng->txt("tst_your_answer_was")); // Mantis 28646. I don't really know why Ingmar renamed the placeholder, so
839  // I set both old and new since the old one is set as well in several places.
840  $maxpoints = $question_gui->object->getMaximumPoints();
841  if ($maxpoints == 1) {
842  $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()) . " (" . $maxpoints . " " . $this->lng->txt("point") . ")");
843  } else {
844  $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()) . " (" . $maxpoints . " " . $this->lng->txt("points") . ")");
845  }
846  if ($objectivesList !== null) {
847  $objectives = $this->lng->txt('tst_res_lo_objectives_header') . ': ';
848  $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
849  $template->setVariable('OBJECTIVES', $objectives);
850  }
851  $template->setVariable("SOLUTION_OUTPUT", $result_output);
852  $template->setVariable("RECEIVED_POINTS", sprintf($this->lng->txt("you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id, $pass), $maxpoints));
853  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
854  $template->setVariable("BACKLINK_TEXT", "<< " . $this->lng->txt("back"));
855  return $template->get();
856  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$objectives
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilteredTestResult()

ilTestServiceGUI::getFilteredTestResult (   $active_id,
  $pass,
  $considerHiddenQuestions,
  $considerOptionalQuestions 
)
protected

Definition at line 1155 of file class.ilTestServiceGUI.php.

References $DIC, $ilDB, buildPassDetailsOverviewTableGUI(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES, and ILIAS\Repository\refinery().

1155  : array
1156  {
1157  global $DIC;
1158  $ilDB = $DIC['ilDB'];
1159  $component_repository = $DIC['component.repository'];
1160 
1161  $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1162  $table_gui->initFilter();
1163 
1164  $questionList = new ilAssQuestionList($ilDB, $this->lng, $this->refinery, $component_repository);
1165 
1166  $questionList->setParentObjIdsFilter(array($this->object->getId()));
1167  $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES);
1168 
1169  foreach ($table_gui->getFilterItems() as $item) {
1170  if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') {
1171  $v = $item->getValue();
1172 
1173  if (is_array($v) && count($v) && !(int) $v[0]) {
1174  continue;
1175  }
1176 
1177  $taxId = substr($item->getPostVar(), strlen('tax_'));
1178  $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
1179  } elseif ($item->getValue() !== false) {
1180  $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1181  }
1182  }
1183 
1184  $questionList->load();
1185 
1186  $filteredTestResult = array();
1187 
1188  $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions, $considerOptionalQuestions);
1189 
1190  foreach ($resultData as $resultItemKey => $resultItemValue) {
1191  if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
1192  continue;
1193  }
1194 
1195  if (!$questionList->isInList($resultItemValue['qid'])) {
1196  continue;
1197  }
1198 
1199  $filteredTestResult[] = $resultItemValue;
1200  }
1201 
1202  return $filteredTestResult;
1203  }
global $DIC
Definition: feed.php:28
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
+ Here is the call graph for this function:

◆ getGradingMessageBuilder()

ilTestServiceGUI::getGradingMessageBuilder (   $activeId)
protected
Parameters
integer$activeId
Returns
ilTestGradingMessageBuilder

Definition at line 1135 of file class.ilTestServiceGUI.php.

References ILIAS\Repository\lng().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestEvaluationGUI\outUserResultsOverview().

1136  {
1137  require_once 'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
1138  $gradingMessageBuilder = new ilTestGradingMessageBuilder($this->lng, $this->object);
1139 
1140  $gradingMessageBuilder->setActiveId($activeId);
1141 
1142  return $gradingMessageBuilder;
1143  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObject()

ilTestServiceGUI::getObject ( )

Definition at line 1348 of file class.ilTestServiceGUI.php.

References $object.

Referenced by ilTestPlayerAbstractGUI\outQuestionSummaryCmd().

1349  {
1350  return $this->object;
1351  }
+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainer()

◆ getParticipantData()

ilTestServiceGUI::getParticipantData ( )

◆ getPassDetailsOverviewTableGUI()

ilTestServiceGUI::getPassDetailsOverviewTableGUI (   $result_array,
  $active_id,
  $pass,
  $targetGUI,
  $targetCMD,
  $questionDetailsCMD,
  $questionAnchorNav,
ilTestQuestionRelatedObjectivesList  $objectivesList = null,
  $multipleObjectivesInvolved = true 
)
protected

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

References ILIAS\LTI\ToolProvider\$key, buildPassDetailsOverviewTableGUI(), ILIAS\Repository\ctrl(), isPdfDeliveryRequest(), and ILIAS\Repository\object().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

645  $this->ctrl->setParameter($targetGUI, 'active_id', $active_id);
646  $this->ctrl->setParameter($targetGUI, 'pass', $pass);
647 
648  $tableGUI = $this->buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD);
649 
650  if (!$this->isPdfDeliveryRequest()) {
651  $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
652  }
653 
654  $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
655  $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
656 
657  if ($objectivesList !== null) {
658  $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
659  $tableGUI->setObjectiveOrientedPresentationEnabled(true);
660  }
661 
662  $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
663 
664  $tableGUI->setActiveId($active_id);
665  $tableGUI->setShowSuggestedSolution(false);
666 
667  $usersQuestionSolutions = array();
668 
669  foreach ($result_array as $key => $val) {
670  if ($key === 'test' || $key === 'pass') {
671  continue;
672  }
673 
674  if ($this->object->getShowSolutionSuggested() && strlen($val['solution'])) {
675  $tableGUI->setShowSuggestedSolution(true);
676  }
677 
678  if (isset($val['pass'])) {
679  $tableGUI->setPassColumnEnabled(true);
680  }
681 
682  $usersQuestionSolutions[$key] = $val;
683  }
684 
685  $tableGUI->initColumns();
686  $tableGUI->initFilter();
687 
688  $tableGUI->setFilterCommand($targetCMD . 'SetTableFilter');
689  $tableGUI->setResetCommand($targetCMD . 'ResetTableFilter');
690 
691  $tableGUI->setData($usersQuestionSolutions);
692 
693  return $tableGUI;
694  }
string $key
Consumer key/client ID value.
Definition: System.php:193
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPassListOfAnswers()

ilTestServiceGUI::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.

Parameters
array$result_arrayAn array containing the results of the users test pass (generated by ilObjTest::getTestResult)
integer$active_idActive ID of the active user
integer$passTest pass
boolean$show_solutionsTRUE, if the solution output should be shown in the answers, FALSE otherwise
Returns
string HTML code of the list of answers public

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

References $objectives, buildQuestionAnswerShuffler(), isContextResultPresentation(), isPdfDeliveryRequest(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and assQuestionGUI\RENDER_PURPOSE_PRINT_PDF.

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

381  : string {
382  $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", true, true, "Modules/Test");
383 
384  $counter = 1;
385  // output of questions with solutions
386  foreach ($result_array as $question_data) {
387  if (!array_key_exists('workedthrough', $question_data)) {
388  $question_data['workedthrough'] = 0;
389  }
390  if (!array_key_exists('qid', $question_data)) {
391  $question_data['qid'] = -1;
392  }
393 
394  if (($question_data["workedthrough"] == 1) || ($only_answered_questions == false)) {
395  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "Modules/TestQuestionPool");
396  $question_id = $question_data["qid"] ?? null;
397  if ($question_id !== null
398  && $question_id !== -1
399  && is_numeric($question_id)) {
400  $maintemplate->setCurrentBlock("printview_question");
401  $question_gui = $this->object->createQuestionGUI("", $question_id);
402  $question_gui->object->setShuffler($this->buildQuestionAnswerShuffler(
403  (int) $question_id,
404  (int) $active_id,
405  (int) $pass
406  ));
407  if (is_object($question_gui)) {
408  if ($this->isPdfDeliveryRequest()) {
409  $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
410  }
411 
412  if ($anchorNav) {
413  $template->setCurrentBlock('block_id');
414  $template->setVariable('BLOCK_ID', "detailed_answer_block_act_{$active_id}_qst_{$question_id}");
415  $template->parseCurrentBlock();
416 
417  $template->setCurrentBlock('back_anchor');
418  $template->setVariable('HREF_BACK_ANCHOR', "#pass_details_tbl_row_act_{$active_id}_qst_{$question_id}");
419  $template->setVariable('TXT_BACK_ANCHOR', $this->lng->txt('tst_back_to_question_list'));
420  $template->parseCurrentBlock();
421  }
422 
423  if ($show_reached_points) {
424  $template->setCurrentBlock("result_points");
425  $template->setVariable("RESULT_POINTS", $this->lng->txt("tst_reached_points") . ": " . $question_gui->object->getReachedPoints($active_id, $pass) . " " . $this->lng->txt("of") . " " . $question_gui->object->getMaximumPoints());
426  $template->parseCurrentBlock();
427  }
428  $template->setVariable("COUNTER_QUESTION", $counter . ". ");
429  $template->setVariable("TXT_QUESTION_ID", $this->lng->txt('question_id_short'));
430  $template->setVariable("QUESTION_ID", $question_gui->object->getId());
431  $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()));
432 
433  if ($objectivesList !== null) {
434  $objectives = $this->lng->txt('tst_res_lo_objectives_header') . ': ';
435  $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
436  $template->setVariable("OBJECTIVES", $objectives);
437  }
438 
439  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
440 
441  $show_feedback = $this->isContextResultPresentation() && $this->object->getShowSolutionFeedback();
442  $show_best_solution = $this->isContextResultPresentation() && $show_solutions;
443  $show_graphical_output = $this->isContextResultPresentation();
444 
445  if ($show_best_solution) {
446  $compare_template = new ilTemplate('tpl.il_as_tst_answers_compare.html', true, true, 'Modules/Test');
447  $test_session = $this->testSessionFactory->getSession($active_id);
448  if ($pass <= $test_session->getLastFinishedPass()) {
449  $compare_template->setVariable("HEADER_PARTICIPANT", $this->lng->txt('tst_header_participant'));
450  } else {
451  $compare_template->setVariable("HEADER_PARTICIPANT", $this->lng->txt('tst_header_participant_no_answer'));
452  }
453 
454  $compare_template->setVariable("HEADER_SOLUTION", $this->lng->txt('tst_header_solution'));
455  $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_graphical_output, false, $show_question_only, $show_feedback);
456  $best_output = $question_gui->getSolutionOutput($active_id, $pass, false, false, $show_question_only, false, true);
457 
458  $compare_template->setVariable('PARTICIPANT', $result_output);
459  $compare_template->setVariable('SOLUTION', $best_output);
460  if ($question_gui instanceof assTextQuestionGUI && $this->object->getAutosave()) {
461  $intermediate_output = $question_gui->getAutoSavedSolutionOutput(
462  $active_id,
463  $pass,
464  false,
465  false,
466  false,
467  false,
468  false,
469  false,
470  false
471  );
472  $compare_template->setVariable('TXT_INTERMEDIATE', $this->lng->txt('autosavecontent'));
473  $compare_template->setVariable('INTERMEDIATE', $intermediate_output);
474  }
475  $template->setVariable('SOLUTION_OUTPUT', $compare_template->get());
476  } else {
477  $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_graphical_output, false, $show_question_only, $show_feedback);
478  if ($question_gui instanceof assTextQuestionGUI && $this->object->getAutosave()) {
479  $intermediate_output = $question_gui->getAutoSavedSolutionOutput(
480  $active_id,
481  $pass,
482  false,
483  false,
484  false,
485  false,
486  false,
487  false,
488  false
489  );
490  $template->setVariable('TXT_INTERMEDIATE', $this->lng->txt('autosavecontent'));
491  $template->setVariable('INTERMEDIATE', $intermediate_output);
492  }
493  $template->setVariable('SOLUTION_OUTPUT', $result_output);
494  }
495 
496  $maintemplate->setCurrentBlock("printview_question");
497  $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
498  $maintemplate->parseCurrentBlock();
499  $counter++;
500  }
501  }
502  }
503  }
504 
505  if ($testResultHeaderLabelBuilder !== null) {
506  if ($pass !== null) {
507  $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel($pass + 1);
508  } else {
509  $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
510  }
511  } else {
512  $headerText = '';
513  }
514 
515  $maintemplate->setVariable("RESULTS_OVERVIEW", $headerText);
516  return $maintemplate->get();
517  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$objectives
buildQuestionAnswerShuffler(int $question_id, int $active_id, int $pass_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPassListOfAnswersWithScoring()

ilTestServiceGUI::getPassListOfAnswersWithScoring ( $result_array,
  $active_id,
  $pass,
  $show_solutions = false 
)

Returns the list of answers of a users test pass and offers a scoring option.

Parameters
array$result_arrayAn array containing the results of the users test pass (generated by ilObjTest::getTestResult)
integer$active_idActive ID of the active user
integer$passTest pass
boolean$show_solutionsTRUE, if the solution output should be shown in the answers, FALSE otherwise
Returns
string HTML code of the list of answers public
Deprecated:

Definition at line 558 of file class.ilTestServiceGUI.php.

References ilObjAssessmentFolder\_getManualScoring(), assQuestion\_getReachedPoints(), ILIAS\Repository\ctrl(), ilObjTest\getSingleManualFeedback(), ilYuiUtil\initDomEvent(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilLegacyFormElementsUtil\prepareFormOutput().

558  : string
559  {
560  $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", true, true, "Modules/Test");
562 
563  $counter = 1;
564  // output of questions with solutions
565  foreach ($result_array as $question_data) {
566  $question = $question_data["qid"];
567  if (is_numeric($question)) {
568  $question_gui = $this->object->createQuestionGUI("", $question);
569  if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
570  $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", true, true, "Modules/TestQuestionPool");
571  $scoretemplate = new ilTemplate("tpl.il_as_tst_manual_scoring_points.html", true, true, "Modules/Test");
572  #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question");
573  $template->setVariable("COUNTER_QUESTION", $counter . ". ");
574  $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()));
575  $points = $question_gui->object->getMaximumPoints();
576  if ($points == 1) {
577  $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point"));
578  } else {
579  $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points"));
580  }
581 
582  $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? true : false;
583  $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, false, $show_question_only, $this->object->getShowSolutionFeedback(), false, true);
584 
585  $solout = $question_gui->object->getSuggestedSolutionOutput();
586  if (strlen($solout)) {
587  $scoretemplate->setCurrentBlock("suggested_solution");
588  $scoretemplate->setVariable("TEXT_SUGGESTED_SOLUTION", $this->lng->txt("solution_hint"));
589  $scoretemplate->setVariable("VALUE_SUGGESTED_SOLUTION", $solout);
590  $scoretemplate->parseCurrentBlock();
591  }
592 
593  $scoretemplate->setCurrentBlock("feedback");
594  $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question);
595  $feedback = ilObjTest::getSingleManualFeedback((int) $active_id, (int) $question, (int) $pass)['feedback'] ?? '';
596  $scoretemplate->setVariable(
597  "VALUE_FEEDBACK",
599  $this->object->prepareTextareaOutput($feedback, true)
600  )
601  );
602  $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback"));
603  $scoretemplate->parseCurrentBlock();
604 
605  $scoretemplate->setVariable("NAME_INPUT", $question);
606  $this->ctrl->setParameter($this, "active_id", $active_id);
607  $this->ctrl->setParameter($this, "pass", $pass);
608  $scoretemplate->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "manscoring"));
609  $scoretemplate->setVariable("LABEL_INPUT", $this->lng->txt("tst_change_points_for_question"));
610  $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\"");
611  $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save"));
612 
613  $template->setVariable("SOLUTION_OUTPUT", $result_output);
614  $maintemplate->setCurrentBlock("printview_question");
615  $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
616  $maintemplate->setVariable("QUESTION_SCORING", $scoretemplate->get());
617  $maintemplate->parseCurrentBlock();
618  }
619  $counter++;
620  }
621  }
622  if ($counter == 1) {
623  // no scorable questions found
624  $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found"));
625  }
626  $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass + 1));
627 
628  include_once "./Services/YUI/classes/class.ilYuiUtil.php";
630 
631  return $maintemplate->get();
632  }
static initDomEvent(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent used in Services/Calendar, Modules/Session, Modules/Test (Jan 2022) ...
static prepareFormOutput($a_str, bool $a_strip=false)
static getSingleManualFeedback(int $active_id, int $question_id, int $pass)
static _getReachedPoints(int $active_id, int $question_id, int $pass)
static _getManualScoring()
Retrieve the manual scoring settings.
+ Here is the call graph for this function:

◆ getPassOverviewTableData()

ilTestServiceGUI::getPassOverviewTableData ( ilTestSession  $testSession,
  $passes,
  $withResults 
)

This method uses the data of a given test pass to create an evaluation for displaying into a table used in the ilTestEvaluationGUI.

Parameters
ilTestSession$testSessionthe current test session
array$passesAn integer array of test runs
boolean$withResults$withResults tells the method to include all scoring data into the returned row
Returns
array The array contains the date of the requested row

Definition at line 194 of file class.ilTestServiceGUI.php.

References $data, buildQuestionRelatedObjectivesList(), ilTestSession\getActiveId(), ilLOTestQuestionAdapter\getInstance(), getObjectiveOrientedContainer(), ilAssQuestionHintTracking\getRequestRequestStatisticDataRegisterByActiveId(), ilObjTest\lookupLastTestPassAccess(), and ILIAS\Repository\object().

Referenced by ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), and ilTestEvaluationGUI\outUserResultsOverview().

194  : array
195  {
196  $data = array();
197 
198  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
199  $considerHiddenQuestions = false;
200 
201  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
202  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
203  } else {
204  $considerHiddenQuestions = true;
205  }
206 
207  $scoredPass = $this->object->_getResultPass($testSession->getActiveId());
208 
209  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
211  $testSession->getActiveId()
212  );
213 
214  foreach ($passes as $pass) {
215  $row = [
216  'scored' => false,
217  'pass' => $pass,
218  'date' => ilObjTest::lookupLastTestPassAccess($testSession->getActiveId(), $pass)
219  ];
220  $considerOptionalQuestions = true;
221 
222  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
223  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->getActiveId(), $pass);
224  $testSequence->loadFromDb();
225  $testSequence->loadQuestions();
226 
227  if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
228  $considerOptionalQuestions = false;
229  }
230 
231  $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
232  $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
233 
234  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
235  $objectivesList->loadObjectivesTitles();
236 
237  $row['objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
238  }
239 
240  if ($withResults) {
241  $result_array = $this->object->getTestResult($testSession->getActiveId(), $pass, false, $considerHiddenQuestions, $considerOptionalQuestions);
242 
243  foreach ($result_array as $resultStructKEY => $question) {
244  if ($resultStructKEY === 'test' || $resultStructKEY === 'pass') {
245  continue;
246  }
247 
248  $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId($pass, $question['qid']);
249 
250  if ($requestData instanceof ilAssQuestionHintRequestStatisticData && $result_array[$resultStructKEY]['requested_hints'] === null) {
251  $result_array['pass']['total_requested_hints'] += $requestData->getRequestsCount();
252 
253  $result_array[$resultStructKEY]['requested_hints'] = $requestData->getRequestsCount();
254  $result_array[$resultStructKEY]['hint_points'] = $requestData->getRequestsPoints();
255  }
256  }
257 
258  if (!$result_array['pass']['total_max_points']) {
259  $row['percentage'] = 0;
260  } else {
261  $row['percentage'] = ($result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points']) * 100;
262  }
263 
264  $row['max_points'] = $result_array['pass']['total_max_points'];
265  $row['reached_points'] = $result_array['pass']['total_reached_points'];
266  $row['scored'] = ($pass == $scoredPass);
267  $row['num_workedthrough_questions'] = $result_array['pass']['num_workedthrough'];
268  $row['num_questions_total'] = $result_array['pass']['num_questions_total'];
269 
270  if ($this->object->isOfferingQuestionHintsEnabled()) {
271  $row['hints'] = $result_array['pass']['total_requested_hints'];
272  }
273  }
274 
275  $data[] = $row;
276  }
277 
278  return $data;
279  }
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
static lookupLastTestPassAccess($activeId, $passIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionResultForTestUsers()

ilTestServiceGUI::getQuestionResultForTestUsers (   $question_id,
  $test_id 
)

Creates a HTML representation for the results of a given question in a test.

Parameters
integer$question_idThe original id of the question
integer$test_idThe test id

Definition at line 1058 of file class.ilTestServiceGUI.php.

References $i, ilTestPDFGenerator\generatePDF(), getResultsHeadUserAndPass(), ILIAS\Repository\object(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilPDFGeneratorUtils\prepareGenerationRequest(), and assQuestionGUI\RENDER_PURPOSE_PRINT_PDF.

Referenced by ilTestEvaluationGUI\exportQuestionForAllParticipants().

1059  {
1060  // prepare generation before contents are processed (for mathjax)
1062 
1063  // REQUIRED, since we call this object regardless of the loop
1064  $question_gui = $this->object->createQuestionGUI("", $question_id);
1065 
1066  $this->object->setAccessFilteredParticipantList(
1067  $this->object->buildStatisticsAccessFilteredParticipantList()
1068  );
1069 
1070  $foundusers = $this->object->getParticipantsForTestAndQuestion($test_id, $question_id);
1071  $output = '';
1072  foreach ($foundusers as $active_id => $passes) {
1073  $resultpass = $this->object->_getResultPass($active_id);
1074  for ($i = 0; $i < count($passes); $i++) {
1075  if (($resultpass !== null) && ($resultpass == $passes[$i]["pass"])) {
1076  if ($output) {
1077  $output .= "<br /><br /><br />";
1078  }
1079 
1080  // check if re-instantiation is really neccessary
1081  $question_gui = $this->object->createQuestionGUI("", $passes[$i]["qid"]);
1082  $output .= $this->getResultsHeadUserAndPass($active_id, $resultpass + 1);
1083  $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
1084  $output .= $question_gui->getSolutionOutput(
1085  $active_id,
1086  $resultpass,
1087  $graphicalOutput = false,
1088  $result_output = false,
1089  $show_question_only = false,
1090  $show_feedback = false
1091  );
1092  }
1093  }
1094  }
1095 
1096  require_once './Modules/Test/classes/class.ilTestPDFGenerator.php';
1097  ilTestPDFGenerator::generatePDF($output, ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $question_gui->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1098  }
const PDF_USER_RESULT
PDF Purposes.
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest(string $service, string $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResultsHeadUserAndPass()

ilTestServiceGUI::getResultsHeadUserAndPass (   $active_id,
  $pass 
)

Returns the user and pass data for a test results output.

Parameters
integer$active_idThe active ID of the user
Returns
string HTML code of the user data for the test results public

Definition at line 1012 of file class.ilTestServiceGUI.php.

References ilObjUser\_lookupLogin(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by getQuestionResultForTestUsers().

1012  : string
1013  {
1014  $template = new ilTemplate("tpl.il_as_tst_results_head_user_pass.html", true, true, "Modules/Test");
1015  include_once './Services/User/classes/class.ilObjUser.php';
1016  $user_id = $this->object->_getUserIdFromActiveId($active_id);
1017  if (strlen(ilObjUser::_lookupLogin($user_id)) > 0) {
1018  $user = new ilObjUser($user_id);
1019  } else {
1020  $user = new ilObjUser();
1021  $user->setLastname($this->lng->txt("deleted_user"));
1022  }
1023  if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == false))) {
1024  $template->setCurrentBlock("user_matric");
1025  $template->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
1026  $template->parseCurrentBlock();
1027  $template->setCurrentBlock("user_matric_value");
1028  $template->setVariable("VALUE_USR_MATRIC", $user->getMatriculation());
1029  $template->parseCurrentBlock();
1030  $template->touchBlock("user_matric_separator");
1031  }
1032 
1033  $invited_user = array_pop($this->object->getInvitedUsers($user_id));
1034  if (strlen($invited_user["clientip"] ?? '')) {
1035  $template->setCurrentBlock("user_clientip");
1036  $template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
1037  $template->parseCurrentBlock();
1038  $template->setCurrentBlock("user_clientip_value");
1039  $template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
1040  $template->parseCurrentBlock();
1041  $template->touchBlock("user_clientip_separator");
1042  }
1043 
1044  $template->setVariable("TXT_USR_NAME", $this->lng->txt("name"));
1045  $uname = $this->object->userLookupFullName($user_id, false);
1046  $template->setVariable("VALUE_USR_NAME", $uname);
1047  $template->setVariable("TXT_PASS", $this->lng->txt("scored_pass"));
1048  $template->setVariable("VALUE_PASS", $pass);
1049  return $template->get();
1050  }
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResultsOfUserOutput()

ilTestServiceGUI::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.

Parameters
ilTestSession | ilTestSessionDynamicQuestionSet$testSession
integer$active_id
integer$pass
boolean$show_pass_details
boolean$show_answers
boolean$show_question_only
boolean$show_reached_pointspublic

Definition at line 870 of file class.ilTestServiceGUI.php.

References $DIC, buildQuestionRelatedObjectivesList(), ilSession\get(), getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getGradingMessageBuilder(), ilLOTestQuestionAdapter\getInstance(), getObjectiveOrientedContainer(), getPassDetailsOverviewTableGUI(), getPassListOfAnswers(), getResultsSignature(), isGradingMessageRequired(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ilObjTest\lookupLastTestPassAccess(), ILIAS\Repository\object(), populateExamId(), and populatePassFinishDate().

870  : string
871  {
872  global $DIC;
873  $ilObjDataCache = $DIC['ilObjDataCache'];
874 
875  include_once("./Services/UICore/classes/class.ilTemplate.php");
876  $template = new ilTemplate("tpl.il_as_tst_results_participant.html", true, true, "Modules/Test");
877 
878  if ($this->participantData instanceof ilTestParticipantData) {
879  $user_id = $this->participantData->getUserIdByActiveId($active_id);
880  $uname = $this->participantData->getConcatedFullnameByActiveId($active_id, false);
881  } else {
882  $user_id = $this->object->_getUserIdFromActiveId($active_id);
883  $uname = $this->object->userLookupFullName($user_id, true);
884  }
885 
886  if ($this->object->getAnonymity()) {
887  $uname = $this->lng->txt('anonymous');
888  }
889 
890  if ((($this->testrequest->isset('pass')) && (strlen($this->testrequest->raw("pass")) > 0)) || (!is_null($pass))) {
891  if (is_null($pass)) {
892  $pass = $this->testrequest->raw("pass");
893  }
894  }
895 
896  if (!is_null($pass)) {
897  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
898  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
899  $objectivesList = null;
900 
901  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
902  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
903  $testSequence->loadFromDb();
904  $testSequence->loadQuestions();
905 
906  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
907  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
908 
909  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
910  $objectivesList->loadObjectivesTitles();
911 
912  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
913  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
914  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
915  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
916  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
917  }
918 
919  $result_array = $this->object->getTestResult(
920  $active_id,
921  $pass,
922  false,
923  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
924  );
925 
926  $user_id = $this->object->_getUserIdFromActiveId($active_id);
927  $showAllAnswers = true;
928  if ($this->object->isExecutable($testSession, $user_id)) {
929  $showAllAnswers = false;
930  }
931  if ($show_answers) {
932  $list_of_answers = $this->getPassListOfAnswers(
933  $result_array,
934  $active_id,
935  $pass,
936  ilSession::get('tst_results_show_best_solutions'),
937  $showAllAnswers,
938  $show_question_only,
939  $show_reached_points,
940  $show_pass_details,
941  $objectivesList,
942  $testResultHeaderLabelBuilder
943  );
944  $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
945  }
946 
947  if ($show_pass_details) {
948  $overviewTableGUI = $this->getPassDetailsOverviewTableGUI(
949  $result_array,
950  $active_id,
951  $pass,
952  $targetGUI,
953  "getResultsOfUserOutput",
954  '',
955  $show_answers,
956  $objectivesList
957  );
958  $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
959  $template->setVariable("PASS_DETAILS", $overviewTableGUI->getHTML());
960  }
961 
962  $signature = $this->getResultsSignature();
963  $template->setVariable("SIGNATURE", $signature);
964 
965  if ($this->object->isShowExamIdInTestResultsEnabled()) {
966  $template->setCurrentBlock('exam_id_footer');
967  $template->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
968  $testSession->getActiveId(),
969  $pass
970  ));
971  $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
972  $template->parseCurrentBlock();
973  }
974  }
975 
976  $template->setCurrentBlock('participant_back_anchor');
977  $template->setVariable("HREF_PARTICIPANT_BACK_ANCHOR", "#tst_results_toolbar");
978  $template->setVariable("TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt('tst_back_to_top'));
979  $template->parseCurrentBlock();
980 
981  $template->setCurrentBlock('participant_block_id');
982  $template->setVariable("PARTICIPANT_BLOCK_ID", "participant_active_{$active_id}");
983  $template->parseCurrentBlock();
984 
985  if ($this->isGradingMessageRequired()) {
986  $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
987  $gradingMessageBuilder->buildList();
988 
989  $template->setCurrentBlock('grading_message');
990  $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
991  $template->parseCurrentBlock();
992  }
993 
994 
995  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
996  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
997  $template->setVariable("USER_DATA", $user_data);
998 
999  $this->populateExamId($template, (int) $active_id, (int) $pass);
1000  $this->populatePassFinishDate($template, ilObjTest::lookupLastTestPassAccess($active_id, $pass));
1001 
1002  return $template->get();
1003  }
static get(string $a_var)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getResultsSignature()
Returns HTML code for a signature field.
global $DIC
Definition: feed.php:28
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
static lookupLastTestPassAccess($activeId, $passIndex)
populatePassFinishDate($tpl, $passFinishDate)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
getPassDetailsOverviewTableGUI( $result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
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.
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:

◆ getResultsSignature()

ilTestServiceGUI::getResultsSignature ( )

Returns HTML code for a signature field.

Returns
string HTML code of the date and signature field for the test results public

Definition at line 702 of file class.ilTestServiceGUI.php.

References ilDatePresentation\formatDate(), ilUtil\getImagePath(), IL_CAL_UNIX, ILIAS\Repository\lng(), ILIAS\Repository\object(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outUserListOfAnswerPasses(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestPlayerAbstractGUI\showListOfAnswers().

702  : string
703  {
704  if ($this->object->getShowSolutionSignature() && !$this->object->getAnonymity()) {
705  $template = new ilTemplate("tpl.il_as_tst_results_userdata_signature.html", true, true, "Modules/Test");
706  $template->setVariable("TXT_DATE", $this->lng->txt("date"));
709  $template->setVariable("VALUE_DATE", ilDatePresentation::formatDate(new ilDate(time(), IL_CAL_UNIX)));
711  $template->setVariable("TXT_SIGNATURE", $this->lng->txt("tst_signature"));
712  $template->setVariable("IMG_SPACER", ilUtil::getImagePath("spacer.png"));
713  return $template->get();
714  } else {
715  return "";
716  }
717  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isContextResultPresentation()

ilTestServiceGUI::isContextResultPresentation ( )
Returns
boolean

Definition at line 114 of file class.ilTestServiceGUI.php.

References $contextResultPresentation.

Referenced by getPassListOfAnswers().

114  : bool
115  {
117  }
+ Here is the caller graph for this function:

◆ isGradingMessageRequired()

ilTestServiceGUI::isGradingMessageRequired ( )
protected

Definition at line 1114 of file class.ilTestServiceGUI.php.

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

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserPassDetails(), and ilTestEvaluationGUI\outUserResultsOverview().

1114  : bool
1115  {
1116  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1117  return false;
1118  }
1119 
1120  if ($this->object->isShowGradingStatusEnabled()) {
1121  return true;
1122  }
1123 
1124  if ($this->object->isShowGradingMarkEnabled()) {
1125  return true;
1126  }
1127 
1128  return false;
1129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPdfDeliveryRequest()

ilTestServiceGUI::isPdfDeliveryRequest ( )
protected
Returns
bool

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

Referenced by buildPassDetailsOverviewTableGUI(), ilTestEvaluationGUI\executeCommand(), getCorrectSolutionOutput(), getPassDetailsOverviewTableGUI(), getPassListOfAnswers(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserPassDetails(), ilTestEvaluationGUI\outUserResultsOverview(), populateContent(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

327  : bool
328  {
329  if (!$this->testrequest->isset('pdf')) {
330  return false;
331  }
332 
333  if (!(bool) $this->testrequest->raw('pdf')) {
334  return false;
335  }
336 
337  return true;
338  }
+ Here is the caller graph for this function:

◆ outCorrectSolution()

ilTestServiceGUI::outCorrectSolution ( )
protected

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

public

Definition at line 1243 of file class.ilTestServiceGUI.php.

References $DIC, ilObjTestGUI\accessViolationRedirect(), buildQuestionRelatedObjectivesList(), ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), getCorrectSolutionOutput(), ilLOTestQuestionAdapter\getInstance(), getObjectiveOrientedContainer(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by outCorrectSolutionCmd().

1244  {
1245  if (!$this->object->getShowSolutionDetails()) {
1246  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"), true);
1247  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1248  }
1249 
1250  $testSession = $this->testSessionFactory->getSession();
1251  $activeId = $testSession->getActiveId();
1252 
1253  if (!($activeId > 0)) {
1254  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1255  }
1256 
1257  $this->ctrl->saveParameter($this, "pass");
1258  $pass = (int) $this->testrequest->raw("pass");
1259 
1260  $questionId = (int) $this->testrequest->raw('evaluation');
1261 
1262  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
1263  $testSequence->loadFromDb();
1264  $testSequence->loadQuestions();
1265 
1266  if (!$testSequence->questionExists($questionId)) {
1268  }
1269 
1270  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1271  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
1272  $testSequence->loadFromDb();
1273  $testSequence->loadQuestions();
1274 
1275  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1276  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1277  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1278  $objectivesList->loadObjectivesTitles();
1279  } else {
1280  $objectivesList = null;
1281  }
1282 
1283  global $DIC;
1284  $ilTabs = $DIC['ilTabs'];
1285 
1286  if ($this instanceof ilTestEvalObjectiveOrientedGUI) {
1287  $ilTabs->setBackTarget(
1288  $this->lng->txt("tst_back_to_virtual_pass"),
1289  $this->ctrl->getLinkTarget($this, 'showVirtualPass')
1290  );
1291  } else {
1292  $ilTabs->setBackTarget(
1293  $this->lng->txt("tst_back_to_pass_details"),
1294  $this->ctrl->getLinkTarget($this, 'outUserPassDetails')
1295  );
1296  }
1297  $ilTabs->clearSubTabs();
1298 
1299  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1300  $this->tpl->setCurrentBlock("ContentStyle");
1301  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1302  $this->tpl->parseCurrentBlock();
1303 
1304  $this->tpl->setCurrentBlock("SyntaxStyle");
1305  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1306  $this->tpl->parseCurrentBlock();
1307 
1308  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1309  if ($this->object->getShowSolutionAnswersOnly()) {
1310  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1311  }
1312 
1313  $solution = $this->getCorrectSolutionOutput($questionId, $activeId, $pass, $objectivesList);
1314 
1315  $this->tpl->setContent($solution);
1316  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static accessViolationRedirect()
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
global $DIC
Definition: feed.php:28
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outCorrectSolutionCmd()

ilTestServiceGUI::outCorrectSolutionCmd ( )
protected

Definition at line 1233 of file class.ilTestServiceGUI.php.

References outCorrectSolution().

1234  {
1235  $this->outCorrectSolution(); // cannot be named xxxCmd, because it's also called from context without Cmd in names
1236  }
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
+ Here is the call graph for this function:

◆ populateContent()

ilTestServiceGUI::populateContent (   $content)
protected
Parameters
string$content

Definition at line 1208 of file class.ilTestServiceGUI.php.

References ilTestPDFGenerator\generatePDF(), isPdfDeliveryRequest(), ILIAS\Repository\object(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and PDF_USER_RESULT.

Referenced by ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().

1209  {
1210  if ($this->isPdfDeliveryRequest()) {
1212  $content,
1214  $this->object->getTitleFilenameCompliant(),
1216  );
1217  } else {
1218  $this->tpl->setContent($content);
1219  }
1220  }
const PDF_USER_RESULT
PDF Purposes.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateExamId()

ilTestServiceGUI::populateExamId ( ilTemplate  $tpl,
int  $activeId,
int  $pass 
)
Parameters
ilTemplate$tpl
int$activeId
int$pass

Definition at line 1337 of file class.ilTestServiceGUI.php.

References ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), and HTML_Template_IT\setVariable().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), and ilTestEvaluationGUI\outUserPassDetails().

1338  {
1339  if ($this->object->isShowExamIdInTestResultsEnabled()) {
1340  $tpl->setVariable("EXAM_ID_TXT", $this->lng->txt('exam_id'));
1341  $tpl->setVariable('EXAM_ID', ilObjTest::lookupExamId(
1342  $activeId,
1343  $pass
1344  ));
1345  }
1346  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populatePassFinishDate()

ilTestServiceGUI::populatePassFinishDate (   $tpl,
  $passFinishDate 
)
Parameters
ilTemplate$tpl
int$passFinishDate

Definition at line 1322 of file class.ilTestServiceGUI.php.

References $tpl, ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

Referenced by getResultsOfUserOutput(), ilTestEvaluationGUI\outParticipantsPassDetails(), and ilTestEvaluationGUI\outUserPassDetails().

1323  {
1326  $passFinishDate = ilDatePresentation::formatDate(new ilDateTime($passFinishDate, IL_CAL_UNIX));
1328  $tpl->setVariable("PASS_FINISH_DATE_LABEL", $this->lng->txt('tst_pass_finished_on'));
1329  $tpl->setVariable("PASS_FINISH_DATE_VALUE", $passFinishDate);
1330  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContextResultPresentation()

ilTestServiceGUI::setContextResultPresentation (   $contextResultPresentation)
Parameters
boolean$contextResultPresentation

Definition at line 122 of file class.ilTestServiceGUI.php.

References $contextResultPresentation.

Referenced by ilTestEvaluationGUI\outUserListOfAnswerPasses().

123  {
124  $this->contextResultPresentation = $contextResultPresentation;
125  }
+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainer()

ilTestServiceGUI::setObjectiveOrientedContainer ( ilTestObjectiveOrientedContainer  $objectiveOrientedContainer)
Parameters
ilTestObjectiveOrientedContainer$objectiveOrientedContainer

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

References $objectiveOrientedContainer.

285  {
286  $this->objectiveOrientedContainer = $objectiveOrientedContainer;
287  }

◆ setParticipantData()

ilTestServiceGUI::setParticipantData (   $participantData)
Parameters
\ilTestParticipantData$participantData

Definition at line 173 of file class.ilTestServiceGUI.php.

References $participantData.

174  {
175  $this->participantData = $participantData;
176  }

Field Documentation

◆ $contextResultPresentation

ilTestServiceGUI::$contextResultPresentation = true
private

◆ $ctrl

ilTestServiceGUI::$ctrl

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

◆ $db

ilTestServiceGUI::$db
protected

◆ $ilias

ilTestServiceGUI::$ilias

◆ $lng

◆ $objCache

ilTestServiceGUI::$objCache
protected

Definition at line 77 of file class.ilTestServiceGUI.php.

Referenced by ilTestEvaluationGUI\outUserPassDetails().

◆ $object

ilTestServiceGUI::$object = null

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

Referenced by getObject(), and ilTestEvaluationGUI\getObject().

◆ $objectiveOrientedContainer

ilTestServiceGUI::$objectiveOrientedContainer
private

◆ $participantData

◆ $randomGroup

RandomGroup ilTestServiceGUI::$randomGroup
private

Definition at line 102 of file class.ilTestServiceGUI.php.

◆ $ref_id

ilTestServiceGUI::$ref_id

Definition at line 81 of file class.ilTestServiceGUI.php.

◆ $refinery

Refinery ilTestServiceGUI::$refinery
protected

Definition at line 58 of file class.ilTestServiceGUI.php.

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

◆ $service

ilTestServiceGUI::$service = null

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

◆ $tabs

ilTestServiceGUI::$tabs
protected

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

Referenced by ilTestEvaluationGUI\outUserPassDetails().

◆ $testrequest

ILIAS Test InternalRequestService ilTestServiceGUI::$testrequest
protected

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

◆ $testSequenceFactory

ilTestServiceGUI::$testSequenceFactory = null
protected

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

Referenced by ilTestOutputGUI\executeCommand().

◆ $testSessionFactory

ilTestServiceGUI::$testSessionFactory = null
protected

Definition at line 88 of file class.ilTestServiceGUI.php.

Referenced by ilTestOutputGUI\executeCommand().

◆ $tpl

◆ $tree

ilTestServiceGUI::$tree

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