ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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'), $DIC->database()
50 );
51 }
ILIAS Setting Class.
global $DIC

References $DIC.

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

1786 {
1787 $this->redirectToPassDeletionContext($_POST['context']);
1788 }
$_POST["username"]

References $_POST, and redirectToPassDeletionContext().

+ Here is the call graph for this function:

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

1761 {
1762 if( isset($_GET['context']) && strlen($_GET['context']) )
1763 {
1764 $context = $_GET['context'];
1765 }
1766 else
1767 {
1769 }
1770
1771 if( !$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest() )
1772 {
1773 $this->redirectToPassDeletionContext($context);
1774 }
1775
1776 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1777
1778 $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1779 $confirm->build((int)$_GET['active_id'], (int)$_GET['pass'], $context);
1780
1781 global $tpl;
1782 $tpl->setContent($this->ctrl->getHTML($confirm));
1783 }
$_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 2189 of file class.ilTestEvaluationGUI.php.

2190 {
2191 require_once 'Modules/Test/classes/class.ilTestPassFinishTasks.php';
2192 $participants = $this->object->getTestParticipants();
2193 foreach($participants as $participant)
2194 {
2195 if(array_key_exists('unfinished_passes', $participant) && $participant['unfinished_passes'] == 1)
2196 {
2197 $this->finishTestPass($participant['active_id'], $this->object->getId());
2198 }
2199 }
2201 }
finishTestPass($active_id, $obj_id)

References finishTestPass(), and redirectBackToParticipantsScreen().

+ Here is the call graph for this function:

◆ confirmFinishTestPassForUser()

ilTestEvaluationGUI::confirmFinishTestPassForUser ( )

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

2171 {
2172 require_once 'Modules/Test/classes/class.ilTestPassFinishTasks.php';
2173 $active_id = (int) $_GET["active_id"];
2174 $this->finishTestPass($active_id, $this->object->getId());
2176 }

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

339 {
340 global $DIC;
341
342 if((!$DIC->access()->checkAccess('tst_statistics', '', $this->ref_id)) && (!$DIC->access()->checkAccess('write', '', $this->ref_id)))
343 {
344 ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), TRUE);
345 $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
346 }
347
348 $active_id = $_GET['active_id'];
349 if(strlen($active_id) == 0)
350 {
351 ilUtil::sendInfo($this->lng->txt('detailed_evaluation_missing_active_id'), TRUE);
352 $this->ctrl->redirect($this, 'outEvaluation');
353 }
354
355 $this->tpl->addCss(ilUtil::getStyleSheetLocation('output', 'test_print.css', 'Modules/Test'), 'print');
356
357 $toolbar = $DIC['ilToolbar'];
358
359 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
360 $backBtn = ilLinkButton::getInstance();
361 $backBtn->setCaption('back');
362 $backBtn->setUrl($this->ctrl->getLinkTarget($this, 'outEvaluation'));
363 $toolbar->addInputItem($backBtn);
364
365 $data =& $this->object->getCompleteEvaluationData();
366
367 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
368 $form = new ilPropertyFormGUI();
369 $form->setTitle(sprintf(
370 $this->lng->txt('detailed_evaluation_for'), $data->getParticipant($active_id)->getName()
371 ));
372
373 $resultPoints = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultspoints'));
374 $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()) . " %" . ")");
375 $form->addItem($resultPoints);
376
377 if(strlen($data->getParticipant($active_id)->getMark()))
378 {
379 $resultMarks = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_resultsmarks'));
380 $resultMarks->setValue($data->getParticipant($active_id)->getMark());
381 $form->addItem($resultMarks);
382 if(strlen($data->getParticipant($active_id)->getECTSMark()))
383 {
384 $ectsGrade = new ilNonEditableValueGUI($this->lng->txt('ects_grade'));
385 $ectsGrade->setValue($data->getParticipant($active_id)->getECTSMark());
386 $form->addItem($ectsGrade);
387 }
388 }
389
390 if($this->object->isOfferingQuestionHintsEnabled() )
391 {
392 $requestHints = new ilNonEditableValueGUI($this->lng->txt('tst_question_hints_requested_hint_count_header'));
393 $requestHints->setValue($data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
394 $form->addItem($requestHints);
395 }
396
397 $time_seconds = $data->getParticipant($active_id)->getTimeOfWork();
398 $atime_seconds = $data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds / $data->getParticipant($active_id)->getNumberOfQuestions() : 0;
399 $time_hours = floor($time_seconds/3600);
400 $time_seconds -= $time_hours * 3600;
401 $time_minutes = floor($time_seconds/60);
402 $time_seconds -= $time_minutes * 60;
403 $timeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_timeofwork'));
404 $timeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
405 $form->addItem($timeOfWork);
406
407 $this->tpl->setVariable("TXT_ATIMEOFWORK", $this->lng->txt(""));
408 $time_hours = floor($atime_seconds/3600);
409 $atime_seconds -= $time_hours * 3600;
410 $time_minutes = floor($atime_seconds/60);
411 $atime_seconds -= $time_minutes * 60;
412 $avgTimeOfWork = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_atimeofwork'));
413 $avgTimeOfWork->setValue(sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
414 $form->addItem($avgTimeOfWork);
415
416 $firstVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_firstvisit'));
417 $firstVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getFirstVisit(),IL_CAL_UNIX)));
418 $form->addItem($firstVisit);
419
420 $lastVisit = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_lastvisit'));
421 $lastVisit->setValue(ilDatePresentation::formatDate(new ilDateTime($data->getParticipant($active_id)->getLastVisit(),IL_CAL_UNIX)));
422 $form->addItem($lastVisit);
423
424 $nrPasses = new ilNonEditableValueGUI($this->lng->txt('tst_nr_of_passes'));
425 $nrPasses->setValue($data->getParticipant($active_id)->getLastPass() + 1);
426 $form->addItem($nrPasses);
427
428 $scoredPass = new ilNonEditableValueGUI($this->lng->txt('scored_pass'));
429 if($this->object->getPassScoring() == SCORE_BEST_PASS)
430 {
431 $scoredPass->setValue($data->getParticipant($active_id)->getBestPass() + 1);
432 }
433 else
434 {
435 $scoredPass->setValue($data->getParticipant($active_id)->getLastPass() + 1);
436 }
437 $form->addItem($scoredPass);
438
439 $median = $data->getStatistics()->getStatistics()->median();
440 $pct = $data->getParticipant($active_id)->getMaxpoints() ? ($median / $data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
441 $mark = $this->object->mark_schema->getMatchingMark($pct);
442 if(is_object($mark))
443 {
444 $markMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_mark_median'));
445 $markMedian->setValue($mark->getShortName());
446 $form->addItem($markMedian);
447 }
448
449 $rankParticipant = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_participant'));
450 $rankParticipant->setValue($data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
451 $form->addItem($rankParticipant);
452
453 $rankMedian = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_rank_median'));
454 $rankMedian->setValue($data->getStatistics()->getStatistics()->rank_median());
455 $form->addItem($rankMedian);
456
457 $totalParticipants = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_total_participants'));
458 $totalParticipants->setValue($data->getStatistics()->getStatistics()->count());
459 $form->addItem($totalParticipants);
460
461 $medianField = new ilNonEditableValueGUI($this->lng->txt('tst_stat_result_median'));
462 $medianField->setValue($median);
463 $form->addItem($medianField);
464
465 $this->tpl->setContent($form->getHTML());
466
467 $tables = array();
468
469 for($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++)
470 {
471 $finishdate = $this->object->getPassFinishDate($active_id, $pass);
472 if($finishdate > 0)
473 {
474 if(($DIC->access()->checkAccess('write', '', (int)$_GET['ref_id'])))
475 {
476 $this->ctrl->setParameter($this, 'statistics', '1');
477 $this->ctrl->setParameter($this, 'active_id', $active_id);
478 $this->ctrl->setParameter($this, 'pass', $pass);
479 }
480 else
481 {
482 $this->ctrl->setParameter($this, 'statistics', '');
483 $this->ctrl->setParameter($this, 'active_id', '');
484 $this->ctrl->setParameter($this, 'pass', '');
485 }
486
487 require_once 'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
488 $table = new ilTestDetailedEvaluationStatisticsTableGUI($this, 'detailedEvaluation', ($pass + 1). '_' . $this->object->getId());
489 $table->setTitle(sprintf($this->lng->txt("tst_eval_question_points"), $pass + 1));
490 if(($DIC->access()->checkAccess('write', '', (int)$_GET['ref_id'])))
491 {
492 $table->addCommandButton('outParticipantsPassDetails', $this->lng->txt('tst_show_answer_sheet'));
493 }
494
495 $questions = $data->getParticipant($active_id)->getQuestions($pass);
496 if(!is_array($questions))
497 {
498 $questions = $data->getParticipant($active_id)->getQuestions(0);
499 }
500
501 $tableData = array();
502
503 $counter = 0;
504 foreach((array)$questions as $question)
505 {
506 $userDataData = array(
507 'counter' => ++$counter,
508 'id' => $question['id'],
509 'id_txt' => $this->lng->txt('question_id_short'),
510 'title' => $data->getQuestionTitle($question['id'])
511 );
512
513 $answeredquestion = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
514 if(is_array($answeredquestion))
515 {
516 $percent = $answeredquestion['points'] ? $answeredquestion['reached'] / $answeredquestion['points'] * 100.0 : 0;
517 $userDataData['points'] = $answeredquestion['reached'] . ' ' . strtolower($this->lng->txt('of')) . " " . $answeredquestion['points'] . ' (' . sprintf("%.2f", $percent) . ' %)';
518 }
519 else
520 {
521 $userDataData['points'] = '0 ' . strtolower($this->lng->txt('of')) . ' ' . $question['points'] . ' (' . sprintf("%.2f", 0) . ' %) - ' . $this->lng->txt('question_not_answered');
522 }
523
524 $tableData[] = $userDataData;
525 }
526 $table->setData($tableData);
527
528 $tables[] = $table->getHTML();
529 }
530 }
531
532 $GLOBALS['tpl']->setContent($form->getHTML() . implode('', $tables));
533 }
sprintf('%.4f', $callTime)
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Factory.
This class represents a non editable value in a property form.
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

References $_GET, $counter, $data, $DIC, $GLOBALS, $pass, ilDatePresentation\formatDate(), ilLinkButton\getInstance(), ilUtil\getStyleSheetLocation(), IL_CAL_UNIX, 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 56 of file class.ilTestEvaluationGUI.php.

57 {
58 $cmd = $this->ctrl->getCmd();
59 $next_class = $this->ctrl->getNextClass($this);
60 $this->ctrl->saveParameter($this, "sequence");
61 $this->ctrl->saveParameter($this, "active_id");
62 $cmd = $this->getCommand($cmd);
63 switch($next_class)
64 {
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
$cmd
Definition: sahs_server.php:35

References $cmd, $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 775 of file class.ilTestEvaluationGUI.php.

776 {
777 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
778 $expFactory = new ilTestExportFactory($this->object);
779 $exportObj = $expFactory->getExporter('aggregated');
780
781 switch ($_POST["export_type"])
782 {
783 case "excel":
784 $exportObj->exportToExcel($deliver = TRUE);
785 break;
786 case "csv":
787 $exportObj->exportToCSV($deliver = TRUE);
788 break;
789 }
790 }

References $_POST.

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

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

@access public

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

799 {
800 global $ilUser;
801
802 include_once "./Services/Utilities/classes/class.ilUtil.php";
803 include_once "./Services/Certificate/classes/class.ilCertificate.php";
804 include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
805 $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
806 $archive_dir = $certificate->createArchiveDirectory();
807 $total_users = array();
808 $total_users =& $this->object->evalTotalPersonsArray();
809 if (count($total_users))
810 {
811 foreach ($total_users as $active_id => $name)
812 {
813 $user_id = $this->object->_getUserIdFromActiveId($active_id);
814 $pdf = $certificate->outCertificate(
815 array(
816 "active_id" => $active_id,
817 "userfilter" => $userfilter,
818 "passedonly" => $passedonly
819 ),
820 FALSE
821 );
822 if (strlen($pdf))
823 {
824 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
825 }
826 }
827 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
828 }
829
830 }
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
$ilUser
Definition: imgupload.php:18

References $certificate, $ilUser, $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 716 of file class.ilTestEvaluationGUI.php.

717 {
718 $filterby = "";
719 if (array_key_exists("g_filterby", $_GET))
720 {
721 $filterby = $_GET["g_filterby"];
722 }
723
724 $filtertext = "";
725 if (array_key_exists("g_userfilter", $_GET))
726 {
727 $filtertext = $_GET["g_userfilter"];
728 }
729
730 $passedonly = FALSE;
731 if (array_key_exists("g_passedonly", $_GET))
732 {
733 if ($_GET["g_passedonly"] == 1)
734 {
735 $passedonly = TRUE;
736 }
737 }
738
739 require_once 'Modules/Test/classes/class.ilTestExportFactory.php';
740 $expFactory = new ilTestExportFactory($this->object);
741
742 switch ($_POST["export_type"])
743 {
744 case "excel":
745 $expFactory->getExporter('results')->exportToExcel(
746 $deliver = TRUE, $filterby, $filtertext, $passedonly
747 );
748 break;
749
750 case "csv":
751 $expFactory->getExporter('results')->exportToCSV(
752 $deliver = TRUE, $filterby, $filtertext, $passedonly
753 );
754 break;
755
756 case "certificate":
757 if ($passedonly)
758 {
759 $this->ctrl->setParameterByClass("iltestcertificategui", "g_passedonly", "1");
760 }
761 if (strlen($filtertext))
762 {
763 $this->ctrl->setParameterByClass("iltestcertificategui", "g_userfilter", $filtertext);
764 }
765 $this->ctrl->redirect($this, "exportCertificate");
766 break;
767 }
768 }

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

549 {
550 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
551 $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
552 if ( $question_object instanceof ilObjFileHandlingQuestionType )
553 {
554 $question_object->deliverFileUploadZIPFile($this->object->getTestId(), $this->object->getTitle());
555 }
556 else
557 {
558 $this->ctrl->redirect($this, "singleResults");
559 }
560 }
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 539 of file class.ilTestEvaluationGUI.php.

540 {
541 $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
542 }
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 136 of file class.ilTestEvaluationGUI.php.

137 {
138 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
139 $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
140 $table_gui->writeFilterToSession();
141 $this->ctrl->redirect($this, "outEvaluation");
142 }
TableGUI class for evaluation of all users.

◆ finishAllUserPasses()

ilTestEvaluationGUI::finishAllUserPasses ( )

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

2179 {
2180 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2181 $cgui = new ilConfirmationGUI();
2182 $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2183 $cgui->setHeaderText($this->lng->txt("finish_pass_for_all_users"));
2184 $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2185 $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForAllUser");
2186 $this->tpl->setContent($cgui->getHTML());
2187 }
Confirmation screen class.

◆ finishTestPass()

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

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

2204 {
2205 $this->processLockerFactory->setActiveId($active_id);
2206 $processLocker = $this->processLockerFactory->getLocker();
2207
2208 $test_pass_finisher = new ilTestPassFinishTasks($active_id, $obj_id);
2209 $test_pass_finisher->performFinishTasks($processLocker);
2210 }
Class ilTestPassFinishTasks.

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

+ Here is the caller graph for this function:

◆ finishTestPassForSingleUser()

ilTestEvaluationGUI::finishTestPassForSingleUser ( )

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

2160 {
2161 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
2162 $cgui = new ilConfirmationGUI();
2163 $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2164 $cgui->setHeaderText($this->lng->txt("finish_pass_for_user_confirmation"));
2165 $cgui->setCancel($this->lng->txt("cancel"), "redirectBackToParticipantsScreen");
2166 $cgui->setConfirm($this->lng->txt("proceed"), "confirmFinishTestPassForUser");
2167 $this->tpl->setContent($cgui->getHTML());
2168 }

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

839 {
840 if ($original_id > 0)
841 {
842 return $original_id;
843 }
844 else
845 {
846 return $question_id;
847 }
848 }

◆ getFilteredTestResult()

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

Reimplemented from ilTestServiceGUI.

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

2093 {
2094 global $ilDB, $ilPluginAdmin;
2095
2096 $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions);
2097 $questionIds = array();
2098 foreach($resultData as $resultItemKey => $resultItemValue)
2099 {
2100 if($resultItemKey === 'test' || $resultItemKey === 'pass')
2101 {
2102 continue;
2103 }
2104
2105 $questionIds[] = $resultItemValue['qid'];
2106 }
2107
2108 $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
2109 $table_gui->initFilter();
2110
2111 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2112 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
2113
2114 $questionList->setIncludeQuestionIdsFilter($questionIds);
2115 $questionList->setQuestionInstanceTypeFilter(null);
2116
2117 foreach ($table_gui->getFilterItems() as $item)
2118 {
2119 if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
2120 {
2121 $v = $item->getValue();
2122
2123 if( is_array($v) && count($v) && !(int)$v[0] )
2124 {
2125 continue;
2126 }
2127
2128 $taxId = substr($item->getPostVar(), strlen('tax_'));
2129 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
2130 }
2131 elseif( $item->getValue() !== false )
2132 {
2133 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2134 }
2135 }
2136
2137 $questionList->load();
2138
2139 $filteredTestResult = array();
2140
2141 foreach($resultData as $resultItemKey => $resultItemValue)
2142 {
2143 if($resultItemKey === 'test' || $resultItemKey === 'pass')
2144 {
2145 continue;
2146 }
2147
2148 if( !$questionList->isInList($resultItemValue['qid']) )
2149 {
2150 continue;
2151 }
2152
2153 $filteredTestResult[] = $resultItemValue;
2154 }
2155
2156 return $filteredTestResult;
2157 }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
global $ilDB

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

Referenced by 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 {
85 array_push($headernames, $this->lng->txt("counter"));
86 }
87 else
88 {
89 array_push($headernames, $this->lng->txt("name"));
90 array_push($headernames, $this->lng->txt("login"));
91 }
92 $additionalFields = $this->object->getEvaluationAdditionalFields();
93 if (count($additionalFields))
94 {
95 foreach ($additionalFields as $fieldname)
96 {
97 array_push($headernames, $this->lng->txt($fieldname));
98 }
99 }
100 array_push($headernames, $this->lng->txt("tst_reached_points"));
101 array_push($headernames, $this->lng->txt("tst_mark"));
102 if ($this->object->getECTSOutput())
103 {
104 array_push($headernames, $this->lng->txt("ects_grade"));
105 }
106 array_push($headernames, $this->lng->txt("tst_answered_questions"));
107 array_push($headernames, $this->lng->txt("working_time"));
108 array_push($headernames, $this->lng->txt("detailed_evaluation"));
109 return $headernames;
110 }

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

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

113 {
114 $headervars = array();
115 if ($this->object->getAnonymity())
116 {
117 array_push($headervars, "counter");
118 }
119 else
120 {
121 array_push($headervars, "name");
122 array_push($headervars, "login");
123 }
124 array_push($headervars, "resultspoints");
125 array_push($headervars, "resultsmarks");
126 if ($this->object->getECTSOutput())
127 {
128 array_push($headervars, "ects_grade");
129 }
130 array_push($headervars, "qworkedthrough");
131 array_push($headervars, "timeofwork");
132 array_push($headervars, "");
133 return $headervars;
134 }

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

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

1746 {
1747 $testSession = $this->testSessionFactory->getSession();
1748
1749 require_once './Services/Certificate/classes/class.ilCertificate.php';
1750 require_once './Modules/Test/classes/class.ilTestCertificateAdapter.php';
1751 $certificate = new ilCertificate(new ilTestCertificateAdapter( $this->object ) );
1752 $certificate->outCertificate(
1753 array(
1754 "active_id" => $testSession->getActiveId(),
1755 "pass" => ilObjTest::_getResultPass( $testSession->getActiveId() )
1756 )
1757 );
1758 }
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 857 of file class.ilTestEvaluationGUI.php.

858 {
859 global $ilTabs, $ilAccess, $ilObjDataCache;
860
861 if (!$ilAccess->checkAccess('write', '', $this->ref_id))
862 {
863 // allow only write access
864 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
865 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
866 }
867
868 $this->ctrl->saveParameter($this, "active_id");
869 $active_id = (int)$_GET["active_id"];
870 $testSession = $this->testSessionFactory->getSession($active_id);
871
872 // protect actives from other tests
873 if( $testSession->getTestId() != $this->object->getTestId() )
874 {
875 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
876 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
877 }
878
879 $this->ctrl->saveParameter($this, "pass");
880 $pass = (int)$_GET["pass"];
881
882 if ( isset($_GET['statistics']) && $_GET['statistics'] == 1)
883 {
884 $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
885 $this->ctrl->saveParameter($this, 'statistics');
886
887 $ilTabs->setBackTarget(
888 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'detailedEvaluation')
889 );
890 }
891 elseif ($this->object->getNrOfTries() == 1)
892 {
893 $ilTabs->setBackTarget(
894 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
895 );
896 }
897 else
898 {
899 $ilTabs->setBackTarget(
900 $this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this, 'outParticipantsResultsOverview')
901 );
902 }
903
904 // prepare generation before contents are processed (for mathjax)
905 if ($this->isPdfDeliveryRequest())
906 {
907 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
909 }
910
911 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
912 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
913
914 $objectivesList = null;
915
916 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
917 {
918 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
919 $testSequence->loadFromDb();
920 $testSequence->loadQuestions();
921
922 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
923 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
924
925 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
926 $objectivesList->loadObjectivesTitles();
927
928 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
929 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
930 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
931 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
932 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
933 }
934
935 $result_array = $this->object->getTestResult(
936 $active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
937 );
938
939 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $this, "outParticipantsPassDetails", '', true, $objectivesList);
940 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
941 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, FALSE);
942 $user_id = $this->object->_getUserIdFromActiveId($active_id);
943
944 $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE, "Modules/Test");
945
946 $toolbar = $this->buildUserTestResultsToolbarGUI();
947
948 $this->ctrl->setParameter($this, 'pdf', '1');
949 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails') );
950 $this->ctrl->setParameter($this, 'pdf', '');
951
952 if( isset($_GET['show_best_solutions']) )
953 {
954 $_SESSION['tst_results_show_best_solutions'] = true;
955 }
956 elseif( isset($_GET['hide_best_solutions']) )
957 {
958 $_SESSION['tst_results_show_best_solutions'] = false;
959 }
960 elseif( !isset($_SESSION['tst_results_show_best_solutions']) )
961 {
962 $_SESSION['tst_results_show_best_solutions'] = false;
963 }
964
965 if( $_SESSION['tst_results_show_best_solutions'] )
966 {
967 $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
968 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
969 $this->ctrl->setParameter($this, 'hide_best_solutions', '');
970 }
971 else
972 {
973 $this->ctrl->setParameter($this, 'show_best_solutions', '1');
974 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
975 $this->ctrl->setParameter($this, 'show_best_solutions', '');
976 }
977
978 $toolbar->build();
979 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
980
981 if( $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1 )
982 {
983 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
984 $gradingMessageBuilder->buildList();
985
986 $template->setCurrentBlock('grading_message');
987 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
988 $template->parseCurrentBlock();
989 }
990
991 $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $_SESSION['tst_results_show_best_solutions'], false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder);
992 $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
993 $template->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
994
995 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
996 {
997 $template->setVariable("USER_DATA", $user_data);
998
999 $uname = $this->object->userLookupFullName($user_id);
1000 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1001
1002 $template->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1003 }
1004
1005 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1006
1007 $this->populatePassFinishDate($template, $this->object->getPassFinishDate($active_id, $pass));
1008
1009 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1010 if ($this->object->getShowSolutionAnswersOnly())
1011 {
1012 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1013 }
1014
1015 if( $this->isPdfDeliveryRequest() )
1016 {
1017 //$this->object->deliverPDFfromHTML($template->get());
1018 require_once 'class.ilTestPDFGenerator.php';
1019 ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant());
1020 }
1021 else
1022 {
1023 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1024 }
1025 }
$_SESSION["AccountId"]
static getInstance(ilTestSession $a_test_session)
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
static generatePDF($pdf_output, $output_mode, $filename=null)
populatePassFinishDate($tpl, $passFinishDate)
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.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)

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

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

1033 {
1034 global $ilTabs, $ilAccess, $ilObjDataCache;
1035
1036 if (!$ilAccess->checkAccess('write', '', $this->ref_id))
1037 {
1038 // allow only write access
1039 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
1040 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1041 }
1042
1043 $active_id = (int)$_GET["active_id"];
1044 $testSession = $this->testSessionFactory->getSession($active_id);
1045
1046 // protect actives from other tests
1047 if( $testSession->getTestId() != $this->object->getTestId() )
1048 {
1049 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
1050 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1051 }
1052
1053 if ($this->object->getNrOfTries() == 1)
1054 {
1055 $this->ctrl->setParameter($this, "active_id", $active_id);
1056 $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
1057 $this->ctrl->redirect($this, "outParticipantsPassDetails");
1058 }
1059
1060 $ilTabs->setBackTarget(
1061 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
1062 );
1063
1064 // prepare generation before contents are processed (for mathjax)
1065 if ($this->isPdfDeliveryRequest())
1066 {
1067 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1069 }
1070
1071 $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE, "Modules/Test");
1072
1073 $toolbar = $this->buildUserTestResultsToolbarGUI();
1074
1075 $this->ctrl->setParameter($this, 'pdf', '1');
1076 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, __FUNCTION__) );
1077 $this->ctrl->setParameter($this, 'pdf', '');
1078
1079 $toolbar->build();
1080 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1081
1082 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1083 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1084 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1085 {
1086 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1087 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1088 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1089 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1090 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1091 }
1092
1093 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1094 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1095 $testPassesSelector->setActiveId($testSession->getActiveId());
1096 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1097
1098 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outParticipantsResultsOverview');
1099 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1100 $passOverViewTableGUI->setResultPresentationEnabled(true);
1101 $passOverViewTableGUI->setPassDetailsCommand('outParticipantsPassDetails');
1102 $passOverViewTableGUI->init();
1103 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(), true, true));
1104 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1105 $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1106
1107 if( $this->isGradingMessageRequired() )
1108 {
1109 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1110 $gradingMessageBuilder->buildList();
1111
1112 $template->setCurrentBlock('grading_message');
1113 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
1114 $template->parseCurrentBlock();
1115 }
1116
1117 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
1118 $user_id = $this->object->_getUserIdFromActiveId($active_id);
1119
1120 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1121 {
1122 if ($this->object->getAnonymity())
1123 {
1124 $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1125 }
1126 else
1127 {
1128 $uname = $this->object->userLookupFullName($user_id, TRUE);
1129 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1130 $template->setVariable("USER_DATA", $user_data);
1131 }
1132 }
1133
1134 $template->parseCurrentBlock();
1135
1136
1137 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1138 if ($this->object->getShowSolutionAnswersOnly())
1139 {
1140 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1141 }
1142
1143 if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
1144 {
1145 //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1146
1147 $name = ilObjUser::_lookupName($user_id);
1148 $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__'. $this->object->getTitleFilenameCompliant();
1149 require_once 'class.ilTestPDFGenerator.php';
1151 //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
1152 //$template->setVariable("PDF_FILE_LOCATION", $filename);
1153 }
1154 else
1155 {
1156 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1157 }
1158 }
static _lookupName($a_user_id)
lookup user name
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)

References $_GET, $filename, $GLOBALS, 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, 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 1520 of file class.ilTestEvaluationGUI.php.

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

References $_GET, $GLOBALS, $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().

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

1184 {
1185 global $ilTabs, $ilUser, $ilObjDataCache;
1186
1187 $this->handleTabs('results_pass_oriented');
1188
1189 if ($this->object->getNrOfTries() == 1)
1190 {
1191 $ilTabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen'));
1192 }
1193 else
1194 {
1195 $ilTabs->setBackTarget($this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
1196 }
1197
1198 $testSession = $this->testSessionFactory->getSession();
1199
1200 if( !$this->object->getShowPassDetails() )
1201 {
1202 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1203
1204 #if($executable["executable"])
1205 #{
1206 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1207 #}
1208 }
1209
1210 $active_id = $testSession->getActiveId();
1211 $user_id = $testSession->getUserId();
1212
1213 $this->ctrl->saveParameter($this, "pass");
1214 $pass = $_GET["pass"];
1215
1216 // prepare generation before contents are processed (for mathjax)
1217 if ($this->isPdfDeliveryRequest())
1218 {
1219 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1221 }
1222
1223 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1224 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1225
1226 $objectivesList = null;
1227
1228 $considerHiddenQuestions = true;
1229 $considerOptionalQuestions = true;
1230
1231 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1232 {
1233 $considerHiddenQuestions = false;
1234
1235 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1236 $testSequence->loadFromDb();
1237 $testSequence->loadQuestions();
1238
1239 if( $this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed() )
1240 {
1241 $considerOptionalQuestions = false;
1242 }
1243
1244 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1245 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1246
1247 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1248 $objectivesList->loadObjectivesTitles();
1249
1250 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1251 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1252 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1253 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1254 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1255 }
1256
1257 $result_array = $this->getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions);
1258
1259 $command_solution_details = "";
1260 if ($this->object->getShowSolutionDetails())
1261 {
1262 $command_solution_details = "outCorrectSolution";
1263 }
1264 $questionAnchorNav = $this->object->canShowSolutionPrintview();
1265
1266 $tpl = new ilTemplate('tpl.il_as_tst_pass_details_overview_participants.html', true, true, "Modules/Test");
1267
1268 if( !$this->isPdfDeliveryRequest() )
1269 {
1270 $toolbar = $this->buildUserTestResultsToolbarGUI();
1271
1272 $this->ctrl->setParameter($this, 'pdf', '1');
1273 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outUserPassDetails') );
1274 $this->ctrl->setParameter($this, 'pdf', '');
1275
1276 include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1277 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1278 {
1279 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1280 }
1281
1282 $toolbar->build();
1283
1284 $tpl->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1285
1286 $tpl->setCurrentBlock('signature');
1287 $tpl->setVariable("SIGNATURE", $this->getResultsSignature());
1288 $tpl->parseCurrentBlock();
1289
1290 if ($this->object->isShowExamIdInTestResultsEnabled())
1291 {
1292 $tpl->setCurrentBlock('exam_id');
1293 $tpl->setVariable('EXAM_ID', ilObjTest::lookupExamId(
1294 $testSession->getActiveId(), $pass
1295 ));
1296 $tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1297 $tpl->parseCurrentBlock();
1298 }
1299 }
1300
1301 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() &&
1302 $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1 )
1303 {
1304 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1305 $gradingMessageBuilder->buildMessage();
1306 $gradingMessageBuilder->sendMessage();
1307
1308 #$template->setCurrentBlock('grading_message');
1309 #$template->setVariable('GRADING_MESSAGE', );
1310 #$template->parseCurrentBlock();
1311 }
1312
1313 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI(
1314 $result_array, $active_id, $pass, $this, "outUserPassDetails",
1315 $command_solution_details, $questionAnchorNav, $objectivesList
1316 );
1317 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1318 $tpl->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1319
1320 if( $this->object->canShowSolutionPrintview() )
1321 {
1322 $list_of_answers = $this->getPassListOfAnswers(
1323 $result_array, $active_id, $pass, $this->object->getShowSolutionListComparison(),
1324 false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder
1325 );
1326 $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1327 }
1328
1329 $tpl->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass+1));
1330 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1331
1332 $uname = $this->object->userLookupFullName($user_id, TRUE);
1333 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
1334 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1335 {
1336 if($this->object->getAnonymity())
1337 {
1338 $tpl->setVariable("TEXT_HEADING", $this->lng->txt("tst_result_pass"));
1339 } else
1340 {
1341 $tpl->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1342 $tpl->setVariable("USER_DATA", $user_data);
1343 }
1344 }
1345
1346 $this->populatePassFinishDate($tpl, $this->object->getPassFinishDate($active_id, $pass));
1347
1348 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1349 if ($this->object->getShowSolutionAnswersOnly())
1350 {
1351 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1352 }
1353
1354 if( $this->isPdfDeliveryRequest() )
1355 {
1356 require_once 'class.ilTestPDFGenerator.php';
1357 ilTestPDFGenerator::generatePDF($tpl->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant());
1358 }
1359 else
1360 {
1361 $this->tpl->setContent($tpl->get());
1362 }
1363 }
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)

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(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, 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 1169 of file class.ilTestEvaluationGUI.php.

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

1161 {
1162 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1163 $tableGUI->initFilter();
1164 $tableGUI->resetOffset();
1165 $tableGUI->writeFilterToSession();
1166 $this->outUserPassDetails();
1167 }

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

1371 {
1372 global $ilUser, $ilTabs, $ilObjDataCache;
1373
1374 $this->handleTabs('results_pass_oriented');
1375
1376 $ilTabs->setBackTarget(
1377 $this->lng->txt('tst_results_back_introduction'),
1378 $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')
1379 );
1380
1381 $testSession = $this->testSessionFactory->getSession();
1382 $active_id = $testSession->getActiveId();
1383 $user_id = $ilUser->getId();
1384 $uname = $this->object->userLookupFullName($user_id, TRUE);
1385
1386 if( !$this->object->canShowTestResults($testSession) )
1387 {
1388 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1389 }
1390
1391 // prepare generation before contents are processed (for mathjax)
1392 if ($this->isPdfDeliveryRequest())
1393 {
1394 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1396 }
1397
1398 $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", TRUE, TRUE, "Modules/Test");
1399 $template = new ilTemplate("tpl.il_as_tst_results_participant.html", TRUE, TRUE, "Modules/Test");
1400
1401 $toolbar = $this->buildUserTestResultsToolbarGUI();
1402
1403 $this->ctrl->setParameter($this, 'pdf', '1');
1404 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outUserResultsOverview') );
1405 $this->ctrl->setParameter($this, 'pdf', '');
1406
1407 include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1408 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1409 {
1410 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1411 }
1412
1413 $toolbar->build();
1414
1415 $templatehead->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1416
1417 $passDetailsEnabled = $this->object->getShowPassDetails();
1418 #if (!$passDetailsEnabled)
1419 #{
1420 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1421 # if (!$executable["executable"]) $passDetailsEnabled = true;
1422 #}
1423
1424 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1425 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1426 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1427 {
1428 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1429 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1430 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1431 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1432 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1433 }
1434
1435 $template->setCurrentBlock("pass_overview");
1436
1437 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1438 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1439 $testPassesSelector->setActiveId($testSession->getActiveId());
1440 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1441
1442 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outUserResultsOverview');
1443 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1444 $passOverViewTableGUI->setResultPresentationEnabled(true);
1445 if($passDetailsEnabled)
1446 {
1447 $passOverViewTableGUI->setPassDetailsCommand('outUserPassDetails');
1448 }
1449 if( $this->object->isPassDeletionAllowed() )
1450 {
1451 $passOverViewTableGUI->setPassDeletionCommand('confirmDeletePass');
1452 }
1453 $passOverViewTableGUI->init();
1454 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(), true));
1455 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1456 $overview = $passOverViewTableGUI->getHTML();
1457 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1458 {
1459 require_once 'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1460 $loStatus = new ilTestLearningObjectivesStatusGUI($this->lng);
1461 $loStatus->setCrsObjId($this->getObjectiveOrientedContainer()->getObjId());
1462 $loStatus->setUsrId($testSession->getUserId());
1463 $overview .= "<br />".$loStatus->getHTML();
1464 }
1465 $template->setVariable("PASS_OVERVIEW", $overview);
1466 $template->parseCurrentBlock();
1467
1468 if( $this->isGradingMessageRequired() )
1469 {
1470 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1471 $gradingMessageBuilder->buildMessage();
1472 $gradingMessageBuilder->sendMessage();
1473
1474 #$template->setCurrentBlock('grading_message');
1475 #$template->setVariable('GRADING_MESSAGE', );
1476 #$template->parseCurrentBlock();
1477 }
1478
1479 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
1480
1481 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1482 {
1483 if ($this->object->getAnonymity())
1484 {
1485 $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1486 }
1487 else
1488 {
1489 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1490 $template->setVariable("USER_DATA", $user_data);
1491 }
1492 }
1493
1494 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1495 if ($this->object->getShowSolutionAnswersOnly())
1496 {
1497 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1498 }
1499 $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
1500
1501 if( $this->isPdfDeliveryRequest() )
1502 {
1503 //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1504 require_once 'class.ilTestPDFGenerator.php';
1505 ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant());
1506 }
1507 else
1508 {
1509 $this->tpl->setContent($templatehead->get());
1510 }
1511 }

References $GLOBALS, $ilUser, 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, 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 1645 of file class.ilTestEvaluationGUI.php.

1646 {
1647 if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1648 {
1649 $this->ctrl->saveParameter($this, "pass");
1650 $this->ctrl->saveParameter($this, "active_id");
1651 $this->outTestResults(false, $_GET["pass"]);
1652 }
1653 else
1654 {
1655 $this->outTestResults(false);
1656 }
1657 }

References $_GET.

◆ redirectBackToParticipantsScreen()

ilTestEvaluationGUI::redirectBackToParticipantsScreen ( )
protected

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

2213 {
2214 $this->ctrl->redirectByClass("ilobjtestgui", "participants");
2215 }

Referenced by confirmFinishTestPassForAllUser(), and confirmFinishTestPassForUser().

+ Here is the caller graph for this function:

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

1791 {
1792 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1793
1794 switch($context)
1795 {
1797
1798 $this->ctrl->redirect($this, 'outUserResultsOverview');
1799
1801
1802 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1803
1805
1806 $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1807 }
1808 }

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

145 {
146 include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
147 $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
148 $table_gui->resetFilter();
149 $this->ctrl->redirect($this, "outEvaluation");
150 }

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

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

1664 {
1665 global $ilAccess;
1666
1667 if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
1668 {
1669 // allow only evaluation access
1670 ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1671 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1672 }
1673
1674 $data =& $this->object->getCompleteEvaluationData();
1675 $color_class = array("tblrow1", "tblrow2");
1676 $counter = 0;
1677 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1678 $foundParticipants =& $data->getParticipants();
1679 if (count($foundParticipants) == 0)
1680 {
1681 ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1682 return;
1683 }
1684 else
1685 {
1686 $rows = array();
1687 foreach ($data->getQuestionTitles() as $question_id => $question_title)
1688 {
1689 $answered = 0;
1690 $reached = 0;
1691 $max = 0;
1692 foreach ($foundParticipants as $userdata)
1693 {
1694 $pass = $userdata->getScoredPass();
1695 if (is_object($userdata->getPass($pass)))
1696 {
1697 $question =& $userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1698 if (is_array($question))
1699 {
1700 $answered++;
1701 }
1702 }
1703 }
1704 $counter++;
1705 $this->ctrl->setParameter($this, "qid", $question_id);
1706 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1707 $question_object = assQuestion::_instanciateQuestion($question_id);
1708 $download = "";
1709 if ( $question_object instanceof ilObjFileHandlingQuestionType )
1710 {
1711 if ($question_object->hasFileUploads($this->object->getTestId()))
1712 {
1713 $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants"). "\">" . $this->lng->txt("download") . "</a>";
1714 }
1715 }
1716 array_push($rows,
1717 array(
1718 'qid' => $question_id,
1719 'question_title' => $question_title,
1720 'number_of_answers' => $answered,
1721 'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1722 'file_uploads' => $download
1723 )
1724 );
1725 }
1726 if (count($rows))
1727 {
1728 require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1729 $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1730 $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1731 $table_gui->setData($rows);
1732
1733 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1734 }
1735 else
1736 {
1737 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1738 }
1739 }
1740 }
TableGUI class for results by question.

References $counter, $data, $pass, 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: