ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
 buildQuestionAnswerShuffler (string $question_id, string $active_id, string $active_pass)
 
 buildFixedShufflerSeedFromBasicSeed (string $basic_seed)
 
 getPassDetailsOverviewTableGUI ($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

 $testAccess
 
 $processLockerFactory
 
- Protected Attributes inherited from ilTestServiceGUI
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
 $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, and ILIAS\GlobalScreen\Provider\__construct().

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  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

References $_POST, and redirectToPassDeletionContext().

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

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

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

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

◆ confirmFinishTestPassForAllUser()

ilTestEvaluationGUI::confirmFinishTestPassForAllUser ( )

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

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

2205  {
2206  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2208 
2209  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2210  $participantList = new ilTestParticipantList($this->object);
2211  $participantList->initializeFromDbRows($this->object->getTestParticipants());
2212  $participantList = $participantList->getAccessFilteredList($accessFilter);
2213 
2214  foreach ($participantList as $participant) {
2215  if (!$participant->hasUnfinishedPasses()) {
2216  continue;
2217  }
2218 
2219  $this->finishTestPass($participant->getActiveId(), $this->object->getId());
2220  }
2221 
2223  }
finishTestPass($active_id, $obj_id)
+ Here is the call graph for this function:

◆ confirmFinishTestPassForUser()

ilTestEvaluationGUI::confirmFinishTestPassForUser ( )

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

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

2147  {
2148  global $DIC; /* @var ILIAS\DI\Container $DIC */
2149 
2150  $activeId = (int) $_GET["active_id"];
2151 
2152  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2154 
2155  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2156  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
2157  $participantData->setActiveIdsFilter(array($activeId));
2158  $participantData->setParticipantAccessFilter($accessFilter);
2159  $participantData->load($this->object->getTestId());
2160 
2161  if (in_array($activeId, $participantData->getActiveIds())) {
2162  $this->finishTestPass($activeId, $this->object->getId());
2163  }
2164 
2166  }
$_GET["client_id"]
finishTestPass($active_id, $obj_id)
$DIC
Definition: xapitoken.php:46
+ 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 364 of file class.ilTestEvaluationGUI.php.

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

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

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

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

References $_POST.

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

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

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

public

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

References $DIC, $name, ilUserCertificateZip\createArchiveDirectory(), ilCertificatePdfAction\createPDF(), and ilUtil\getASCIIFilename().

812  {
813  global $DIC;
814 
815  $globalCertificatePrerequisites = new ilCertificateActiveValidator();
816  if (!$globalCertificatePrerequisites->validate()) {
817  $DIC['ilErr']->raiseError($this->lng->txt('permission_denied'), $DIC['ilErr']->MESSAGE);
818  }
819 
820  $database = $DIC->database();
821  $logger = $DIC->logger()->root();
822 
823  $pathFactory = new ilCertificatePathFactory();
824  $objectId = $this->object->getId();
825  $zipAction = new ilUserCertificateZip(
826  $objectId,
827  $pathFactory->create($this->object)
828  );
829 
830  $archive_dir = $zipAction->createArchiveDirectory();
831  $total_users = array();
832 
833  $this->object->setAccessFilteredParticipantList(
834  $this->object->buildStatisticsAccessFilteredParticipantList()
835  );
836 
837  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
838  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository, $logger);
839 
840  $total_users = &$this->object->evalTotalPersonsArray();
841  if (count($total_users)) {
842  $certValidator = new ilCertificateDownloadValidator();
843 
844  foreach ($total_users as $active_id => $name) {
845  $user_id = $this->object->_getUserIdFromActiveId($active_id);
846 
847  if (!$certValidator->isCertificateDownloadable($user_id, $objectId)) {
848  continue;
849  }
850 
851  $pdfAction = new ilCertificatePdfAction(
852  $logger,
853  $pdfGenerator,
855  $this->lng->txt('error_creating_certificate_pdf')
856  );
857 
858  $pdf = $pdfAction->createPDF($user_id, $objectId);
859  if (strlen($pdf)) {
860  $zipAction->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
861  }
862  }
863  $zipArchive = $zipAction->zipCertificatesInArchiveDirectory($archive_dir, true);
864  }
865  }
Class ilPdfGeneratorConstantsTest.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
if($format !==null) $name
Definition: metadata.php:230
Validates if an active certificate is stored in the database and can be downloaded by the user...
createArchiveDirectory()
Creates a directory for a zip archive containing multiple certificates.
Just a wrapper class to create Unit Test for other classes.
createPDF(int $userId, int $objectId)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ exportEvaluation()

ilTestEvaluationGUI::exportEvaluation ( )

Exports the evaluation data to a selected file format.

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

References $_GET, and $_POST.

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

References $_GET, and assQuestion\_instanciateQuestion().

567  {
568  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
569  $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
570  if ($question_object instanceof ilObjFileHandlingQuestionType) {
571  $question_object->deliverFileUploadZIPFile(
572  $this->ref_id,
573  $this->object->getTestId(),
574  $this->object->getTitle()
575  );
576  } else {
577  $this->ctrl->redirect($this, "singleResults");
578  }
579  }
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 557 of file class.ilTestEvaluationGUI.php.

References $_GET, and ilTestServiceGUI\getQuestionResultForTestUsers().

558  {
559  $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
560  }
$_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 ( )

give error if the processing time of at least user is not yet over

See also
https://mantis.ilias.de/view.php?id=30357

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

References ilTestParticipantAccessFilter\getManageParticipantsUserFilter(), redirectBackToParticipantsScreen(), and ilUtil\sendFailure().

2169  {
2174  if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2175  if ($this->object->endingTimeReached() == false) {
2176 
2178  $participantList = new ilTestParticipantList($this->object);
2179  $participantList->initializeFromDbRows($this->object->getTestParticipants());
2180  $participantList = $participantList->getAccessFilteredList($accessFilter);
2181 
2182  foreach ($participantList as $participant) {
2183  if (!$participant->hasUnfinishedPasses()) {
2184  continue;
2185  }
2186  $starting_time = $this->object->getStartingTimeOfUser($participant->getActiveId());
2187  if ($this->object->isMaxProcessingTimeReached($starting_time, $participant->getActiveId()) == false) {
2188  ilUtil::sendFailure($this->lng->txt("finish_pass_for_all_users_in_processing_time"), true);
2190  }
2191  }
2192  }
2193  }
2194 
2195  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2196  $cgui = new ilConfirmationGUI();
2197  $cgui->setFormAction($this->ctrl->getFormAction($this));
2198  $cgui->setHeaderText($this->lng->txt("finish_pass_for_all_users"));
2199  $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2200  $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForAllUser");
2201  $this->tpl->setContent($cgui->getHTML());
2202  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ finishTestPass()

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

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

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

2226  {
2227  $processLocker = $this->processLockerFactory->withContextId((int) $active_id)->getLocker();
2228 
2229  $test_pass_finisher = new ilTestPassFinishTasks($active_id, $obj_id);
2230  $test_pass_finisher->performFinishTasks($processLocker);
2231  }
Class ilTestPassFinishTasks.
+ Here is the caller graph for this function:

◆ finishTestPassForSingleUser()

ilTestEvaluationGUI::finishTestPassForSingleUser ( )

warn if the processing time of the user is not yet over

See also
https://mantis.ilias.de/view.php?id=30357

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

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

2098  {
2099  global $DIC; /* @var ILIAS\DI\Container $DIC */
2100 
2101  $activeId = (int) $_GET["active_id"];
2102 
2103  require_once 'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2105 
2106  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
2107  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
2108  $participantData->setActiveIdsFilter(array($activeId));
2109  $participantData->setParticipantAccessFilter($accessFilter);
2110  $participantData->load($this->object->getTestId());
2111 
2112  if (!in_array($activeId, $participantData->getActiveIds())) {
2114  }
2115 
2120  if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2121  if ($this->object->endingTimeReached() == false) {
2122  $starting_time = $this->object->getStartingTimeOfUser($activeId);
2123  if ($this->object->isMaxProcessingTimeReached($starting_time, $activeId) == false) {
2124  ilUtil::sendInfo($this->lng->txt("finish_pass_for_user_in_processing_time"));
2125  }
2126  }
2127  }
2128 
2129  require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2130  $cgui = new ilConfirmationGUI();
2131 
2132  $cgui->setHeaderText(sprintf(
2133  $this->lng->txt("finish_pass_for_user_confirmation"),
2134  $participantData->getFormatedFullnameByActiveId($activeId)
2135  ));
2136 
2137  $this->ctrl->setParameter($this, 'active_id', $activeId);
2138  $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2139 
2140  $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2141  $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForUser");
2142 
2143  $this->tpl->setContent($cgui->getHTML());
2144  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$DIC
Definition: xapitoken.php:46
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 873 of file class.ilTestEvaluationGUI.php.

874  {
875  if ($original_id > 0) {
876  return $original_id;
877  } else {
878  return $question_id;
879  }
880  }

◆ getFilteredTestResult()

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

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

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

Referenced by outParticipantsPassDetails(), and outUserPassDetails().

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

References $DIC, and ilCertificatePdfAction\downloadPdf().

1723  {
1724  global $DIC;
1725 
1726  $user = $DIC->user();
1727  $database = $DIC->database();
1728  $logger = $DIC->logger()->root();
1729 
1730  $ilUserCertificateRepository = new ilUserCertificateRepository($database, $logger);
1731  $pdfGenerator = new ilPdfGenerator($ilUserCertificateRepository, $logger);
1732 
1733  $pdfAction = new ilCertificatePdfAction(
1734  $logger,
1735  $pdfGenerator,
1737  $this->lng->txt('error_creating_certificate_pdf')
1738  );
1739 
1740  $pdfAction->downloadPdf((int) $user->getId(), (int) $this->object->getId());
1741  }
Class ilPdfGeneratorConstantsTest.
Just a wrapper class to create Unit Test for other classes.
$DIC
Definition: xapitoken.php:46
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, Vendor\Package\$e, 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  try {
330  $globalCertificatePrerequisites = new ilCertificateActiveValidator();
331  if ($globalCertificatePrerequisites->validate()) {
332  $options['certificate'] = $this->lng->txt('exp_type_certificate');
333  }
334  } catch (ilException $e) {
335  }
336  }
337 
338  $export_type->setOptions($options);
339 
340  $ilToolbar->addInputItem($export_type, true);
341  require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
342  $button = ilSubmitButton::getInstance();
343  $button->setCommand('exportEvaluation');
344  $button->setCaption('export');
345  $button->getOmitPreventDoubleSubmission();
346  $ilToolbar->addButtonInstance($button);
347  }
348 
349  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
350  if ($this->object->getShowSolutionAnswersOnly()) {
351  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
352  }
353 
354  $this->tpl->setContent($table_gui->getHTML());
355  }
$data
Definition: storeScorm.php:23
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.
$DIC
Definition: xapitoken.php:46
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
+ 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 889 of file class.ilTestEvaluationGUI.php.

References $_GET, $_SESSION, $data, $DIC, $pass, $result, 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().

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

◆ outParticipantsPassDetailsResetTableFilter()

ilTestEvaluationGUI::outParticipantsPassDetailsResetTableFilter ( )

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

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

1191  {
1192  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1193  $tableGUI->initFilter();
1194  $tableGUI->resetOffset();
1195  $tableGUI->resetFilter();
1196  $this->outParticipantsPassDetails();
1197  }
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 1181 of file class.ilTestEvaluationGUI.php.

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

1182  {
1183  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1184  $tableGUI->initFilter();
1185  $tableGUI->resetOffset();
1186  $tableGUI->writeFilterToSession();
1187  $this->outParticipantsPassDetails();
1188  }
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 1049 of file class.ilTestEvaluationGUI.php.

References $_GET, $DIC, $filename, $name, 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().

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

References $_GET, $DIC, $ilUser, $pass, 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().

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

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

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

1173  {
1174  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1175  $tableGUI->initFilter();
1176  $tableGUI->resetOffset();
1177  $tableGUI->resetFilter();
1178  $this->outUserPassDetails();
1179  }
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 1163 of file class.ilTestEvaluationGUI.php.

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

1164  {
1165  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1166  $tableGUI->initFilter();
1167  $tableGUI->resetOffset();
1168  $tableGUI->writeFilterToSession();
1169  $this->outUserPassDetails();
1170  }
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 1390 of file class.ilTestEvaluationGUI.php.

References $DIC, $ilUser, 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().

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

References $_GET.

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

◆ redirectBackToParticipantsScreen()

ilTestEvaluationGUI::redirectBackToParticipantsScreen ( )
protected

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

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

2234  {
2235  $this->ctrl->redirectByClass("ilTestParticipantsGUI");
2236  }
+ Here is the caller graph for this function:

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

References $_POST, $_SESSION, $context, $DIC, $ilDB, $pass, $result, 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().

1771  {
1772  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1773 
1774  switch ($context) {
1776 
1777  $this->ctrl->redirect($this, 'outUserResultsOverview');
1778 
1779  // no break
1781 
1782  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1783 
1784  // no break
1786 
1787  $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1788  }
1789  }
$context
Definition: webdav.php:26
+ 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 1648 of file class.ilTestEvaluationGUI.php.

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

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