ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation ($contextResultPresentation)
 
 ilTestServiceGUI (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)
 
- Protected Member Functions inherited from ilTestServiceGUI
 handleTabs ($activeTabId)
 
 isPdfDeliveryRequest ()
 
 getPassDetailsOverviewTableGUI ($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null)
 
 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...
 

Private Member Functions

 redirectToPassDeletionContext ($context)
 

Additional Inherited Members

- Data Fields inherited from ilTestServiceGUI
 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 
- Protected Attributes inherited from ilTestServiceGUI
 $db
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

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

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

37 {
38 parent::ilTestServiceGUI($a_object);
39 }

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

1703 {
1704 $this->redirectToPassDeletionContext($_POST['context']);
1705 }
$_POST['username']
Definition: cron.php:12

References $_POST, and redirectToPassDeletionContext().

+ Here is the call graph for this function:

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

1678 {
1679 if( isset($_GET['context']) && strlen($_GET['context']) )
1680 {
1681 $context = $_GET['context'];
1682 }
1683 else
1684 {
1686 }
1687
1688 if( !$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest() )
1689 {
1690 $this->redirectToPassDeletionContext($context);
1691 }
1692
1693 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1694
1695 $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1696 $confirm->build((int)$_GET['active_id'], (int)$_GET['pass'], $context);
1697
1698 global $tpl;
1699 $tpl->setContent($this->ctrl->getHTML($confirm));
1700 }
$_GET["client_id"]

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

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

327 {
328 global $ilAccess;
329
330 if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
331 {
332 ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), TRUE);
333 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
334 }
335
336 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_evaluation_details.html", "Modules/Test");
337
338 $active_id = $_GET["active_id"];
339 if (strlen($active_id) == 0)
340 {
341 ilUtil::sendInfo($this->lng->txt("detailed_evaluation_missing_active_id"), TRUE);
342 $this->ctrl->redirect($this, "outEvaluation");
343 }
344
345 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
346
347 $data =& $this->object->getCompleteEvaluationData();
348 $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
349 $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outEvaluation"));
350 $this->tpl->setVariable("HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt("detailed_evaluation_for"),
351 $data->getParticipant($active_id)->getName())
352 );
353 $this->tpl->setVariable("STATISTICAL_DATA", $this->lng->txt("statistical_data"));
354 $this->tpl->setVariable("TXT_RESULTSPOINTS", $this->lng->txt("tst_stat_result_resultspoints"));
355 $this->tpl->setVariable("VALUE_RESULTSPOINTS", $data->getParticipant($active_id)->getReached() . " " . strtolower($this->lng->txt("of")) . " " . $data->getParticipant($active_id)->getMaxpoints() . " (" . sprintf("%2.2f", $data->getParticipant($active_id)->getReachedPointsInPercent()) . " %" . ")");
356 if (strlen($data->getParticipant($active_id)->getMark()))
357 {
358 $this->tpl->setVariable("TXT_RESULTSMARKS", $this->lng->txt("tst_stat_result_resultsmarks"));
359 $this->tpl->setVariable("VALUE_RESULTSMARKS", $data->getParticipant($active_id)->getMark());
360 if (strlen($data->getParticipant($active_id)->getECTSMark()))
361 {
362 $this->tpl->setVariable("TXT_ECTS", $this->lng->txt("ects_grade"));
363 $this->tpl->setVariable("VALUE_ECTS", $data->getParticipant($active_id)->getECTSMark());
364 }
365 }
366
367 if( $this->object->isOfferingQuestionHintsEnabled() )
368 {
369 $this->tpl->setVariable("TXT_REQUESTED_HINTS_COUNT", $this->lng->txt("tst_question_hints_requested_hint_count_header"));
370 $this->tpl->setVariable("VALUE_REQUESTED_HINTS_COUNT", $data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
371 }
372
373 $this->tpl->setVariable("TXT_QWORKEDTHROUGH", $this->lng->txt("tst_stat_result_qworkedthrough"));
374 $this->tpl->setVariable("VALUE_QWORKEDTHROUGH", $data->getParticipant($active_id)->getQuestionsWorkedThrough() . " " . strtolower($this->lng->txt("of")) . " " . $data->getParticipant($active_id)->getNumberOfQuestions() . " (" . sprintf("%2.2f", $data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent()) . " %" . ")");
375
376 $this->tpl->setVariable("TXT_TIMEOFWORK", $this->lng->txt("tst_stat_result_timeofwork"));
377 $time_seconds = $data->getParticipant($active_id)->getTimeOfWork();
378 $atime_seconds = $data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds / $data->getParticipant($active_id)->getNumberOfQuestions() : 0;
379 $time_hours = floor($time_seconds/3600);
380 $time_seconds -= $time_hours * 3600;
381 $time_minutes = floor($time_seconds/60);
382 $time_seconds -= $time_minutes * 60;
383 $this->tpl->setVariable("VALUE_TIMEOFWORK", sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
384 $this->tpl->setVariable("TXT_ATIMEOFWORK", $this->lng->txt("tst_stat_result_atimeofwork"));
385 $time_hours = floor($atime_seconds/3600);
386 $atime_seconds -= $time_hours * 3600;
387 $time_minutes = floor($atime_seconds/60);
388 $atime_seconds -= $time_minutes * 60;
389 $this->tpl->setVariable("VALUE_ATIMEOFWORK", sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
390 $this->tpl->setVariable("TXT_FIRSTVISIT", $this->lng->txt("tst_stat_result_firstvisit"));
391 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
392 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
393 #);
394 $this->tpl->setVariable('VAL_FIRST_VISIT',ilDatePresentation::formatDate(
395 new ilDateTime($data->getParticipant($active_id)->getFirstVisit(),IL_CAL_UNIX)));
396 $this->tpl->setVariable("TXT_LASTVISIT", $this->lng->txt("tst_stat_result_lastvisit"));
397 #$this->tpl->setVariable("VALUE_LASTVISIT",
398 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
399 #);
400 $this->tpl->setVariable('VAL_FIRST_VISIT',ilDatePresentation::formatDate(
401 new ilDateTime($data->getParticipant($active_id)->getLastVisit(),IL_CAL_UNIX)));
402
403 $this->tpl->setVariable("TXT_NROFPASSES", $this->lng->txt("tst_nr_of_passes"));
404 $this->tpl->setVariable("VALUE_NROFPASSES", $data->getParticipant($active_id)->getLastPass() + 1);
405 $this->tpl->setVariable("TXT_SCOREDPASS", $this->lng->txt("scored_pass"));
406 if ($this->object->getPassScoring() == SCORE_BEST_PASS)
407 {
408 $this->tpl->setVariable("VALUE_SCOREDPASS", $data->getParticipant($active_id)->getBestPass() + 1);
409 }
410 else
411 {
412 $this->tpl->setVariable("VALUE_SCOREDPASS", $data->getParticipant($active_id)->getLastPass() + 1);
413 }
414
415 $median = $data->getStatistics()->getStatistics()->median();
416 $pct = $data->getParticipant($active_id)->getMaxpoints() ? ($median / $data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
417 $mark = $this->object->mark_schema->getMatchingMark($pct);
418 if (is_object($mark))
419 {
420 $this->tpl->setVariable("TXT_MARK_MEDIAN", $this->lng->txt("tst_stat_result_mark_median"));
421 $this->tpl->setVariable("VALUE_MARK_MEDIAN", $mark->getShortName());
422 }
423
424 $this->tpl->setVariable("TXT_RANK_PARTICIPANT", $this->lng->txt("tst_stat_result_rank_participant"));
425 $this->tpl->setVariable("VALUE_RANK_PARTICIPANT", $data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
426 $this->tpl->setVariable("TXT_RANK_MEDIAN", $this->lng->txt("tst_stat_result_rank_median"));
427 $this->tpl->setVariable("VALUE_RANK_MEDIAN", $data->getStatistics()->getStatistics()->rank_median());
428 $this->tpl->setVariable("TXT_TOTAL_PARTICIPANTS", $this->lng->txt("tst_stat_result_total_participants"));
429 $this->tpl->setVariable("VALUE_TOTAL_PARTICIPANTS", $data->getStatistics()->getStatistics()->count());
430 $this->tpl->setVariable("TXT_RESULT_MEDIAN", $this->lng->txt("tst_stat_result_median"));
431 $this->tpl->setVariable("VALUE_RESULT_MEDIAN", $median);
432
433 for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++)
434 {
435 $finishdate = $this->object->getPassFinishDate($active_id, $pass);
436 if ($finishdate > 0)
437 {
438 $this->tpl->setCurrentBlock("question_header");
439 $this->tpl->setVariable("TXT_QUESTION_DATA", sprintf($this->lng->txt("tst_eval_question_points"), $pass+1));
440 $this->tpl->parseCurrentBlock();
441 global $ilAccess;
442 if (($ilAccess->checkAccess("write", "", $_GET["ref_id"])))
443 {
444 $this->tpl->setCurrentBlock("question_footer");
445 $this->tpl->setVariable("TEXT_TO_DETAILED_RESULTS", $this->lng->txt("tst_show_answer_sheet"));
446 $this->ctrl->setParameter($this, "statistics", "1");
447 $this->ctrl->setParameter($this, "active_id", $active_id);
448 $this->ctrl->setParameter($this, "pass", $pass);
449 $this->tpl->setVariable("URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this, "outParticipantsPassDetails"));
450 $this->tpl->parseCurrentBlock();
451 }
452 $questions = $data->getParticipant($active_id)->getQuestions($pass);
453 if (!is_array($questions))
454 {
455 $questions = $data->getParticipant($active_id)->getQuestions(0);
456 }
457 $counter = 1;
458 foreach ((array)$questions as $question)
459 {
460 $this->tpl->setCurrentBlock("question_row");
461 $this->tpl->setVariable("QUESTION_COUNTER", $counter);
462 $this->tpl->setVariable("QUESTION_ID", $question["id"]);
463 $this->tpl->setVariable("QUESTION_ID_TXT", $this->lng->txt('question_id_short'));
464 $this->tpl->setVariable("QUESTION_TITLE", $data->getQuestionTitle($question["id"]));
465 $answeredquestion = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
466 if (is_array($answeredquestion))
467 {
468 $percent = $answeredquestion["points"] ? $answeredquestion["reached"] / $answeredquestion["points"] * 100.0 : 0;
469 $this->tpl->setVariable("QUESTION_POINTS", $answeredquestion["reached"] . " " . strtolower($this->lng->txt("of")) . " " . $answeredquestion["points"] . " (" . sprintf("%.2f", $percent) . " %)");
470 }
471 else
472 {
473 $this->tpl->setVariable("QUESTION_POINTS", "0 " . strtolower($this->lng->txt("of")) . " " . $question["points"] . " (" . sprintf("%.2f", 0) . " %) - " . $this->lng->txt("question_not_answered"));
474 }
475 $this->tpl->parseCurrentBlock();
476 $counter++;
477 }
478 $this->tpl->touchBlock("question_stats");
479 }
480 }
481 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
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.
$data
const SCORE_BEST_PASS

References $_GET, $data, $pass, ilDatePresentation\formatDate(), ilUtil\getStyleSheetLocation(), IL_CAL_UNIX, SCORE_BEST_PASS, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ executeCommand()

& ilTestEvaluationGUI::executeCommand ( )

execute command

Reimplemented from ilTestServiceGUI.

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

45 {
46 $cmd = $this->ctrl->getCmd();
47 $next_class = $this->ctrl->getNextClass($this);
48 $this->ctrl->saveParameter($this, "sequence");
49 $this->ctrl->saveParameter($this, "active_id");
50 $cmd = $this->getCommand($cmd);
51 switch($next_class)
52 {
53 case 'iltestpassdetailsoverviewtablegui':
54 require_once 'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
55 $tableGUI = new ilTestPassDetailsOverviewTableGUI($this->ctrl, $this, 'outUserPassDetails');
56 $tableGUI->setIsPdfGenerationRequest($this->isPdfDeliveryRequest());
57 $tableGUI->initFilter();
58 $this->ctrl->forwardCommand($tableGUI);
59 break;
60
61 default:
62 $ret =& $this->$cmd();
63 break;
64 }
65 return $ret;
66 }
getCommand($cmd)
Retrieves the ilCtrl command.
$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 720 of file class.ilTestEvaluationGUI.php.

721 {
722 switch ($_POST["export_type"])
723 {
724 case "excel":
725 include_once "./Modules/Test/classes/class.ilTestExport.php";
726 $exportObj = new ilTestExport($this->object, "aggregated");
727 $exportObj->exportToExcel($deliver = TRUE);
728 break;
729 case "csv":
730 include_once "./Modules/Test/classes/class.ilTestExport.php";
731 $exportObj = new ilTestExport($this->object, "aggregated");
732 $exportObj->exportToCSV($deliver = TRUE);
733 break;
734 }
735 }
Export class for tests.

References $_POST.

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

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

@access public

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

744 {
745 global $ilUser;
746
747 include_once "./Services/Utilities/classes/class.ilUtil.php";
748 include_once "./Services/Certificate/classes/class.ilCertificate.php";
749 include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
750 $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
751 $archive_dir = $certificate->createArchiveDirectory();
752 $total_users = array();
753 $total_users =& $this->object->evalTotalPersonsArray();
754 if (count($total_users))
755 {
756 foreach ($total_users as $active_id => $name)
757 {
758 $user_id = $this->object->_getUserIdFromActiveId($active_id);
759 $pdf = $certificate->outCertificate(
760 array(
761 "active_id" => $active_id,
762 "userfilter" => $userfilter,
763 "passedonly" => $passedonly
764 ),
765 FALSE
766 );
767 if (strlen($pdf))
768 {
769 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
770 }
771 }
772 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
773 }
774
775 }
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
global $ilUser
Definition: imgupload.php:15

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

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

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

497 {
498 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
499 $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
500 if ( $question_object instanceof ilObjFileHandlingQuestionType )
501 {
502 $question_object->deliverFileUploadZIPFile($this->object->getTestId(), $this->object->getTitle());
503 }
504 else
505 {
506 $this->ctrl->redirect($this, "singleResults");
507 }
508 }
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 487 of file class.ilTestEvaluationGUI.php.

488 {
489 $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
490 }
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 124 of file class.ilTestEvaluationGUI.php.

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

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

784 {
785 if ($original_id > 0)
786 {
787 return $original_id;
788 }
789 else
790 {
791 return $question_id;
792 }
793 }

◆ getFilteredTestResult()

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

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

2010 {
2011 global $ilDB, $ilPluginAdmin;
2012
2013 $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions);
2014 $questionIds = array();
2015 foreach($resultData as $resultItemKey => $resultItemValue)
2016 {
2017 if($resultItemKey === 'test' || $resultItemKey === 'pass')
2018 {
2019 continue;
2020 }
2021
2022 $questionIds[] = $resultItemValue['qid'];
2023 }
2024
2025 $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
2026 $table_gui->initFilter();
2027
2028 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2029 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
2030
2031 $questionList->setIncludeQuestionIdsFilter($questionIds);
2032 $questionList->setQuestionInstanceTypeFilter(null);
2033
2034 foreach ($table_gui->getFilterItems() as $item)
2035 {
2036 if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
2037 {
2038 $v = $item->getValue();
2039
2040 if( is_array($v) && count($v) && !(int)$v[0] )
2041 {
2042 continue;
2043 }
2044
2045 $taxId = substr($item->getPostVar(), strlen('tax_'));
2046 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
2047 }
2048 elseif( $item->getValue() !== false )
2049 {
2050 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2051 }
2052 }
2053
2054 $questionList->load();
2055
2056 $filteredTestResult = array();
2057
2058 foreach($resultData as $resultItemKey => $resultItemValue)
2059 {
2060 if($resultItemKey === 'test' || $resultItemKey === 'pass')
2061 {
2062 continue;
2063 }
2064
2065 if( !$questionList->isInList($resultItemValue['qid']) )
2066 {
2067 continue;
2068 }
2069
2070 $filteredTestResult[] = $resultItemValue;
2071 }
2072
2073 return $filteredTestResult;
2074 }
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 68 of file class.ilTestEvaluationGUI.php.

69 {
70 $headernames = array();
71 if ($this->object->getAnonymity())
72 {
73 array_push($headernames, $this->lng->txt("counter"));
74 }
75 else
76 {
77 array_push($headernames, $this->lng->txt("name"));
78 array_push($headernames, $this->lng->txt("login"));
79 }
80 $additionalFields = $this->object->getEvaluationAdditionalFields();
81 if (count($additionalFields))
82 {
83 foreach ($additionalFields as $fieldname)
84 {
85 array_push($headernames, $this->lng->txt($fieldname));
86 }
87 }
88 array_push($headernames, $this->lng->txt("tst_reached_points"));
89 array_push($headernames, $this->lng->txt("tst_mark"));
90 if ($this->object->getECTSOutput())
91 {
92 array_push($headernames, $this->lng->txt("ects_grade"));
93 }
94 array_push($headernames, $this->lng->txt("tst_answered_questions"));
95 array_push($headernames, $this->lng->txt("working_time"));
96 array_push($headernames, $this->lng->txt("detailed_evaluation"));
97 return $headernames;
98 }

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

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

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

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

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

1663 {
1664 $testSession = $this->testSessionFactory->getSession();
1665
1666 require_once './Services/Certificate/classes/class.ilCertificate.php';
1667 require_once './Modules/Test/classes/class.ilTestCertificateAdapter.php';
1668 $certificate = new ilCertificate(new ilTestCertificateAdapter( $this->object ) );
1669 $certificate->outCertificate(
1670 array(
1671 "active_id" => $testSession->getActiveId(),
1672 "pass" => ilObjTest::_getResultPass( $testSession->getActiveId() )
1673 )
1674 );
1675 }
_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 802 of file class.ilTestEvaluationGUI.php.

803 {
804 global $ilTabs, $ilAccess, $ilObjDataCache;
805
806 if (!$ilAccess->checkAccess('write', '', $this->ref_id))
807 {
808 // allow only write access
809 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
810 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
811 }
812
813 $this->ctrl->saveParameter($this, "active_id");
814 $active_id = (int)$_GET["active_id"];
815 $testSession = $this->testSessionFactory->getSession($active_id);
816
817 // protect actives from other tests
818 if( $testSession->getTestId() != $this->object->getTestId() )
819 {
820 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
821 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
822 }
823
824 $this->ctrl->saveParameter($this, "pass");
825 $pass = (int)$_GET["pass"];
826
827 if ( isset($_GET['statistics']) && $_GET['statistics'] == 1)
828 {
829 $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
830 $this->ctrl->saveParameter($this, 'statistics');
831
832 $ilTabs->setBackTarget(
833 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'detailedEvaluation')
834 );
835 }
836 elseif ($this->object->getNrOfTries() == 1)
837 {
838 $ilTabs->setBackTarget(
839 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
840 );
841 }
842 else
843 {
844 $ilTabs->setBackTarget(
845 $this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this, 'outParticipantsResultsOverview')
846 );
847 }
848
849 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
850 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
851
852 $objectivesList = null;
853
854 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
855 {
856 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
857 $testSequence->loadFromDb();
858 $testSequence->loadQuestions();
859
860 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
861 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
862
863 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
864 $objectivesList->loadObjectivesTitles();
865
866 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
867 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
868 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
869 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
870 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
871 }
872
873 $result_array = $this->object->getTestResult(
874 $active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
875 );
876
877 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $this, "outParticipantsPassDetails", '', true, $objectivesList);
878 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
879 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, FALSE);
880 $user_id = $this->object->_getUserIdFromActiveId($active_id);
881
882 $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE, "Modules/Test");
883
884 $toolbar = $this->buildUserTestResultsToolbarGUI();
885
886 $this->ctrl->setParameter($this, 'pdf', '1');
887 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails') );
888 $this->ctrl->setParameter($this, 'pdf', '');
889
890 if( isset($_GET['show_best_solutions']) )
891 {
892 $_SESSION['tst_results_show_best_solutions'] = true;
893 }
894 elseif( isset($_GET['hide_best_solutions']) )
895 {
896 $_SESSION['tst_results_show_best_solutions'] = false;
897 }
898 elseif( !isset($_SESSION['tst_results_show_best_solutions']) )
899 {
900 $_SESSION['tst_results_show_best_solutions'] = false;
901 }
902
903 if( $_SESSION['tst_results_show_best_solutions'] )
904 {
905 $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
906 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
907 $this->ctrl->setParameter($this, 'hide_best_solutions', '');
908 }
909 else
910 {
911 $this->ctrl->setParameter($this, 'show_best_solutions', '1');
912 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
913 $this->ctrl->setParameter($this, 'show_best_solutions', '');
914 }
915
916 $toolbar->build();
917 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
918
919 if( $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1 )
920 {
921 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
922 $gradingMessageBuilder->buildList();
923
924 $template->setCurrentBlock('grading_message');
925 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
926 $template->parseCurrentBlock();
927 }
928
929 $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $_SESSION['tst_results_show_best_solutions'], false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder);
930 $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
931 $template->setVariable("PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
932
933 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
934 {
935 $template->setVariable("USER_DATA", $user_data);
936
937 $uname = $this->object->userLookupFullName($user_id);
938 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
939
940 $template->setVariable("TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
941 }
942
943 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
944
945 $this->populatePassFinishDate($template, $this->object->getPassFinishDate($active_id, $pass));
946
947 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
948 if ($this->object->getShowSolutionAnswersOnly())
949 {
950 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
951 }
952
953 if( $this->isPdfDeliveryRequest() )
954 {
955 //$this->object->deliverPDFfromHTML($template->get());
956 require_once 'class.ilTestPDFGenerator.php';
957 ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
958 }
959 else
960 {
961 $this->tpl->setVariable("ADM_CONTENT", $template->get());
962 }
963 }
$_SESSION["AccountId"]
static getInstance(ilTestSession $a_test_session)
special template class to simplify handling of ITX/PEAR
static generatePDF($pdf_output, $output_mode, $filename=null)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=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)

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(), and ilUtil\sendInfo().

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

971 {
972 global $ilTabs, $ilAccess, $ilObjDataCache;
973
974 if (!$ilAccess->checkAccess('write', '', $this->ref_id))
975 {
976 // allow only write access
977 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
978 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
979 }
980
981 $active_id = (int)$_GET["active_id"];
982 $testSession = $this->testSessionFactory->getSession($active_id);
983
984 // protect actives from other tests
985 if( $testSession->getTestId() != $this->object->getTestId() )
986 {
987 ilUtil::sendInfo($this->lng->txt('no_permission'), true);
988 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
989 }
990
991 if ($this->object->getNrOfTries() == 1)
992 {
993 $this->ctrl->setParameter($this, "active_id", $active_id);
994 $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
995 $this->ctrl->redirect($this, "outParticipantsPassDetails");
996 }
997
998 $ilTabs->setBackTarget(
999 $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
1000 );
1001
1002 $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE, "Modules/Test");
1003
1004 $toolbar = $this->buildUserTestResultsToolbarGUI();
1005
1006 $this->ctrl->setParameter($this, 'pdf', '1');
1007 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, __FUNCTION__) );
1008 $this->ctrl->setParameter($this, 'pdf', '');
1009
1010 $toolbar->build();
1011 $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1012
1013 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1014 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1015 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1016 {
1017 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1018 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1019 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1020 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1021 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1022 }
1023
1024 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1025 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1026 $testPassesSelector->setActiveId($testSession->getActiveId());
1027 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1028
1029 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outParticipantsResultsOverview');
1030 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1031 $passOverViewTableGUI->setResultPresentationEnabled(true);
1032 $passOverViewTableGUI->setPassDetailsCommand('outParticipantsPassDetails');
1033 $passOverViewTableGUI->init();
1034 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(), true));
1035 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1036 $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1037
1038 if( $this->isGradingMessageRequired() )
1039 {
1040 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
1041 $gradingMessageBuilder->buildList();
1042
1043 $template->setCurrentBlock('grading_message');
1044 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
1045 $template->parseCurrentBlock();
1046 }
1047
1048 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
1049 $user_id = $this->object->_getUserIdFromActiveId($active_id);
1050
1051 if( !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1052 {
1053 if ($this->object->getAnonymity())
1054 {
1055 $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1056 }
1057 else
1058 {
1059 $uname = $this->object->userLookupFullName($user_id, TRUE);
1060 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1061 $template->setVariable("USER_DATA", $user_data);
1062 }
1063 }
1064
1065 $template->parseCurrentBlock();
1066
1067
1068 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1069 if ($this->object->getShowSolutionAnswersOnly())
1070 {
1071 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1072 }
1073
1074 if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
1075 {
1076 //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1077
1078 $name = ilObjUser::_lookupName($user_id);
1079 $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__'. $this->object->getTitle();
1080 require_once 'class.ilTestPDFGenerator.php';
1082 //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
1083 //$template->setVariable("PDF_FILE_LOCATION", $filename);
1084 }
1085 else
1086 {
1087 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1088 }
1089 }
$filename
Definition: buildRTE.php:89
static _lookupName($a_user_id)
lookup user name
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

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(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and ilUtil\sendInfo().

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

1438 {
1439 global $ilUser, $ilObjDataCache;
1440
1441 if (!$this->object->getShowSolutionPrintview())
1442 {
1443 ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1444 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1445 }
1446
1447 $template = new ilTemplate("tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE, "Modules/Test");
1448
1449 $pass = null;
1450 if (array_key_exists("pass", $_GET))
1451 {
1452 if (strlen($_GET["pass"])) $pass = $_GET["pass"];
1453 }
1454 $user_id = $ilUser->getId();
1455
1456 $testSession = $this->testSessionFactory->getSession();
1457 $active_id = $testSession->getActiveId();
1458
1459 $overview = "";
1460 if ($this->object->getNrOfTries() == 1)
1461 {
1462 $pass = 0;
1463 }
1464 else
1465 {
1466 $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_passes"));
1467
1468 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
1469 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
1470 $testPassesSelector->setActiveId($testSession->getActiveId());
1471 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1472
1473 $passOverViewTableGUI = $this->buildPassOverviewTableGUI($this, 'outUserListOfAnswerPasses');
1474 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1475 $passOverViewTableGUI->setResultPresentationEnabled(false);
1476 $passOverViewTableGUI->setPassDetailsCommand('outUserListOfAnswerPasses');
1477 $passOverViewTableGUI->init();
1478 $passOverViewTableGUI->setData($this->getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(), false));
1479 $template->setVariable("PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1480 }
1481
1482 $signature = "";
1483 if (strlen($pass))
1484 {
1485 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1486 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
1487
1488 $objectivesList = null;
1489
1490 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1491 {
1492 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1493 $testSequence->loadFromDb();
1494 $testSequence->loadQuestions();
1495
1496 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1497 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1498
1499 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1500 $objectivesList->loadObjectivesTitles();
1501
1502 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1503 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1504 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1505 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1506 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1507 }
1508
1509 $result_array = $this->object->getTestResult(
1510 $active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
1511 );
1512
1513 $signature = $this->getResultsSignature();
1514 $user_id =& $this->object->_getUserIdFromActiveId($active_id);
1515 $showAllAnswers = TRUE;
1516 if ($this->object->isExecutable($testSession, $user_id))
1517 {
1518 $showAllAnswers = FALSE;
1519 }
1520 $this->setContextResultPresentation(false);
1521 $answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, FALSE, $showAllAnswers, false, false, false, $objectivesList, $testResultHeaderLabelBuilder);
1522 $template->setVariable("PASS_DETAILS", $answers);
1523 }
1524 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1525 $template->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
1526 $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
1527 $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1528 $template->setVariable("PRINT_URL", "javascript:window.print();");
1529
1530 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
1531 $template->setVariable("USER_DATA", $user_data);
1532 $template->setVariable("TEXT_LIST_OF_ANSWERS", $this->lng->txt("tst_list_of_answers"));
1533 if (strlen($signature))
1534 {
1535 $template->setVariable("SIGNATURE", $signature);
1536 }
1537 if (!is_null($pass) && $this->object->isShowExamIdInTestResultsEnabled())
1538 {
1539 $template->setCurrentBlock('exam_id_footer');
1540 $template->setVariable('EXAM_ID_VAL', $this->object->lookupExamId(
1541 $testSession->getActiveId(), $pass
1542 ));
1543 $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1544 $template->parseCurrentBlock();
1545 }
1546 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1547
1548 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1549 if ($this->object->getShowSolutionAnswersOnly())
1550 {
1551 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1552 }
1553 }
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(), 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 1114 of file class.ilTestEvaluationGUI.php.

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

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(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and ilTestServiceGUI\populatePassFinishDate().

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

1101 {
1102 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1103 $tableGUI->initFilter();
1104 $tableGUI->resetOffset();
1105 $tableGUI->resetFilter();
1106 $this->outUserPassDetails();
1107 }
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 1091 of file class.ilTestEvaluationGUI.php.

1092 {
1093 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1094 $tableGUI->initFilter();
1095 $tableGUI->resetOffset();
1096 $tableGUI->writeFilterToSession();
1097 $this->outUserPassDetails();
1098 }

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

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

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(), and ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD.

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

1563 {
1564 if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1565 {
1566 $this->ctrl->saveParameter($this, "pass");
1567 $this->ctrl->saveParameter($this, "active_id");
1568 $this->outTestResults(false, $_GET["pass"]);
1569 }
1570 else
1571 {
1572 $this->outTestResults(false);
1573 }
1574 }

References $_GET.

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

1708 {
1709 require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1710
1711 switch($context)
1712 {
1714
1715 $this->ctrl->redirect($this, 'outUserResultsOverview');
1716
1718
1719 $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1720
1722
1723 $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1724 }
1725 }

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

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

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

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

1581 {
1582 global $ilAccess;
1583
1584 if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
1585 {
1586 // allow only evaluation access
1587 ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1588 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1589 }
1590
1591 $data =& $this->object->getCompleteEvaluationData();
1592 $color_class = array("tblrow1", "tblrow2");
1593 $counter = 0;
1594 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1595 $foundParticipants =& $data->getParticipants();
1596 if (count($foundParticipants) == 0)
1597 {
1598 ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1599 return;
1600 }
1601 else
1602 {
1603 $rows = array();
1604 foreach ($data->getQuestionTitles() as $question_id => $question_title)
1605 {
1606 $answered = 0;
1607 $reached = 0;
1608 $max = 0;
1609 foreach ($foundParticipants as $userdata)
1610 {
1611 $pass = $userdata->getScoredPass();
1612 if (is_object($userdata->getPass($pass)))
1613 {
1614 $question =& $userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1615 if (is_array($question))
1616 {
1617 $answered++;
1618 }
1619 }
1620 }
1621 $counter++;
1622 $this->ctrl->setParameter($this, "qid", $question_id);
1623 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1624 $question_object = assQuestion::_instanciateQuestion($question_id);
1625 $download = "";
1626 if ( $question_object instanceof ilObjFileHandlingQuestionType )
1627 {
1628 if ($question_object->hasFileUploads($this->object->getTestId()))
1629 {
1630 $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants"). "\">" . $this->lng->txt("download") . "</a>";
1631 }
1632 }
1633 array_push($rows,
1634 array(
1635 'qid' => $question_id,
1636 'question_title' => $question_title,
1637 'number_of_answers' => $answered,
1638 'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1639 'file_uploads' => $download
1640 )
1641 );
1642 }
1643 if (count($rows))
1644 {
1645 require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1646 $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1647 $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1648 $table_gui->setData($rows);
1649
1650 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1651 }
1652 else
1653 {
1654 $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1655 }
1656 }
1657 }
TableGUI class for results by question.

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

+ Here is the call graph for this function:

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