ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 
 singleResults ()
 Creates user results for single questions. More...
 
 outCertificate ()
 Output of a test certificate. More...
 
 confirmDeletePass ()
 
 cancelDeletePass ()
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextWithinTestPass ()
 
 setContextWithinTestPass ($contextWithinTestPass)
 
 ilTestServiceGUI (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
 setParticipantData ($participantData)
 
 getParticipantData ()
 
executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 getPassOverview ($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE, $adminMode=false)
 Returns the pass overview for a given active ID. More...
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false)
 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...
 
 getResultsUserdata ($testSession, $active_id, $overwrite_anonymity=FALSE)
 Returns the user data for a test results output. More...
 
 getCorrectSolutionOutput ($question_id, $active_id, $pass)
 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...
 

Protected Member Functions

 getFilteredTestResult ($active_id, $pass)
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 getPassDetailsOverview ($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessage ($activeId)
 

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
 
 $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$

ilTestEvaluationGUI: ilTestPassDetailsOverviewTableGUI ilTestEvaluationGUI: ilTestResultsToolbarGUI ilTestEvaluationGUI: ilTestPassDeletionConfirmationGUI

Definition at line 27 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 37 of file class.ilTestEvaluationGUI.php.

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

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

References $_POST, and redirectToPassDeletionContext().

1561  {
1562  $this->redirectToPassDeletionContext($_POST['context']);
1563  }
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

References $_GET, ilTestServiceGUI\$tpl, and ilTestPassDeletionConfirmationGUI\CONTEXT_PASS_OVERVIEW.

1536  {
1537  if( !$this->object->isPassDeletionAllowed() )
1538  {
1539  $this->ctrl->redirect($this, 'outUserResultsOverview');
1540  }
1541 
1542  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1543 
1544  if( isset($_GET['context']) && strlen($_GET['context']) )
1545  {
1546  $context = $_GET['context'];
1547  }
1548  else
1549  {
1551  }
1552 
1553  $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1554  $confirm->build((int)$_GET['active_id'], (int)$_GET['pass'], $context);
1555 
1556  global $tpl;
1557  $tpl->setContent($this->ctrl->getHTML($confirm));
1558  }
$_GET["client_id"]

◆ detailedEvaluation()

ilTestEvaluationGUI::detailedEvaluation ( )

Creates the detailed evaluation output for a selected participant.

Creates the detailed evaluation output for a selected participant

public

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

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

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

◆ executeCommand()

& ilTestEvaluationGUI::executeCommand ( )

execute command

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

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

46  {
47  $cmd = $this->ctrl->getCmd();
48  $next_class = $this->ctrl->getNextClass($this);
49  $this->ctrl->saveParameter($this, "sequence");
50  $this->ctrl->saveParameter($this, "active_id");
51  $cmd = $this->getCommand($cmd);
52  switch($next_class)
53  {
54  case 'iltestpassdetailsoverviewtablegui':
55  require_once 'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
56  $tableGUI = new ilTestPassDetailsOverviewTableGUI($this->ctrl, $this, 'outUserPassDetails');
57  $tableGUI->setIsPdfGenerationRequest($this->isPdfDeliveryRequest());
58  $tableGUI->initFilter();
59  $this->ctrl->forwardCommand($tableGUI);
60  break;
61 
62  default:
63  $ret =& $this->$cmd();
64  break;
65  }
66  return $ret;
67  }
$cmd
Definition: sahs_server.php:35
getCommand($cmd)
Retrieves the ilCtrl command.
+ Here is the call graph for this function:

◆ exportAggregatedResults()

ilTestEvaluationGUI::exportAggregatedResults ( )

Exports the aggregated results.

public

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

References $_POST.

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

◆ exportCertificate()

ilTestEvaluationGUI::exportCertificate ( )

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

public

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

References $ilUser, and ilUtil\getASCIIFilename().

745  {
746  global $ilUser;
747 
748  include_once "./Services/Utilities/classes/class.ilUtil.php";
749  include_once "./Services/Certificate/classes/class.ilCertificate.php";
750  include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
751  $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
752  $archive_dir = $certificate->createArchiveDirectory();
753  $total_users = array();
754  $total_users =& $this->object->evalTotalPersonsArray();
755  if (count($total_users))
756  {
757  foreach ($total_users as $active_id => $name)
758  {
759  $user_id = $this->object->_getUserIdFromActiveId($active_id);
760  $pdf = $certificate->outCertificate(
761  array(
762  "active_id" => $active_id,
763  "userfilter" => $userfilter,
764  "passedonly" => $passedonly
765  ),
766  FALSE
767  );
768  if (strlen($pdf))
769  {
770  $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
771  }
772  }
773  $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
774  }
775 
776  }
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
global $ilUser
Definition: imgupload.php:15
Create PDF certificates.
+ Here is the call graph for this function:

◆ exportEvaluation()

ilTestEvaluationGUI::exportEvaluation ( )

Exports the evaluation data to a selected file format.

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

References $_GET, and $_POST.

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

◆ exportFileUploadsForAllParticipants()

ilTestEvaluationGUI::exportFileUploadsForAllParticipants ( )

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

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

References $_GET, $data, assQuestion\_instanciateQuestion(), ilSubmitButton\getInstance(), ilUtil\sendInfo(), and ilSelectInputGUI\setOptions().

498  {
499  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
500  $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
501  if ( $question_object instanceof ilObjFileHandlingQuestionType )
502  {
503  $question_object->getFileUploadZIPFile($this->object->getTestId());
504  }
505  else
506  {
507  $this->ctrl->redirect($this, "singleResults");
508  }
509  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
$_GET["client_id"]
Interface ilObjFileHandlingQuestionType.
+ Here is the call graph for this function:

◆ exportQuestionForAllParticipants()

ilTestEvaluationGUI::exportQuestionForAllParticipants ( )

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

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

References $_GET, and ilTestServiceGUI\getQuestionResultForTestUsers().

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

◆ filterEvaluation()

ilTestEvaluationGUI::filterEvaluation ( )

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

126  {
127  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
128  $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
129  $table_gui->writeFilterToSession();
130  $this->ctrl->redirect($this, "outEvaluation");
131  }
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 784 of file class.ilTestEvaluationGUI.php.

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

◆ getFilteredTestResult()

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

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

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

Referenced by outUserPassDetails().

1859  {
1860  global $ilDB, $ilPluginAdmin;
1861 
1862  $testResults = $this->object->getTestResult($active_id, $pass);
1863  $questionIds = array();
1864  foreach($testResults as $resultItemKey => $resultItemValue)
1865  {
1866  if($resultItemKey === 'test' || $resultItemKey === 'pass')
1867  {
1868  continue;
1869  }
1870 
1871  $questionIds[] = $resultItemValue['qid'];
1872  }
1873 
1874  $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1875  $table_gui->initFilter();
1876 
1877  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1878  $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin, null);
1879  $questionList->setQuestionIdsFilter($questionIds);
1880  $questionList->setQuestionInstanceTypeFilter(null);
1881 
1882  foreach ($table_gui->getFilterItems() as $item)
1883  {
1884  if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
1885  {
1886  $v = $item->getValue();
1887 
1888  if( is_array($v) && count($v) && !(int)$v[0] )
1889  {
1890  continue;
1891  }
1892 
1893  $taxId = substr($item->getPostVar(), strlen('tax_'));
1894  $questionList->addTaxonomyFilter($taxId, $item->getValue());
1895  }
1896  elseif( $item->getValue() !== false )
1897  {
1898  $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1899  }
1900  }
1901 
1902  $questionList->load();
1903 
1904  $filteredTestResult = array();
1905 
1906  foreach($testResults as $resultItemKey => $resultItemValue)
1907  {
1908  if($resultItemKey === 'test' || $resultItemKey === 'pass')
1909  {
1910  continue;
1911  }
1912 
1913  if( !$questionList->isInList($resultItemValue['qid']) )
1914  {
1915  continue;
1916  }
1917 
1918  $filteredTestResult[] = $resultItemValue;
1919  }
1920 
1921  return $filteredTestResult;
1922  }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeaderNames()

& ilTestEvaluationGUI::getHeaderNames ( )

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

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

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

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

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

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

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

References ilObjTest\_getResultPass().

1521  {
1522  $testSession = $this->testSessionFactory->getSession();
1523 
1524  require_once './Services/Certificate/classes/class.ilCertificate.php';
1525  require_once './Modules/Test/classes/class.ilTestCertificateAdapter.php';
1526  $certificate = new ilCertificate(new ilTestCertificateAdapter( $this->object ) );
1527  $certificate->outCertificate(
1528  array(
1529  "active_id" => $testSession->getActiveId(),
1530  "pass" => ilObjTest::_getResultPass( $testSession->getActiveId() )
1531  )
1532  );
1533  }
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
Create PDF certificates.
+ Here is the call graph for this function:

◆ outCorrectSolution()

ilTestEvaluationGUI::outCorrectSolution ( )

Creates an output of the solution of an answer compared to the correct solution.

public

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

References $_GET, $pass, ilObjStyleSheet\getContentStylePath(), ilTestServiceGUI\getCorrectSolutionOutput(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), and ilUtil\sendInfo().

1376  {
1377  if( !$this->object->getShowSolutionDetails() )
1378  {
1379  ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1380  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1381  }
1382 
1383  $testSession = $this->testSessionFactory->getSession();
1384  $activeId = $testSession->getActiveId();
1385 
1386  if( !($activeId > 0) )
1387  {
1388  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1389  }
1390 
1391  if( !$this->object->canShowTestResults($testSession, $testSession->getUserId()) )
1392  {
1393  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1394  }
1395 
1396  $this->ctrl->saveParameter($this, "pass");
1397  $pass = (int)$_GET['pass'];
1398 
1399  $testSequence = $this->testSequenceFactory->getSequenceByPass($testSession, $pass);
1400  $testSequence->loadFromDb();
1401  $testSequence->loadQuestions();
1402 
1403  $questionId = (int)$_GET['evaluation'];
1404 
1405  if( !$testSequence->questionExists($questionId) )
1406  {
1407  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1408  }
1409 
1410  global $ilTabs;
1411 
1412  $ilTabs->setBackTarget($this->lng->txt("tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this, 'outUserPassDetails'));
1413 
1414  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1415  $this->tpl->setCurrentBlock("ContentStyle");
1416  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1417  $this->tpl->parseCurrentBlock();
1418 
1419  $this->tpl->setCurrentBlock("SyntaxStyle");
1420  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1421  $this->tpl->parseCurrentBlock();
1422 
1423  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1424  if ($this->object->getShowSolutionAnswersOnly())
1425  {
1426  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1427  }
1428 
1429  $solution = $this->getCorrectSolutionOutput($questionId, $activeId, $pass);
1430 
1431  $this->tpl->setContent($solution);
1432  }
getCorrectSolutionOutput($question_id, $active_id, $pass)
Returns an output of the solution to an answer compared to the correct solution.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getSyntaxStylePath()
get syntax style path
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getContentStylePath($a_style_id)
get content style path
+ Here is the call graph for this function:

◆ outParticipantsPassDetails()

ilTestEvaluationGUI::outParticipantsPassDetails ( )

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

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

public

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

References $_GET, $_SESSION, $pass, ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getGradingMessage(), ilTestServiceGUI\getPassDetailsOverview(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and ilUtil\sendInfo().

804  {
805  global $ilTabs, $ilAccess;
806 
807  if (!$ilAccess->checkAccess('write', '', $this->ref_id))
808  {
809  // allow only write access
810  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
811  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
812  }
813 
814  $this->ctrl->saveParameter($this, "active_id");
815  $active_id = (int)$_GET["active_id"];
816  $testSession = $this->testSessionFactory->getSession($active_id);
817 
818  // protect actives from other tests
819  if( $testSession->getTestId() != $this->object->getTestId() )
820  {
821  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
822  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
823  }
824 
825  $this->ctrl->saveParameter($this, "pass");
826  $pass = (int)$_GET["pass"];
827 
828  if ( isset($_GET['statistics']) && $_GET['statistics'] == 1)
829  {
830  $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
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  $result_array =& $this->object->getTestResult($active_id, $pass);
850 
851  $overview = $this->getPassDetailsOverview($result_array, $active_id, $pass, $this, "outParticipantsPassDetails", '', true);
852  $user_data = $this->getResultsUserdata($testSession, $active_id, FALSE);
853  $user_id = $this->object->_getUserIdFromActiveId($active_id);
854 
855  $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE, "Modules/Test");
856 
857  require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
858  $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
859 
860  $this->ctrl->setParameter($this, 'pdf', '1');
861  $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails') );
862  $this->ctrl->setParameter($this, 'pdf', '');
863 
864  if( isset($_GET['show_best_solutions']) )
865  {
866  $_SESSION['tst_results_show_best_solutions'] = true;
867  }
868  elseif( isset($_GET['hide_best_solutions']) )
869  {
870  $_SESSION['tst_results_show_best_solutions'] = false;
871  }
872  elseif( !isset($_SESSION['tst_results_show_best_solutions']) )
873  {
874  $_SESSION['tst_results_show_best_solutions'] = false;
875  }
876 
877  if( $_SESSION['tst_results_show_best_solutions'] )
878  {
879  $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
880  $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
881  $this->ctrl->setParameter($this, 'hide_best_solutions', '');
882  }
883  else
884  {
885  $this->ctrl->setParameter($this, 'show_best_solutions', '1');
886  $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'outParticipantsPassDetails'));
887  $this->ctrl->setParameter($this, 'show_best_solutions', '');
888  }
889 
890  $toolbar->build();
891  $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
892 
893  if( $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1 )
894  {
895  $template->setCurrentBlock('grading_message');
896  $template->setVariable('GRADING_MESSAGE', $this->getGradingMessage($active_id));
897  $template->parseCurrentBlock();
898  }
899 
900  $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $_SESSION['tst_results_show_best_solutions'], false, false, false, true);
901  $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
902  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
903  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
904  $template->setVariable("PASS_DETAILS", $overview);
905  $template->setVariable("USER_DATA", $user_data);
906  $uname = $this->object->userLookupFullName($user_id);
907  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
908 
909  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
910  if ($this->object->getShowSolutionAnswersOnly())
911  {
912  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
913  }
914 
915  if( $this->isPdfDeliveryRequest() )
916  {
917  //$this->object->deliverPDFfromHTML($template->get());
918  require_once 'class.ilTestPDFGenerator.php';
919  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
920  }
921  else
922  {
923  $this->tpl->setVariable("ADM_CONTENT", $template->get());
924  }
925  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false)
Returns the list of answers of a users test pass.
special template class to simplify handling of ITX/PEAR
getPassDetailsOverview($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav)
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:

◆ outParticipantsResultsOverview()

ilTestEvaluationGUI::outParticipantsResultsOverview ( )

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

public

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

References $_GET, $filename, ilObjTest\_getResultPass(), ilObjUser\_lookupName(), ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getGradingMessage(), ilTestServiceGUI\getPassOverview(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and ilUtil\sendInfo().

933  {
934  global $ilTabs, $ilAccess;
935 
936  if (!$ilAccess->checkAccess('write', '', $this->ref_id))
937  {
938  // allow only write access
939  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
940  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
941  }
942 
943  $active_id = (int)$_GET["active_id"];
944  $testSession = $this->testSessionFactory->getSession($active_id);
945 
946  // protect actives from other tests
947  if( $testSession->getTestId() != $this->object->getTestId() )
948  {
949  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
950  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
951  }
952 
953  if ($this->object->getNrOfTries() == 1)
954  {
955  $this->ctrl->setParameter($this, "active_id", $active_id);
956  $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
957  $this->ctrl->redirect($this, "outParticipantsPassDetails");
958  }
959 
960  $ilTabs->setBackTarget(
961  $this->lng->txt('back'), $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
962  );
963 
964  $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE, "Modules/Test");
965 
966  require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
967  $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
968 
969  $this->ctrl->setParameter($this, 'pdf', '1');
970  $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, __FUNCTION__) );
971  $this->ctrl->setParameter($this, 'pdf', '');
972 
973  $toolbar->build();
974  $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
975 
976  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outParticipantsPassDetails", false, false, true);
977  $template->setVariable("PASS_OVERVIEW", $overview);
978 
979  $user_id = $this->object->_getUserIdFromActiveId($active_id);
980  $user_data = $this->getResultsUserdata($testSession, $active_id);
981  $template->setVariable("USER_DATA", $user_data);
982  $template->setVariable("TEXT_OVERVIEW", $this->lng->txt("tst_results_overview"));
983 
984  if( $this->isGradingMessageRequired() )
985  {
986  $template->setCurrentBlock('grading_message');
987  $template->setVariable('GRADING_MESSAGE', $this->getGradingMessage($active_id));
988  $template->parseCurrentBlock();
989  }
990 
991  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
992  $template->parseCurrentBlock();
993 
994  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
995  if ($this->object->getShowSolutionAnswersOnly())
996  {
997  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
998  }
999 
1000  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
1001  {
1002  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1003 
1004  $name = ilObjUser::_lookupName($user_id);
1005  $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__'. $this->object->getTitle();
1006  require_once 'class.ilTestPDFGenerator.php';
1008  //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
1009  //$template->setVariable("PDF_FILE_LOCATION", $filename);
1010  }
1011  else
1012  {
1013  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1014  }
1015  }
static _lookupName($a_user_id)
lookup user name
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE, $adminMode=false)
Returns the pass overview for a given active ID.
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
$filename
Definition: buildRTE.php:89
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:

◆ outUserListOfAnswerPasses()

ilTestEvaluationGUI::outUserListOfAnswerPasses ( )

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

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

public

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

References $_GET, $ilUser, $pass, ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getPassOverview(), ilTestServiceGUI\getResultsSignature(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), and ilUtil\sendInfo().

1271  {
1272  global $ilUser;
1273 
1274  if (!$this->object->getShowSolutionPrintview())
1275  {
1276  ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1277  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1278  }
1279 
1280  $template = new ilTemplate("tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE, "Modules/Test");
1281 
1282  $pass = null;
1283  if (array_key_exists("pass", $_GET))
1284  {
1285  if (strlen($_GET["pass"])) $pass = $_GET["pass"];
1286  }
1287  $user_id = $ilUser->getId();
1288 
1289  $testSession = $this->testSessionFactory->getSession();
1290  $active_id = $testSession->getActiveId();
1291 
1292  $overview = "";
1293  if ($this->object->getNrOfTries() == 1)
1294  {
1295  $pass = 0;
1296  }
1297  else
1298  {
1299  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outUserListOfAnswerPasses", TRUE);
1300  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_passes"));
1301  $template->setVariable("PASS_OVERVIEW", $overview);
1302  }
1303 
1304  $signature = "";
1305  if (strlen($pass))
1306  {
1307  $signature = $this->getResultsSignature();
1308  $result_array =& $this->object->getTestResult($active_id, $pass);
1309  $user_id =& $this->object->_getUserIdFromActiveId($active_id);
1310  $showAllAnswers = TRUE;
1311  if ($this->object->isExecutable($testSession, $user_id))
1312  {
1313  $showAllAnswers = FALSE;
1314  }
1315  $answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, FALSE, $showAllAnswers);
1316  $template->setVariable("PASS_DETAILS", $answers);
1317  }
1318  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1319  $template->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
1320  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
1321  $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1322  $template->setVariable("PRINT_URL", "javascript:window.print();");
1323 
1324  $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
1325  $template->setVariable("USER_DATA", $user_data);
1326  $template->setVariable("TEXT_LIST_OF_ANSWERS", $this->lng->txt("tst_list_of_answers"));
1327  if (strlen($signature))
1328  {
1329  $template->setVariable("SIGNATURE", $signature);
1330  }
1331  if (!is_null($pass) && $this->object->isShowExamIdInTestResultsEnabled())
1332  {
1333  $template->setCurrentBlock('exam_id_footer');
1334  $template->setVariable('EXAM_ID_VAL', $this->object->lookupExamId(
1335  $testSession->getActiveId(), $pass
1336  ));
1337  $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1338  $template->parseCurrentBlock();
1339  }
1340  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1341 
1342  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1343  if ($this->object->getShowSolutionAnswersOnly())
1344  {
1345  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1346  }
1347  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE, $adminMode=false)
Returns the pass overview for a given active ID.
getResultsSignature()
Returns HTML code for a signature field.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false)
Returns the list of answers of a users test pass.
special template class to simplify handling of ITX/PEAR
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ outUserPassDetails()

ilTestEvaluationGUI::outUserPassDetails ( )

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

public

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

References $_GET, $ilUser, $pass, ilTestServiceGUI\$tpl, ilTestPDFGenerator\generatePDF(), getFilteredTestResult(), ilTestServiceGUI\getGradingMessage(), ilTestServiceGUI\getPassDetailsOverview(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getResultsSignature(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), and ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD.

Referenced by outUserPassDetailsResetTableFilter(), and outUserPassDetailsSetTableFilter().

1041  {
1042  global $ilTabs, $ilUser;
1043 
1044  if ($this->object->getNrOfTries() == 1)
1045  {
1046  $ilTabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen'));
1047  }
1048  else
1049  {
1050  $ilTabs->setBackTarget($this->lng->txt('tst_results_back_overview'), $this->ctrl->getLinkTarget($this, 'outUserResultsOverview'));
1051  }
1052 
1053  $testSession = $this->testSessionFactory->getSession();
1054 
1055  if( !$this->object->getShowPassDetails() )
1056  {
1057  #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1058 
1059  #if($executable["executable"])
1060  #{
1061  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1062  #}
1063  }
1064 
1065  $active_id = $testSession->getActiveId();
1066  $user_id = $testSession->getUserId();
1067 
1068  $this->ctrl->saveParameter($this, "pass");
1069  $pass = $_GET["pass"];
1070 
1071  $result_array = $this->getFilteredTestResult($active_id, $pass);
1072 
1073  $command_solution_details = "";
1074  if ($this->object->getShowSolutionDetails())
1075  {
1076  $command_solution_details = "outCorrectSolution";
1077  }
1078  $questionAnchorNav = $this->object->canShowSolutionPrintview();
1079 
1080  $tpl = new ilTemplate('tpl.il_as_tst_pass_details_overview_participants.html', true, true, "Modules/Test");
1081 
1082  if( !$this->isPdfDeliveryRequest() )
1083  {
1084  require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1085  $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
1086 
1087  $this->ctrl->setParameter($this, 'pdf', '1');
1088  $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outUserPassDetails') );
1089  $this->ctrl->setParameter($this, 'pdf', '');
1090 
1091  include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1092  if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1093  {
1094  $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1095  }
1096 
1097  $toolbar->build();
1098 
1099  $tpl->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1100 
1101  $tpl->setCurrentBlock('signature');
1102  $tpl->setVariable("SIGNATURE", $this->getResultsSignature());
1103  $tpl->parseCurrentBlock();
1104 
1105  if ($this->object->isShowExamIdInTestResultsEnabled())
1106  {
1107  $tpl->setCurrentBlock('exam_id');
1108  $tpl->setVariable('EXAM_ID', $this->object->lookupExamId(
1109  $testSession->getActiveId(), $pass
1110  ));
1111  $tpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1112  $tpl->parseCurrentBlock();
1113  }
1114  }
1115 
1116  if( $this->isGradingMessageRequired() && $this->object->getNrOfTries() == 1 )
1117  {
1118  $tpl->setCurrentBlock('grading_message');
1119  $tpl->setVariable('GRADING_MESSAGE', $this->getGradingMessage($active_id));
1120  $tpl->parseCurrentBlock();
1121  }
1122 
1123  $overview = $this->getPassDetailsOverview(
1124  $result_array, $active_id, $pass, $this, "outUserPassDetails", $command_solution_details, $questionAnchorNav
1125  );
1126  $tpl->setVariable("PASS_DETAILS", $overview);
1127 
1128  if( $this->object->canShowSolutionPrintview() )
1129  {
1130  $list_of_answers = $this->getPassListOfAnswers(
1131  $result_array, $active_id, $pass, $this->object->getShowSolutionListComparison(),
1132  false, false, false, true
1133  );
1134  $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1135  }
1136 
1137  $tpl->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
1138  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1139 
1140  $uname = $this->object->userLookupFullName($user_id, TRUE);
1141  $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
1142  if ($this->object->getAnonymity())
1143  {
1144  $tpl->setVariable("TEXT_HEADING", $this->lng->txt("tst_result_pass"));
1145  }
1146  else
1147  {
1148  $tpl->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1149  $tpl->setVariable("USER_DATA", $user_data);
1150  }
1151 
1152  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1153  if ($this->object->getShowSolutionAnswersOnly())
1154  {
1155  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1156  }
1157 
1158  if( $this->isPdfDeliveryRequest() )
1159  {
1160  require_once 'class.ilTestPDFGenerator.php';
1162  }
1163  else
1164  {
1165  $this->tpl->setContent($tpl->get());
1166  }
1167  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getResultsSignature()
Returns HTML code for a signature field.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false)
Returns the list of answers of a users test pass.
special template class to simplify handling of ITX/PEAR
getPassDetailsOverview($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav)
global $ilUser
Definition: imgupload.php:15
getFilteredTestResult($active_id, $pass)
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outUserPassDetailsResetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsResetTableFilter ( )

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

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

1027  {
1028  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1029  $tableGUI->initFilter();
1030  $tableGUI->resetOffset();
1031  $tableGUI->resetFilter();
1032  $this->outUserPassDetails();
1033  }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
+ Here is the call graph for this function:

◆ outUserPassDetailsSetTableFilter()

ilTestEvaluationGUI::outUserPassDetailsSetTableFilter ( )

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

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

1018  {
1019  $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1020  $tableGUI->initFilter();
1021  $tableGUI->resetOffset();
1022  $tableGUI->writeFilterToSession();
1023  $this->outUserPassDetails();
1024  }
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
+ Here is the call graph for this function:

◆ outUserResultsOverview()

ilTestEvaluationGUI::outUserResultsOverview ( )

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

ilTabsGUI $ilTabs

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

References $ilUser, ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getGradingMessage(), ilTestServiceGUI\getPassOverview(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), ilTestServiceGUI\isGradingMessageRequired(), ilTestServiceGUI\isPdfDeliveryRequest(), and ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD.

1175  {
1176  global $ilUser, $ilTabs;
1177 
1178  $ilTabs->setBackTarget(
1179  $this->lng->txt('tst_results_back_introduction'),
1180  $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')
1181  );
1182 
1183  $testSession = $this->testSessionFactory->getSession();
1184  $active_id = $testSession->getActiveId();
1185  $user_id = $ilUser->getId();
1186  $uname = $this->object->userLookupFullName($user_id, TRUE);
1187 
1188  if( !$this->object->canShowTestResults($testSession, $ilUser->getId()) )
1189  {
1190  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1191  }
1192 
1193  $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", TRUE, TRUE, "Modules/Test");
1194  $template = new ilTemplate("tpl.il_as_tst_results_participant.html", TRUE, TRUE, "Modules/Test");
1195 
1196  require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1197  $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
1198 
1199  $this->ctrl->setParameter($this, 'pdf', '1');
1200  $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'outUserResultsOverview') );
1201  $this->ctrl->setParameter($this, 'pdf', '');
1202 
1203  include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1204  if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1205  {
1206  $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this, 'outCertificate'));
1207  }
1208 
1209  $toolbar->build();
1210 
1211  $templatehead->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1212 
1213  $hide_details = !$this->object->getShowPassDetails();
1214  #if ($hide_details)
1215  #{
1216  # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1217  # if (!$executable["executable"]) $hide_details = FALSE;
1218  #}
1219 
1220  $template->setCurrentBlock("pass_overview");
1221  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outUserPassDetails", FALSE, $hide_details);
1222  $template->setVariable("PASS_OVERVIEW", $overview);
1223  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results_overview"));
1224  $template->parseCurrentBlock();
1225 
1226  $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
1227 
1228  if ($this->object->getAnonymity()) {
1229  $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1230  }
1231  else {
1232  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1233  $template->setVariable("USER_DATA", $user_data);
1234  }
1235 
1236  if( $this->isGradingMessageRequired() )
1237  {
1238  $template->setCurrentBlock('grading_message');
1239  $template->setVariable('GRADING_MESSAGE', $this->getGradingMessage($active_id));
1240  $template->parseCurrentBlock();
1241  }
1242 
1243  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1244  if ($this->object->getShowSolutionAnswersOnly())
1245  {
1246  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1247  }
1248  $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
1249 
1250  if( $this->isPdfDeliveryRequest() )
1251  {
1252  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1253  require_once 'class.ilTestPDFGenerator.php';
1254  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
1255  //$this->object->deliverPDFfromHTML($template->get(), sprintf($this->lng->txt("tst_result_user_name"), $uname));
1256  }
1257  else
1258  {
1259  $this->tpl->setContent($templatehead->get());
1260  }
1261  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE, $adminMode=false)
Returns the pass overview for a given active ID.
special template class to simplify handling of ITX/PEAR
global $ilUser
Definition: imgupload.php:15
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:

◆ passDetails()

ilTestEvaluationGUI::passDetails ( )

Output of the learners view of an existing test pass.

Output of the learners view of an existing test pass

public

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

References $_GET.

1357  {
1358  if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1359  {
1360  $this->ctrl->saveParameter($this, "pass");
1361  $this->ctrl->saveParameter($this, "active_id");
1362  $this->outTestResults(false, $_GET["pass"]);
1363  }
1364  else
1365  {
1366  $this->outTestResults(false);
1367  }
1368  }
$_GET["client_id"]

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

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

Referenced by cancelDeletePass().

1566  {
1567  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1568 
1569  switch($context)
1570  {
1572 
1573  $this->ctrl->redirect($this, 'outUserResultsOverview');
1574 
1576 
1577  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1578 
1580 
1581  $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1582  }
1583  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterEvaluation()

ilTestEvaluationGUI::resetfilterEvaluation ( )

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

References $data, $options, ilCertificate\_isComplete(), ilObjUser\_lookupFields(), ilSubmitButton\getInstance(), ilUtil\getStyleSheetLocation(), ilUtil\sendInfo(), ilTable2GUI\setData(), and ilSelectInputGUI\setOptions().

134  {
135  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
136  $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
137  $table_gui->resetFilter();
138  $this->ctrl->redirect($this, "outEvaluation");
139  }
TableGUI class for evaluation of all users.
+ Here is the call graph for this function:

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

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

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

1439  {
1440  global $ilAccess;
1441 
1442  if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
1443  {
1444  // allow only evaluation access
1445  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1446  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1447  }
1448 
1449  $data =& $this->object->getCompleteEvaluationData();
1450  $color_class = array("tblrow1", "tblrow2");
1451  $counter = 0;
1452  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1453  $foundParticipants =& $data->getParticipants();
1454  if (count($foundParticipants) == 0)
1455  {
1456  ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1457  return;
1458  }
1459  else
1460  {
1461  $rows = array();
1462  foreach ($data->getQuestionTitles() as $question_id => $question_title)
1463  {
1464  $answered = 0;
1465  $reached = 0;
1466  $max = 0;
1467  foreach ($foundParticipants as $userdata)
1468  {
1469  $pass = $userdata->getScoredPass();
1470  if (is_object($userdata->getPass($pass)))
1471  {
1472  $question =& $userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1473  if (is_array($question))
1474  {
1475  $answered++;
1476  }
1477  }
1478  }
1479  $counter++;
1480  $this->ctrl->setParameter($this, "qid", $question_id);
1481  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1482  $question_object = assQuestion::_instanciateQuestion($question_id);
1483  $download = "";
1484  if ( $question_object instanceof ilObjFileHandlingQuestionType )
1485  {
1486  if ($question_object->hasFileUploads($this->object->getTestId()))
1487  {
1488  $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants"). "\">" . $this->lng->txt("download") . "</a>";
1489  }
1490  }
1491  array_push($rows,
1492  array(
1493  'qid' => $question_id,
1494  'question_title' => $question_title,
1495  'number_of_answers' => $answered,
1496  'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1497  'file_uploads' => $download
1498  )
1499  );
1500  }
1501  if (count($rows))
1502  {
1503  require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1504  $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1505  $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1506  $table_gui->setData($rows);
1507 
1508  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1509  }
1510  else
1511  {
1512  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1513  }
1514  }
1515  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
TableGUI class for results by question.
Interface ilObjFileHandlingQuestionType.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

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