ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestEvaluationGUI Class Reference

Output class for assessment test evaluation. More...

+ Inheritance diagram for ilTestEvaluationGUI:
+ Collaboration diagram for ilTestEvaluationGUI:

Public Member Functions

 __construct (ilObjTest $a_object)
 ilTestEvaluationGUI constructor More...
 
 getTestAccess ()
 
 setTestAccess ($testAccess)
 
 executeCommand ()
 execute command More...
 
getHeaderNames ()
 
getHeaderVars ()
 
 filterEvaluation ()
 
 resetfilterEvaluation ()
 
 outEvaluation ()
 Creates the evaluation output for the test. More...
 
 detailedEvaluation ()
 Creates the detailed evaluation output for a selected participant. More...
 
 exportQuestionForAllParticipants ()
 Creates a PDF representation of the answers for a given question in a test. More...
 
 exportFileUploadsForAllParticipants ()
 Creates a ZIP file containing all file uploads for a given question in a test. More...
 
 eval_a ()
 Output of anonymous aggregated results for the test. More...
 
 exportEvaluation ()
 Exports the evaluation data to a selected file format. More...
 
 exportAggregatedResults ()
 Exports the aggregated results. More...
 
 exportCertificate ()
 Exports the user results as PDF certificates using XSL-FO via XML:RPC calls. More...
 
 getEvaluationQuestionId ($question_id, $original_id="")
 Returns the ID of a question for evaluation purposes. More...
 
 outParticipantsPassDetails ()
 Output of the pass details of an existing test pass for the test statistics. More...
 
 outParticipantsResultsOverview ()
 Output of the pass overview for a test called from the statistics. More...
 
 outUserPassDetailsSetTableFilter ()
 
 outUserPassDetailsResetTableFilter ()
 
 outParticipantsPassDetailsSetTableFilter ()
 
 outParticipantsPassDetailsResetTableFilter ()
 
 outUserPassDetails ()
 Output of the pass details of an existing test pass for the active test participant. More...
 
 outUserResultsOverview ()
 Output of the pass overview for a test called by a test participant. More...
 
 outUserListOfAnswerPasses ()
 Output of the pass overview for a user when he/she wants to see his/her list of answers. More...
 
 passDetails ()
 Output of the learners view of an existing test pass. More...
 
 singleResults ()
 Creates user results for single questions. More...
 
 outCertificate ()
 Output of a test certificate. More...
 
 confirmDeletePass ()
 
 cancelDeletePass ()
 
 finishTestPassForSingleUser ()
 
 confirmFinishTestPassForUser ()
 
 finishAllUserPasses ()
 
 confirmFinishTestPassForAllUser ()
 
- 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)
 

Protected Member Functions

 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 finishTestPass ($active_id, $obj_id)
 
 redirectBackToParticipantsScreen ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 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

 $testAccess
 
 $processLockerFactory
 
- Protected Attributes inherited from ilTestServiceGUI
 $db
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Member Functions

 redirectToPassDeletionContext ($context)
 

Additional Inherited Members

- Data Fields inherited from ilTestServiceGUI
 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 

Detailed Description

Output class for assessment test evaluation.

The ilTestEvaluationGUI class creates the output for the ilObjTestGUI class when authors evaluate a test. This saves some heap space because the ilObjTestGUI class will be much smaller then

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
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

ilTestEvaluationGUI: ilTestPassDetailsOverviewTableGUI ilTestEvaluationGUI: ilTestResultsToolbarGUI ilTestEvaluationGUI: ilTestPassDeletionConfirmationGUI

Definition at line 28 of file class.ilTestEvaluationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestEvaluationGUI::__construct ( ilObjTest  $a_object)

ilTestEvaluationGUI constructor

The constructor takes possible arguments an creates an instance of the ilTestEvaluationGUI object.

Parameters
ilObjTest$a_objectAssociated ilObjTest class

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

References $DIC.

49  {
50  parent::__construct($a_object);
51 
52  global $DIC; /* @var ILIAS\DI\Container $DIC */
53 
54  require_once 'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
55  $this->processLockerFactory = new ilTestProcessLockerFactory(
56  new ilSetting('assessment'),
57  $DIC->database()
58  );
59  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

Definition at line 1764 of file class.ilTestEvaluationGUI.php.

References $_POST, and redirectToPassDeletionContext().

1765  {
1766  $this->redirectToPassDeletionContext($_POST['context']);
1767  }
$_POST["username"]
+ Here is the call graph for this function:

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

Definition at line 1742 of file class.ilTestEvaluationGUI.php.

References $_GET, $context, $DIC, ilTestServiceGUI\$tpl, ilTestPassDeletionConfirmationGUI\CONTEXT_PASS_OVERVIEW, and redirectToPassDeletionContext().

1743  {
1744  if (isset($_GET['context']) && strlen($_GET['context'])) {
1745  $context = $_GET['context'];
1746  } else {
1748  }
1749 
1750  if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1752  }
1753 
1754  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1755 
1756  $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1757  $confirm->build((int) $_GET['active_id'], (int) $_GET['pass'], $context);
1758 
1759  global $DIC;
1760  $tpl = $DIC['tpl'];
1761  $tpl->setContent($this->ctrl->getHTML($confirm));
1762  }
$context
Definition: webdav.php:25
global $DIC
Definition: saml.php:7
$_GET["client_id"]
+ Here is the call graph for this function:

◆ confirmFinishTestPassForAllUser()

ilTestEvaluationGUI::confirmFinishTestPassForAllUser ( )

Definition at line 2165 of file class.ilTestEvaluationGUI.php.

References finishTestPass(), ilTestParticipantAccessFilter\getManageParticipantsUserFilter(), and redirectBackToParticipantsScreen().

2166  {
2167  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2169 
2170  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2171  $participantList = new ilTestParticipantList($this->object);
2172  $participantList->initializeFromDbRows($this->object->getTestParticipants());
2173  $participantList = $participantList->getAccessFilteredList($accessFilter);
2174 
2175  foreach ($participantList as $participant) {
2176  if (!$participant->hasUnfinishedPasses()) {
2177  continue;
2178  }
2179 
2180  $this->finishTestPass($participant->getActiveId(), $this->object->getId());
2181  }
2182 
2184  }
finishTestPass($active_id, $obj_id)
+ Here is the call graph for this function:

◆ confirmFinishTestPassForUser()

ilTestEvaluationGUI::confirmFinishTestPassForUser ( )

Definition at line 2132 of file class.ilTestEvaluationGUI.php.

References $_GET, $DIC, ilTestServiceGUI\$participantData, finishTestPass(), ilTestParticipantAccessFilter\getManageParticipantsUserFilter(), and redirectBackToParticipantsScreen().

2133  {
2134  global $DIC; /* @var ILIAS\DI\Container $DIC */
2135 
2136  $activeId = (int) $_GET["active_id"];
2137 
2138  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2140 
2141  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2142  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
2143  $participantData->setActiveIdsFilter(array($activeId));
2144  $participantData->setParticipantAccessFilter($accessFilter);
2145  $participantData->load($this->object->getTestId());
2146 
2147  if (in_array($activeId, $participantData->getActiveIds())) {
2148  $this->finishTestPass($activeId, $this->object->getId());
2149  }
2150 
2152  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
finishTestPass($active_id, $obj_id)
+ Here is the call graph for this function:

◆ detailedEvaluation()

ilTestEvaluationGUI::detailedEvaluation ( )

Creates the detailed evaluation output for a selected participant.

Creates the detailed evaluation output for a selected participant

public

Definition at line 361 of file class.ilTestEvaluationGUI.php.

References $_GET, $data, $DIC, $form, $pass, $table, ilObjTestGUI\accessViolationRedirect(), ilDatePresentation\formatDate(), ilLinkButton\getInstance(), ilUtil\getStyleSheetLocation(), getTestAccess(), IL_CAL_UNIX, ilObjTest\lookupPassResultsUpdateTimestamp(), SCORE_BEST_PASS, ilUtil\sendInfo(), ilNonEditableValueGUI\setValue(), and ilTestTabsManager\TAB_ID_STATISTICS.

362  {
363  global $DIC; /* @var ILIAS\DI\Container $DIC */
364 
365  if (!$this->getTestAccess()->checkStatisticsAccess()) {
367  }
368 
369  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_STATISTICS);
370 
371  $active_id = $_GET['active_id'];
372 
373  if (!$this->getTestAccess()->checkResultsAccessForActiveId($active_id)) {
375  }
376 
377  if (strlen($active_id) == 0) {
378  ilUtil::sendInfo($this->lng->txt('detailed_evaluation_missing_active_id'), true);
379  $this->ctrl->redirect($this, 'outEvaluation');
380  }
381 
382  $this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_print.css', 'Modules/Test'), 'print');
383 
384  $toolbar = $DIC['ilToolbar'];
385 
386  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
387  $backBtn = ilLinkButton::getInstance();
388  $backBtn->setCaption('back');
389  $backBtn->setUrl($this->ctrl->getLinkTarget($this, 'outEvaluation'));
390  $toolbar->addInputItem($backBtn);
391 
392  $this->object->setAccessFilteredParticipantList(
393  $this->object->buildStatisticsAccessFilteredParticipantList()
394  );
395 
396  $data = &$this->object->getCompleteEvaluationData();
397 
398  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
399  $form = new ilPropertyFormGUI();
400  $form->setTitle(sprintf(
401  $this->lng->txt('detailed_evaluation_for'),
402  $data->getParticipant($active_id)->getName()
403  ));
404 
405  $resultPoints = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultspoints'));
406  $resultPoints->setValue($data->getParticipant($active_id)->getReached() . " " . strtolower($this->lng->txt("of")) . " " . $data->getParticipant($active_id)->getMaxpoints() . " (" . sprintf("%2.2f", $data->getParticipant($active_id)->getReachedPointsInPercent()) . " %" . ")");
407  $form->addItem($resultPoints);
408 
409  if (strlen($data->getParticipant($active_id)->getMark())) {
410  $resultMarks = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultsmarks'));
411  $resultMarks->setValue($data->getParticipant($active_id)->getMark());
412  $form->addItem($resultMarks);
413  if (strlen($data->getParticipant($active_id)->getECTSMark())) {
414  $ectsGrade = new ilNonEditableValueGUI($this->lng->txt('ects_grade'));
415  $ectsGrade->setValue($data->getParticipant($active_id)->getECTSMark());
416  $form->addItem($ectsGrade);
417  }
418  }
419 
420  if ($this->object->isOfferingQuestionHintsEnabled()) {
421  $requestHints = new ilNonEditableValueGUI($this->lng->txt('tst_question_hints_requested_hint_count_header'));
422  $requestHints->setValue($data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
423  $form->addItem($requestHints);
424  }
425 
426  $time_seconds = $data->getParticipant($active_id)->getTimeOfWork();
427  $atime_seconds = $data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds / $data->getParticipant($active_id)->getNumberOfQuestions() : 0;
428  $time_hours = floor($time_seconds / 3600);
429  $time_seconds -= $time_hours * 3600;
430  $time_minutes = floor($time_seconds / 60);
431  $time_seconds -= $time_minutes * 60;
432  $timeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_timeofwork'));
433  $timeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
434  $form->addItem($timeOfWork);
435 
436  $this->tpl->setVariable("TXT_ATIMEOFWORK", $this->lng->txt(""));
437  $time_hours = floor($atime_seconds / 3600);
438  $atime_seconds -= $time_hours * 3600;
439  $time_minutes = floor($atime_seconds / 60);
440  $atime_seconds -= $time_minutes * 60;
441  $avgTimeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_atimeofwork'));
442  $avgTimeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
443  $form->addItem($avgTimeOfWork);
444 
445  $firstVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_firstvisit'));
446  $firstVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getFirstVisit(), IL_CAL_UNIX)));
447  $form->addItem($firstVisit);
448 
449  $lastVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_lastvisit'));
450  $lastVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getLastVisit(), IL_CAL_UNIX)));
451  $form->addItem($lastVisit);
452 
453  $nrPasses = new ilNonEditableValueGUI($this->lng->txt('tst_nr_of_passes'));
454  $nrPasses->setValue($data->getParticipant($active_id)->getLastPass() + 1);
455  $form->addItem($nrPasses);
456 
457  $scoredPass = new ilNonEditableValueGUI($this->lng->txt('scored_pass'));
458  if ($this->object->getPassScoring() == SCORE_BEST_PASS) {
459  $scoredPass->setValue($data->getParticipant($active_id)->getBestPass() + 1);
460  } else {
461  $scoredPass->setValue($data->getParticipant($active_id)->getLastPass() + 1);
462  }
463  $form->addItem($scoredPass);
464 
465  $median = $data->getStatistics()->getStatistics()->median();
466  $pct = $data->getParticipant($active_id)->getMaxpoints() ? ($median / $data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
467  $mark = $this->object->mark_schema->getMatchingMark($pct);
468  if (is_object($mark)) {
469  $markMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_mark_median'));
470  $markMedian->setValue($mark->getShortName());
471  $form->addItem($markMedian);
472  }
473 
474  $rankParticipant = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_participant'));
475  $rankParticipant->setValue($data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
476  $form->addItem($rankParticipant);
477 
478  $rankMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_median'));
479  $rankMedian->setValue($data->getStatistics()->getStatistics()->rank_median());
480  $form->addItem($rankMedian);
481 
482  $totalParticipants = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_total_participants'));
483  $totalParticipants->setValue($data->getStatistics()->getStatistics()->count());
484  $form->addItem($totalParticipants);
485 
486  $medianField = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_median'));
487  $medianField->setValue($median);
488  $form->addItem($medianField);
489 
490  $this->tpl->setContent($form->getHTML());
491 
492  $tables = array();
493 
494  for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++) {
495  $finishdate = ilObjTest::lookupPassResultsUpdateTimestamp($active_id, $pass);
496  if ($finishdate > 0) {
497  if (($DIC->access()->checkAccess('write', '', (int) $_GET['ref_id']))) {
498  $this->ctrl->setParameter($this, 'statistics', '1');
499  $this->ctrl->setParameter($this, 'active_id', $active_id);
500  $this->ctrl->setParameter($this, 'pass', $pass);
501  } else {
502  $this->ctrl->setParameter($this, 'statistics', '');
503  $this->ctrl->setParameter($this, 'active_id', '');
504  $this->ctrl->setParameter($this, 'pass', '');
505  }
506 
507  require_once 'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
508  $table = new ilTestDetailedEvaluationStatisticsTableGUI($this, 'detailedEvaluation', ($pass + 1) . '_' . $this->object->getId());
509  $table->setTitle(sprintf($this->lng->txt("tst_eval_question_points"), $pass + 1));
510  if (($DIC->access()->checkAccess('write', '', (int) $_GET['ref_id']))) {
511  $table->addCommandButton('outParticipantsPassDetails', $this->lng->txt('tst_show_answer_sheet'));
512  }
513 
514  $questions = $data->getParticipant($active_id)->getQuestions($pass);
515  if (!is_array($questions)) {
516  $questions = $data->getParticipant($active_id)->getQuestions(0);
517  }
518 
519  $tableData = array();
520 
521  $counter = 0;
522  foreach ((array) $questions as $question) {
523  $userDataData = array(
524  'counter' => ++$counter,
525  'id' => $question['id'],
526  'id_txt' => $this->lng->txt('question_id_short'),
527  'title' => $data->getQuestionTitle($question['id'])
528  );
529 
530  $answeredquestion = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
531  if (is_array($answeredquestion)) {
532  $percent = $answeredquestion['points'] ? $answeredquestion['reached'] / $answeredquestion['points'] * 100.0 : 0;
533  $userDataData['points'] = $answeredquestion['reached'] . ' ' . strtolower($this->lng->txt('of')) . " " . $answeredquestion['points'] . ' (' . sprintf("%.2f", $percent) . ' %)';
534  } else {
535  $userDataData['points'] = '0 ' . strtolower($this->lng->txt('of')) . ' ' . $question['points'] . ' (' . sprintf("%.2f", 0) . ' %) - ' . $this->lng->txt('question_not_answered');
536  }
537 
538  $tableData[] = $userDataData;
539  }
540  $table->setData($tableData);
541 
542  $tables[] = $table->getHTML();
543  }
544  }
545 
546  global $DIC; /* @var ILIAS\DI\Container $DIC */
547  $DIC['tpl']->setContent($form->getHTML() . implode('', $tables));
548  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static lookupPassResultsUpdateTimestamp($active_id, $pass)
const IL_CAL_UNIX
static accessViolationRedirect()
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.
if(isset($_POST['submit'])) $form
Date and time handling
This class represents a non editable value in a property form.
if(empty($password)) $table
Definition: pwgen.php:24
const SCORE_BEST_PASS
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ eval_a()

ilTestEvaluationGUI::eval_a ( )

Output of anonymous aggregated results for the test.

Output of anonymous aggregated results for the test

public

Definition at line 585 of file class.ilTestEvaluationGUI.php.

References $data, $DIC, $i, $rows, ilObjTestGUI\accessViolationRedirect(), ilSubmitButton\getInstance(), getTestAccess(), ilSelectInputGUI\setOptions(), and ilTestTabsManager\TAB_ID_STATISTICS.

586  {
587  global $DIC; /* @var ILIAS\DI\Container $DIC */
588  $ilToolbar = $DIC->toolbar();
589 
590  if (!$this->getTestAccess()->checkStatisticsAccess()) {
592  }
593 
594  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_STATISTICS);
595 
596  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_anonymous_aggregation.html", "Modules/Test");
597 
598  $this->object->setAccessFilteredParticipantList(
599  $this->object->buildStatisticsAccessFilteredParticipantList()
600  );
601 
602  $eval = &$this->object->getCompleteEvaluationData();
603  $data = array();
604  $foundParticipants = &$eval->getParticipants();
605  if (count($foundParticipants)) {
606  $ilToolbar->setFormName('form_output_eval');
607  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'exportAggregatedResults'));
608  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
609  $export_type = new ilSelectInputGUI($this->lng->txt('exp_eval_data'), 'export_type');
610  $export_type->setOptions(array(
611  'excel' => $this->lng->txt('exp_type_excel'),
612  'csv' => $this->lng->txt('exp_type_spss')
613  ));
614  $ilToolbar->addInputItem($export_type, true);
615  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
616  $button = ilSubmitButton::getInstance();
617  $button->setCommand('exportAggregatedResults');
618  $button->setCaption('export');
619  $button->getOmitPreventDoubleSubmission();
620  $ilToolbar->addButtonInstance($button);
621 
622  array_push($data, array(
623  'result' => $this->lng->txt("tst_eval_total_persons"),
624  'value' => count($foundParticipants)
625  ));
626  $total_finished = $eval->getTotalFinishedParticipants();
627  array_push($data, array(
628  'result' => $this->lng->txt("tst_eval_total_finished"),
629  'value' => $total_finished
630  ));
631  $average_time = $this->object->evalTotalStartedAverageTime(
632  $eval->getParticipantIds()
633  );
634  $diff_seconds = $average_time;
635  $diff_hours = floor($diff_seconds / 3600);
636  $diff_seconds -= $diff_hours * 3600;
637  $diff_minutes = floor($diff_seconds / 60);
638  $diff_seconds -= $diff_minutes * 60;
639  array_push($data, array(
640  'result' => $this->lng->txt("tst_eval_total_finished_average_time"),
641  'value' => sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
642  ));
643  $total_passed = 0;
644  $total_passed_reached = 0;
645  $total_passed_max = 0;
646  $total_passed_time = 0;
647  foreach ($foundParticipants as $userdata) {
648  if ($userdata->getPassed()) {
649  $total_passed++;
650  $total_passed_reached += $userdata->getReached();
651  $total_passed_max += $userdata->getMaxpoints();
652  $total_passed_time += $userdata->getTimeOfWork();
653  }
654  }
655  $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
656  $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
657  $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
658  array_push($data, array(
659  'result' => $this->lng->txt("tst_eval_total_passed"),
660  'value' => $total_passed
661  ));
662  array_push($data, array(
663  'result' => $this->lng->txt("tst_eval_total_passed_average_points"),
664  'value' => sprintf("%2.2f", $average_passed_reached) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%2.2f", $average_passed_max)
665  ));
666  $average_time = $average_passed_time;
667  $diff_seconds = $average_time;
668  $diff_hours = floor($diff_seconds / 3600);
669  $diff_seconds -= $diff_hours * 3600;
670  $diff_minutes = floor($diff_seconds / 60);
671  $diff_seconds -= $diff_minutes * 60;
672  array_push($data, array(
673  'result' => $this->lng->txt("tst_eval_total_passed_average_time"),
674  'value' => sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
675  ));
676  }
677 
678  include_once "./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
679  $table_gui = new ilTestAggregatedResultsTableGUI($this, 'eval_a');
680  $table_gui->setData($data);
681  $this->tpl->setVariable('AGGREGATED_RESULTS', $table_gui->getHTML());
682 
683  $rows = array();
684  foreach ($eval->getQuestionTitles() as $question_id => $question_title) {
685  $answered = 0;
686  $reached = 0;
687  $max = 0;
688  foreach ($foundParticipants as $userdata) {
689  for ($i = 0; $i <= $userdata->getLastPass(); $i++) {
690  if (is_object($userdata->getPass($i))) {
691  $question = &$userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
692  if (is_array($question)) {
693  $answered++;
694  $reached += $question["reached"];
695  $max += $question["points"];
696  }
697  }
698  }
699  }
700  $percent = $max ? $reached / $max * 100.0 : 0;
701  $counter++;
702  $this->ctrl->setParameter($this, "qid", $question_id);
703 
704  $points_reached = ($answered ? $reached / $answered : 0);
705  $points_max = ($answered ? $max / $answered : 0);
706  array_push(
707  $rows,
708  array(
709  'qid' => $question_id,
710  'title' => $question_title,
711  'points' => $points_reached,
712  'points_reached' => $points_reached,
713  'points_max' => $points_max,
714  'percentage' => (float) $percent,
715  'answers' => $answered
716  )
717  );
718  }
719  include_once "./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
720  $table_gui = new ilTestAverageReachedPointsTableGUI($this, 'eval_a');
721  $table_gui->setData($rows);
722  $this->tpl->setVariable('TBL_AVG_REACHED', $table_gui->getHTML());
723  }
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
static accessViolationRedirect()
setOptions($a_options)
Set Options.
$rows
Definition: xhr_table.php:10
$i
Definition: disco.tpl.php:19
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ executeCommand()

ilTestEvaluationGUI::executeCommand ( )

execute command

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

References $ret, ilTestServiceGUI\getCommand(), and ilTestServiceGUI\isPdfDeliveryRequest().

81  {
82  $cmd = $this->ctrl->getCmd();
83  $next_class = $this->ctrl->getNextClass($this);
84  $this->ctrl->saveParameter($this, "sequence");
85  $this->ctrl->saveParameter($this, "active_id");
86  $cmd = $this->getCommand($cmd);
87  switch ($next_class) {
88  case 'iltestpassdetailsoverviewtablegui':
89  require_once 'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
90  $tableGUI = new ilTestPassDetailsOverviewTableGUI($this->ctrl, $this, 'outUserPassDetails');
91  $tableGUI->setIsPdfGenerationRequest($this->isPdfDeliveryRequest());
92  $tableGUI->initFilter();
93  $this->ctrl->forwardCommand($tableGUI);
94  break;
95 
96  default:
97  $ret = &$this->$cmd();
98  break;
99  }
100  return $ret;
101  }
getCommand($cmd)
Retrieves the ilCtrl command.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ exportAggregatedResults()

ilTestEvaluationGUI::exportAggregatedResults ( )

Exports the aggregated results.

public

Definition at line 786 of file class.ilTestEvaluationGUI.php.

References $_POST.

787  {
788  require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
789  $expFactory = new ilTestExportFactory($this->object);
790  $exportObj = $expFactory->getExporter('aggregated');
791 
792  switch ($_POST["export_type"]) {
793  case "excel":
794  $exportObj->exportToExcel($deliver = true);
795  break;
796  case "csv":
797  $exportObj->exportToCSV($deliver = true);
798  break;
799  }
800  }
$_POST["username"]

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

Exports the user results as PDF certificates using XSL-FO via XML:RPC calls.

public

Definition at line 808 of file class.ilTestEvaluationGUI.php.

References $certificate, $DIC, $factory, $name, $pdf, and ilUtil\getASCIIFilename().

809  {
810  global $DIC;
811 
812  $globalCertificatePrerequisites = new ilCertificateActiveValidator();
813  if (!$globalCertificatePrerequisites->validate()) {
814  $DIC['ilErr']->raiseError($this->lng->txt('permission_denied'), $DIC['ilErr']->MESSAGE);
815  }
816 
817  $database = $DIC->database();
818  $logger = $DIC->logger()->root();
819 
821 
822  $certificate = $factory->create($this->object);
823 
824  $archive_dir = $certificate->createArchiveDirectory();
825  $total_users = array();
826 
827  $this->object->setAccessFilteredParticipantList(
828  $this->object->buildStatisticsAccessFilteredParticipantList()
829  );
830 
831  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
832  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository, $logger);
833 
834  $total_users = &$this->object->evalTotalPersonsArray();
835  if (count($total_users)) {
836  $certValidator = new ilCertificateDownloadValidator();
837 
838  foreach ($total_users as $active_id => $name) {
839  $user_id = $this->object->_getUserIdFromActiveId($active_id);
840 
841  if (!$certValidator->isCertificateDownloadable($user_id, $this->object->getId())) {
842  continue;
843  }
844 
845  $pdfAction = new ilCertificatePdfAction(
846  $logger,
847  $pdfGenerator,
849  $this->lng->txt('error_creating_certificate_pdf')
850  );
851 
852  $pdf = $pdfAction->createPDF($user_id, $this->object->getid());
853  if (strlen($pdf)) {
854  $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
855  }
856  }
857  $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, true);
858  }
859  }
Class ilPdfGeneratorConstantsTest.
global $DIC
Definition: saml.php:7
$pdf
Definition: example_001.php:31
$factory
Definition: metadata.php:43
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
Validates if an active certificate is stored in the database and can be downloaded by the user...
Just a wrapper class to create Unit Test for other classes.
+ Here is the call graph for this function:

◆ exportEvaluation()

ilTestEvaluationGUI::exportEvaluation ( )

Exports the evaluation data to a selected file format.

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

References $_GET, and $_POST.

729  {
730  $filterby = "";
731  if (array_key_exists("g_filterby", $_GET)) {
732  $filterby = $_GET["g_filterby"];
733  }
734 
735  $filtertext = "";
736  if (array_key_exists("g_userfilter", $_GET)) {
737  $filtertext = $_GET["g_userfilter"];
738  }
739 
740  $passedonly = false;
741  if (array_key_exists("g_passedonly", $_GET)) {
742  if ($_GET["g_passedonly"] == 1) {
743  $passedonly = true;
744  }
745  }
746 
747  require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
748  $expFactory = new ilTestExportFactory($this->object);
749 
750  switch ($_POST["export_type"]) {
751  case "excel":
752  $expFactory->getExporter('results')->exportToExcel(
753  $deliver = true,
754  $filterby,
755  $filtertext,
756  $passedonly
757  );
758  break;
759 
760  case "csv":
761  $expFactory->getExporter('results')->exportToCSV(
762  $deliver = true,
763  $filterby,
764  $filtertext,
765  $passedonly
766  );
767  break;
768 
769  case "certificate":
770  if ($passedonly) {
771  $this->ctrl->setParameterByClass("iltestcertificategui", "g_passedonly", "1");
772  }
773  if (strlen($filtertext)) {
774  $this->ctrl->setParameterByClass("iltestcertificategui", "g_userfilter", $filtertext);
775  }
776  $this->ctrl->redirect($this, "exportCertificate");
777  break;
778  }
779  }
$_GET["client_id"]
$_POST["username"]

◆ exportFileUploadsForAllParticipants()

ilTestEvaluationGUI::exportFileUploadsForAllParticipants ( )

Creates a ZIP file containing all file uploads for a given question in a test.

Definition at line 563 of file class.ilTestEvaluationGUI.php.

References $_GET, and assQuestion\_instanciateQuestion().

564  {
565  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
566  $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
567  if ($question_object instanceof ilObjFileHandlingQuestionType) {
568  $question_object->deliverFileUploadZIPFile(
569  $this->ref_id,
570  $this->object->getTestId(),
571  $this->object->getTitle()
572  );
573  } else {
574  $this->ctrl->redirect($this, "singleResults");
575  }
576  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
$_GET["client_id"]
Interface ilObjFileHandlingQuestionType.
+ Here is the call graph for this function:

◆ exportQuestionForAllParticipants()

ilTestEvaluationGUI::exportQuestionForAllParticipants ( )

Creates a PDF representation of the answers for a given question in a test.

Definition at line 554 of file class.ilTestEvaluationGUI.php.

References $_GET, and ilTestServiceGUI\getQuestionResultForTestUsers().

555  {
556  $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
557  }
$_GET["client_id"]
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
+ Here is the call graph for this function:

◆ filterEvaluation()

ilTestEvaluationGUI::filterEvaluation ( )
Deprecated:
command is not used any longer

Definition at line 152 of file class.ilTestEvaluationGUI.php.

References ilObjTestGUI\accessViolationRedirect(), and getTestAccess().

153  {
154  if (!$this->getTestAccess()->checkStatisticsAccess()) {
156  }
157 
158  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
159  $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
160  $table_gui->writeFilterToSession();
161  $this->ctrl->redirect($this, "outEvaluation");
162  }
TableGUI class for evaluation of all users.
static accessViolationRedirect()
+ Here is the call graph for this function:

◆ finishAllUserPasses()

ilTestEvaluationGUI::finishAllUserPasses ( )

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

2155  {
2156  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2157  $cgui = new ilConfirmationGUI();
2158  $cgui->setFormAction($this->ctrl->getFormAction($this));
2159  $cgui->setHeaderText($this->lng->txt("finish_pass_for_all_users"));
2160  $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2161  $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForAllUser");
2162  $this->tpl->setContent($cgui->getHTML());
2163  }
Confirmation screen class.

◆ finishTestPass()

ilTestEvaluationGUI::finishTestPass (   $active_id,
  $obj_id 
)
protected

Definition at line 2186 of file class.ilTestEvaluationGUI.php.

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

2187  {
2188  $this->processLockerFactory->setActiveId($active_id);
2189  $processLocker = $this->processLockerFactory->getLocker();
2190 
2191  $test_pass_finisher = new ilTestPassFinishTasks($active_id, $obj_id);
2192  $test_pass_finisher->performFinishTasks($processLocker);
2193  }
Class ilTestPassFinishTasks.
+ Here is the caller graph for this function:

◆ finishTestPassForSingleUser()

ilTestEvaluationGUI::finishTestPassForSingleUser ( )

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

References $_GET, $DIC, ilTestServiceGUI\$participantData, ilTestParticipantAccessFilter\getManageParticipantsUserFilter(), and redirectBackToParticipantsScreen().

2097  {
2098  global $DIC; /* @var ILIAS\DI\Container $DIC */
2099 
2100  $activeId = (int) $_GET["active_id"];
2101 
2102  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2104 
2105  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2106  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
2107  $participantData->setActiveIdsFilter(array($activeId));
2108  $participantData->setParticipantAccessFilter($accessFilter);
2109  $participantData->load($this->object->getTestId());
2110 
2111  if (!in_array($activeId, $participantData->getActiveIds())) {
2113  }
2114 
2115  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2116  $cgui = new ilConfirmationGUI();
2117 
2118  $cgui->setHeaderText(sprintf(
2119  $this->lng->txt("finish_pass_for_user_confirmation"),
2120  $participantData->getFormatedFullnameByActiveId($activeId)
2121  ));
2122 
2123  $this->ctrl->setParameter($this, 'active_id', $activeId);
2124  $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2125 
2126  $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2127  $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForUser");
2128 
2129  $this->tpl->setContent($cgui->getHTML());
2130  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ getEvaluationQuestionId()

ilTestEvaluationGUI::getEvaluationQuestionId (   $question_id,
  $original_id = "" 
)

Returns the ID of a question for evaluation purposes.

If a question id and the id of the original question are given, this function returns the original id, otherwise the question id

Returns
int question or original id

Definition at line 867 of file class.ilTestEvaluationGUI.php.

868  {
869  if ($original_id > 0) {
870  return $original_id;
871  } else {
872  return $question_id;
873  }
874  }

◆ getFilteredTestResult()

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

Definition at line 2037 of file class.ilTestEvaluationGUI.php.

References $DIC, $ilDB, $pass, and ilTestServiceGUI\buildPassDetailsOverviewTableGUI().

Referenced by outParticipantsPassDetails(), and outUserPassDetails().

2038  {
2039  global $DIC;
2040  $ilDB = $DIC['ilDB'];
2041  $ilPluginAdmin = $DIC['ilPluginAdmin'];
2042 
2043  $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions);
2044  $questionIds = array();
2045  foreach ($resultData as $resultItemKey => $resultItemValue) {
2046  if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
2047  continue;
2048  }
2049 
2050  $questionIds[] = $resultItemValue['qid'];
2051  }
2052 
2053  $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
2054  $table_gui->initFilter();
2055 
2056  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2057  $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
2058 
2059  $questionList->setIncludeQuestionIdsFilter($questionIds);
2060  $questionList->setQuestionInstanceTypeFilter(null);
2061 
2062  foreach ($table_gui->getFilterItems() as $item) {
2063  if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') {
2064  $v = $item->getValue();
2065 
2066  if (is_array($v) && count($v) && !(int) $v[0]) {
2067  continue;
2068  }
2069 
2070  $taxId = substr($item->getPostVar(), strlen('tax_'));
2071  $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
2072  } elseif ($item->getValue() !== false) {
2073  $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2074  }
2075  }
2076 
2077  $questionList->load();
2078 
2079  $filteredTestResult = array();
2080 
2081  foreach ($resultData as $resultItemKey => $resultItemValue) {
2082  if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
2083  continue;
2084  }
2085 
2086  if (!$questionList->isInList($resultItemValue['qid'])) {
2087  continue;
2088  }
2089 
2090  $filteredTestResult[] = $resultItemValue;
2091  }
2092 
2093  return $filteredTestResult;
2094  }
global $DIC
Definition: saml.php:7
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeaderNames()

& ilTestEvaluationGUI::getHeaderNames ( )

Definition at line 103 of file class.ilTestEvaluationGUI.php.

104  {
105  $headernames = array();
106  if ($this->object->getAnonymity()) {
107  array_push($headernames, $this->lng->txt("counter"));
108  } else {
109  array_push($headernames, $this->lng->txt("name"));
110  array_push($headernames, $this->lng->txt("login"));
111  }
112  $additionalFields = $this->object->getEvaluationAdditionalFields();
113  if (count($additionalFields)) {
114  foreach ($additionalFields as $fieldname) {
115  array_push($headernames, $this->lng->txt($fieldname));
116  }
117  }
118  array_push($headernames, $this->lng->txt("tst_reached_points"));
119  array_push($headernames, $this->lng->txt("tst_mark"));
120  if ($this->object->getECTSOutput()) {
121  array_push($headernames, $this->lng->txt("ects_grade"));
122  }
123  array_push($headernames, $this->lng->txt("tst_answered_questions"));
124  array_push($headernames, $this->lng->txt("working_time"));
125  array_push($headernames, $this->lng->txt("detailed_evaluation"));
126  return $headernames;
127  }

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

Definition at line 129 of file class.ilTestEvaluationGUI.php.

130  {
131  $headervars = array();
132  if ($this->object->getAnonymity()) {
133  array_push($headervars, "counter");
134  } else {
135  array_push($headervars, "name");
136  array_push($headervars, "login");
137  }
138  array_push($headervars, "resultspoints");
139  array_push($headervars, "resultsmarks");
140  if ($this->object->getECTSOutput()) {
141  array_push($headervars, "ects_grade");
142  }
143  array_push($headervars, "qworkedthrough");
144  array_push($headervars, "timeofwork");
145  array_push($headervars, "");
146  return $headervars;
147  }

◆ getTestAccess()

ilTestEvaluationGUI::getTestAccess ( )

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

Definition at line 1721 of file class.ilTestEvaluationGUI.php.

References $DIC, $user, and ilCertificatePdfAction\downloadPdf().

1722  {
1723  global $DIC;
1724 
1725  $user = $DIC->user();
1726  $database = $DIC->database();
1727  $logger = $DIC->logger()->root();
1728 
1729  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
1730  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository, $logger);
1731 
1732  $pdfAction = new ilCertificatePdfAction(
1733  $logger,
1734  $pdfGenerator,
1736  $this->lng->txt('error_creating_certificate_pdf')
1737  );
1738 
1739  $pdfAction->downloadPdf((int) $user->getId(), (int) $this->object->getId());
1740  }
Class ilPdfGeneratorConstantsTest.
global $DIC
Definition: saml.php:7
$user
Definition: migrateto20.php:57
Just a wrapper class to create Unit Test for other classes.
downloadPdf(int $userId, int $objectId)
+ Here is the call graph for this function:

◆ outEvaluation()

ilTestEvaluationGUI::outEvaluation ( )

Creates the evaluation output for the test.

public

Definition at line 184 of file class.ilTestEvaluationGUI.php.

References $data, $DIC, PHPMailer\PHPMailer\$options, ilTestServiceGUI\$participantData, ilObjUser\_lookupFields(), ilObjTestGUI\accessViolationRedirect(), ilTestParticipantAccessFilter\getAccessStatisticsUserFilter(), ilSubmitButton\getInstance(), ilUtil\getStyleSheetLocation(), getTestAccess(), ilTable2GUI\setData(), ilSelectInputGUI\setOptions(), and ilTestTabsManager\TAB_ID_STATISTICS.

185  {
186  global $DIC; /* @var ILIAS\DI\Container $DIC */
187  $ilToolbar = $DIC->toolbar();
188 
189  if (!$this->getTestAccess()->checkStatisticsAccess()) {
191  }
192 
193  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_STATISTICS);
194 
195  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
196 
197  $table_gui = new ilEvaluationAllTableGUI(
198  $this,
199  'outEvaluation',
200  $this->object->getAnonymity(),
201  $this->object->isOfferingQuestionHintsEnabled()
202  );
203 
204  $data = array();
205  $arrFilter = array();
206 
207  foreach ($table_gui->getFilterItems() as $item) {
208  if ($item->getValue() !== false) {
209  switch ($item->getPostVar()) {
210  case 'group':
211  case 'name':
212  case 'course':
213  $arrFilter[$item->getPostVar()] = $item->getValue();
214  break;
215  case 'passed_only':
216  $passedonly = $item->getChecked();
217  break;
218  }
219  }
220  }
221  include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
222  $eval = new ilTestEvaluationData($this->object);
223  $eval->setFilterArray($arrFilter);
224  $foundParticipants = $eval->getParticipants();
225 
226  require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
227  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
228 
229  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
230  $participantData->setActiveIdsFilter($eval->getParticipantIds());
231 
232  $participantData->setParticipantAccessFilter(
234  );
235 
236  $participantData->load($this->object->getTestId());
237 
238  $counter = 1;
239  if (count($participantData->getActiveIds()) > 0) {
240  if ($this->object->getECTSOutput()) {
241  $passed_array = &$this->object->getTotalPointsPassedArray();
242  }
243  foreach ($participantData->getActiveIds() as $active_id) {
244  if (!isset($foundParticipants[$active_id]) || !($foundParticipants[$active_id] instanceof ilTestEvaluationUserData)) {
245  continue;
246  }
247 
248  /* @var $userdata ilTestEvaluationUserData */
249  $userdata = $foundParticipants[$active_id];
250 
251  $remove = false;
252  if ($passedonly) {
253  $mark_obj = $this->object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
254 
255  if ($mark_obj->getPassed() == false || !$userdata->areObligationsAnswered()) {
256  $remove = true;
257  }
258  }
259  if (!$remove) {
260  // build the evaluation row
261  $evaluationrow = array();
262  if ($this->object->getAnonymity()) {
263  $evaluationrow['name'] = $counter;
264  $evaluationrow['login'] = '';
265  } else {
266  $evaluationrow['name'] = $userdata->getName();
267  if (strlen($userdata->getLogin())) {
268  $evaluationrow['login'] = "[" . $userdata->getLogin() . "]";
269  } else {
270  $evaluationrow['login'] = '';
271  }
272  }
273 
274  $evaluationrow['reached'] = $userdata->getReached();
275  $evaluationrow['max'] = $userdata->getMaxpoints();
276  $evaluationrow['hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
277  $evaluationrow['exam_id'] = $userdata->getExamIdFromScoredPass();
278  $percentage = $userdata->getReachedPointsInPercent();
279  $mark = $this->object->getMarkSchema()->getMatchingMark($percentage);
280  if (is_object($mark)) {
281  $evaluationrow['mark'] = $mark->getShortName();
282  }
283  if ($this->object->getECTSOutput()) {
284  $ects_mark = $this->object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
285  $evaluationrow['ects_grade'] = $ects_mark;
286  }
287  $evaluationrow['answered'] = $userdata->getQuestionsWorkedThroughInPercent();
288  $evaluationrow['questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
289  $evaluationrow['number_of_questions'] = $userdata->getNumberOfQuestions();
290  $time_seconds = $userdata->getTimeOfWork();
291  $time_hours = floor($time_seconds / 3600);
292  $time_seconds -= $time_hours * 3600;
293  $time_minutes = floor($time_seconds / 60);
294  $time_seconds -= $time_minutes * 60;
295  $evaluationrow['working_time'] = sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
296  $this->ctrl->setParameter($this, "active_id", $active_id);
297  $href = $this->ctrl->getLinkTarget($this, "detailedEvaluation");
298  $detailed_evaluation = $this->lng->txt("detailed_evaluation_show");
299  $evaluationrow['details'] = "<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
300  $userfields = ilObjUser::_lookupFields($userdata->getUserID());
301  $evaluationrow['gender'] = $userfields['gender'];
302  $evaluationrow['email'] = $userfields['email'];
303  $evaluationrow['institution'] = $userfields['institution'];
304  $evaluationrow['street'] = $userfields['street'];
305  $evaluationrow['city'] = $userfields['city'];
306  $evaluationrow['zipcode'] = $userfields['zipcode'];
307  $evaluationrow['country'] = $userfields['country'];
308  $evaluationrow['sel_country'] = $userfields['sel_country'];
309  $evaluationrow['department'] = $userfields['department'];
310  $evaluationrow['matriculation'] = $userfields['matriculation'];
311  $counter++;
312  $data[] = $evaluationrow;
313  }
314  }
315  }
316 
317  $table_gui->setData($data);
318  if (count($participantData->getActiveIds()) > 0) {
319  $ilToolbar->setFormName('form_output_eval');
320  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'exportEvaluation'));
321  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
322  $export_type = new ilSelectInputGUI($this->lng->txt('exp_eval_data'), 'export_type');
323  $options = array(
324  'excel' => $this->lng->txt('exp_type_excel'),
325  'csv' => $this->lng->txt('exp_type_spss')
326  );
327 
328  if (!$this->object->getAnonymity()) {
329  $globalCertificatePrerequisites = new ilCertificateActiveValidator();
330  if ($globalCertificatePrerequisites->validate()) {
331  $options['certificate'] = $this->lng->txt('exp_type_certificate');
332  }
333  }
334 
335  $export_type->setOptions($options);
336 
337  $ilToolbar->addInputItem($export_type, true);
338  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
339  $button = ilSubmitButton::getInstance();
340  $button->setCommand('exportEvaluation');
341  $button->setCaption('export');
342  $button->getOmitPreventDoubleSubmission();
343  $ilToolbar->addButtonInstance($button);
344  }
345 
346  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
347  if ($this->object->getShowSolutionAnswersOnly()) {
348  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
349  }
350 
351  $this->tpl->setContent($table_gui->getHTML());
352  }
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
TableGUI class for evaluation of all users.
static accessViolationRedirect()
setOptions($a_options)
Set Options.
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ outParticipantsPassDetails()

ilTestEvaluationGUI::outParticipantsPassDetails ( )

Output of the pass details of an existing test pass for the test statistics.

Output of the pass details of an existing test pass for the test statistics

public

Definition at line 883 of file class.ilTestEvaluationGUI.php.

References $_GET, $_SESSION, $data, $DIC, $pass, $result, $template, ilObjTestGUI\accessViolationRedirect(), ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getFilteredTestResult(), ilTestServiceGUI\getGradingMessageBuilder(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassDetailsOverviewTableGUI(), ilTestServiceGUI\getPassListOfAnswers(), ilUtil\getStyleSheetLocation(), getTestAccess(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilObjTest\lookupLastTestPassAccess(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilTestServiceGUI\populateExamId(), ilTestServiceGUI\populatePassFinishDate(), and ilPDFGeneratorUtils\prepareGenerationRequest().

Referenced by outParticipantsPassDetailsResetTableFilter(), and outParticipantsPassDetailsSetTableFilter().

884  {
885  global $DIC;
886  $ilTabs = $DIC['ilTabs'];
887  $ilAccess = $DIC['ilAccess'];
888  $ilObjDataCache = $DIC['ilObjDataCache'];
889 
890  $active_id = (int) $_GET["active_id"];
891 
892  if (!$this->getTestAccess()->checkResultsAccessForActiveId($active_id)) {
894  }
895 
896  $this->ctrl->saveParameter($this, "active_id");
897  $testSession = $this->testSessionFactory->getSession($active_id);
898 
899  // protect actives from other tests
900  if ($testSession->getTestId() != $this->object->getTestId()) {
902  }
903 
904  $this->ctrl->saveParameter($this, "pass");
905  $pass = (int) $_GET["pass"];
906 
907  if (isset($_GET['statistics']) && $_GET['statistics'] == 1) {
908  $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
909  $this->ctrl->saveParameter($this, 'statistics');
910 
911  $ilTabs->setBackTarget(
912  $this->lng->txt('back'),
913  $this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'detailedEvaluation')
914  );
915  } elseif ($this->object->getNrOfTries() == 1) {
916  $ilTabs->setBackTarget(
917  $this->lng->txt('back'),
918  $this->ctrl->getLinkTargetByClass('ilParticipantsTestResultsGUI')
919  );
920  } else {
921  $ilTabs->setBackTarget(
922  $this->lng->txt('tst_results_back_overview'),
923  $this->ctrl->getLinkTarget($this, 'outParticipantsResultsOverview')
924  );
925  }
926 
927  // prepare generation before contents are processed (for mathjax)
928  if ($this->isPdfDeliveryRequest()) {
930  }
931 
932  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
933  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
934 
935  $objectivesList = null;
936 
937  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
938  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
939  $testSequence->loadFromDb();
940  $testSequence->loadQuestions();
941 
942  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
943  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
944 
945  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
946  $objectivesList->loadObjectivesTitles();
947 
948  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
949  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
950  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
951  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
952  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
953  }
954 
955  $result_array = $this->getFilteredTestResult($active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired());
956 
957  $overviewTableGUI = $this->getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $this, "outParticipantsPassDetails", '', true, $objectivesList);
958  $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
959  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, false);
960  $user_id = $this->object->_getUserIdFromActiveId($active_id);
961 
962  $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", true, true, "Modules/Test");
963 
964  $toolbar = $this->buildUserTestResultsToolbarGUI();
965 
966  $this->ctrl->setParameter($this, 'pdf', '1');
967  $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
968  $this->ctrl->setParameter($this, 'pdf', '');
969 
970  if (isset($_GET['show_best_solutions'])) {
971  $_SESSION['tst_results_show_best_solutions'] = true;
972  } elseif (isset($_GET['hide_best_solutions'])) {
973  $_SESSION['tst_results_show_best_solutions'] = false;
974  } elseif (!isset($_SESSION['tst_results_show_best_solutions'])) {
975  $_SESSION['tst_results_show_best_solutions'] = false;
976  }
977 
978  if ($_SESSION['tst_results_show_best_solutions']) {
979  $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
980  $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
981  $this->ctrl->setParameter($this, 'hide_best_solutions', '');
982  } else {
983  $this->ctrl->setParameter($this, 'show_best_solutions', '1');
984  $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
985  $this->ctrl->setParameter($this, 'show_best_solutions', '');
986  }
987 
988  $toolbar->build();
989  $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
990 
991  if ($this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1) {
992  $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
993  $gradingMessageBuilder->buildList();
994 
995  $template->setCurrentBlock('grading_message');
996  $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
997  $template->parseCurrentBlock();
998  }
999 
1000  $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $_SESSION['tst_results_show_best_solutions'], false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder);
1001  $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1002  $template->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1003 
1004  $data = &$this->object->getCompleteEvaluationData();
1005  $result = $data->getParticipant($active_id)->getReached() . " " . strtolower($this->lng->txt("of")) . " " . $data->getParticipant($active_id)->getMaxpoints() . " (" . sprintf("%2.2f", $data->getParticipant($active_id)->getReachedPointsInPercent()) . " %" . ")";
1006  $template->setCurrentBlock('total_score');
1007  $template->setVariable("TOTAL_RESULT_TEXT",$this->lng->txt('tst_stat_result_resultspoints'));
1008  $template->setVariable("TOTAL_RESULT",$result);
1009  $template->parseCurrentBlock();
1010 
1011  if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1012  $template->setVariable("USER_DATA", $user_data);
1013 
1014  $uname = $this->object->userLookupFullName($user_id);
1015  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1016 
1017  $template->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1018  }
1019 
1020  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1021 
1022  $this->populateExamId($template, (int) $active_id, (int) $pass);
1024 
1025  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1026  if ($this->object->getShowSolutionAnswersOnly()) {
1027  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1028  }
1029 
1030  if ($this->isPdfDeliveryRequest()) {
1031  //$this->object->deliverPDFfromHTML($template->get());
1032  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1033  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1034  } else {
1035  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1036  }
1037  }
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$_SESSION["AccountId"]
$result
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
const PDF_USER_RESULT
PDF Purposes.
static accessViolationRedirect()
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
special template class to simplify handling of ITX/PEAR
static lookupLastTestPassAccess($activeId, $passIndex)
populatePassFinishDate($tpl, $passFinishDate)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
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 prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
$data
Definition: bench.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outParticipantsPassDetailsResetTableFilter()

ilTestEvaluationGUI::outParticipantsPassDetailsResetTableFilter ( )

Definition at line 1186 of file class.ilTestEvaluationGUI.php.

References ilTestServiceGUI\buildPassDetailsOverviewTableGUI(), and outParticipantsPassDetails().

1187  {
1188  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1189  $tableGUI->initFilter();
1190  $tableGUI->resetOffset();
1191  $tableGUI->resetFilter();
1192  $this->outParticipantsPassDetails();
1193  }
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
+ Here is the call graph for this function:

◆ outParticipantsPassDetailsSetTableFilter()

ilTestEvaluationGUI::outParticipantsPassDetailsSetTableFilter ( )

Definition at line 1177 of file class.ilTestEvaluationGUI.php.

References ilTestServiceGUI\buildPassDetailsOverviewTableGUI(), and outParticipantsPassDetails().

1178  {
1179  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1180  $tableGUI->initFilter();
1181  $tableGUI->resetOffset();
1182  $tableGUI->writeFilterToSession();
1183  $this->outParticipantsPassDetails();
1184  }
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
+ Here is the call graph for this function:

◆ outParticipantsResultsOverview()

ilTestEvaluationGUI::outParticipantsResultsOverview ( )

Output of the pass overview for a test called from the statistics.

public

Definition at line 1044 of file class.ilTestEvaluationGUI.php.

References $_GET, $DIC, $filename, $name, $template, ilObjTest\_getResultPass(), ilObjUser\_lookupName(), ilObjTestGUI\accessViolationRedirect(), ilTestServiceGUI\buildPassOverviewTableGUI(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilTestServiceGUI\getGradingMessageBuilder(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassOverviewTableData(), ilUtil\getStyleSheetLocation(), getTestAccess(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, and ilPDFGeneratorUtils\prepareGenerationRequest().

1045  {
1046  global $DIC;
1047  $ilTabs = $DIC['ilTabs'];
1048  $ilObjDataCache = $DIC['ilObjDataCache'];
1049 
1050  $active_id = (int) $_GET["active_id"];
1051 
1052  if (!$this->getTestAccess()->checkResultsAccessForActiveId($active_id)) {
1054  }
1055 
1056  $testSession = $this->testSessionFactory->getSession($active_id);
1057 
1058  // protect actives from other tests
1059  if ($testSession->getTestId() != $this->object->getTestId()) {
1061  }
1062 
1063  if ($this->object->getNrOfTries() == 1) {
1064  $this->ctrl->setParameter($this, "active_id", $active_id);
1065  $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
1066  $this->ctrl->redirect($this, "outParticipantsPassDetails");
1067  }
1068 
1069  $ilTabs->setBackTarget(
1070  $this->lng->txt('back'),
1071  $this->ctrl->getLinkTargetByClass('ilParticipantsTestResultsGUI')
1072  );
1073 
1074  // prepare generation before contents are processed (for mathjax)
1075  if ($this->isPdfDeliveryRequest()) {
1077  }
1078 
1079  $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", true, true, "Modules/Test");
1080 
1081  $toolbar = $this->buildUserTestResultsToolbarGUI();
1082 
1083  $this->ctrl->setParameter($this, 'pdf', '1');
1084  $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
1085  $this->ctrl->setParameter($this, 'pdf', '');
1086 
1087  $toolbar->build();
1088  $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1089 
1090  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1091  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1092  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1093  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1094  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1095  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1096  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1097  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1098  }
1099 
1100  global $DIC; /* @var ILIAS\DI\Container $DIC */
1101  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1102  $testPassesSelector = new ilTestPassesSelector($DIC['ilDB'], $this->object);
1103  $testPassesSelector->setActiveId($testSession->getActiveId());
1104  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1105 
1106  $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this);
1107  $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1108  $passOverViewTableGUI->setResultPresentationEnabled(true);
1109  $passOverViewTableGUI->setPassDetailsCommand('outParticipantsPassDetails');
1110  $passOverViewTableGUI->init();
1111  $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(), true, true));
1112  $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1113  $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1114 
1115  if ($this->isGradingMessageRequired()) {
1116  $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1117  $gradingMessageBuilder->buildList();
1118 
1119  $template->setCurrentBlock('grading_message');
1120  $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
1121  $template->parseCurrentBlock();
1122  }
1123 
1124  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1125  $user_id = $this->object->_getUserIdFromActiveId($active_id);
1126 
1127  if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1128  if ($this->object->getAnonymity()) {
1129  $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1130  } else {
1131  $uname = $this->object->userLookupFullName($user_id, true);
1132  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1133  $template->setVariable("USER_DATA", $user_data);
1134  }
1135  }
1136 
1137  $template->parseCurrentBlock();
1138 
1139 
1140  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1141  if ($this->object->getShowSolutionAnswersOnly()) {
1142  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1143  }
1144 
1145  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1)) {
1146  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1147 
1148  $name = ilObjUser::_lookupName($user_id);
1149  $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__' . $this->object->getTitleFilenameCompliant();
1150  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1152  //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
1153  //$template->setVariable("PDF_FILE_LOCATION", $filename);
1154  } else {
1155  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1156  }
1157  }
static _lookupName($a_user_id)
lookup user name
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
const PDF_USER_RESULT
PDF Purposes.
static accessViolationRedirect()
buildPassOverviewTableGUI($targetGUI)
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
special template class to simplify handling of ITX/PEAR
$filename
Definition: buildRTE.php:89
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
+ Here is the call graph for this function:

◆ outUserListOfAnswerPasses()

ilTestEvaluationGUI::outUserListOfAnswerPasses ( )

Output of the pass overview for a user when he/she wants to see his/her list of answers.

Output of the pass overview for a user when he/she wants to see his/her list of answers

public

Definition at line 1516 of file class.ilTestEvaluationGUI.php.

References $_GET, $DIC, $ilUser, $pass, $template, ilTestServiceGUI\buildPassOverviewTableGUI(), ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getPassOverviewTableData(), ilTestServiceGUI\getResultsSignature(), ilUtil\getStyleSheetLocation(), ilObjTest\lookupExamId(), ilUtil\sendInfo(), and ilTestServiceGUI\setContextResultPresentation().

1517  {
1518  global $DIC; /* @var ILIAS\DI\Container $DIC */
1519  $ilUser = $DIC['ilUser'];
1520  $ilObjDataCache = $DIC['ilObjDataCache'];
1521 
1522  if (!$this->object->getShowSolutionPrintview()) {
1523  ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1524  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1525  }
1526 
1527  $template = new ilTemplate("tpl.il_as_tst_info_list_of_answers.html", true, true, "Modules/Test");
1528 
1529  $pass = null;
1530  if (array_key_exists("pass", $_GET)) {
1531  if (strlen($_GET["pass"])) {
1532  $pass = $_GET["pass"];
1533  }
1534  }
1535  $user_id = $ilUser->getId();
1536 
1537  $testSession = $this->testSessionFactory->getSession();
1538  $active_id = $testSession->getActiveId();
1539 
1540  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_passes"));
1541 
1542  global $DIC; /* @var ILIAS\DI\Container $DIC */
1543  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1544  $testPassesSelector = new ilTestPassesSelector($DIC['ilDB'], $this->object);
1545  $testPassesSelector->setActiveId($testSession->getActiveId());
1546  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1547 
1548  $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this);
1549  $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1550  $passOverViewTableGUI->setResultPresentationEnabled(false);
1551  $passOverViewTableGUI->setPassDetailsCommand('outUserListOfAnswerPasses');
1552  $passOverViewTableGUI->init();
1553  $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(), false));
1554  $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1555 
1556  $signature = "";
1557  if (strlen($pass)) {
1558  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1559  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1560 
1561  $objectivesList = null;
1562 
1563  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1564  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1565  $testSequence->loadFromDb();
1566  $testSequence->loadQuestions();
1567 
1568  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1569  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1570 
1571  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1572  $objectivesList->loadObjectivesTitles();
1573 
1574  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1575  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1576  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1577  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1578  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1579  }
1580 
1581  $result_array = $this->object->getTestResult(
1582  $active_id,
1583  $pass,
1584  false,
1585  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1586  );
1587 
1588  $signature = $this->getResultsSignature();
1589  $user_id = &$this->object->_getUserIdFromActiveId($active_id);
1590  $showAllAnswers = true;
1591  if ($this->object->isExecutable($testSession, $user_id)) {
1592  $showAllAnswers = false;
1593  }
1594  $this->setContextResultPresentation(false);
1595  $answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, false, $showAllAnswers, false, false, false, $objectivesList, $testResultHeaderLabelBuilder);
1596  $template->setVariable("PASS_DETAILS", $answers);
1597  }
1598  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1599  $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1600  $template->setVariable("PRINT_URL", "javascript:window.print();");
1601 
1602  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1603  $template->setVariable("USER_DATA", $user_data);
1604  $template->setVariable("TEXT_LIST_OF_ANSWERS", $this->lng->txt("tst_list_of_answers"));
1605  if (strlen($signature)) {
1606  $template->setVariable("SIGNATURE", $signature);
1607  }
1608  if (!is_null($pass) && $this->object->isShowExamIdInTestResultsEnabled()) {
1609  $template->setCurrentBlock('exam_id_footer');
1610  $template->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1611  $testSession->getActiveId(),
1612  $pass
1613  ));
1614  $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1615  $template->parseCurrentBlock();
1616  }
1617  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1618 
1619  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1620  if ($this->object->getShowSolutionAnswersOnly()) {
1621  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1622  }
1623  }
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
setContextResultPresentation($contextResultPresentation)
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getResultsSignature()
Returns HTML code for a signature field.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
buildPassOverviewTableGUI($targetGUI)
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
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.
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:

◆ outUserPassDetails()

ilTestEvaluationGUI::outUserPassDetails ( )

Output of the pass details of an existing test pass for the active test participant.

public

Definition at line 1200 of file class.ilTestEvaluationGUI.php.

References $_GET, $data, $DIC, $ilUser, $pass, $result, ilTestServiceGUI\$tpl, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getFilteredTestResult(), ilTestServiceGUI\getGradingMessageBuilder(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassDetailsOverviewTableGUI(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getResultsSignature(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilObjTest\lookupExamId(), ilObjTest\lookupLastTestPassAccess(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilTestServiceGUI\populateExamId(), ilTestServiceGUI\populatePassFinishDate(), and ilPDFGeneratorUtils\prepareGenerationRequest().

Referenced by outUserPassDetailsResetTableFilter(), and outUserPassDetailsSetTableFilter().

1201  {
1202  global $DIC;
1203  $ilTabs = $DIC['ilTabs'];
1204  $ilUser = $DIC['ilUser'];
1205  $ilObjDataCache = $DIC['ilObjDataCache'];
1206 
1207  $ilTabs->clearSubTabs();
1208  $ilTabs->setBackTarget($this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this));
1209 
1210  $testSession = $this->testSessionFactory->getSession();
1211 
1212  if (!$this->object->getShowPassDetails()) {
1213  #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1214 
1215  #if($executable["executable"])
1216  #{
1217  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1218  #}
1219  }
1220 
1221  $active_id = $testSession->getActiveId();
1222  $user_id = $testSession->getUserId();
1223 
1224  $this->ctrl->saveParameter($this, "pass");
1225  $pass = $_GET["pass"];
1226 
1227  // prepare generation before contents are processed (for mathjax)
1228  if ($this->isPdfDeliveryRequest()) {
1230  }
1231 
1232  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1233  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1234 
1235  $objectivesList = null;
1236 
1237  $considerHiddenQuestions = true;
1238  $considerOptionalQuestions = true;
1239 
1240  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1241  $considerHiddenQuestions = false;
1242 
1243  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1244  $testSequence->loadFromDb();
1245  $testSequence->loadQuestions();
1246 
1247  if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1248  $considerOptionalQuestions = false;
1249  }
1250 
1251  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1252  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1253 
1254  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1255  $objectivesList->loadObjectivesTitles();
1256 
1257  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1258  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1259  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1260  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1261  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1262  }
1263 
1264  $result_array = $this->getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions);
1265 
1266  $command_solution_details = "";
1267  if ($this->object->getShowSolutionDetails()) {
1268  $command_solution_details = "outCorrectSolution";
1269  }
1270  $questionAnchorNav = $this->object->canShowSolutionPrintview();
1271 
1272  $tpl = new ilTemplate('tpl.il_as_tst_pass_details_overview_participants.html', true, true, "Modules/Test");
1273 
1274  if (!$this->isPdfDeliveryRequest()) {
1275  $toolbar = $this->buildUserTestResultsToolbarGUI();
1276 
1277  $this->ctrl->setParameter($this, 'pdf', '1');
1278  $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outUserPassDetails'));
1279  $this->ctrl->setParameter($this, 'pdf', '');
1280 
1281  $validator = new ilCertificateDownloadValidator();
1282  if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1283  $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1284  }
1285 
1286  $toolbar->build();
1287 
1288  $tpl->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1289 
1290  $tpl->setCurrentBlock('signature');
1291  $tpl->setVariable("SIGNATURE", $this->getResultsSignature());
1292  $tpl->parseCurrentBlock();
1293 
1294  if ($this->object->isShowExamIdInTestResultsEnabled()) {
1295  $tpl->setCurrentBlock('exam_id');
1296  $tpl->setVariable('EXAM_ID', ilObjTest::lookupExamId(
1297  $testSession->getActiveId(),
1298  $pass
1299  ));
1300  $tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1301  $tpl->parseCurrentBlock();
1302  }
1303  }
1304 
1305  if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() &&
1306  $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1) {
1307  $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1308  $gradingMessageBuilder->buildMessage();
1309  $gradingMessageBuilder->sendMessage();
1310 
1311  #$template->setCurrentBlock('grading_message');
1312  #$template->setVariable('GRADING_MESSAGE', );
1313  #$template->parseCurrentBlock();
1314  }
1315 
1316  $overviewTableGUI = $this->getPassDetailsOverviewTableGUI(
1317  $result_array,
1318  $active_id,
1319  $pass,
1320  $this,
1321  "outUserPassDetails",
1322  $command_solution_details,
1323  $questionAnchorNav,
1324  $objectivesList
1325  );
1326  $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1327  $tpl->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1328 
1329  $data = &$this->object->getCompleteEvaluationData();
1330  $result = $data->getParticipant($active_id)->getReached() . " " . strtolower($this->lng->txt("of")) . " " . $data->getParticipant($active_id)->getMaxpoints() . " (" . sprintf("%2.2f", $data->getParticipant($active_id)->getReachedPointsInPercent()) . " %" . ")";
1331  $tpl->setCurrentBlock('total_score');
1332  $tpl->setVariable("TOTAL_RESULT_TEXT",$this->lng->txt('tst_stat_result_resultspoints'));
1333  $tpl->setVariable("TOTAL_RESULT",$result);
1334  $tpl->parseCurrentBlock();
1335 
1336  if ($this->object->canShowSolutionPrintview()) {
1337  $list_of_answers = $this->getPassListOfAnswers(
1338  $result_array,
1339  $active_id,
1340  $pass,
1341  $this->object->getShowSolutionListComparison(),
1342  false,
1343  false,
1344  false,
1345  true,
1346  $objectivesList,
1347  $testResultHeaderLabelBuilder
1348  );
1349  $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1350  }
1351 
1352  $tpl->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1353  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1354 
1355  $uname = $this->object->userLookupFullName($user_id, true);
1356  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1357  if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1358  if ($this->object->getAnonymity()) {
1359  $tpl->setVariable("TEXT_HEADING", $this->lng->txt("tst_result_pass"));
1360  } else {
1361  $tpl->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1362  $tpl->setVariable("USER_DATA", $user_data);
1363  }
1364  }
1365 
1366  $this->populateExamId($tpl, (int) $active_id, (int) $pass);
1368 
1369  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1370  if ($this->object->getShowSolutionAnswersOnly()) {
1371  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1372  }
1373 
1374  if ($this->isPdfDeliveryRequest()) {
1375  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1376  ilTestPDFGenerator::generatePDF($tpl->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1377  } else {
1378  $this->tpl->setContent($tpl->get());
1379  }
1380  }
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$result
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
const PDF_USER_RESULT
PDF Purposes.
getResultsSignature()
Returns HTML code for a signature field.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
special template class to simplify handling of ITX/PEAR
Validates if an active certificate is stored in the database and can be downloaded by the user...
$ilUser
Definition: imgupload.php:18
static lookupLastTestPassAccess($activeId, $passIndex)
populatePassFinishDate($tpl, $passFinishDate)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
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 prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
$data
Definition: bench.php:6
static lookupExamId($active_id, $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outUserPassDetailsResetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsResetTableFilter ( )

Definition at line 1168 of file class.ilTestEvaluationGUI.php.

References ilTestServiceGUI\buildPassDetailsOverviewTableGUI(), and outUserPassDetails().

1169  {
1170  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1171  $tableGUI->initFilter();
1172  $tableGUI->resetOffset();
1173  $tableGUI->resetFilter();
1174  $this->outUserPassDetails();
1175  }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
+ Here is the call graph for this function:

◆ outUserPassDetailsSetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsSetTableFilter ( )

Definition at line 1159 of file class.ilTestEvaluationGUI.php.

References ilTestServiceGUI\buildPassDetailsOverviewTableGUI(), and outUserPassDetails().

1160  {
1161  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1162  $tableGUI->initFilter();
1163  $tableGUI->resetOffset();
1164  $tableGUI->writeFilterToSession();
1165  $this->outUserPassDetails();
1166  }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
+ Here is the call graph for this function:

◆ outUserResultsOverview()

ilTestEvaluationGUI::outUserResultsOverview ( )

Output of the pass overview for a test called by a test participant.

ilTabsGUI $ilTabs

Definition at line 1387 of file class.ilTestEvaluationGUI.php.

References $DIC, $ilUser, $template, ilTestServiceGUI\buildPassOverviewTableGUI(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilTestServiceGUI\getGradingMessageBuilder(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassOverviewTableData(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, and ilPDFGeneratorUtils\prepareGenerationRequest().

1388  {
1389  global $DIC;
1390  $ilUser = $DIC['ilUser'];
1391  $ilObjDataCache = $DIC['ilObjDataCache'];
1392 
1393  $testSession = $this->testSessionFactory->getSession();
1394  $active_id = $testSession->getActiveId();
1395  $user_id = $ilUser->getId();
1396  $uname = $this->object->userLookupFullName($user_id, true);
1397 
1398  if (!$this->object->canShowTestResults($testSession)) {
1399  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1400  }
1401 
1402  // prepare generation before contents are processed (for mathjax)
1403  if ($this->isPdfDeliveryRequest()) {
1405  }
1406 
1407  $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", true, true, "Modules/Test");
1408  $template = new ilTemplate("tpl.il_as_tst_results_participant.html", true, true, "Modules/Test");
1409 
1410  $toolbar = $this->buildUserTestResultsToolbarGUI();
1411 
1412  $this->ctrl->setParameter($this, 'pdf', '1');
1413  $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
1414  $this->ctrl->setParameter($this, 'pdf', '');
1415 
1416  $validator = new ilCertificateDownloadValidator();
1417  if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1418  $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1419  }
1420 
1421  $toolbar->build();
1422 
1423  $templatehead->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1424 
1425  $passDetailsEnabled = $this->object->getShowPassDetails();
1426  #if (!$passDetailsEnabled)
1427  #{
1428  # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1429  # if (!$executable["executable"]) $passDetailsEnabled = true;
1430  #}
1431 
1432  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1433  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1434  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1435  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1436  $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1437  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1438  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1439  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1440  }
1441 
1442  $template->setCurrentBlock("pass_overview");
1443 
1444  global $DIC; /* @var ILIAS\DI\Container $DIC */
1445  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1446  $testPassesSelector = new ilTestPassesSelector($DIC['ilDB'], $this->object);
1447  $testPassesSelector->setActiveId($testSession->getActiveId());
1448  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1449 
1450  $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this);
1451  $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1452  $passOverViewTableGUI->setResultPresentationEnabled(true);
1453  if ($passDetailsEnabled) {
1454  $passOverViewTableGUI->setPassDetailsCommand('outUserPassDetails');
1455  }
1456  if ($this->object->isPassDeletionAllowed()) {
1457  $passOverViewTableGUI->setPassDeletionCommand('confirmDeletePass');
1458  }
1459  $passOverViewTableGUI->init();
1460  $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(), true));
1461  $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1462  $overview = $passOverViewTableGUI->getHTML();
1463  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1464  require_once 'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1465  $loStatus = new ilTestLearningObjectivesStatusGUI($this->lng);
1466  $loStatus->setCrsObjId($this->getObjectiveOrientedContainer()->getObjId());
1467  $loStatus->setUsrId($testSession->getUserId());
1468  $overview .= "<br />" . $loStatus->getHTML();
1469  }
1470  $template->setVariable("PASS_OVERVIEW", $overview);
1471  $template->parseCurrentBlock();
1472 
1473  if ($this->isGradingMessageRequired()) {
1474  $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1475  $gradingMessageBuilder->buildMessage();
1476  $gradingMessageBuilder->sendMessage();
1477 
1478  #$template->setCurrentBlock('grading_message');
1479  #$template->setVariable('GRADING_MESSAGE', );
1480  #$template->parseCurrentBlock();
1481  }
1482 
1483  $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1484 
1485  if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1486  if ($this->object->getAnonymity()) {
1487  $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1488  } else {
1489  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1490  $template->setVariable("USER_DATA", $user_data);
1491  }
1492  }
1493 
1494  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1495  if ($this->object->getShowSolutionAnswersOnly()) {
1496  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1497  }
1498  $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
1499 
1500  if ($this->isPdfDeliveryRequest()) {
1501  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1502  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1503  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1504  } else {
1505  $this->tpl->setContent($templatehead->get());
1506  }
1507  }
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
const PDF_USER_RESULT
PDF Purposes.
buildPassOverviewTableGUI($targetGUI)
special template class to simplify handling of ITX/PEAR
Validates if an active certificate is stored in the database and can be downloaded by the user...
$ilUser
Definition: imgupload.php:18
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
+ Here is the call graph for this function:

◆ passDetails()

ilTestEvaluationGUI::passDetails ( )

Output of the learners view of an existing test pass.

Output of the learners view of an existing test pass

public

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

References $_GET.

1633  {
1634  if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0)) {
1635  $this->ctrl->saveParameter($this, "pass");
1636  $this->ctrl->saveParameter($this, "active_id");
1637  $this->outTestResults(false, $_GET["pass"]);
1638  } else {
1639  $this->outTestResults(false);
1640  }
1641  }
$_GET["client_id"]

◆ redirectBackToParticipantsScreen()

ilTestEvaluationGUI::redirectBackToParticipantsScreen ( )
protected

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

Referenced by confirmFinishTestPassForAllUser(), confirmFinishTestPassForUser(), and finishTestPassForSingleUser().

2196  {
2197  $this->ctrl->redirectByClass("ilTestParticipantsGUI");
2198  }
+ Here is the caller graph for this function:

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

Definition at line 1769 of file class.ilTestEvaluationGUI.php.

References $_POST, $_SESSION, $context, $DIC, $ilDB, $pass, $result, $row, $table, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), assQuestion\_updateTestResultCache(), ilTestPassDeletionConfirmationGUI\CONTEXT_DYN_TEST_PLAYER, ilTestPassDeletionConfirmationGUI\CONTEXT_INFO_SCREEN, ilTestPassDeletionConfirmationGUI\CONTEXT_PASS_OVERVIEW, and ilTestDynamicQuestionSetStatisticTableGUI\FILTERED_TABLE_ID.

Referenced by cancelDeletePass(), and confirmDeletePass().

1770  {
1771  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1772 
1773  switch ($context) {
1775 
1776  $this->ctrl->redirect($this, 'outUserResultsOverview');
1777 
1778  // no break
1780 
1781  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1782 
1783  // no break
1785 
1786  $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1787  }
1788  }
$context
Definition: webdav.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterEvaluation()

ilTestEvaluationGUI::resetfilterEvaluation ( )
Deprecated:
command is not used any longer

Definition at line 167 of file class.ilTestEvaluationGUI.php.

References ilObjTestGUI\accessViolationRedirect(), and getTestAccess().

168  {
169  if (!$this->getTestAccess()->checkStatisticsAccess()) {
171  }
172 
173  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
174  $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
175  $table_gui->resetFilter();
176  $this->ctrl->redirect($this, "outEvaluation");
177  }
TableGUI class for evaluation of all users.
static accessViolationRedirect()
+ Here is the call graph for this function:

◆ setTestAccess()

ilTestEvaluationGUI::setTestAccess (   $testAccess)
Parameters
ilTestAccess$testAccess

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

References $testAccess.

73  {
74  $this->testAccess = $testAccess;
75  }

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

Definition at line 1647 of file class.ilTestEvaluationGUI.php.

References $data, $DIC, $pass, $rows, assQuestion\_instanciateQuestion(), ilObjTestGUI\accessViolationRedirect(), getTestAccess(), ilUtil\sendInfo(), and ilTestTabsManager\TAB_ID_STATISTICS.

1648  {
1649  global $DIC; /* @var ILIAS\DI\Container $DIC */
1650 
1651  if (!$this->getTestAccess()->checkStatisticsAccess()) {
1653  }
1654 
1655  $this->object->setAccessFilteredParticipantList(
1656  $this->object->buildStatisticsAccessFilteredParticipantList()
1657  );
1658 
1659  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_STATISTICS);
1660 
1661  $data = &$this->object->getCompleteEvaluationData();
1662  $color_class = array("tblrow1", "tblrow2");
1663  $counter = 0;
1664  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1665  $foundParticipants = &$data->getParticipants();
1666  if (count($foundParticipants) == 0) {
1667  ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1668  return;
1669  } else {
1670  $rows = array();
1671  foreach ($data->getQuestionTitles() as $question_id => $question_title) {
1672  $answered = 0;
1673  $reached = 0;
1674  $max = 0;
1675  foreach ($foundParticipants as $userdata) {
1676  $pass = $userdata->getScoredPass();
1677  if (is_object($userdata->getPass($pass))) {
1678  $question = &$userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1679  if (is_array($question)) {
1680  $answered++;
1681  }
1682  }
1683  }
1684  $counter++;
1685  $this->ctrl->setParameter($this, "qid", $question_id);
1686  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1687  $question_object = assQuestion::_instanciateQuestion($question_id);
1688  $download = "";
1689  if ($question_object instanceof ilObjFileHandlingQuestionType) {
1690  if ($question_object->hasFileUploads($this->object->getTestId())) {
1691  $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants") . "\">" . $this->lng->txt("download") . "</a>";
1692  }
1693  }
1694  array_push(
1695  $rows,
1696  array(
1697  'qid' => $question_id,
1698  'question_title' => $question_title,
1699  'number_of_answers' => $answered,
1700  'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1701  'file_uploads' => $download
1702  )
1703  );
1704  }
1705  if (count($rows)) {
1706  require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1707  $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1708  $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1709  $table_gui->setData($rows);
1710 
1711  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1712  } else {
1713  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1714  }
1715  }
1716  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
global $DIC
Definition: saml.php:7
TableGUI class for results by question.
Interface ilObjFileHandlingQuestionType.
static accessViolationRedirect()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$rows
Definition: xhr_table.php:10
$data
Definition: bench.php:6
+ Here is the call graph for this function:

Field Documentation

◆ $processLockerFactory

ilTestEvaluationGUI::$processLockerFactory
protected

Definition at line 38 of file class.ilTestEvaluationGUI.php.

◆ $testAccess

ilTestEvaluationGUI::$testAccess
protected

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

Referenced by getTestAccess(), and setTestAccess().


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