ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 executeCommand ()
 execute command More...
 
getHeaderNames ()
 
getHeaderVars ()
 
 filterEvaluation ()
 
 resetfilterEvaluation ()
 
 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...
 
 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, $targetCmd='')
 
 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)
 

Protected Member Functions

 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 finishTestPass ($active_id, $obj_id)
 
 redirectBackToParticipantsScreen ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 handleTabs ($activeTabId)
 
 isPdfDeliveryRequest ()
 
 getPassDetailsOverviewTableGUI ($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

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

Private Member Functions

 redirectToPassDeletionContext ($context)
 

Additional Inherited Members

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

Detailed Description

Output class for assessment test evaluation.

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

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

@ilCtrl_Calls ilTestEvaluationGUI: ilTestPassDetailsOverviewTableGUI @ilCtrl_Calls ilTestEvaluationGUI: ilTestResultsToolbarGUI @ilCtrl_Calls ilTestEvaluationGUI: ilTestPassDeletionConfirmationGUI

Definition at line 26 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

Reimplemented from ilTestServiceGUI.

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

42 {
43 parent::__construct($a_object);
44
45 global $DIC; /* @var ILIAS\DI\Container $DIC */
46
47 require_once 'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
48 $this->processLockerFactory = new ilTestProcessLockerFactory(
49 new ilSetting('assessment'),
50 $DIC->database()
51 );
52 }
ILIAS Setting Class.
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

1655 {
1656 $this->redirectToPassDeletionContext($_POST['context']);
1657 }
$_POST["username"]

References $_POST, and redirectToPassDeletionContext().

+ Here is the call graph for this function:

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

1634 {
1635 if (isset($_GET['context']) && strlen($_GET['context'])) {
1636 $context = $_GET['context'];
1637 } else {
1639 }
1640
1641 if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1642 $this->redirectToPassDeletionContext($context);
1643 }
1644
1645 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1646
1647 $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1648 $confirm->build((int) $_GET['active_id'], (int) $_GET['pass'], $context);
1649
1650 global $tpl;
1651 $tpl->setContent($this->ctrl->getHTML($confirm));
1652 }
$_GET["client_id"]

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

+ Here is the call graph for this function:

◆ confirmFinishTestPassForAllUser()

ilTestEvaluationGUI::confirmFinishTestPassForAllUser ( )

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

2014 {
2015 require_once 'Modules/Test/classes/class.ilTestPassFinishTasks.php';
2016 $participants = $this->object->getTestParticipants();
2017 foreach ($participants as $participant) {
2018 if (array_key_exists('unfinished_passes', $participant) && $participant['unfinished_passes'] == 1) {
2019 $this->finishTestPass($participant['active_id'], $this->object->getId());
2020 }
2021 }
2023 }
finishTestPass($active_id, $obj_id)

References finishTestPass(), and redirectBackToParticipantsScreen().

+ Here is the call graph for this function:

◆ confirmFinishTestPassForUser()

ilTestEvaluationGUI::confirmFinishTestPassForUser ( )

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

1995 {
1996 require_once 'Modules/Test/classes/class.ilTestPassFinishTasks.php';
1997 $active_id = (int) $_GET["active_id"];
1998 $this->finishTestPass($active_id, $this->object->getId());
2000 }

References $_GET, finishTestPass(), and redirectBackToParticipantsScreen().

+ 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

@access public

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

310 {
311 global $DIC;
312
313 if ((!$DIC->access()->checkAccess('tst_statistics', '', $this->ref_id)) && (!$DIC->access()->checkAccess('write', '', $this->ref_id))) {
314 ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
315 $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
316 }
317
318 $active_id = $_GET['active_id'];
319 if (strlen($active_id) == 0) {
320 ilUtil::sendInfo($this->lng->txt('detailed_evaluation_missing_active_id'), true);
321 $this->ctrl->redirect($this, 'outEvaluation');
322 }
323
324 $this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_print.css', 'Modules/Test'), 'print');
325
326 $toolbar = $DIC['ilToolbar'];
327
328 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
329 $backBtn = ilLinkButton::getInstance();
330 $backBtn->setCaption('back');
331 $backBtn->setUrl($this->ctrl->getLinkTarget($this, 'outEvaluation'));
332 $toolbar->addInputItem($backBtn);
333
334 $data =&$this->object->getCompleteEvaluationData();
335
336 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
337 $form = new ilPropertyFormGUI();
338 $form->setTitle(sprintf(
339 $this->lng->txt('detailed_evaluation_for'),
340 $data->getParticipant($active_id)->getName()
341 ));
342
343 $resultPoints = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultspoints'));
344 $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()) . " %" . ")");
345 $form->addItem($resultPoints);
346
347 if (strlen($data->getParticipant($active_id)->getMark())) {
348 $resultMarks = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultsmarks'));
349 $resultMarks->setValue($data->getParticipant($active_id)->getMark());
350 $form->addItem($resultMarks);
351 if (strlen($data->getParticipant($active_id)->getECTSMark())) {
352 $ectsGrade = new ilNonEditableValueGUI($this->lng->txt('ects_grade'));
353 $ectsGrade->setValue($data->getParticipant($active_id)->getECTSMark());
354 $form->addItem($ectsGrade);
355 }
356 }
357
358 if ($this->object->isOfferingQuestionHintsEnabled()) {
359 $requestHints = new ilNonEditableValueGUI($this->lng->txt('tst_question_hints_requested_hint_count_header'));
360 $requestHints->setValue($data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
361 $form->addItem($requestHints);
362 }
363
364 $time_seconds = $data->getParticipant($active_id)->getTimeOfWork();
365 $atime_seconds = $data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds / $data->getParticipant($active_id)->getNumberOfQuestions() : 0;
366 $time_hours = floor($time_seconds/3600);
367 $time_seconds -= $time_hours * 3600;
368 $time_minutes = floor($time_seconds/60);
369 $time_seconds -= $time_minutes * 60;
370 $timeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_timeofwork'));
371 $timeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
372 $form->addItem($timeOfWork);
373
374 $this->tpl->setVariable("TXT_ATIMEOFWORK", $this->lng->txt(""));
375 $time_hours = floor($atime_seconds/3600);
376 $atime_seconds -= $time_hours * 3600;
377 $time_minutes = floor($atime_seconds/60);
378 $atime_seconds -= $time_minutes * 60;
379 $avgTimeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_atimeofwork'));
380 $avgTimeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
381 $form->addItem($avgTimeOfWork);
382
383 $firstVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_firstvisit'));
384 $firstVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getFirstVisit(), IL_CAL_UNIX)));
385 $form->addItem($firstVisit);
386
387 $lastVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_lastvisit'));
388 $lastVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getLastVisit(), IL_CAL_UNIX)));
389 $form->addItem($lastVisit);
390
391 $nrPasses = new ilNonEditableValueGUI($this->lng->txt('tst_nr_of_passes'));
392 $nrPasses->setValue($data->getParticipant($active_id)->getLastPass() + 1);
393 $form->addItem($nrPasses);
394
395 $scoredPass = new ilNonEditableValueGUI($this->lng->txt('scored_pass'));
396 if ($this->object->getPassScoring() == SCORE_BEST_PASS) {
397 $scoredPass->setValue($data->getParticipant($active_id)->getBestPass() + 1);
398 } else {
399 $scoredPass->setValue($data->getParticipant($active_id)->getLastPass() + 1);
400 }
401 $form->addItem($scoredPass);
402
403 $median = $data->getStatistics()->getStatistics()->median();
404 $pct = $data->getParticipant($active_id)->getMaxpoints() ? ($median / $data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
405 $mark = $this->object->mark_schema->getMatchingMark($pct);
406 if (is_object($mark)) {
407 $markMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_mark_median'));
408 $markMedian->setValue($mark->getShortName());
409 $form->addItem($markMedian);
410 }
411
412 $rankParticipant = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_participant'));
413 $rankParticipant->setValue($data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
414 $form->addItem($rankParticipant);
415
416 $rankMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_median'));
417 $rankMedian->setValue($data->getStatistics()->getStatistics()->rank_median());
418 $form->addItem($rankMedian);
419
420 $totalParticipants = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_total_participants'));
421 $totalParticipants->setValue($data->getStatistics()->getStatistics()->count());
422 $form->addItem($totalParticipants);
423
424 $medianField = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_median'));
425 $medianField->setValue($median);
426 $form->addItem($medianField);
427
428 $this->tpl->setContent($form->getHTML());
429
430 $tables = array();
431
432 for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++) {
433 $finishdate = ilObjTest::lookupPassResultsUpdateTimestamp($active_id, $pass);
434 if ($finishdate > 0) {
435 if (($DIC->access()->checkAccess('write', '', (int) $_GET['ref_id']))) {
436 $this->ctrl->setParameter($this, 'statistics', '1');
437 $this->ctrl->setParameter($this, 'active_id', $active_id);
438 $this->ctrl->setParameter($this, 'pass', $pass);
439 } else {
440 $this->ctrl->setParameter($this, 'statistics', '');
441 $this->ctrl->setParameter($this, 'active_id', '');
442 $this->ctrl->setParameter($this, 'pass', '');
443 }
444
445 require_once 'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
446 $table = new ilTestDetailedEvaluationStatisticsTableGUI($this, 'detailedEvaluation', ($pass + 1) . '_' . $this->object->getId());
447 $table->setTitle(sprintf($this->lng->txt("tst_eval_question_points"), $pass + 1));
448 if (($DIC->access()->checkAccess('write', '', (int) $_GET['ref_id']))) {
449 $table->addCommandButton('outParticipantsPassDetails', $this->lng->txt('tst_show_answer_sheet'));
450 }
451
452 $questions = $data->getParticipant($active_id)->getQuestions($pass);
453 if (!is_array($questions)) {
454 $questions = $data->getParticipant($active_id)->getQuestions(0);
455 }
456
457 $tableData = array();
458
459 $counter = 0;
460 foreach ((array) $questions as $question) {
461 $userDataData = array(
462 'counter' => ++$counter,
463 'id' => $question['id'],
464 'id_txt' => $this->lng->txt('question_id_short'),
465 'title' => $data->getQuestionTitle($question['id'])
466 );
467
468 $answeredquestion = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
469 if (is_array($answeredquestion)) {
470 $percent = $answeredquestion['points'] ? $answeredquestion['reached'] / $answeredquestion['points'] * 100.0 : 0;
471 $userDataData['points'] = $answeredquestion['reached'] . ' ' . strtolower($this->lng->txt('of')) . " " . $answeredquestion['points'] . ' (' . sprintf("%.2f", $percent) . ' %)';
472 } else {
473 $userDataData['points'] = '0 ' . strtolower($this->lng->txt('of')) . ' ' . $question['points'] . ' (' . sprintf("%.2f", 0) . ' %) - ' . $this->lng->txt('question_not_answered');
474 }
475
476 $tableData[] = $userDataData;
477 }
478 $table->setData($tableData);
479
480 $tables[] = $table->getHTML();
481 }
482 }
483
484 $GLOBALS['tpl']->setContent($form->getHTML() . implode('', $tables));
485 }
sprintf('%.4f', $callTime)
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Factory.
This class represents a non editable value in a property form.
static lookupPassResultsUpdateTimestamp($active_id, $pass)
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
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$counter
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const SCORE_BEST_PASS
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form

References $_GET, $counter, $data, $DIC, $form, $GLOBALS, $pass, $table, ilDatePresentation\formatDate(), ilLinkButton\getInstance(), ilUtil\getStyleSheetLocation(), IL_CAL_UNIX, ilObjTest\lookupPassResultsUpdateTimestamp(), SCORE_BEST_PASS, ilUtil\sendInfo(), and sprintf.

+ Here is the call graph for this function:

◆ executeCommand()

ilTestEvaluationGUI::executeCommand ( )

execute command

Reimplemented from ilTestServiceGUI.

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

58 {
59 $cmd = $this->ctrl->getCmd();
60 $next_class = $this->ctrl->getNextClass($this);
61 $this->ctrl->saveParameter($this, "sequence");
62 $this->ctrl->saveParameter($this, "active_id");
63 $cmd = $this->getCommand($cmd);
64 switch ($next_class) {
65 case 'iltestpassdetailsoverviewtablegui':
66 require_once 'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
67 $tableGUI = new ilTestPassDetailsOverviewTableGUI($this->ctrl, $this, 'outUserPassDetails');
68 $tableGUI->setIsPdfGenerationRequest($this->isPdfDeliveryRequest());
69 $tableGUI->initFilter();
70 $this->ctrl->forwardCommand($tableGUI);
71 break;
72
73 default:
74 $ret =&$this->$cmd();
75 break;
76 }
77 return $ret;
78 }
getCommand($cmd)
Retrieves the ilCtrl command.
$ret
Definition: parser.php:6

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

+ Here is the call graph for this function:

◆ exportAggregatedResults()

ilTestEvaluationGUI::exportAggregatedResults ( )

Exports the aggregated results.

@access public

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

716 {
717 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
718 $expFactory = new ilTestExportFactory($this->object);
719 $exportObj = $expFactory->getExporter('aggregated');
720
721 switch ($_POST["export_type"]) {
722 case "excel":
723 $exportObj->exportToExcel($deliver = true);
724 break;
725 case "csv":
726 $exportObj->exportToCSV($deliver = true);
727 break;
728 }
729 }

References $_POST.

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

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

@access public

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

738 {
739 global $ilUser;
740
741 include_once "./Services/Utilities/classes/class.ilUtil.php";
742 include_once "./Services/Certificate/classes/class.ilCertificate.php";
743 include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
744 $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
745 $archive_dir = $certificate->createArchiveDirectory();
746 $total_users = array();
747 $total_users =&$this->object->evalTotalPersonsArray();
748 if (count($total_users)) {
749 foreach ($total_users as $active_id => $name) {
750 $user_id = $this->object->_getUserIdFromActiveId($active_id);
751 $pdf = $certificate->outCertificate(
752 array(
753 "active_id" => $active_id,
754 "userfilter" => $userfilter,
755 "passedonly" => $passedonly
756 ),
757 false
758 );
759 if (strlen($pdf)) {
760 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
761 }
762 }
763 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, true);
764 }
765 }
Create PDF certificates.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
$pdf
Definition: example_001.php:31
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
if($format !==null) $name
Definition: metadata.php:146
$ilUser
Definition: imgupload.php:18

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

+ Here is the call graph for this function:

◆ exportEvaluation()

ilTestEvaluationGUI::exportEvaluation ( )

Exports the evaluation data to a selected file format.

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

658 {
659 $filterby = "";
660 if (array_key_exists("g_filterby", $_GET)) {
661 $filterby = $_GET["g_filterby"];
662 }
663
664 $filtertext = "";
665 if (array_key_exists("g_userfilter", $_GET)) {
666 $filtertext = $_GET["g_userfilter"];
667 }
668
669 $passedonly = false;
670 if (array_key_exists("g_passedonly", $_GET)) {
671 if ($_GET["g_passedonly"] == 1) {
672 $passedonly = true;
673 }
674 }
675
676 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
677 $expFactory = new ilTestExportFactory($this->object);
678
679 switch ($_POST["export_type"]) {
680 case "excel":
681 $expFactory->getExporter('results')->exportToExcel(
682 $deliver = true,
683 $filterby,
684 $filtertext,
685 $passedonly
686 );
687 break;
688
689 case "csv":
690 $expFactory->getExporter('results')->exportToCSV(
691 $deliver = true,
692 $filterby,
693 $filtertext,
694 $passedonly
695 );
696 break;
697
698 case "certificate":
699 if ($passedonly) {
700 $this->ctrl->setParameterByClass("iltestcertificategui", "g_passedonly", "1");
701 }
702 if (strlen($filtertext)) {
703 $this->ctrl->setParameterByClass("iltestcertificategui", "g_userfilter", $filtertext);
704 }
705 $this->ctrl->redirect($this, "exportCertificate");
706 break;
707 }
708 }

References $_GET, and $_POST.

◆ exportFileUploadsForAllParticipants()

ilTestEvaluationGUI::exportFileUploadsForAllParticipants ( )

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

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

501 {
502 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
503 $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
504 if ($question_object instanceof ilObjFileHandlingQuestionType) {
505 $question_object->deliverFileUploadZIPFile($this->object->getTestId(), $this->object->getTitle());
506 } else {
507 $this->ctrl->redirect($this, "singleResults");
508 }
509 }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
Interface ilObjFileHandlingQuestionType.

References $_GET, and assQuestion\_instanciateQuestion().

+ 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 491 of file class.ilTestEvaluationGUI.php.

492 {
493 $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
494 }
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.

References $_GET, and ilTestServiceGUI\getQuestionResultForTestUsers().

+ Here is the call graph for this function:

◆ filterEvaluation()

ilTestEvaluationGUI::filterEvaluation ( )

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

127 {
128 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
129 $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
130 $table_gui->writeFilterToSession();
131 $this->ctrl->redirect($this, "outEvaluation");
132 }
TableGUI class for evaluation of all users.

◆ finishAllUserPasses()

ilTestEvaluationGUI::finishAllUserPasses ( )

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

2003 {
2004 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2005 $cgui = new ilConfirmationGUI();
2006 $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2007 $cgui->setHeaderText($this->lng->txt("finish_pass_for_all_users"));
2008 $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2009 $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForAllUser");
2010 $this->tpl->setContent($cgui->getHTML());
2011 }
Confirmation screen class.

◆ finishTestPass()

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

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

2026 {
2027 $this->processLockerFactory->setActiveId($active_id);
2028 $processLocker = $this->processLockerFactory->getLocker();
2029
2030 $test_pass_finisher = new ilTestPassFinishTasks($active_id, $obj_id);
2031 $test_pass_finisher->performFinishTasks($processLocker);
2032 }
Class ilTestPassFinishTasks.

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

+ Here is the caller graph for this function:

◆ finishTestPassForSingleUser()

ilTestEvaluationGUI::finishTestPassForSingleUser ( )

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

1984 {
1985 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
1986 $cgui = new ilConfirmationGUI();
1987 $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
1988 $cgui->setHeaderText($this->lng->txt("finish_pass_for_user_confirmation"));
1989 $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
1990 $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForUser");
1991 $this->tpl->setContent($cgui->getHTML());
1992 }

◆ 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 773 of file class.ilTestEvaluationGUI.php.

774 {
775 if ($original_id > 0) {
776 return $original_id;
777 } else {
778 return $question_id;
779 }
780 }

◆ getFilteredTestResult()

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

Reimplemented from ilTestServiceGUI.

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

1927 {
1928 global $ilDB, $ilPluginAdmin;
1929
1930 $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions);
1931 $questionIds = array();
1932 foreach ($resultData as $resultItemKey => $resultItemValue) {
1933 if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
1934 continue;
1935 }
1936
1937 $questionIds[] = $resultItemValue['qid'];
1938 }
1939
1940 $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1941 $table_gui->initFilter();
1942
1943 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1944 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
1945
1946 $questionList->setIncludeQuestionIdsFilter($questionIds);
1947 $questionList->setQuestionInstanceTypeFilter(null);
1948
1949 foreach ($table_gui->getFilterItems() as $item) {
1950 if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') {
1951 $v = $item->getValue();
1952
1953 if (is_array($v) && count($v) && !(int) $v[0]) {
1954 continue;
1955 }
1956
1957 $taxId = substr($item->getPostVar(), strlen('tax_'));
1958 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
1959 } elseif ($item->getValue() !== false) {
1960 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1961 }
1962 }
1963
1964 $questionList->load();
1965
1966 $filteredTestResult = array();
1967
1968 foreach ($resultData as $resultItemKey => $resultItemValue) {
1969 if ($resultItemKey === 'test' || $resultItemKey === 'pass') {
1970 continue;
1971 }
1972
1973 if (!$questionList->isInList($resultItemValue['qid'])) {
1974 continue;
1975 }
1976
1977 $filteredTestResult[] = $resultItemValue;
1978 }
1979
1980 return $filteredTestResult;
1981 }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
global $ilDB

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

Referenced by outParticipantsPassDetails(), and outUserPassDetails().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeaderNames()

& ilTestEvaluationGUI::getHeaderNames ( )

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

81 {
82 $headernames = array();
83 if ($this->object->getAnonymity()) {
84 array_push($headernames, $this->lng->txt("counter"));
85 } else {
86 array_push($headernames, $this->lng->txt("name"));
87 array_push($headernames, $this->lng->txt("login"));
88 }
89 $additionalFields = $this->object->getEvaluationAdditionalFields();
90 if (count($additionalFields)) {
91 foreach ($additionalFields as $fieldname) {
92 array_push($headernames, $this->lng->txt($fieldname));
93 }
94 }
95 array_push($headernames, $this->lng->txt("tst_reached_points"));
96 array_push($headernames, $this->lng->txt("tst_mark"));
97 if ($this->object->getECTSOutput()) {
98 array_push($headernames, $this->lng->txt("ects_grade"));
99 }
100 array_push($headernames, $this->lng->txt("tst_answered_questions"));
101 array_push($headernames, $this->lng->txt("working_time"));
102 array_push($headernames, $this->lng->txt("detailed_evaluation"));
103 return $headernames;
104 }

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

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

107 {
108 $headervars = array();
109 if ($this->object->getAnonymity()) {
110 array_push($headervars, "counter");
111 } else {
112 array_push($headervars, "name");
113 array_push($headervars, "login");
114 }
115 array_push($headervars, "resultspoints");
116 array_push($headervars, "resultsmarks");
117 if ($this->object->getECTSOutput()) {
118 array_push($headervars, "ects_grade");
119 }
120 array_push($headervars, "qworkedthrough");
121 array_push($headervars, "timeofwork");
122 array_push($headervars, "");
123 return $headervars;
124 }

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

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

1619 {
1620 $testSession = $this->testSessionFactory->getSession();
1621
1622 require_once './Services/Certificate/classes/class.ilCertificate.php';
1623 require_once './Modules/Test/classes/class.ilTestCertificateAdapter.php';
1624 $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
1625 $certificate->outCertificate(
1626 array(
1627 "active_id" => $testSession->getActiveId(),
1628 "pass" => ilObjTest::_getResultPass($testSession->getActiveId())
1629 )
1630 );
1631 }
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.

References $certificate, and ilObjTest\_getResultPass().

+ 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

@access public

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

790 {
791 global $ilTabs, $ilAccess, $ilObjDataCache;
792
793 if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
794 // allow only write access
795 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
796 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
797 }
798
799 $this->ctrl->saveParameter($this, "active_id");
800 $active_id = (int) $_GET["active_id"];
801 $testSession = $this->testSessionFactory->getSession($active_id);
802
803 // protect actives from other tests
804 if ($testSession->getTestId() != $this->object->getTestId()) {
805 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
806 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
807 }
808
809 $this->ctrl->saveParameter($this, "pass");
810 $pass = (int) $_GET["pass"];
811
812 if (isset($_GET['statistics']) && $_GET['statistics'] == 1) {
813 $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
814 $this->ctrl->saveParameter($this, 'statistics');
815
816 $ilTabs->setBackTarget(
817 $this->lng->txt('back'),
818 $this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'detailedEvaluation')
819 );
820 } elseif ($this->object->getNrOfTries() == 1) {
821 $ilTabs->setBackTarget(
822 $this->lng->txt('back'),
823 $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
824 );
825 } else {
826 $ilTabs->setBackTarget(
827 $this->lng->txt('tst_results_back_overview'),
828 $this->ctrl->getLinkTarget($this, 'outParticipantsResultsOverview')
829 );
830 }
831
832 // prepare generation before contents are processed (for mathjax)
833 if ($this->isPdfDeliveryRequest()) {
834 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
836 }
837
838 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
839 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
840
841 $objectivesList = null;
842
843 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
844 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
845 $testSequence->loadFromDb();
846 $testSequence->loadQuestions();
847
848 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
849 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
850
851 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
852 $objectivesList->loadObjectivesTitles();
853
854 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
855 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
856 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
857 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
858 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
859 }
860
861 $result_array = $this->getFilteredTestResult($active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired());
862
863 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $this, "outParticipantsPassDetails", '', true, $objectivesList);
864 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
865 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, false);
866 $user_id = $this->object->_getUserIdFromActiveId($active_id);
867
868 $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", true, true, "Modules/Test");
869
870 $toolbar = $this->buildUserTestResultsToolbarGUI();
871
872 $this->ctrl->setParameter($this, 'pdf', '1');
873 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
874 $this->ctrl->setParameter($this, 'pdf', '');
875
876 if (isset($_GET['show_best_solutions'])) {
877 $_SESSION['tst_results_show_best_solutions'] = true;
878 } elseif (isset($_GET['hide_best_solutions'])) {
879 $_SESSION['tst_results_show_best_solutions'] = false;
880 } elseif (!isset($_SESSION['tst_results_show_best_solutions'])) {
881 $_SESSION['tst_results_show_best_solutions'] = false;
882 }
883
884 if ($_SESSION['tst_results_show_best_solutions']) {
885 $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
886 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
887 $this->ctrl->setParameter($this, 'hide_best_solutions', '');
888 } else {
889 $this->ctrl->setParameter($this, 'show_best_solutions', '1');
890 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
891 $this->ctrl->setParameter($this, 'show_best_solutions', '');
892 }
893
894 $toolbar->build();
895 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
896
897 if ($this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1) {
898 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
899 $gradingMessageBuilder->buildList();
900
901 $template->setCurrentBlock('grading_message');
902 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
903 $template->parseCurrentBlock();
904 }
905
906 $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $_SESSION['tst_results_show_best_solutions'], false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder);
907 $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
908 $template->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
909
910 if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
911 $template->setVariable("USER_DATA", $user_data);
912
913 $uname = $this->object->userLookupFullName($user_id);
914 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
915
916 $template->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
917 }
918
919 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
920
922
923 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
924 if ($this->object->getShowSolutionAnswersOnly()) {
925 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
926 }
927
928 if ($this->isPdfDeliveryRequest()) {
929 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
930 ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
931 } else {
932 $this->tpl->setVariable("ADM_CONTENT", $template->get());
933 }
934 }
$_SESSION["AccountId"]
static getInstance(ilTestSession $a_test_session)
static lookupLastTestPassAccess($activeId, $passIndex)
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
special template class to simplify handling of ITX/PEAR
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
populatePassFinishDate($tpl, $passFinishDate)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
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.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
$template
const PDF_USER_RESULT
PDF Purposes.

References $_GET, $_SESSION, $pass, $template, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), getFilteredTestResult(), ilTestServiceGUI\getGradingMessageBuilder(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassDetailsOverviewTableGUI(), ilTestServiceGUI\getPassListOfAnswers(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilObjTest\lookupLastTestPassAccess(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilTestServiceGUI\populatePassFinishDate(), ilPDFGeneration\prepareGeneration(), ilUtil\sendInfo(), and sprintf.

Referenced by outParticipantsPassDetailsResetTableFilter(), and outParticipantsPassDetailsSetTableFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outParticipantsPassDetailsResetTableFilter()

ilTestEvaluationGUI::outParticipantsPassDetailsResetTableFilter ( )

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

1084 {
1085 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1086 $tableGUI->initFilter();
1087 $tableGUI->resetOffset();
1088 $tableGUI->resetFilter();
1090 }
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.

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

+ Here is the call graph for this function:

◆ outParticipantsPassDetailsSetTableFilter()

ilTestEvaluationGUI::outParticipantsPassDetailsSetTableFilter ( )

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

1075 {
1076 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outParticipantsPassDetails');
1077 $tableGUI->initFilter();
1078 $tableGUI->resetOffset();
1079 $tableGUI->writeFilterToSession();
1081 }

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

+ Here is the call graph for this function:

◆ outParticipantsResultsOverview()

ilTestEvaluationGUI::outParticipantsResultsOverview ( )

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

@access public

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

942 {
943 global $ilTabs, $ilAccess, $ilObjDataCache;
944
945 if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
946 // allow only write access
947 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
948 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
949 }
950
951 $active_id = (int) $_GET["active_id"];
952 $testSession = $this->testSessionFactory->getSession($active_id);
953
954 // protect actives from other tests
955 if ($testSession->getTestId() != $this->object->getTestId()) {
956 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
957 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
958 }
959
960 if ($this->object->getNrOfTries() == 1) {
961 $this->ctrl->setParameter($this, "active_id", $active_id);
962 $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
963 $this->ctrl->redirect($this, "outParticipantsPassDetails");
964 }
965
966 $ilTabs->setBackTarget(
967 $this->lng->txt('back'),
968 $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
969 );
970
971 // prepare generation before contents are processed (for mathjax)
972 if ($this->isPdfDeliveryRequest()) {
973 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
975 }
976
977 $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", true, true, "Modules/Test");
978
979 $toolbar = $this->buildUserTestResultsToolbarGUI();
980
981 $this->ctrl->setParameter($this, 'pdf', '1');
982 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
983 $this->ctrl->setParameter($this, 'pdf', '');
984
985 $toolbar->build();
986 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
987
988 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
989 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
990 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
991 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
992 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
993 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
994 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
995 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
996 }
997
998 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
999 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1000 $testPassesSelector->setActiveId($testSession->getActiveId());
1001 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1002
1003 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outParticipantsResultsOverview');
1004 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1005 $passOverViewTableGUI->setResultPresentationEnabled(true);
1006 $passOverViewTableGUI->setPassDetailsCommand('outParticipantsPassDetails');
1007 $passOverViewTableGUI->init();
1008 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(), true, true));
1009 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1010 $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1011
1012 if ($this->isGradingMessageRequired()) {
1013 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1014 $gradingMessageBuilder->buildList();
1015
1016 $template->setCurrentBlock('grading_message');
1017 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
1018 $template->parseCurrentBlock();
1019 }
1020
1021 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1022 $user_id = $this->object->_getUserIdFromActiveId($active_id);
1023
1024 if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1025 if ($this->object->getAnonymity()) {
1026 $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1027 } else {
1028 $uname = $this->object->userLookupFullName($user_id, true);
1029 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1030 $template->setVariable("USER_DATA", $user_data);
1031 }
1032 }
1033
1034 $template->parseCurrentBlock();
1035
1036
1037 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1038 if ($this->object->getShowSolutionAnswersOnly()) {
1039 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1040 }
1041
1042 if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1)) {
1043 //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1044
1045 $name = ilObjUser::_lookupName($user_id);
1046 $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__' . $this->object->getTitleFilenameCompliant();
1047 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1049 //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
1050 //$template->setVariable("PDF_FILE_LOCATION", $filename);
1051 } else {
1052 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1053 }
1054 }
static _lookupName($a_user_id)
lookup user name
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)

References $_GET, $filename, $GLOBALS, $name, $template, ilObjTest\_getResultPass(), ilObjUser\_lookupName(), 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, ilPDFGeneration\prepareGeneration(), ilUtil\sendInfo(), and sprintf.

+ 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

@access public

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

1414 {
1415 global $ilUser, $ilObjDataCache;
1416
1417 if (!$this->object->getShowSolutionPrintview()) {
1418 ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1419 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1420 }
1421
1422 $template = new ilTemplate("tpl.il_as_tst_info_list_of_answers.html", true, true, "Modules/Test");
1423
1424 $pass = null;
1425 if (array_key_exists("pass", $_GET)) {
1426 if (strlen($_GET["pass"])) {
1427 $pass = $_GET["pass"];
1428 }
1429 }
1430 $user_id = $ilUser->getId();
1431
1432 $testSession = $this->testSessionFactory->getSession();
1433 $active_id = $testSession->getActiveId();
1434
1435 $overview = "";
1436 if ($this->object->getNrOfTries() == 1) {
1437 $pass = 0;
1438 } else {
1439 $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_passes"));
1440
1441 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1442 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1443 $testPassesSelector->setActiveId($testSession->getActiveId());
1444 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1445
1446 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outUserListOfAnswerPasses');
1447 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1448 $passOverViewTableGUI->setResultPresentationEnabled(false);
1449 $passOverViewTableGUI->setPassDetailsCommand('outUserListOfAnswerPasses');
1450 $passOverViewTableGUI->init();
1451 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(), false));
1452 $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1453 }
1454
1455 $signature = "";
1456 if (strlen($pass)) {
1457 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1458 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1459
1460 $objectivesList = null;
1461
1462 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1463 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1464 $testSequence->loadFromDb();
1465 $testSequence->loadQuestions();
1466
1467 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1468 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1469
1470 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1471 $objectivesList->loadObjectivesTitles();
1472
1473 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1474 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1475 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1476 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1477 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1478 }
1479
1480 $result_array = $this->object->getTestResult(
1481 $active_id,
1482 $pass,
1483 false,
1484 !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1485 );
1486
1487 $signature = $this->getResultsSignature();
1488 $user_id =&$this->object->_getUserIdFromActiveId($active_id);
1489 $showAllAnswers = true;
1490 if ($this->object->isExecutable($testSession, $user_id)) {
1491 $showAllAnswers = false;
1492 }
1493 $this->setContextResultPresentation(false);
1494 $answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, false, $showAllAnswers, false, false, false, $objectivesList, $testResultHeaderLabelBuilder);
1495 $template->setVariable("PASS_DETAILS", $answers);
1496 }
1497 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1498 $template->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
1499 $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
1500 $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1501 $template->setVariable("PRINT_URL", "javascript:window.print();");
1502
1503 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1504 $template->setVariable("USER_DATA", $user_data);
1505 $template->setVariable("TEXT_LIST_OF_ANSWERS", $this->lng->txt("tst_list_of_answers"));
1506 if (strlen($signature)) {
1507 $template->setVariable("SIGNATURE", $signature);
1508 }
1509 if (!is_null($pass) && $this->object->isShowExamIdInTestResultsEnabled()) {
1510 $template->setCurrentBlock('exam_id_footer');
1511 $template->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
1512 $testSession->getActiveId(),
1513 $pass
1514 ));
1515 $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1516 $template->parseCurrentBlock();
1517 }
1518 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1519
1520 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1521 if ($this->object->getShowSolutionAnswersOnly()) {
1522 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1523 }
1524 }
static lookupExamId($active_id, $pass)
getResultsSignature()
Returns HTML code for a signature field.
setContextResultPresentation($contextResultPresentation)

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

+ 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.

@access public

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

1098 {
1099 global $ilTabs, $ilUser, $ilObjDataCache;
1100
1101 $this->handleTabs('results_pass_oriented');
1102
1103 if ($this->object->getNrOfTries() == 1) {
1104 $ilTabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen'));
1105 } else {
1106 $ilTabs->setBackTarget($this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
1107 }
1108
1109 $testSession = $this->testSessionFactory->getSession();
1110
1111 if (!$this->object->getShowPassDetails()) {
1112 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1113
1114 #if($executable["executable"])
1115 #{
1116 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1117 #}
1118 }
1119
1120 $active_id = $testSession->getActiveId();
1121 $user_id = $testSession->getUserId();
1122
1123 $this->ctrl->saveParameter($this, "pass");
1124 $pass = $_GET["pass"];
1125
1126 // prepare generation before contents are processed (for mathjax)
1127 if ($this->isPdfDeliveryRequest()) {
1128 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1130 }
1131
1132 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1133 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1134
1135 $objectivesList = null;
1136
1137 $considerHiddenQuestions = true;
1138 $considerOptionalQuestions = true;
1139
1140 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1141 $considerHiddenQuestions = false;
1142
1143 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1144 $testSequence->loadFromDb();
1145 $testSequence->loadQuestions();
1146
1147 if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1148 $considerOptionalQuestions = false;
1149 }
1150
1151 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1152 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1153
1154 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1155 $objectivesList->loadObjectivesTitles();
1156
1157 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1158 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1159 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1160 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1161 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1162 }
1163
1164 $result_array = $this->getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions);
1165
1166 $command_solution_details = "";
1167 if ($this->object->getShowSolutionDetails()) {
1168 $command_solution_details = "outCorrectSolution";
1169 }
1170 $questionAnchorNav = $this->object->canShowSolutionPrintview();
1171
1172 $tpl = new ilTemplate('tpl.il_as_tst_pass_details_overview_participants.html', true, true, "Modules/Test");
1173
1174 if (!$this->isPdfDeliveryRequest()) {
1175 $toolbar = $this->buildUserTestResultsToolbarGUI();
1176
1177 $this->ctrl->setParameter($this, 'pdf', '1');
1178 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outUserPassDetails'));
1179 $this->ctrl->setParameter($this, 'pdf', '');
1180
1181 include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1182 if ($this->object->canShowCertificate($testSession, $user_id, $active_id)) {
1183 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1184 }
1185
1186 $toolbar->build();
1187
1188 $tpl->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1189
1190 $tpl->setCurrentBlock('signature');
1191 $tpl->setVariable("SIGNATURE", $this->getResultsSignature());
1192 $tpl->parseCurrentBlock();
1193
1194 if ($this->object->isShowExamIdInTestResultsEnabled()) {
1195 $tpl->setCurrentBlock('exam_id');
1196 $tpl->setVariable('EXAM_ID', ilObjTest::lookupExamId(
1197 $testSession->getActiveId(),
1198 $pass
1199 ));
1200 $tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1201 $tpl->parseCurrentBlock();
1202 }
1203 }
1204
1205 if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() &&
1206 $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1) {
1207 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1208 $gradingMessageBuilder->buildMessage();
1209 $gradingMessageBuilder->sendMessage();
1210
1211 #$template->setCurrentBlock('grading_message');
1212 #$template->setVariable('GRADING_MESSAGE', );
1213 #$template->parseCurrentBlock();
1214 }
1215
1216 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI(
1217 $result_array,
1218 $active_id,
1219 $pass,
1220 $this,
1221 "outUserPassDetails",
1222 $command_solution_details,
1223 $questionAnchorNav,
1224 $objectivesList
1225 );
1226 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1227 $tpl->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1228
1229 if ($this->object->canShowSolutionPrintview()) {
1230 $list_of_answers = $this->getPassListOfAnswers(
1231 $result_array,
1232 $active_id,
1233 $pass,
1234 $this->object->getShowSolutionListComparison(),
1235 false,
1236 false,
1237 false,
1238 true,
1239 $objectivesList,
1240 $testResultHeaderLabelBuilder
1241 );
1242 $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1243 }
1244
1245 $tpl->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass+1));
1246 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1247
1248 $uname = $this->object->userLookupFullName($user_id, true);
1249 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1250 if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1251 if ($this->object->getAnonymity()) {
1252 $tpl->setVariable("TEXT_HEADING", $this->lng->txt("tst_result_pass"));
1253 } else {
1254 $tpl->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1255 $tpl->setVariable("USER_DATA", $user_data);
1256 }
1257 }
1258
1260
1261 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1262 if ($this->object->getShowSolutionAnswersOnly()) {
1263 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1264 }
1265
1266 if ($this->isPdfDeliveryRequest()) {
1267 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1268 ilTestPDFGenerator::generatePDF($tpl->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1269 } else {
1270 $this->tpl->setContent($tpl->get());
1271 }
1272 }

References $_GET, $ilUser, $pass, 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\handleTabs(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilObjTest\lookupExamId(), ilObjTest\lookupLastTestPassAccess(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilTestServiceGUI\populatePassFinishDate(), ilPDFGeneration\prepareGeneration(), and sprintf.

Referenced by outUserPassDetailsResetTableFilter(), and outUserPassDetailsSetTableFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outUserPassDetailsResetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsResetTableFilter ( )

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

1066 {
1067 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1068 $tableGUI->initFilter();
1069 $tableGUI->resetOffset();
1070 $tableGUI->resetFilter();
1071 $this->outUserPassDetails();
1072 }
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.

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

+ Here is the call graph for this function:

◆ outUserPassDetailsSetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsSetTableFilter ( )

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

1057 {
1058 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1059 $tableGUI->initFilter();
1060 $tableGUI->resetOffset();
1061 $tableGUI->writeFilterToSession();
1062 $this->outUserPassDetails();
1063 }

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

+ Here is the call graph for this function:

◆ outUserResultsOverview()

ilTestEvaluationGUI::outUserResultsOverview ( )

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

@global ilTabsGUI $ilTabs

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

1280 {
1281 global $ilUser, $ilTabs, $ilObjDataCache;
1282
1283 $this->handleTabs('results_pass_oriented');
1284
1285 $ilTabs->setBackTarget(
1286 $this->lng->txt('tst_results_back_introduction'),
1287 $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')
1288 );
1289
1290 $testSession = $this->testSessionFactory->getSession();
1291 $active_id = $testSession->getActiveId();
1292 $user_id = $ilUser->getId();
1293 $uname = $this->object->userLookupFullName($user_id, true);
1294
1295 if (!$this->object->canShowTestResults($testSession)) {
1296 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1297 }
1298
1299 // prepare generation before contents are processed (for mathjax)
1300 if ($this->isPdfDeliveryRequest()) {
1301 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1303 }
1304
1305 $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", true, true, "Modules/Test");
1306 $template = new ilTemplate("tpl.il_as_tst_results_participant.html", true, true, "Modules/Test");
1307
1308 $toolbar = $this->buildUserTestResultsToolbarGUI();
1309
1310 $this->ctrl->setParameter($this, 'pdf', '1');
1311 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
1312 $this->ctrl->setParameter($this, 'pdf', '');
1313
1314 include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1315 if ($this->object->canShowCertificate($testSession, $user_id, $active_id)) {
1316 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1317 }
1318
1319 $toolbar->build();
1320
1321 $templatehead->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1322
1323 $passDetailsEnabled = $this->object->getShowPassDetails();
1324 #if (!$passDetailsEnabled)
1325 #{
1326 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1327 # if (!$executable["executable"]) $passDetailsEnabled = true;
1328 #}
1329
1330 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1331 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1332 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1333 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1334 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1335 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1336 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1337 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1338 }
1339
1340 $template->setCurrentBlock("pass_overview");
1341
1342 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1343 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1344 $testPassesSelector->setActiveId($testSession->getActiveId());
1345 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1346
1347 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outUserResultsOverview');
1348 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1349 $passOverViewTableGUI->setResultPresentationEnabled(true);
1350 if ($passDetailsEnabled) {
1351 $passOverViewTableGUI->setPassDetailsCommand('outUserPassDetails');
1352 }
1353 if ($this->object->isPassDeletionAllowed()) {
1354 $passOverViewTableGUI->setPassDeletionCommand('confirmDeletePass');
1355 }
1356 $passOverViewTableGUI->init();
1357 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(), true));
1358 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1359 $overview = $passOverViewTableGUI->getHTML();
1360 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1361 require_once 'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1362 $loStatus = new ilTestLearningObjectivesStatusGUI($this->lng);
1363 $loStatus->setCrsObjId($this->getObjectiveOrientedContainer()->getObjId());
1364 $loStatus->setUsrId($testSession->getUserId());
1365 $overview .= "<br />" . $loStatus->getHTML();
1366 }
1367 $template->setVariable("PASS_OVERVIEW", $overview);
1368 $template->parseCurrentBlock();
1369
1370 if ($this->isGradingMessageRequired()) {
1371 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1372 $gradingMessageBuilder->buildMessage();
1373 $gradingMessageBuilder->sendMessage();
1374
1375 #$template->setCurrentBlock('grading_message');
1376 #$template->setVariable('GRADING_MESSAGE', );
1377 #$template->parseCurrentBlock();
1378 }
1379
1380 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, true);
1381
1382 if (!$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
1383 if ($this->object->getAnonymity()) {
1384 $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1385 } else {
1386 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1387 $template->setVariable("USER_DATA", $user_data);
1388 }
1389 }
1390
1391 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1392 if ($this->object->getShowSolutionAnswersOnly()) {
1393 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1394 }
1395 $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
1396
1397 if ($this->isPdfDeliveryRequest()) {
1398 //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1399 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
1400 ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant(), PDF_USER_RESULT);
1401 } else {
1402 $this->tpl->setContent($templatehead->get());
1403 }
1404 }

References $GLOBALS, $ilUser, $template, ilTestServiceGUI\buildPassOverviewTableGUI(), ilTestServiceGUI\buildUserTestResultsToolbarGUI(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilTestServiceGUI\getGradingMessageBuilder(), ilTestServiceGUI\getObjectiveOrientedContainer(), ilTestServiceGUI\getPassOverviewTableData(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\handleTabs(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, ilPDFGeneration\prepareGeneration(), and sprintf.

+ 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

@access public

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

1534 {
1535 if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0)) {
1536 $this->ctrl->saveParameter($this, "pass");
1537 $this->ctrl->saveParameter($this, "active_id");
1538 $this->outTestResults(false, $_GET["pass"]);
1539 } else {
1540 $this->outTestResults(false);
1541 }
1542 }

References $_GET.

◆ redirectBackToParticipantsScreen()

ilTestEvaluationGUI::redirectBackToParticipantsScreen ( )
protected

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

2035 {
2036 $this->ctrl->redirectByClass("ilobjtestgui", "participants");
2037 }

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

+ Here is the caller graph for this function:

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

1660 {
1661 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1662
1663 switch ($context) {
1665
1666 $this->ctrl->redirect($this, 'outUserResultsOverview');
1667
1668 // no break
1670
1671 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1672
1673 // no break
1675
1676 $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1677 }
1678 }

References ilTestPassDeletionConfirmationGUI\CONTEXT_DYN_TEST_PLAYER, ilTestPassDeletionConfirmationGUI\CONTEXT_INFO_SCREEN, and ilTestPassDeletionConfirmationGUI\CONTEXT_PASS_OVERVIEW.

Referenced by cancelDeletePass(), and confirmDeletePass().

+ Here is the caller graph for this function:

◆ resetfilterEvaluation()

ilTestEvaluationGUI::resetfilterEvaluation ( )

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

135 {
136 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
137 $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
138 $table_gui->resetFilter();
139 $this->ctrl->redirect($this, "outEvaluation");
140 }

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

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

1549 {
1550 global $ilAccess;
1551
1552 if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id))) {
1553 // allow only evaluation access
1554 ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1555 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1556 }
1557
1558 $data =&$this->object->getCompleteEvaluationData();
1559 $color_class = array("tblrow1", "tblrow2");
1560 $counter = 0;
1561 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1562 $foundParticipants =&$data->getParticipants();
1563 if (count($foundParticipants) == 0) {
1564 ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1565 return;
1566 } else {
1567 $rows = array();
1568 foreach ($data->getQuestionTitles() as $question_id => $question_title) {
1569 $answered = 0;
1570 $reached = 0;
1571 $max = 0;
1572 foreach ($foundParticipants as $userdata) {
1573 $pass = $userdata->getScoredPass();
1574 if (is_object($userdata->getPass($pass))) {
1575 $question =&$userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1576 if (is_array($question)) {
1577 $answered++;
1578 }
1579 }
1580 }
1581 $counter++;
1582 $this->ctrl->setParameter($this, "qid", $question_id);
1583 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1584 $question_object = assQuestion::_instanciateQuestion($question_id);
1585 $download = "";
1586 if ($question_object instanceof ilObjFileHandlingQuestionType) {
1587 if ($question_object->hasFileUploads($this->object->getTestId())) {
1588 $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants") . "\">" . $this->lng->txt("download") . "</a>";
1589 }
1590 }
1591 array_push(
1592 $rows,
1593 array(
1594 'qid' => $question_id,
1595 'question_title' => $question_title,
1596 'number_of_answers' => $answered,
1597 'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1598 'file_uploads' => $download
1599 )
1600 );
1601 }
1602 if (count($rows)) {
1603 require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1604 $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1605 $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1606 $table_gui->setData($rows);
1607
1608 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1609 } else {
1610 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1611 }
1612 }
1613 }
TableGUI class for results by question.
$userdata
Definition: demo.php:48
$rows
Definition: xhr_table.php:10

References $counter, $data, $pass, $rows, $userdata, assQuestion\_instanciateQuestion(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

Field Documentation

◆ $processLockerFactory

ilTestEvaluationGUI::$processLockerFactory
protected

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


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