ILIAS  release_4-4 Revision
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 ()
 
 outEvaluation ()
 Creates the evaluation output for the test. More...
 
 detailedEvaluation ()
 Creates the detailed evaluation output for a selected participant. More...
 
 exportQuestionForAllParticipants ()
 Creates a PDF representation of the answers for a given question in a test. More...
 
 exportFileUploadsForAllParticipants ()
 Creates a ZIP file containing all file uploads for a given question in a test. More...
 
 eval_a ()
 Output of anonymous aggregated results for the test. More...
 
 exportEvaluation ()
 Exports the evaluation data to a selected file format. More...
 
 exportAggregatedResults ()
 Exports the aggregated results. More...
 
 exportCertificate ()
 Exports the user results as PDF certificates using XSL-FO via XML:RPC calls. More...
 
 getEvaluationQuestionId ($question_id, $original_id="")
 Returns the ID of a question for evaluation purposes. More...
 
 outParticipantsPassDetails ()
 Output of the pass details of an existing test pass for the test statistics. More...
 
 outParticipantsResultsOverview ()
 Output of the pass overview for a test called from the statistics. More...
 
 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
 ilTestServiceGUI (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 getPassOverview ($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE)
 Returns the pass overview for a given active ID. More...
 
 getFinalStatement ($active_id)
 Returns the final statement for a user. More...
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=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...
 
 getPassDetailsOverview ($result_array, $active_id, $pass, $targetclass="", $targetcommandsort="", $targetcommanddetails="", $standard_header=TRUE)
 Returns the pass details overview for a given active ID and pass. 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, $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...
 

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
 $testSessionFactory = null
 
 $testSequenceFactory = null
 

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: ilTestPassDeletionConfirmationGUI

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

35  {
36  parent::ilTestServiceGUI($a_object);
37  }

Member Function Documentation

◆ cancelDeletePass()

ilTestEvaluationGUI::cancelDeletePass ( )

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

References $_POST, and redirectToPassDeletionContext().

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

◆ confirmDeletePass()

ilTestEvaluationGUI::confirmDeletePass ( )

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

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

1452  {
1453  if( !$this->object->isPassDeletionAllowed() )
1454  {
1455  $this->ctrl->redirect($this, 'outUserResultsOverview');
1456  }
1457 
1458  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1459 
1460  if( isset($_GET['context']) && strlen($_GET['context']) )
1461  {
1462  $context = $_GET['context'];
1463  }
1464  else
1465  {
1467  }
1468 
1469  $confirm = new ilTestPassDeletionConfirmationGUI($this->ctrl, $this->lng, $this);
1470  $confirm->build((int)$_GET['active_id'], (int)$_GET['pass'], $context);
1471 
1472  global $tpl;
1473  $tpl->setContent($this->ctrl->getHTML($confirm));
1474  }
$_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 303 of file class.ilTestEvaluationGUI.php.

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

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

◆ eval_a()

ilTestEvaluationGUI::eval_a ( )

Output of anonymous aggregated results for the test.

Output of anonymous aggregated results for the test

public

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

References $data, and ilUtil\sendInfo().

495  {
496  global $ilAccess;
497 
498  if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
499  {
500  // allow only evaluation access
501  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
502  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
503  }
504 
505  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_anonymous_aggregation.html", "Modules/Test");
506  $eval =& $this->object->getCompleteEvaluationData();
507  $data = array();
508  $foundParticipants =& $eval->getParticipants();
509  if (count($foundParticipants))
510  {
511  $template = new ilTemplate("tpl.il_as_tst_evaluation_export.html", TRUE, TRUE, "Modules/Test");
512  $template->setVariable("EXPORT_DATA", $this->lng->txt("exp_eval_data"));
513  $template->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
514  $template->setVariable("TEXT_CSV", $this->lng->txt("exp_type_spss"));
515  $template->setVariable("CMD_EXPORT", "exportAggregatedResults");
516  $template->setVariable("BTN_EXPORT", $this->lng->txt("export"));
517  $template->setVariable("BTN_PRINT", $this->lng->txt("print"));
518  $template->setVariable("BTN_COMMAND", $this->ctrl->getCmd());
519  $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "exportAggregatedResults"));
520  $exportoutput = $template->get();
521  $this->tpl->setVariable("EVALUATION_EXPORT", $exportoutput);
522 
523  array_push($data, array(
524  'result' => $this->lng->txt("tst_eval_total_persons"),
525  'value' => count($foundParticipants)
526  ));
527  $total_finished = $this->object->evalTotalFinished();
528  array_push($data, array(
529  'result' => $this->lng->txt("tst_eval_total_finished"),
530  'value' => $total_finished
531  ));
532  $average_time = $this->object->evalTotalStartedAverageTime();
533  $diff_seconds = $average_time;
534  $diff_hours = floor($diff_seconds/3600);
535  $diff_seconds -= $diff_hours * 3600;
536  $diff_minutes = floor($diff_seconds/60);
537  $diff_seconds -= $diff_minutes * 60;
538  array_push($data, array(
539  'result' => $this->lng->txt("tst_eval_total_finished_average_time"),
540  'value' => sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
541  ));
542  $total_passed = 0;
543  $total_passed_reached = 0;
544  $total_passed_max = 0;
545  $total_passed_time = 0;
546  foreach ($foundParticipants as $userdata)
547  {
548  if ($userdata->getPassed())
549  {
550  $total_passed++;
551  $total_passed_reached += $userdata->getReached();
552  $total_passed_max += $userdata->getMaxpoints();
553  $total_passed_time += $userdata->getTimeOfWork();
554  }
555  }
556  $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
557  $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
558  $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
559  array_push($data, array(
560  'result' => $this->lng->txt("tst_eval_total_passed"),
561  'value' => $total_passed
562  ));
563  array_push($data, array(
564  'result' => $this->lng->txt("tst_eval_total_passed_average_points"),
565  'value' => sprintf("%2.2f", $average_passed_reached) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%2.2f", $average_passed_max)
566  ));
567  $average_time = $average_passed_time;
568  $diff_seconds = $average_time;
569  $diff_hours = floor($diff_seconds/3600);
570  $diff_seconds -= $diff_hours * 3600;
571  $diff_minutes = floor($diff_seconds/60);
572  $diff_seconds -= $diff_minutes * 60;
573  array_push($data, array(
574  'result' => $this->lng->txt("tst_eval_total_passed_average_time"),
575  'value' => sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
576  ));
577  }
578 
579  include_once "./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
580  $table_gui = new ilTestAggregatedResultsTableGUI($this, 'eval_a');
581  $table_gui->setData($data);
582  $this->tpl->setVariable('AGGREGATED_RESULTS', $table_gui->getHTML());
583 
584  $rows = array();
585  foreach ($eval->getQuestionTitles() as $question_id => $question_title)
586  {
587  $answered = 0;
588  $reached = 0;
589  $max = 0;
590  foreach ($foundParticipants as $userdata)
591  {
592  for ($i = 0; $i <= $userdata->getLastPass(); $i++)
593  {
594  if (is_object($userdata->getPass($i)))
595  {
596  $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
597  if (is_array($question))
598  {
599  $answered++;
600  $reached += $question["reached"];
601  $max += $question["points"];
602  }
603  }
604  }
605  }
606  $percent = $max ? $reached/$max * 100.0 : 0;
607  $counter++;
608  $this->ctrl->setParameter($this, "qid", $question_id);
609  array_push($rows,
610  array(
611  'qid' => $question_id,
612  'title' => $question_title,
613  'points' => sprintf("%.2f", $answered ? $reached / $answered : 0) . " " . strtolower($this->lng->txt("of")) . " " . sprintf("%.2f", $answered ? $max / $answered : 0),
614  'percentage' => (float)$percent,
615  'answers' => $answered
616  )
617  );
618  }
619  include_once "./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
620  $table_gui = new ilTestAverageReachedPointsTableGUI($this, 'eval_a');
621  $table_gui->setData($rows);
622  $this->tpl->setVariable('TBL_AVG_REACHED', $table_gui->getHTML());
623  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the call graph for this function:

◆ executeCommand()

& ilTestEvaluationGUI::executeCommand ( )

execute command

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

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

43  {
44  $cmd = $this->ctrl->getCmd();
45  $next_class = $this->ctrl->getNextClass($this);
46  $this->ctrl->saveParameter($this, "sequence");
47  $this->ctrl->saveParameter($this, "active_id");
48  $cmd = $this->getCommand($cmd);
49  switch($next_class)
50  {
51  default:
52  $ret =& $this->$cmd();
53  break;
54  }
55  return $ret;
56  }
$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 684 of file class.ilTestEvaluationGUI.php.

References $_POST.

685  {
686  switch ($_POST["export_type"])
687  {
688  case "excel":
689  include_once "./Modules/Test/classes/class.ilTestExport.php";
690  $exportObj = new ilTestExport($this->object, "aggregated");
691  $exportObj->exportToExcel($deliver = TRUE);
692  break;
693  case "csv":
694  include_once "./Modules/Test/classes/class.ilTestExport.php";
695  $exportObj = new ilTestExport($this->object, "aggregated");
696  $exportObj->exportToCSV($deliver = TRUE);
697  break;
698  }
699  }
$_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 707 of file class.ilTestEvaluationGUI.php.

References $ilUser, and ilUtil\getASCIIFilename().

708  {
709  global $ilUser;
710 
711  include_once "./Services/Utilities/classes/class.ilUtil.php";
712  include_once "./Services/Certificate/classes/class.ilCertificate.php";
713  include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
714  $certificate = new ilCertificate(new ilTestCertificateAdapter($this->object));
715  $archive_dir = $certificate->createArchiveDirectory();
716  $total_users = array();
717  $total_users =& $this->object->evalTotalPersonsArray();
718  if (count($total_users))
719  {
720  foreach ($total_users as $active_id => $name)
721  {
722  $user_id = $this->object->_getUserIdFromActiveId($active_id);
723  $pdf = $certificate->outCertificate(
724  array(
725  "active_id" => $active_id,
726  "userfilter" => $userfilter,
727  "passedonly" => $passedonly
728  ),
729  FALSE
730  );
731  if (strlen($pdf))
732  {
733  $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id . "_" . str_replace(" ", "_", ilUtil::getASCIIFilename($name)) . ".pdf");
734  }
735  }
736  $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
737  }
738 
739  }
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 628 of file class.ilTestEvaluationGUI.php.

References $_GET, and $_POST.

629  {
630  $filterby = "";
631  if (array_key_exists("g_filterby", $_GET))
632  {
633  $filterby = $_GET["g_filterby"];
634  }
635 
636  $filtertext = "";
637  if (array_key_exists("g_userfilter", $_GET))
638  {
639  $filtertext = $_GET["g_userfilter"];
640  }
641 
642  $passedonly = FALSE;
643  if (array_key_exists("g_passedonly", $_GET))
644  {
645  if ($_GET["g_passedonly"] == 1)
646  {
647  $passedonly = TRUE;
648  }
649  }
650 
651  switch ($_POST["export_type"])
652  {
653  case "excel":
654  require_once './Modules/Test/classes/class.ilTestExport.php';
655  $exportObj = new ilTestExport($this->object, "results");
656  $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
657  break;
658 
659  case "csv":
660  require_once './Modules/Test/classes/class.ilTestExport.php';
661  $exportObj = new ilTestExport($this->object, "results");
662  $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
663  break;
664 
665  case "certificate":
666  if ($passedonly)
667  {
668  $this->ctrl->setParameterByClass("iltestcertificategui", "g_passedonly", "1");
669  }
670  if (strlen($filtertext))
671  {
672  $this->ctrl->setParameterByClass("iltestcertificategui", "g_userfilter", $filtertext);
673  }
674  $this->ctrl->redirect($this, "exportCertificate");
675  break;
676  }
677  }
$_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 473 of file class.ilTestEvaluationGUI.php.

References $_GET, and assQuestion\_instanciateQuestion().

474  {
475  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
476  $question_object = assQuestion::_instanciateQuestion($_GET["qid"]);
477  if ( $question_object instanceof ilObjFileHandlingQuestionType )
478  {
479  $question_object->getFileUploadZIPFile($this->object->getTestId());
480  }
481  else
482  {
483  $this->ctrl->redirect($this, "singleResults");
484  }
485  }
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 464 of file class.ilTestEvaluationGUI.php.

References $_GET, and ilTestServiceGUI\getQuestionResultForTestUsers().

465  {
466  $this->getQuestionResultForTestUsers($_GET["qid"], $this->object->getTestId());
467  }
$_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 114 of file class.ilTestEvaluationGUI.php.

115  {
116  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
117  $table_gui = new ilEvaluationAllTableGUI($this, 'outEvaluation');
118  $table_gui->writeFilterToSession();
119  $this->ctrl->redirect($this, "outEvaluation");
120  }
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 747 of file class.ilTestEvaluationGUI.php.

748  {
749  if ($original_id > 0)
750  {
751  return $original_id;
752  }
753  else
754  {
755  return $question_id;
756  }
757  }

◆ getHeaderNames()

& ilTestEvaluationGUI::getHeaderNames ( )

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

59  {
60  $headernames = array();
61  if ($this->object->getAnonymity())
62  {
63  array_push($headernames, $this->lng->txt("counter"));
64  }
65  else
66  {
67  array_push($headernames, $this->lng->txt("name"));
68  array_push($headernames, $this->lng->txt("login"));
69  }
70  $additionalFields = $this->object->getEvaluationAdditionalFields();
71  if (count($additionalFields))
72  {
73  foreach ($additionalFields as $fieldname)
74  {
75  array_push($headernames, $this->lng->txt($fieldname));
76  }
77  }
78  array_push($headernames, $this->lng->txt("tst_reached_points"));
79  array_push($headernames, $this->lng->txt("tst_mark"));
80  if ($this->object->ects_output)
81  {
82  array_push($headernames, $this->lng->txt("ects_grade"));
83  }
84  array_push($headernames, $this->lng->txt("tst_answered_questions"));
85  array_push($headernames, $this->lng->txt("working_time"));
86  array_push($headernames, $this->lng->txt("detailed_evaluation"));
87  return $headernames;
88  }

◆ getHeaderVars()

& ilTestEvaluationGUI::getHeaderVars ( )

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

91  {
92  $headervars = array();
93  if ($this->object->getAnonymity())
94  {
95  array_push($headervars, "counter");
96  }
97  else
98  {
99  array_push($headervars, "name");
100  array_push($headervars, "login");
101  }
102  array_push($headervars, "resultspoints");
103  array_push($headervars, "resultsmarks");
104  if ($this->object->ects_output)
105  {
106  array_push($headervars, "ects_grade");
107  }
108  array_push($headervars, "qworkedthrough");
109  array_push($headervars, "timeofwork");
110  array_push($headervars, "");
111  return $headervars;
112  }

◆ outCertificate()

ilTestEvaluationGUI::outCertificate ( )

Output of a test certificate.

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

References ilObjTest\_getResultPass().

1437  {
1438  $testSession = $this->testSessionFactory->getSession();
1439 
1440  require_once './Services/Certificate/classes/class.ilCertificate.php';
1441  require_once './Modules/Test/classes/class.ilTestCertificateAdapter.php';
1442  $certificate = new ilCertificate(new ilTestCertificateAdapter( $this->object ) );
1443  $certificate->outCertificate(
1444  array(
1445  "active_id" => $testSession->getActiveId(),
1446  "pass" => ilObjTest::_getResultPass( $testSession->getActiveId() )
1447  )
1448  );
1449  }
_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 1288 of file class.ilTestEvaluationGUI.php.

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

1289  {
1290  if( !$this->object->getShowSolutionDetails() )
1291  {
1292  ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1293  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1294  }
1295 
1296  $testSession = $this->testSessionFactory->getSession();
1297  $activeId = $testSession->getActiveId();
1298 
1299  if( !($activeId > 0) )
1300  {
1301  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1302  }
1303 
1304  if( !$this->object->canShowTestResults($testSession, $testSession->getUserId()) )
1305  {
1306  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1307  }
1308 
1309  $this->ctrl->saveParameter($this, "pass");
1310  $pass = (int)$_GET['pass'];
1311 
1312  $testSequence = $this->testSequenceFactory->getSequenceByPass($testSession, $pass);
1313  $testSequence->loadFromDb();
1314  $testSequence->loadQuestions();
1315 
1316  $questionId = (int)$_GET['evaluation'];
1317 
1318  if( !$testSequence->questionExists($questionId) )
1319  {
1320  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1321  }
1322 
1323  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_correct_solution.html", "Modules/Test");
1324 
1325  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1326  $this->tpl->setCurrentBlock("ContentStyle");
1327  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1328  $this->tpl->parseCurrentBlock();
1329 
1330  $this->tpl->setCurrentBlock("SyntaxStyle");
1331  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1332  $this->tpl->parseCurrentBlock();
1333 
1334  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1335  if ($this->object->getShowSolutionAnswersOnly())
1336  {
1337  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1338  }
1339 
1340  $this->tpl->setCurrentBlock("adm_content");
1341  $solution = $this->getCorrectSolutionOutput($questionId, $activeId, $pass);
1342  $this->tpl->setVariable("OUTPUT_SOLUTION", $solution);
1343  $this->tpl->setVariable("TEXT_BACK", $this->lng->txt("back"));
1344  $this->ctrl->saveParameter($this, "pass");
1345  $this->ctrl->saveParameter($this, "active_id");
1346  $this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1347  $this->tpl->parseCurrentBlock();
1348  }
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:

◆ outEvaluation()

ilTestEvaluationGUI::outEvaluation ( )

Creates the evaluation output for the test.

public

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

References $data, ilCertificate\_isComplete(), ilObjUser\_lookupFields(), ilUtil\getStyleSheetLocation(), ilUtil\sendInfo(), and ilTable2GUI\setData().

136  {
137  global $ilAccess;
138 
139  if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
140  {
141  // allow only evaluation access
142  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
143  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
144  }
145 
146  include_once "./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
147 
148  $table_gui = new ilEvaluationAllTableGUI(
149  $this, 'outEvaluation', $this->object->getAnonymity(), $this->object->isOfferingQuestionHintsEnabled()
150  );
151 
152  $data = array();
153  $arrFilter = array();
154 
155  foreach ($table_gui->getFilterItems() as $item)
156  {
157  if ($item->getValue() !== false)
158  {
159  switch ($item->getPostVar())
160  {
161  case 'group':
162  case 'name':
163  case 'course':
164  $arrFilter[$item->getPostVar()] = $item->getValue();
165  break;
166  case 'passed_only':
167  $passedonly = $item->getChecked();
168  break;
169  }
170  }
171  }
172  include_once "./Modules/Test/classes/class.ilTestEvaluationData.php";
173  $eval = new ilTestEvaluationData($this->object);
174  $eval->setFilterArray($arrFilter);
175  $foundParticipants =& $eval->getParticipants();
176  $counter = 1;
177  if (count($foundParticipants) > 0)
178  {
179  if ($this->object->ects_output)
180  {
181  $passed_array =& $this->object->getTotalPointsPassedArray();
182  }
183  foreach ($foundParticipants as $active_id => $userdata)
184  {
185  /* @var $userdata ilTestEvaluationUserData */
186 
187  $remove = FALSE;
188  if ($passedonly)
189  {
190  $mark_obj = $this->object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
191 
192  if( $mark_obj->getPassed() == FALSE || !$userdata->areObligationsAnswered() )
193  {
194  $remove = TRUE;
195  }
196  }
197  if (!$remove)
198  {
199  // build the evaluation row
200  $evaluationrow = array();
201  if ($this->object->getAnonymity())
202  {
203  $evaluationrow['name'] = $counter;
204  $evaluationrow['login'] = '';
205  }
206  else
207  {
208  $evaluationrow['name'] = $userdata->getName();
209  if (strlen($userdata->getLogin()))
210  {
211  $evaluationrow['login'] = "[" . $userdata->getLogin() . "]";
212  }
213  else
214  {
215  $evaluationrow['login'] = '';
216  }
217  }
218 
219  $evaluationrow['reached'] = $userdata->getReached();
220  $evaluationrow['max'] = $userdata->getMaxpoints();
221  $evaluationrow['hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
222  $percentage = $userdata->getReachedPointsInPercent();
223  $mark = $this->object->getMarkSchema()->getMatchingMark($percentage);
224  if (is_object($mark))
225  {
226  $evaluationrow['mark'] = $mark->getShortName();
227  }
228  if ($this->object->ects_output)
229  {
230  $ects_mark = $this->object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
231  $evaluationrow['ects_grade'] = $ects_mark;
232  }
233  $evaluationrow['answered'] = $userdata->getQuestionsWorkedThroughInPercent();
234  $evaluationrow['questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
235  $evaluationrow['number_of_questions'] = $userdata->getNumberOfQuestions();
236  $time_seconds = $userdata->getTimeOfWork();
237  $time_hours = floor($time_seconds/3600);
238  $time_seconds -= $time_hours * 3600;
239  $time_minutes = floor($time_seconds/60);
240  $time_seconds -= $time_minutes * 60;
241  $evaluationrow['working_time'] = sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
242  $this->ctrl->setParameter($this, "active_id", $active_id);
243  $href = $this->ctrl->getLinkTarget($this, "detailedEvaluation");
244  $detailed_evaluation = $this->lng->txt("detailed_evaluation_show");
245  $evaluationrow['details'] = "<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
246  $userfields = ilObjUser::_lookupFields($userdata->getUserID());
247  $evaluationrow['gender'] = $userfields['gender'];
248  $evaluationrow['email'] = $userfields['email'];
249  $evaluationrow['institution'] = $userfields['institution'];
250  $evaluationrow['street'] = $userfields['street'];
251  $evaluationrow['city'] = $userfields['city'];
252  $evaluationrow['zipcode'] = $userfields['zipcode'];
253  $evaluationrow['country'] = $userfields['country'];
254  $evaluationrow['department'] = $userfields['department'];
255  $evaluationrow['matriculation'] = $userfields['matriculation'];
256  $counter++;
257  $data[] = $evaluationrow;
258  }
259  }
260  }
261 
262  $table_gui->setData($data);
263  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_evaluation.html", "Modules/Test");
264  $this->tpl->setVariable('EVALUATION_DATA', $table_gui->getHTML());
265  if (count($foundParticipants) > 0)
266  {
267  $template = new ilTemplate("tpl.il_as_tst_evaluation_export.html", TRUE, TRUE, "Modules/Test");
268  $template->setVariable("EXPORT_DATA", $this->lng->txt("exp_eval_data"));
269  if (!$this->object->getAnonymity())
270  {
271  include_once "./Services/Certificate/classes/class.ilCertificate.php";
272  include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
274  {
275  $template->setVariable("TEXT_CERTIFICATE", $this->lng->txt("exp_type_certificate"));
276  }
277  }
278  $template->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
279  $template->setVariable("TEXT_CSV", $this->lng->txt("exp_type_spss"));
280  $template->setVariable("CMD_EXPORT", "exportEvaluation");
281  $template->setVariable("BTN_EXPORT", $this->lng->txt("export"));
282  $template->setVariable("BTN_PRINT", $this->lng->txt("print"));
283  $template->setVariable("BTN_COMMAND", $this->ctrl->getCmd());
284  $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "exportEvaluation"));
285  $exportoutput = $template->get();
286  $this->tpl->setVariable("EVALUATION_EXPORT", $exportoutput);
287  }
288 
289  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
290  if ($this->object->getShowSolutionAnswersOnly())
291  {
292  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
293  }
294  }
_lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
_isComplete($adapter)
Checks the status of the certificate.
TableGUI class for evaluation of all users.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ 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 766 of file class.ilTestEvaluationGUI.php.

References $_GET, $pass, ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getFinalStatement(), ilUtil\getHtmlPath(), ilUtil\getImagePath(), ilTestServiceGUI\getPassDetailsOverview(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, and ilUtil\sendInfo().

767  {
768  global $ilTabs, $ilAccess;
769 
770  if (!$ilAccess->checkAccess('write', '', $this->ref_id))
771  {
772  // allow only write access
773  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
774  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
775  }
776 
777  $this->ctrl->saveParameter($this, "active_id");
778  $active_id = (int)$_GET["active_id"];
779  $testSession = $this->testSessionFactory->getSession($active_id);
780 
781  // protect actives from other tests
782  if( $testSession->getTestId() != $this->object->getTestId() )
783  {
784  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
785  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
786  }
787 
788  $this->ctrl->saveParameter($this, "pass");
789  $pass = (int)$_GET["pass"];
790 
791  $result_array =& $this->object->getTestResult($active_id, $pass);
792 
793  $overview = $this->getPassDetailsOverview($result_array, $active_id, $pass, "iltestevaluationgui", "outParticipantsPassDetails");
794  $user_data = $this->getResultsUserdata($testSession, $active_id, FALSE);
795  $user_id = $this->object->_getUserIdFromActiveId($active_id);
796 
797  $template = new ilTemplate("tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE, "Modules/Test");
798 
799  $this->ctrl->setParameter($this, "pdf", "1");
800  $template->setCurrentBlock("pdf_export");
801  $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "outParticipantsPassDetails"));
802  $this->ctrl->setParameter($this, "pdf", "");
803  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
804  $template->setVariable("PDF_IMG_ALT", $this->lng->txt("pdf_export"));
805  $template->setVariable("PDF_IMG_URL", ilUtil::getHtmlPath(ilUtil::getImagePath("application-pdf.png")));
806  $template->parseCurrentBlock();
807 
808  if (array_key_exists("statistics", $_GET) && ($_GET["statistics"] == 1))
809  {
810  $template->setVariable("BACK_TEXT", $this->lng->txt("back"));
811  $this->ctrl->setParameterByClass("ilTestEvaluationGUI", "active_id", $active_id);
812  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilTestEvaluationGUI", "detailedEvaluation"));
813  }
814  else
815  {
816  if ($this->object->getNrOfTries() == 1)
817  {
818  $template->setVariable("BACK_TEXT", $this->lng->txt("back"));
819  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "participants"));
820  }
821  else
822  {
823  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this), "outParticipantsResultsOverview"));
824  $template->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_overview"));
825  }
826  }
827  $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
828  $template->setVariable("PRINT_URL", "javascript:window.print();");
829 
830  if ($this->object->getNrOfTries() == 1)
831  {
832  $statement = $this->getFinalStatement($active_id);
833  $template->setVariable("USER_MARK", $statement["mark"]);
834  if (strlen($statement["markects"]))
835  {
836  $template->setVariable("USER_MARK_ECTS", $statement["markects"]);
837  }
838  }
839 
840  $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, TRUE);
841  $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
842  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
843  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
844  $template->setVariable("PASS_DETAILS", $overview);
845  $template->setVariable("USER_DETAILS", $user_data);
846  $uname = $this->object->userLookupFullName($user_id);
847  $template->setVariable("USER_NAME", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
848 
849  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
850  if ($this->object->getShowSolutionAnswersOnly())
851  {
852  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
853  }
854 
855  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
856  {
857  //$this->object->deliverPDFfromHTML($template->get());
858  require_once 'class.ilTestPDFGenerator.php';
859  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
860  }
861  else
862  {
863  $this->tpl->setVariable("ADM_CONTENT", $template->get());
864  }
865  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE)
Returns the list of answers of a users test pass.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getPassDetailsOverview($result_array, $active_id, $pass, $targetclass="", $targetcommandsort="", $targetcommanddetails="", $standard_header=TRUE)
Returns the pass details overview for a given active ID and pass.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getHtmlPath($relative_path)
get url of path
getFinalStatement($active_id)
Returns the final statement for a user.
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 872 of file class.ilTestEvaluationGUI.php.

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

873  {
874  global $ilAccess;
875 
876  if (!$ilAccess->checkAccess('write', '', $this->ref_id))
877  {
878  // allow only write access
879  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
880  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
881  }
882 
883  $active_id = (int)$_GET["active_id"];
884  $testSession = $this->testSessionFactory->getSession($active_id);
885 
886  // protect actives from other tests
887  if( $testSession->getTestId() != $this->object->getTestId() )
888  {
889  ilUtil::sendInfo($this->lng->txt('no_permission'), true);
890  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
891  }
892 
893  if ($this->object->getNrOfTries() == 1)
894  {
895  $this->ctrl->setParameter($this, "active_id", $active_id);
896  $this->ctrl->setParameter($this, "pass", ilObjTest::_getResultPass($active_id));
897  $this->ctrl->redirect($this, "outParticipantsPassDetails");
898  }
899 
900  $template = new ilTemplate("tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE, "Modules/Test");
901 
902  $this->ctrl->setParameter($this, "pdf", "1");
903  $template->setCurrentBlock("pdf_export");
904  $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "outParticipantsResultsOverview"));
905  $this->ctrl->setParameter($this, "pdf", "");
906  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
907  $template->setVariable("PDF_IMG_ALT", $this->lng->txt("pdf_export"));
908  $template->setVariable("PDF_IMG_URL", ilUtil::getHtmlPath(ilUtil::getImagePath("application-pdf.png")));
909  $template->parseCurrentBlock();
910 
911  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outParticipantsPassDetails");
912  $template->setVariable("PASS_OVERVIEW", $overview);
913  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
914  $template->setVariable("BACK_TEXT", $this->lng->txt("back"));
915  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "participants"));
916  $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
917  $template->setVariable("PRINT_URL", "javascript:window.print();");
918 
919  $statement = $this->getFinalStatement($active_id);
920  $user_id = $this->object->_getUserIdFromActiveId($active_id);
921  $user_data = $this->getResultsUserdata($testSession, $active_id);
922  $template->setVariable("USER_DATA", $user_data);
923  $template->setVariable("TEXT_OVERVIEW", $this->lng->txt("tst_results_overview"));
924  $template->setVariable("USER_MARK", $statement["mark"]);
925  if (strlen($statement["markects"]))
926  {
927  $template->setVariable("USER_MARK_ECTS", $statement["markects"]);
928  }
929  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
930  $template->parseCurrentBlock();
931 
932  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
933  if ($this->object->getShowSolutionAnswersOnly())
934  {
935  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
936  }
937 
938  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
939  {
940  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
941 
942  $name = ilObjUser::_lookupName($user_id);
943  $filename = $name['lastname'] . '_' . $name['firstname'] . '_' . $name['login'] . '__'. $this->object->getTitle();
944  require_once 'class.ilTestPDFGenerator.php';
946  //ilUtil::deliverData($file, ilUtil::getASCIIFilename($this->object->getTitle()) . ".pdf", "application/pdf", false, true);
947  //$template->setVariable("PDF_FILE_LOCATION", $filename);
948  }
949  else
950  {
951  $this->tpl->setVariable("ADM_CONTENT", $template->get());
952  }
953  }
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"]
_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.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getHtmlPath($relative_path)
get url of path
$filename
Definition: buildRTE.php:89
getFinalStatement($active_id)
Returns the final statement for a user.
static generatePDF($pdf_output, $output_mode, $filename=null)
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE)
Returns the pass overview for a given active ID.
+ 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 1183 of file class.ilTestEvaluationGUI.php.

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

1184  {
1185  global $ilUser;
1186 
1187  if (!$this->object->getShowSolutionPrintview())
1188  {
1189  ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1190  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1191  }
1192 
1193  $template = new ilTemplate("tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE, "Modules/Test");
1194 
1195  $pass = null;
1196  if (array_key_exists("pass", $_GET))
1197  {
1198  if (strlen($_GET["pass"])) $pass = $_GET["pass"];
1199  }
1200  $user_id = $ilUser->getId();
1201 
1202  $testSession = $this->testSessionFactory->getSession();
1203  $active_id = $testSession->getActiveId();
1204 
1205  $overview = "";
1206  if ($this->object->getNrOfTries() == 1)
1207  {
1208  $pass = 0;
1209  }
1210  else
1211  {
1212  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outUserListOfAnswerPasses", TRUE);
1213  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_passes"));
1214  $template->setVariable("PASS_OVERVIEW", $overview);
1215  }
1216 
1217  $signature = "";
1218  if (strlen($pass))
1219  {
1220  $signature = $this->getResultsSignature();
1221  $result_array =& $this->object->getTestResult($active_id, $pass);
1222  $user_id =& $this->object->_getUserIdFromActiveId($active_id);
1223  $showAllAnswers = TRUE;
1224  if ($this->object->isExecutable($testSession, $user_id))
1225  {
1226  $showAllAnswers = FALSE;
1227  }
1228  $answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, FALSE, $showAllAnswers);
1229  $template->setVariable("PASS_DETAILS", $answers);
1230  }
1231  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1232  $template->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
1233  $template->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
1234  $template->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1235  $template->setVariable("PRINT_URL", "javascript:window.print();");
1236 
1237  $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
1238  $template->setVariable("USER_DATA", $user_data);
1239  $template->setVariable("TEXT_LIST_OF_ANSWERS", $this->lng->txt("tst_list_of_answers"));
1240  if (strlen($signature))
1241  {
1242  $template->setVariable("SIGNATURE", $signature);
1243  }
1244  if ($this->object->isShowExamIdInTestResultsEnabled())
1245  {
1246  $template->setCurrentBlock('exam_id_footer');
1247  $template->setVariable('EXAM_ID_VAL', $this->object->lookupExamId(
1248  $testSession->getActiveId(), $pass
1249  ));
1250  $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1251  $template->parseCurrentBlock();
1252  }
1253  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1254 
1255  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1256  if ($this->object->getShowSolutionAnswersOnly())
1257  {
1258  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1259  }
1260  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE)
Returns the list of answers of a users test pass.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getResultsSignature()
Returns HTML code for a signature field.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
global $ilUser
Definition: imgupload.php:15
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE)
Returns the pass overview for a given active ID.
+ 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.

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

public

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

References $_GET, $pass, ilTestServiceGUI\getFinalStatement(), ilTestServiceGUI\getPassDetailsOverview(), ilTestServiceGUI\getPassListOfAnswers(), and ilUtil\getStyleSheetLocation().

963  {
964  $testSession = $this->testSessionFactory->getSession();
965 
966  $active_id = $testSession->getActiveId();
967  $user_id = $testSession->getUserId();
968 
969  $this->ctrl->saveParameter($this, "pass");
970  $pass = $_GET["pass"];
971  $result_array =& $this->object->getTestResult($active_id, $pass);
972 
973  $command_solution_details = "";
974  if ($this->object->getShowSolutionDetails())
975  {
976  $command_solution_details = "outCorrectSolution";
977  }
978  $overview = $this->getPassDetailsOverview($result_array, $active_id, $pass, "iltestevaluationgui", "outUserPassDetails", $command_solution_details);
979 
980  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_pass_details_overview_participants.html", "Modules/Test");
981 
982  if ($this->object->getNrOfTries() == 1)
983  {
984 
985  $this->tpl->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
986  $this->tpl->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
987  }
988  else
989  {
990  $this->tpl->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this), "outUserResultsOverview"));
991  $this->tpl->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_overview"));
992  }
993 
994  $this->tpl->parseCurrentBlock();
995 
996  if ($this->object->getNrOfTries() == 1)
997  {
998  $statement = $this->getFinalStatement($active_id);
999  $this->tpl->setVariable("USER_MARK", $statement["mark"]);
1000  if (strlen($statement["markects"]))
1001  {
1002  $this->tpl->setVariable("USER_MARK_ECTS", $statement["markects"]);
1003  }
1004  }
1005 
1006  $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass);
1007 
1008  $this->tpl->setCurrentBlock("adm_content");
1009  $this->tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1010  $this->tpl->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
1011  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1012  $this->tpl->setVariable("PASS_DETAILS", $overview);
1013  $uname = $this->object->userLookupFullName($user_id, TRUE);
1014  $this->tpl->setVariable("USER_NAME", sprintf($this->lng->txt("tst_result_user_name_pass"), $pass + 1, $uname));
1015  $this->tpl->parseCurrentBlock();
1016 
1017  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1018  if ($this->object->getShowSolutionAnswersOnly())
1019  {
1020  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1021  }
1022  }
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE)
Returns the list of answers of a users test pass.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
getPassDetailsOverview($result_array, $active_id, $pass, $targetclass="", $targetcommandsort="", $targetcommanddetails="", $standard_header=TRUE)
Returns the pass details overview for a given active ID and pass.
getFinalStatement($active_id)
Returns the final statement for a user.
+ Here is the call graph for this function:

◆ outUserResultsOverview()

ilTestEvaluationGUI::outUserResultsOverview ( )

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

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

public

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

References $_GET, ilTestServiceGUI\$ilias, $ilLog, $ilUser, $pass, ilTestPDFGenerator\generatePDF(), ilTestServiceGUI\getFinalStatement(), ilUtil\getHtmlPath(), ilUtil\getImagePath(), ilRPCServerSettings\getInstance(), ilTestServiceGUI\getPassDetailsOverview(), ilTestServiceGUI\getPassListOfAnswers(), ilTestServiceGUI\getPassOverview(), ilTestServiceGUI\getResultsSignature(), ilTestServiceGUI\getResultsUserdata(), ilUtil\getStyleSheetLocation(), and ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD.

1032  {
1033  global $ilUser, $ilias, $ilLog;
1034 
1035  $testSession = $this->testSessionFactory->getSession();
1036 
1037  if (!$this->object->canShowTestResults($testSession, $ilUser->getId())) $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1038  include_once("./Services/UICore/classes/class.ilTemplate.php");
1039  $templatehead = new ilTemplate("tpl.il_as_tst_results_participants.html", TRUE, TRUE, "Modules/Test");
1040  $template = new ilTemplate("tpl.il_as_tst_results_participant.html", TRUE, TRUE, "Modules/Test");
1041 
1042  $pass = null;
1043  $user_id = $ilUser->getId();
1044  $uname = $this->object->userLookupFullName($user_id, TRUE);
1045  $active_id = $testSession->getActiveId();
1046  $hide_details = !$this->object->getShowPassDetails();
1047  if ($hide_details)
1048  {
1049  $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1050  if (!$executable["executable"]) $hide_details = FALSE;
1051  }
1052  $begin = microtime(true);
1053  if (($this->object->getNrOfTries() == 1) && (!$hide_details))
1054  {
1055  $pass = 0;
1056  }
1057  else
1058  {
1059  $template->setCurrentBlock("pass_overview");
1060  $overview = $this->getPassOverview($active_id, "iltestevaluationgui", "outUserResultsOverview", FALSE, $hide_details);
1061  $template->setVariable("PASS_OVERVIEW", $overview);
1062  $template->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results_overview"));
1063  $template->parseCurrentBlock();
1064  }
1065 
1066  if (((array_key_exists("pass", $_GET)) && (strlen($_GET["pass"]) > 0)) || (!is_null($pass)))
1067  {
1068  if (is_null($pass)) $pass = $_GET["pass"];
1069  }
1070 
1071 
1072  $this->ctrl->setParameter($this, "pass", $pass);
1073  $this->ctrl->setParameter($this, "pdf", "1");
1074  $templatehead->setCurrentBlock("pdf_export");
1075  $templatehead->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "outUserResultsOverview"));
1076  $this->ctrl->setParameter($this, "pass", "");
1077  $this->ctrl->setParameter($this, "pdf", "");
1078  $templatehead->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
1079  $templatehead->setVariable("PDF_IMG_ALT", $this->lng->txt("pdf_export"));
1080  $templatehead->setVariable("PDF_IMG_URL", ilUtil::getHtmlPath(ilUtil::getImagePath("application-pdf.png")));
1081  $templatehead->parseCurrentBlock();
1082 
1083  include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1084  if(ilRPCServerSettings::getInstance()->isEnabled())
1085  {
1086  if ($this->object->canShowCertificate($testSession, $user_id, $active_id))
1087  {
1088  $templatehead->setVariable("CERTIFICATE_URL", $this->ctrl->getLinkTarget($this, "outCertificate"));
1089  $templatehead->setVariable("CERTIFICATE_TEXT", $this->lng->txt("certificate"));
1090  }
1091  }
1092  $templatehead->setVariable("BACK_TEXT", $this->lng->txt("tst_results_back_introduction"));
1093  $templatehead->setVariable("BACK_URL", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
1094  $templatehead->setVariable("PRINT_TEXT", $this->lng->txt("print"));
1095  $templatehead->setVariable("PRINT_URL", "javascript:window.print();");
1096 
1097  $statement = $this->getFinalStatement($active_id);
1098  $user_data = $this->getResultsUserdata($testSession, $active_id, TRUE);
1099 
1100  // output of the details of a selected pass
1101  $this->ctrl->saveParameter($this, "pass");
1102  $this->ctrl->saveParameter($this, "active_id");
1103  if (!is_null($pass))
1104  {
1105  $result_array =& $this->object->getTestResult($active_id, $pass);
1106  $command_solution_details = "";
1107  if ($this->object->getShowSolutionDetails())
1108  {
1109  $command_solution_details = "outCorrectSolution";
1110  }
1111  $detailsoverview = (!$hide_details) ? $this->getPassDetailsOverview($result_array, $active_id, $pass, "iltestevaluationgui", "outUserResultsOverview", $command_solution_details) : '';
1112 
1113  $user_id = $this->object->_getUserIdFromActiveId($active_id);
1114 
1115  if (!$hide_details && $this->object->canShowSolutionPrintview())
1116  {
1117  $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, $this->object->getShowSolutionListComparison());
1118  }
1119  else if ($this->object->getShowSolutionDetails())
1120  {
1121  // if this is not commented out, all questions with checkmarks/crosses will be shown
1122  // $list_of_answers = $this->getPassListOfAnswers($result_array, $active_id, $pass, true);
1123  }
1124 
1125  $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
1126  $template->setVariable("PASS_RESULTS_OVERVIEW", sprintf($this->lng->txt("tst_results_overview_pass"), $pass + 1));
1127  $template->setVariable("PASS_DETAILS", $detailsoverview);
1128 
1129  $signature = $this->getResultsSignature();
1130  $template->setVariable("SIGNATURE", $signature);
1131  if ($this->object->isShowExamIdInTestResultsEnabled())
1132  {
1133  $template->setCurrentBlock('exam_id_footer');
1134  $template->setVariable('EXAM_ID_VAL', $this->object->lookupExamId(
1135  $testSession->getActiveId(), $pass
1136  ));
1137  $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
1138  $template->parseCurrentBlock();
1139  }
1140  }
1141  if ($this->object->getAnonymity()) {
1142  $template->setVariable("TEXT_HEADING", $this->lng->txt("tst_result"));
1143  }
1144  else {
1145  $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1146  $template->setVariable("USER_DATA", $user_data);
1147  }
1148  $template->setVariable("USER_MARK", $statement["mark"]);
1149  if (strlen($statement["markects"]))
1150  {
1151  $template->setVariable("USER_MARK_ECTS", $statement["markects"]);
1152  }
1153  $template->parseCurrentBlock();
1154 
1155  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1156  if ($this->object->getShowSolutionAnswersOnly())
1157  {
1158  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1159  }
1160  $templatehead->setVariable("RESULTS_PARTICIPANT", $template->get());
1161 
1162  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
1163  {
1164  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
1165  require_once 'class.ilTestPDFGenerator.php';
1166  $content = $template->get();
1167  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
1168  //$this->object->deliverPDFfromHTML($template->get(), sprintf($this->lng->txt("tst_result_user_name"), $uname));
1169  }
1170  else
1171  {
1172  $this->tpl->setVariable("PRINT_CONTENT", $templatehead->get());
1173  }
1174  }
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE)
Returns the list of answers of a users test pass.
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.
getPassDetailsOverview($result_array, $active_id, $pass, $targetclass="", $targetcommandsort="", $targetcommanddetails="", $standard_header=TRUE)
Returns the pass details overview for a given active ID and pass.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getHtmlPath($relative_path)
get url of path
global $ilUser
Definition: imgupload.php:15
getFinalStatement($active_id)
Returns the final statement for a user.
static generatePDF($pdf_output, $output_mode, $filename=null)
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE)
Returns the pass overview for a given active ID.
static getInstance()
Get singelton instance.
+ 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 1269 of file class.ilTestEvaluationGUI.php.

References $_GET.

1270  {
1271  if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
1272  {
1273  $this->ctrl->saveParameter($this, "pass");
1274  $this->ctrl->saveParameter($this, "active_id");
1275  $this->outTestResults(false, $_GET["pass"]);
1276  }
1277  else
1278  {
1279  $this->outTestResults(false);
1280  }
1281  }
$_GET["client_id"]

◆ redirectToPassDeletionContext()

ilTestEvaluationGUI::redirectToPassDeletionContext (   $context)
private

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

References $_POST, $_SESSION, $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().

1482  {
1483  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1484 
1485  switch($context)
1486  {
1488 
1489  $this->ctrl->redirect($this, 'outUserResultsOverview');
1490 
1492 
1493  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
1494 
1496 
1497  $this->ctrl->redirectByClass('ilTestPlayerDynamicQuestionSetGUI', 'startTest');
1498  }
1499  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterEvaluation()

ilTestEvaluationGUI::resetfilterEvaluation ( )

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

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

◆ singleResults()

ilTestEvaluationGUI::singleResults ( )

Creates user results for single questions.

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

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

1355  {
1356  global $ilAccess;
1357 
1358  if ((!$ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) && (!$ilAccess->checkAccess("write", "", $this->ref_id)))
1359  {
1360  // allow only evaluation access
1361  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1362  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1363  }
1364 
1365  $data =& $this->object->getCompleteEvaluationData();
1366  $color_class = array("tblrow1", "tblrow2");
1367  $counter = 0;
1368  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_eval_single_answers.html", "Modules/Test");
1369  $foundParticipants =& $data->getParticipants();
1370  if (count($foundParticipants) == 0)
1371  {
1372  ilUtil::sendInfo($this->lng->txt("tst_no_evaluation_data"));
1373  return;
1374  }
1375  else
1376  {
1377  $rows = array();
1378  foreach ($data->getQuestionTitles() as $question_id => $question_title)
1379  {
1380  $answered = 0;
1381  $reached = 0;
1382  $max = 0;
1383  foreach ($foundParticipants as $userdata)
1384  {
1385  $pass = $userdata->getScoredPass();
1386  if (is_object($userdata->getPass($pass)))
1387  {
1388  $question =& $userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1389  if (is_array($question))
1390  {
1391  $answered++;
1392  }
1393  }
1394  }
1395  $counter++;
1396  $this->ctrl->setParameter($this, "qid", $question_id);
1397  require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
1398  $question_object = assQuestion::_instanciateQuestion($question_id);
1399  $download = "";
1400  if ( $question_object instanceof ilObjFileHandlingQuestionType )
1401  {
1402  if ($question_object->hasFileUploads($this->object->getTestId()))
1403  {
1404  $download = "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportFileUploadsForAllParticipants"). "\">" . $this->lng->txt("download") . "</a>";
1405  }
1406  }
1407  array_push($rows,
1408  array(
1409  'qid' => $question_id,
1410  'question_title' => $question_title,
1411  'number_of_answers' => $answered,
1412  'output' => "<a href=\"" . $this->ctrl->getLinkTarget($this, "exportQuestionForAllParticipants") . "\">" . $this->lng->txt("pdf_export") . "</a>",
1413  'file_uploads' => $download
1414  )
1415  );
1416  }
1417  if (count($rows))
1418  {
1419  require_once './Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1420  $table_gui = new ilResultsByQuestionTableGUI($this, "singleResults");
1421  $table_gui->setTitle($this->lng->txt("tst_answered_questions_test"));
1422  $table_gui->setData($rows);
1423 
1424  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1425  }
1426  else
1427  {
1428  $this->tpl->setVariable("TBL_SINGLE_ANSWERS", $this->lng->txt("adm_no_special_users"));
1429  }
1430  }
1431  }
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.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the call graph for this function:

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