24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
25 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
63 $cmd = $this->ctrl->getCmd();
64 $next_class = $this->ctrl->getNextClass($this);
65 $this->ctrl->saveParameter($this,
"sequence");
66 $this->ctrl->saveParameter($this,
"active_id");
79 $headernames = array();
80 if ($this->object->getAnonymity())
82 array_push($headernames, $this->lng->txt(
"counter"));
86 array_push($headernames, $this->lng->txt(
"name"));
87 array_push($headernames, $this->lng->txt(
"login"));
89 $additionalFields = $this->
object->getEvaluationAdditionalFields();
90 if (count($additionalFields))
92 foreach ($additionalFields as $fieldname)
94 array_push($headernames, $this->lng->txt($fieldname));
97 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
98 array_push($headernames, $this->lng->txt(
"tst_mark"));
99 if ($this->object->ects_output)
101 array_push($headernames, $this->lng->txt(
"ects_grade"));
103 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
104 array_push($headernames, $this->lng->txt(
"working_time"));
105 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
111 $headervars = array();
112 if ($this->object->getAnonymity())
114 array_push($headervars,
"counter");
118 array_push($headervars,
"name");
119 array_push($headervars,
"login");
121 array_push($headervars,
"resultspoints");
122 array_push($headervars,
"resultsmarks");
123 if ($this->object->ects_output)
125 array_push($headervars,
"ects_grade");
127 array_push($headervars,
"qworkedthrough");
128 array_push($headervars,
"timeofwork");
129 array_push($headervars,
"");
144 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
148 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
153 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation.html",
"Modules/Test");
161 if (strcmp($_POST[
"cmd"][$this->ctrl->getCmd()], $this->lng->txt(
"set_filter")) == 0)
164 $filtertext = trim($_POST[
"userfilter"]);
165 $filterby = $_POST[
"filterby"];
166 if ($_POST[
"passedonly"] == 1)
170 if ((strlen($filtertext) == 0) && ($passedonly == FALSE)) $filter = 0;
172 $setting->set(
"tst_stat_filter_passed_" . $this->object->getTestId(), ($passedonly) ? 1 : 0);
173 $setting->set(
"tst_stat_filter_text_" . $this->object->getTestId(), $filtertext);
174 $setting->set(
"tst_stat_filter_by_" . $this->object->getTestId(), $filterby);
178 if (array_key_exists(
"g_userfilter",
$_GET))
180 $filtertext =
$_GET[
"g_userfilter"];
181 $filterby =
$_GET[
"g_filterby"];
186 $pref = $setting->get(
"tst_stat_filter_text_" . $this->object->getTestId());
191 $pref = $setting->get(
"tst_stat_filter_by_" . $this->object->getTestId());
197 if (array_key_exists(
"g_passedonly",
$_GET))
199 if (
$_GET[
"g_passedonly"] == 1)
207 $pref = $setting->get(
"tst_stat_filter_passed_" . $this->object->getTestId());
210 $passedonly = ($pref) ? TRUE : FALSE;
215 if (strcmp($_POST[
"cmd"][$this->ctrl->getCmd()], $this->lng->txt(
"reset_filter")) == 0)
221 $setting->delete(
"tst_stat_filter_passed_" . $this->object->getTestId());
222 $setting->delete(
"tst_stat_filter_text_" . $this->object->getTestId());
223 $setting->delete(
"tst_stat_filter_by_" . $this->object->getTestId());
225 if (strlen($filtertext))
227 $this->ctrl->setParameter($this,
"g_userfilter", $filtertext);
228 $this->ctrl->setParameter($this,
"g_filterby", $filterby);
232 $this->ctrl->setParameter($this,
"g_passedonly",
"1");
235 $offset = (
$_GET[
"offset"]) ?
$_GET[
"offset"] : 0;
236 $orderdirection = (
$_GET[
"sort_order"]) ?
$_GET[
"sort_order"] :
"asc";
237 $defaultOrderColumn =
"name";
238 if ($this->object->getAnonymity()) $defaultOrderColumn =
"counter";
239 $ordercolumn = (
$_GET[
"sort_by"]) ?
$_GET[
"sort_by"] : $defaultOrderColumn;
241 $maxentries = $ilUser->getPref(
"hits_per_page");
247 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
249 $table->setTitle($this->lng->txt(
"participants_evaluation"));
252 $table->enable(
"auto_sort");
253 $table->enable(
"sort");
254 $table->setLimit($maxentries);
256 $header_params = $this->ctrl->getParameterArray($this,
"outEvaluation");
258 $table->setHeaderVars($header_vars, $header_params);
259 $table->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
261 $table->setOffset($offset);
262 $table->setMaxCount(count($total_users));
263 $table->setOrderColumn($ordercolumn);
264 $table->setOrderDirection($orderdirection);
266 $evaluation_rows = array();
268 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
271 $data->setFilter($filterby, $filtertext);
272 $foundParticipants =&
$data->getParticipants();
273 if (count($foundParticipants) == 0)
275 $this->tpl->setVariable(
"EVALUATION_DATA", $this->lng->txt(
"tst_no_evaluation_data"));
277 $additionalFields = $this->
object->getEvaluationAdditionalFields();
279 if ($this->object->ects_output)
281 $passed_array =& $this->
object->getTotalPointsPassedArray();
283 foreach (
$data->getParticipants() as $active_id => $userdata)
288 if ($userdata->getPassed() == FALSE)
296 $evaluationrow = array();
298 if ($this->object->getAnonymity())
300 $fullname = $counter;
301 array_push($evaluationrow, $fullname);
305 array_push($evaluationrow, $userdata->getName());
306 if (strlen($userdata->getLogin()))
308 array_push($evaluationrow,
"[" . $userdata->getLogin() .
"]");
312 array_push($evaluationrow,
"");
315 if (count($additionalFields))
318 foreach ($additionalFields as $fieldname)
320 if (strcmp($fieldname,
"gender") == 0)
322 array_push($evaluationrow, $this->lng->txt(
"gender_" . $userfields[$fieldname]));
326 array_push($evaluationrow, $userfields[$fieldname]);
330 array_push($evaluationrow, $userdata->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " . $userdata->getMaxpoints());
331 $percentage = $userdata->getReachedPointsInPercent();
332 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
333 if (is_object($mark))
335 array_push($evaluationrow, $mark->getShortName());
337 if ($this->object->ects_output)
339 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
340 array_push($evaluationrow, $ects_mark);
342 array_push($evaluationrow, $userdata->getQuestionsWorkedThrough() .
" " . strtolower($this->lng->txt(
"of")) .
" " . $userdata->getNumberOfQuestions() .
" (" . sprintf(
"%2.2f", $userdata->getQuestionsWorkedThroughInPercent()) .
" %" .
")");
344 $time_seconds = $userdata->getTimeOfWork();
345 $time_hours = floor($time_seconds/3600);
346 $time_seconds -= $time_hours * 3600;
347 $time_minutes = floor($time_seconds/60);
348 $time_seconds -= $time_minutes * 60;
349 array_push($evaluationrow, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
350 $this->ctrl->setParameter($this,
"active_id", $active_id);
351 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
352 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
353 array_push($evaluationrow,
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>");
354 array_push($evaluation_rows, $evaluationrow);
358 if (count($foundParticipants) > 0)
360 $table->setData($evaluation_rows);
361 $tableoutput = $table->render();
362 $this->tpl->setVariable(
"EVALUATION_DATA", $tableoutput);
365 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_filter.html", TRUE, TRUE,
"Modules/Test");
366 $filters = array(
"name" => $this->lng->txt(
"name"),
"group" => $this->lng->txt(
"grp"),
"course" => $this->lng->txt(
"crs"));
367 foreach ($filters as $value => $name)
369 $template->setCurrentBlock(
"filterby");
370 $template->setVariable(
"FILTER_BY_NAME", $name);
371 $template->setVariable(
"FILTER_BY_VALUE", $value);
372 if (strcmp($filterby, $value) == 0)
374 $template->setVariable(
"FILTER_BY_SELECTED",
" selected=\"selected\"");
376 $template->parseCurrentBlock();
378 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"outEvaluation"));
379 $template->setVariable(
"TEXT_FILTER_USERS", $this->lng->txt(
"filter"));
380 $template->setVariable(
"TEXT_FILTER", $this->lng->txt(
"set_filter"));
381 $template->setVariable(
"TEXT_BY", $this->lng->txt(
"by"));
382 $template->setVariable(
"TEXT_RESET_FILTER", $this->lng->txt(
"reset_filter"));
383 $template->setVariable(
"TEXT_PASSEDONLY", $this->lng->txt(
"passed_only"));
386 $template->setVariable(
"CHECKED_PASSEDONLY",
" checked=\"checked\"");
388 if (strlen($filtertext) > 0)
390 $template->setVariable(
"VALUE_FILTER_USERS",
" value=\"" . $filtertext .
"\"");
392 $filteroutput = $template->get();
394 if (count($foundParticipants) > 0)
396 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
397 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
398 if (!$this->object->getAnonymity())
400 include_once
"./Modules/Test/classes/class.ilTestCertificate.php";
403 $template->setVariable(
"TEXT_CERTIFICATE", $this->lng->txt(
"exp_type_certificate"));
406 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
407 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
408 $template->setVariable(
"CMD_EXPORT",
"exportEvaluation");
409 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
410 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
411 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
412 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportEvaluation"));
413 $exportoutput = $template->get();
414 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
417 $this->tpl->setVariable(
"EVALUATION_FILTER", $filteroutput);
420 if ($this->object->getShowSolutionAnswersOnly())
437 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
440 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
443 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
445 $active_id =
$_GET[
"active_id"];
446 if (strlen($active_id) == 0)
448 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
449 $this->ctrl->redirect($this,
"outEvaluation");
454 $data =& $this->
object->getCompleteEvaluationData();
455 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
456 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
457 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
458 $data->getParticipant($active_id)->getName())
460 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
461 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
462 $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()) .
" %" .
")");
463 if (strlen(
$data->getParticipant($active_id)->getMark()))
465 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
466 $this->tpl->setVariable(
"VALUE_RESULTSMARKS",
$data->getParticipant($active_id)->getMark());
467 if (strlen(
$data->getParticipant($active_id)->getECTSMark()))
469 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
470 $this->tpl->setVariable(
"VALUE_ECTS",
$data->getParticipant($active_id)->getECTSMark());
473 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
474 $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()) .
" %" .
")");
476 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
477 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
478 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
479 $time_hours = floor($time_seconds/3600);
480 $time_seconds -= $time_hours * 3600;
481 $time_minutes = floor($time_seconds/60);
482 $time_seconds -= $time_minutes * 60;
483 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
484 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
485 $time_hours = floor($atime_seconds/3600);
486 $atime_seconds -= $time_hours * 3600;
487 $time_minutes = floor($atime_seconds/60);
488 $atime_seconds -= $time_minutes * 60;
489 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
490 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
491 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
492 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
496 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
497 #$this->tpl->setVariable("VALUE_LASTVISIT",
498 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
503 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
504 $this->tpl->setVariable(
"VALUE_NROFPASSES",
$data->getParticipant($active_id)->getLastPass() + 1);
505 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
508 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getBestPass() + 1);
512 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getLastPass() + 1);
515 $median =
$data->getStatistics()->getStatistics()->median();
516 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
517 $mark = $this->
object->mark_schema->getMatchingMark($pct);
518 if (is_object($mark))
520 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
521 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
524 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
525 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT",
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
526 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
527 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN",
$data->getStatistics()->getStatistics()->rank_median());
528 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
529 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS",
$data->getStatistics()->getStatistics()->count());
530 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
531 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
535 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
538 $this->tpl->setCurrentBlock(
"question_header");
539 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
540 $this->tpl->parseCurrentBlock();
542 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
544 $this->tpl->setCurrentBlock(
"question_footer");
545 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
546 $this->ctrl->setParameter($this,
"statistics",
"1");
547 $this->ctrl->setParameter($this,
"active_id", $active_id);
548 $this->ctrl->setParameter($this,
"pass",
$pass);
549 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
550 $this->tpl->parseCurrentBlock();
552 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
553 if (!is_array($questions))
555 $questions =
$data->getParticipant($active_id)->getQuestions(0);
558 foreach ($questions as $question)
560 $this->tpl->setCurrentBlock(
"question_row");
561 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
562 $this->tpl->setVariable(
"QUESTION_TITLE",
$data->getQuestionTitle($question[
"id"]));
563 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
564 if (is_array($answeredquestion))
566 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
567 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
571 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
573 $this->tpl->parseCurrentBlock();
576 $this->tpl->touchBlock(
"question_stats");
602 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
606 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
609 $data =& $this->
object->getCompleteEvaluationData();
610 $color_class = array(
"tblrow1",
"tblrow2");
612 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
613 $foundParticipants =&
$data->getParticipants();
614 if (count($foundParticipants))
616 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
617 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
618 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
619 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
620 $template->setVariable(
"CMD_EXPORT",
"exportAggregatedResults");
621 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
622 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
623 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
624 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportAggregatedResults"));
625 $exportoutput = $template->get();
626 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
628 $this->tpl->setCurrentBlock(
"row");
629 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_persons"));
630 $this->tpl->setVariable(
"TXT_VALUE", count($foundParticipants));
631 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
633 $this->tpl->parseCurrentBlock();
634 $this->tpl->setCurrentBlock(
"row");
635 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_finished"));
636 $total_finished = $this->
object->evalTotalFinished();
637 $this->tpl->setVariable(
"TXT_VALUE", $total_finished);
638 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
640 $this->tpl->parseCurrentBlock();
641 $this->tpl->setCurrentBlock(
"row");
642 $average_time = $this->
object->evalTotalStartedAverageTime();
643 $diff_seconds = $average_time;
644 $diff_hours = floor($diff_seconds/3600);
645 $diff_seconds -= $diff_hours * 3600;
646 $diff_minutes = floor($diff_seconds/60);
647 $diff_seconds -= $diff_minutes * 60;
648 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_finished_average_time"));
649 $this->tpl->setVariable(
"TXT_VALUE", sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds));
650 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
653 $total_passed_reached = 0;
654 $total_passed_max = 0;
655 $total_passed_time = 0;
656 foreach ($foundParticipants as $userdata)
658 if ($userdata->getPassed())
661 $total_passed_reached += $userdata->getReached();
662 $total_passed_max += $userdata->getMaxpoints();
663 $total_passed_time += $userdata->getTimeOfWork();
666 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
667 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
668 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
669 $this->tpl->parseCurrentBlock();
670 $this->tpl->setCurrentBlock(
"row");
671 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_passed"));
672 $this->tpl->setVariable(
"TXT_VALUE", $total_passed);
673 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
675 $this->tpl->parseCurrentBlock();
676 $this->tpl->setCurrentBlock(
"row");
677 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_passed_average_points"));
678 $this->tpl->setVariable(
"TXT_VALUE", sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max));
679 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
681 $this->tpl->parseCurrentBlock();
682 $this->tpl->setCurrentBlock(
"row");
683 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"tst_eval_total_passed_average_time"));
684 $average_time = $average_passed_time;
685 $diff_seconds = $average_time;
686 $diff_hours = floor($diff_seconds/3600);
687 $diff_seconds -= $diff_hours * 3600;
688 $diff_minutes = floor($diff_seconds/60);
689 $diff_seconds -= $diff_minutes * 60;
690 $this->tpl->setVariable(
"TXT_VALUE", sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds));
691 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
693 $this->tpl->parseCurrentBlock();
697 $this->tpl->setCurrentBlock(
"emptyrow");
698 $this->tpl->setVariable(
"TXT_NO_ANONYMOUS_AGGREGATION", $this->lng->txt(
"tst_eval_no_anonymous_aggregation"));
699 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
700 $this->tpl->parseCurrentBlock();
704 $maxentries = $ilUser->getPref(
"hits_per_page");
710 $offset = (
$_GET[
"offset"]) ?
$_GET[
"offset"] : 0;
711 $orderdirection = (
$_GET[
"sort_order"]) ?
$_GET[
"sort_order"] :
"asc";
712 $defaultOrderColumn =
"name";
713 if ($this->object->getAnonymity()) $defaultOrderColumn =
"counter";
714 $ordercolumn = (
$_GET[
"sort_by"]) ?
$_GET[
"sort_by"] : $defaultOrderColumn;
717 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
719 $table->setTitle($this->lng->txt(
"average_reached_points"));
720 $table->setHeaderNames(array($this->lng->txt(
"question_title"), $this->lng->txt(
"points"), $this->lng->txt(
"percentage"), $this->lng->txt(
"number_of_answers")));
722 $table->enable(
"auto_sort");
723 $table->enable(
"sort");
724 $table->setLimit($maxentries);
726 $header_params = $this->ctrl->getParameterArray($this,
"eval_a");
727 $header_vars = array(
"question_title",
"points",
"percentage",
"number_of_answers");
728 $table->setHeaderVars($header_vars, $header_params);
729 $table->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
731 $table->setOffset($offset);
732 $table->setMaxCount(count(
$data->getQuestionTitles()));
733 $table->setOrderColumn($ordercolumn);
734 $table->setOrderDirection($orderdirection);
736 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
741 foreach ($foundParticipants as $userdata)
743 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
745 if (is_object($userdata->getPass($i)))
747 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
748 if (is_array($question))
751 $reached += $question[
"reached"];
752 $max += $question[
"points"];
757 $percent = $max ? $reached/$max * 100.0 : 0;
759 $this->ctrl->setParameter($this,
"qid", $question_id);
763 sprintf(
"%.2f", $answered ? $reached / $answered : 0) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%.2f", $answered ? $max / $answered : 0),
764 sprintf(
"%.2f", $percent) .
"%",
769 $table->setData($rows);
770 $tableoutput = $table->render();
771 $this->tpl->setVariable(
"TBL_AVG_REACHED", $tableoutput);
773 $this->tpl->setCurrentBlock(
"adm_content");
774 $this->tpl->setVariable(
"TXT_ANON_EVAL", $this->lng->txt(
"tst_anon_eval"));
775 $this->tpl->setVariable(
"TXT_RESULT", $this->lng->txt(
"result"));
776 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"value"));
777 $this->tpl->setVariable(
"TXT_AVG_REACHED", $this->lng->txt(
"average_reached_points"));
778 $this->tpl->setVariable(
"TXT_QUESTIONTITLE", $this->lng->txt(
"question_title"));
779 $this->tpl->setVariable(
"TXT_POINTS", $this->lng->txt(
"points"));
780 $this->tpl->setVariable(
"TXT_ANSWERS", $this->lng->txt(
"number_of_answers"));
781 $this->tpl->setVariable(
"TXT_PERCENT", $this->lng->txt(
"percentage"));
782 $this->tpl->parseCurrentBlock();
795 if (array_key_exists(
"g_filterby",
$_GET))
797 $filterby =
$_GET[
"g_filterby"];
800 if (array_key_exists(
"g_userfilter",
$_GET))
802 $filtertext =
$_GET[
"g_userfilter"];
805 if (array_key_exists(
"g_passedonly",
$_GET))
807 if (
$_GET[
"g_passedonly"] == 1)
812 switch ($_POST[
"export_type"])
815 include_once
"./Modules/Test/classes/class.ilTestExport.php";
816 $exportObj =
new ilTestExport($this->
object,
"results");
817 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
820 include_once
"./Modules/Test/classes/class.ilTestExport.php";
821 $exportObj =
new ilTestExport($this->
object,
"results");
822 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
827 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
829 if (strlen($filtertext))
831 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
833 $this->ctrl->redirectByClass(
"iltestcertificategui",
"exportCertificate");
845 switch ($_POST[
"export_type"])
848 include_once
"./Modules/Test/classes/class.ilTestExport.php";
849 $exportObj =
new ilTestExport($this->
object,
"aggregated");
850 $exportObj->exportToExcel($deliver = TRUE);
853 include_once
"./Modules/Test/classes/class.ilTestExport.php";
854 $exportObj =
new ilTestExport($this->
object,
"aggregated");
855 $exportObj->exportToCSV($deliver = TRUE);
868 if ($original_id > 0)
881 $additionalFields = array();
882 foreach (
$results as $key => $value)
884 if (preg_match(
"/cb_(\w+)/", $key, $matches) && ($value == 1))
886 array_push($additionalFields, $matches[1]);
889 $this->
object->setEvaluationAdditionalFields($additionalFields);
891 $this->ctrl->redirect($this,
"evalSettings");
898 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
902 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
905 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
907 $form->setFormAction($this->ctrl->getFormAction($this,
"saveEvalSettings"));
908 $form->setTitle($this->lng->txt(
"assessment_eval_settings"));
911 $fields = array(
"gender",
"email",
"institution",
"street",
"city",
"zipcode",
"country",
"department",
"matriculation");
912 $additionalFields = $this->
object->getEvaluationAdditionalFields();
914 foreach ($fields as $dbfield)
918 if ($this->object->getAnonymity())
924 if (in_array($dbfield, $additionalFields)) $checkbox->setChecked(TRUE);
926 $form->addItem($checkbox);
928 $form->addCommandButton(
"saveEvalSettings", $this->lng->txt(
"save"));
930 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
944 $this->ctrl->saveParameter($this,
"pass");
945 $this->ctrl->saveParameter($this,
"active_id");
946 $active_id =
$_GET[
"active_id"];
948 $result_array =& $this->
object->getTestResult($active_id,
$pass);
953 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
955 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
957 if ((strlen($ilias->getSetting(
"rpc_server_host"))) && (strlen($ilias->getSetting(
"rpc_server_port"))))
959 $this->ctrl->setParameter($this,
"pdf",
"1");
960 $template->setCurrentBlock(
"pdf_export");
961 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
962 $this->ctrl->setParameter($this,
"pdf",
"");
963 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
964 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
966 $template->parseCurrentBlock();
969 if (array_key_exists(
"statistics",
$_GET) && (
$_GET[
"statistics"] == 1))
971 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
972 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
973 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilTestEvaluationGUI",
"detailedEvaluation"));
977 if ($this->object->getNrOfTries() == 1)
979 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
980 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
984 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outParticipantsResultsOverview"));
985 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
988 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
989 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
991 if ($this->object->getNrOfTries() == 1)
994 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
995 if (strlen($statement[
"markects"]))
997 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1003 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1004 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1005 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1006 $template->setVariable(
"PASS_DETAILS", $overview);
1007 $template->setVariable(
"USER_DETAILS", $user_data);
1008 $uname = $this->
object->userLookupFullName($user_id);
1009 $template->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1012 if ($this->object->getShowSolutionAnswersOnly())
1017 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1019 $printbody =
new ilTemplate(
"tpl.il_as_tst_print_body.html", TRUE, TRUE,
"Modules/Test");
1021 $printbody->setVariable(
"ADM_CONTENT", $template->get());
1022 $printoutput = $printbody->get();
1023 $printoutput = preg_replace(
"/href=\".*?\"/",
"", $printoutput);
1024 $fo = $this->
object->processPrintoutput2FO($printoutput);
1025 $this->
object->deliverPDFfromFO($fo);
1029 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1044 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
1046 $active_id =
$_GET[
"active_id"];
1047 if ($this->object->getNrOfTries() == 1)
1049 $this->ctrl->setParameter($this,
"active_id", $active_id);
1051 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
1054 if ((strlen($ilias->getSetting(
"rpc_server_host"))) && (strlen($ilias->getSetting(
"rpc_server_port"))))
1056 $this->ctrl->setParameter($this,
"pdf",
"1");
1057 $template->setCurrentBlock(
"pdf_export");
1058 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsResultsOverview"));
1059 $this->ctrl->setParameter($this,
"pdf",
"");
1060 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
1061 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
1063 $template->parseCurrentBlock();
1066 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outParticipantsPassDetails");
1067 $template->setVariable(
"PASS_OVERVIEW", $overview);
1068 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1069 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
1070 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
1071 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1072 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1074 $result_pass = $this->
object->_getResultPass($active_id);
1075 $result_array =& $this->
object->getTestResult($active_id, $result_pass);
1077 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1079 $template->setVariable(
"USER_DATA", $user_data);
1080 $template->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"tst_results_overview"));
1081 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
1082 if (strlen($statement[
"markects"]))
1084 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1086 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1087 $template->parseCurrentBlock();
1090 if ($this->object->getShowSolutionAnswersOnly())
1095 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1097 $printbody =
new ilTemplate(
"tpl.il_as_tst_print_body.html", TRUE, TRUE,
"Modules/Test");
1099 $printbody->setVariable(
"ADM_CONTENT", $template->get());
1100 $printoutput = $printbody->get();
1101 $printoutput = preg_replace(
"/href=\".*?\"/",
"", $printoutput);
1102 $fo = $this->
object->processPrintoutput2FO($printoutput);
1103 $this->
object->deliverPDFfromFO($fo);
1107 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1120 $this->ctrl->saveParameter($this,
"pass");
1121 $this->ctrl->saveParameter($this,
"active_id");
1122 $active_id =
$_GET[
"active_id"];
1124 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1126 $command_solution_details =
"";
1127 if ($this->object->getShowSolutionDetails())
1129 $command_solution_details =
"outCorrectSolution";
1131 $overview = $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserPassDetails", $command_solution_details);
1133 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1135 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_pass_details_overview_participants.html",
"Modules/Test");
1137 if ($this->object->getNrOfTries() == 1)
1139 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1140 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1144 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outUserResultsOverview"));
1145 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
1148 $this->tpl->parseCurrentBlock();
1150 if ($this->object->getNrOfTries() == 1)
1153 $this->tpl->setVariable(
"USER_MARK", $statement[
"mark"]);
1154 if (strlen($statement[
"markects"]))
1156 $this->tpl->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1162 $this->tpl->setCurrentBlock(
"adm_content");
1163 $this->tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1164 $this->tpl->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1165 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1166 $this->tpl->setVariable(
"PASS_DETAILS", $overview);
1167 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1168 $this->tpl->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1169 $this->tpl->parseCurrentBlock();
1172 if ($this->object->getShowSolutionAnswersOnly())
1189 if (!$this->object->canShowTestResults($ilUser->getId())) $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1190 include_once(
"./classes/class.ilTemplate.php");
1191 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1192 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1195 $user_id = $ilUser->getId();
1196 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1197 $active_id = $this->
object->getTestSession()->getActiveId();
1198 $hide_details = !$this->
object->getShowPassDetails();
1201 $executable = $this->
object->isExecutable($ilUser->getId());
1202 if (!$executable[
"executable"]) $hide_details = FALSE;
1204 if (($this->object->getNrOfTries() == 1) && (!$hide_details))
1210 $template->setCurrentBlock(
"pass_overview");
1211 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserResultsOverview", FALSE, $hide_details);
1212 $template->setVariable(
"PASS_OVERVIEW", $overview);
1213 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results_overview"));
1214 $template->parseCurrentBlock();
1217 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
1222 if ((strlen($ilias->getSetting(
"rpc_server_host"))) && (strlen($ilias->getSetting(
"rpc_server_port"))))
1224 $this->ctrl->setParameter($this,
"pass",
$pass);
1225 $this->ctrl->setParameter($this,
"pdf",
"1");
1226 $templatehead->setCurrentBlock(
"pdf_export");
1227 $templatehead->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1228 $this->ctrl->setParameter($this,
"pass",
"");
1229 $this->ctrl->setParameter($this,
"pdf",
"");
1230 $templatehead->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
1231 $templatehead->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
1233 $templatehead->parseCurrentBlock();
1234 if ($this->object->canShowCertificate($user_id, $active_id))
1236 $templatehead->setVariable(
"CERTIFICATE_URL", $this->ctrl->getLinkTargetByClass(
"iltestcertificategui",
"outCertificate"));
1237 $templatehead->setVariable(
"CERTIFICATE_TEXT", $this->lng->txt(
"certificate"));
1240 $templatehead->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1241 $templatehead->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1242 $templatehead->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1243 $templatehead->setVariable(
"PRINT_URL",
"javascript:window.print();");
1245 $result_pass = $this->
object->_getResultPass($active_id);
1246 $result_array =& $this->
object->getTestResult($active_id, $result_pass);
1251 $this->ctrl->saveParameter($this,
"pass");
1252 $this->ctrl->saveParameter($this,
"active_id");
1253 if (!is_null(
$pass))
1255 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1256 $command_solution_details =
"";
1257 if ($this->object->getShowSolutionDetails())
1259 $command_solution_details =
"outCorrectSolution";
1261 $detailsoverview = (!$hide_details) ? $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserResultsOverview", $command_solution_details) :
'';
1263 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1265 if (!$hide_details && $this->object->canShowSolutionPrintview())
1270 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1271 $template->setVariable(
"PASS_RESULTS_OVERVIEW", sprintf($this->lng->txt(
"tst_results_overview_pass"),
$pass + 1));
1272 $template->setVariable(
"PASS_DETAILS", $detailsoverview);
1275 $template->setVariable(
"SIGNATURE", $signature);
1277 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1278 $template->setVariable(
"USER_DATA", $user_data);
1279 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
1280 if (strlen($statement[
"markects"]))
1282 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1284 $template->parseCurrentBlock();
1287 if ($this->object->getShowSolutionAnswersOnly())
1291 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1293 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1295 $printbody =
new ilTemplate(
"tpl.il_as_tst_print_body.html", TRUE, TRUE,
"Modules/Test");
1296 $printbody->setVariable(
"TITLE", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1297 $printbody->setVariable(
"ADM_CONTENT", $template->get());
1298 $printoutput = $printbody->get();
1299 $printoutput = preg_replace(
"/href=\".*?\"/",
"", $printoutput);
1300 $fo = $this->
object->processPrintoutput2FO($printoutput);
1301 $this->
object->deliverPDFfromFO($fo);
1305 $this->tpl->setVariable(
"PRINT_CONTENT", $templatehead->get());
1320 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1323 if (array_key_exists(
"pass",
$_GET))
1327 $user_id = $ilUser->getId();
1328 $active_id = $this->
object->getTestSession()->getActiveId();
1330 if ($this->object->getNrOfTries() == 1)
1336 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserListOfAnswerPasses", TRUE);
1337 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1338 $template->setVariable(
"PASS_OVERVIEW", $overview);
1345 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1346 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1347 $showAllAnswers = TRUE;
1348 if ($this->object->isExecutable($user_id))
1350 $showAllAnswers = FALSE;
1353 $template->setVariable(
"PASS_DETAILS", $answers);
1355 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1356 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1357 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1358 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1359 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1362 $template->setVariable(
"USER_DATA", $user_data);
1363 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1364 if (strlen($signature))
1366 $template->setVariable(
"SIGNATURE", $signature);
1368 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1371 if ($this->object->getShowSolutionAnswersOnly())
1386 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1388 $this->ctrl->saveParameter($this,
"pass");
1389 $this->ctrl->saveParameter($this,
"active_id");
1390 $this->outTestResults(
false,
$_GET[
"pass"]);
1394 $this->outTestResults(
false);
1405 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1407 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1408 $this->tpl->setCurrentBlock(
"ContentStyle");
1410 $this->tpl->parseCurrentBlock();
1412 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1414 $this->tpl->parseCurrentBlock();
1417 if ($this->object->getShowSolutionAnswersOnly())
1422 $this->tpl->setCurrentBlock(
"adm_content");
1424 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1425 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1426 $this->ctrl->saveParameter($this,
"pass");
1427 $this->ctrl->saveParameter($this,
"active_id");
1428 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1429 $this->tpl->parseCurrentBlock();
1441 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1445 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1448 $data =& $this->
object->getCompleteEvaluationData();
1449 $color_class = array(
"tblrow1",
"tblrow2");
1451 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1452 $foundParticipants =&
$data->getParticipants();
1453 if (count($foundParticipants) == 0)
1455 $this->tpl->setCurrentBlock(
"no_participants");
1456 $this->tpl->setVariable(
"NO_PARTICIPANTS", $this->lng->txt(
"tst_no_evaluation_data"));
1457 $this->tpl->parseCurrentBlock();
1458 $this->tpl->setVariable(
"TXT_SINGLE_ANSWERS", $this->lng->txt(
"tst_answered_questions"));
1461 $this->tpl->setVariable(
"TXT_SINGLE_ANSWERS", $this->lng->txt(
"tst_answered_questions"));
1464 $maxentries = $ilUser->getPref(
"hits_per_page");
1465 if ($maxentries < 1)
1470 $offset = (
$_GET[
"offset"]) ?
$_GET[
"offset"] : 0;
1471 $orderdirection = (
$_GET[
"sort_order"]) ?
$_GET[
"sort_order"] :
"asc";
1472 $defaultOrderColumn =
"name";
1473 if ($this->object->getAnonymity()) $defaultOrderColumn =
"counter";
1474 $ordercolumn = (
$_GET[
"sort_by"]) ?
$_GET[
"sort_by"] : $defaultOrderColumn;
1477 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
1479 $table->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1480 $table->setHeaderNames(array($this->lng->txt(
"question_title"), $this->lng->txt(
"number_of_answers"), $this->lng->txt(
"output")));
1482 $table->enable(
"auto_sort");
1483 $table->enable(
"sort");
1484 $table->setLimit($maxentries);
1486 $header_params = $this->ctrl->getParameterArray($this,
"singleResults");
1487 $header_vars = array(
"question_title",
"number_of_answers",
"export");
1488 $table->setHeaderVars($header_vars, $header_params);
1489 $table->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
1491 $table->setOffset($offset);
1492 $table->setMaxCount(count(
$data->getQuestionTitles()));
1493 $table->setOrderColumn($ordercolumn);
1494 $table->setOrderDirection($orderdirection);
1496 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
1501 foreach ($foundParticipants as $userdata)
1503 $pass = $userdata->getScoredPass();
1504 if (is_object($userdata->getPass(
$pass)))
1506 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1507 if (is_array($question))
1514 $this->ctrl->setParameter($this,
"qid", $question_id);
1519 "<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants").
"\">" . $this->lng->txt(
"pdf_export") .
"</a>"
1523 $table->setData($rows);
1524 $tableoutput = $table->render();
1525 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $tableoutput);