4require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
5require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
38 parent::ilTestServiceGUI($a_object);
46 $cmd = $this->ctrl->getCmd();
47 $next_class = $this->ctrl->getNextClass($this);
48 $this->ctrl->saveParameter($this,
"sequence");
49 $this->ctrl->saveParameter($this,
"active_id");
53 case 'iltestpassdetailsoverviewtablegui':
54 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
57 $tableGUI->initFilter();
58 $this->ctrl->forwardCommand($tableGUI);
70 $headernames = array();
71 if ($this->object->getAnonymity())
73 array_push($headernames, $this->lng->txt(
"counter"));
77 array_push($headernames, $this->lng->txt(
"name"));
78 array_push($headernames, $this->lng->txt(
"login"));
80 $additionalFields = $this->
object->getEvaluationAdditionalFields();
81 if (count($additionalFields))
83 foreach ($additionalFields as $fieldname)
85 array_push($headernames, $this->lng->txt($fieldname));
88 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
89 array_push($headernames, $this->lng->txt(
"tst_mark"));
90 if ($this->object->getECTSOutput())
92 array_push($headernames, $this->lng->txt(
"ects_grade"));
94 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
95 array_push($headernames, $this->lng->txt(
"working_time"));
96 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
102 $headervars = array();
103 if ($this->object->getAnonymity())
105 array_push($headervars,
"counter");
109 array_push($headervars,
"name");
110 array_push($headervars,
"login");
112 array_push($headervars,
"resultspoints");
113 array_push($headervars,
"resultsmarks");
114 if ($this->object->getECTSOutput())
116 array_push($headervars,
"ects_grade");
118 array_push($headervars,
"qworkedthrough");
119 array_push($headervars,
"timeofwork");
120 array_push($headervars,
"");
126 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
128 $table_gui->writeFilterToSession();
129 $this->ctrl->redirect($this,
"outEvaluation");
134 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
136 $table_gui->resetFilter();
137 $this->ctrl->redirect($this,
"outEvaluation");
145 function outEvaluation()
151 global $ilAccess, $ilToolbar;
153 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
157 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
160 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
163 $this,
'outEvaluation', $this->object->getAnonymity(), $this->object->isOfferingQuestionHintsEnabled()
167 $arrFilter = array();
169 foreach ($table_gui->getFilterItems() as $item)
171 if ($item->getValue() !==
false)
173 switch ($item->getPostVar())
178 $arrFilter[$item->getPostVar()] = $item->getValue();
181 $passedonly = $item->getChecked();
186 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
188 $eval->setFilterArray($arrFilter);
189 $foundParticipants =& $eval->getParticipants();
191 if (count($foundParticipants) > 0)
193 if ($this->object->getECTSOutput())
195 $passed_array =& $this->
object->getTotalPointsPassedArray();
197 foreach ($foundParticipants as $active_id => $userdata)
204 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
206 if( $mark_obj->getPassed() == FALSE || !$userdata->areObligationsAnswered() )
214 $evaluationrow = array();
215 if ($this->object->getAnonymity())
217 $evaluationrow[
'name'] = $counter;
218 $evaluationrow[
'login'] =
'';
222 $evaluationrow[
'name'] = $userdata->getName();
223 if (strlen($userdata->getLogin()))
225 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
229 $evaluationrow[
'login'] =
'';
233 $evaluationrow[
'reached'] = $userdata->getReached();
234 $evaluationrow[
'max'] = $userdata->getMaxpoints();
235 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
236 $percentage = $userdata->getReachedPointsInPercent();
237 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
238 if (is_object($mark))
240 $evaluationrow[
'mark'] = $mark->getShortName();
242 if ($this->object->getECTSOutput())
244 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
245 $evaluationrow[
'ects_grade'] = $ects_mark;
247 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
248 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
249 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
250 $time_seconds = $userdata->getTimeOfWork();
251 $time_hours = floor($time_seconds/3600);
252 $time_seconds -= $time_hours * 3600;
253 $time_minutes = floor($time_seconds/60);
254 $time_seconds -= $time_minutes * 60;
255 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
256 $this->ctrl->setParameter($this,
"active_id", $active_id);
257 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
258 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
259 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
261 $evaluationrow[
'gender'] = $userfields[
'gender'];
262 $evaluationrow[
'email'] = $userfields[
'email'];
263 $evaluationrow[
'institution'] = $userfields[
'institution'];
264 $evaluationrow[
'street'] = $userfields[
'street'];
265 $evaluationrow[
'city'] = $userfields[
'city'];
266 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
267 $evaluationrow[
'country'] = $userfields[
'country'];
268 $evaluationrow[
'sel_country'] = $userfields[
'sel_country'];
269 $evaluationrow[
'department'] = $userfields[
'department'];
270 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
272 $data[] = $evaluationrow;
277 $table_gui->setData(
$data);
278 if(count($foundParticipants) > 0)
280 $ilToolbar->setFormName(
'form_output_eval');
281 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportEvaluation'));
282 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
283 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
285 'excel' => $this->lng->txt(
'exp_type_excel'),
286 'csv' => $this->lng->txt(
'exp_type_spss')
289 if(!$this->object->getAnonymity())
291 include_once
'Services/Certificate/classes/class.ilCertificate.php';
292 include_once
'Modules/Test/classes/class.ilTestCertificateAdapter.php';
295 $options[
'certificate'] = $this->lng->txt(
'exp_type_certificate');
301 $ilToolbar->addInputItem($export_type,
true);
302 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
304 $button->setCommand(
'exportEvaluation');
305 $button->setCaption(
'export');
306 $button->getOmitPreventDoubleSubmission();
307 $ilToolbar->addButtonInstance($button);
311 if ($this->object->getShowSolutionAnswersOnly())
316 $this->tpl->setContent($table_gui->getHTML());
330 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
333 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
336 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
338 $active_id =
$_GET[
"active_id"];
339 if (strlen($active_id) == 0)
341 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
342 $this->ctrl->redirect($this,
"outEvaluation");
347 $data =& $this->
object->getCompleteEvaluationData();
348 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
349 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
350 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
351 $data->getParticipant($active_id)->getName())
353 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
354 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
355 $this->tpl->setVariable(
"VALUE_RESULTSPOINTS",
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")");
356 if (strlen(
$data->getParticipant($active_id)->getMark()))
358 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
359 $this->tpl->setVariable(
"VALUE_RESULTSMARKS",
$data->getParticipant($active_id)->getMark());
360 if (strlen(
$data->getParticipant($active_id)->getECTSMark()))
362 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
363 $this->tpl->setVariable(
"VALUE_ECTS",
$data->getParticipant($active_id)->getECTSMark());
367 if( $this->object->isOfferingQuestionHintsEnabled() )
369 $this->tpl->setVariable(
"TXT_REQUESTED_HINTS_COUNT", $this->lng->txt(
"tst_question_hints_requested_hint_count_header"));
370 $this->tpl->setVariable(
"VALUE_REQUESTED_HINTS_COUNT",
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
373 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
374 $this->tpl->setVariable(
"VALUE_QWORKEDTHROUGH",
$data->getParticipant($active_id)->getQuestionsWorkedThrough() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getNumberOfQuestions() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent()) .
" %" .
")");
376 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
377 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
378 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
379 $time_hours = floor($time_seconds/3600);
380 $time_seconds -= $time_hours * 3600;
381 $time_minutes = floor($time_seconds/60);
382 $time_seconds -= $time_minutes * 60;
383 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
384 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
385 $time_hours = floor($atime_seconds/3600);
386 $atime_seconds -= $time_hours * 3600;
387 $time_minutes = floor($atime_seconds/60);
388 $atime_seconds -= $time_minutes * 60;
389 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
390 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
391 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
392 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
396 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
397 #$this->tpl->setVariable("VALUE_LASTVISIT",
398 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
403 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
404 $this->tpl->setVariable(
"VALUE_NROFPASSES",
$data->getParticipant($active_id)->getLastPass() + 1);
405 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
408 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getBestPass() + 1);
412 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getLastPass() + 1);
415 $median =
$data->getStatistics()->getStatistics()->median();
416 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
417 $mark = $this->
object->mark_schema->getMatchingMark($pct);
418 if (is_object($mark))
420 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
421 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
424 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
425 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT",
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
426 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
427 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN",
$data->getStatistics()->getStatistics()->rank_median());
428 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
429 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS",
$data->getStatistics()->getStatistics()->count());
430 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
431 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
435 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
438 $this->tpl->setCurrentBlock(
"question_header");
439 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
440 $this->tpl->parseCurrentBlock();
442 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
444 $this->tpl->setCurrentBlock(
"question_footer");
445 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
446 $this->ctrl->setParameter($this,
"statistics",
"1");
447 $this->ctrl->setParameter($this,
"active_id", $active_id);
448 $this->ctrl->setParameter($this,
"pass",
$pass);
449 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
450 $this->tpl->parseCurrentBlock();
452 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
453 if (!is_array($questions))
455 $questions =
$data->getParticipant($active_id)->getQuestions(0);
458 foreach ((array)$questions as $question)
460 $this->tpl->setCurrentBlock(
"question_row");
461 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
462 $this->tpl->setVariable(
"QUESTION_ID", $question[
"id"]);
463 $this->tpl->setVariable(
"QUESTION_ID_TXT", $this->lng->txt(
'question_id_short'));
464 $this->tpl->setVariable(
"QUESTION_TITLE",
$data->getQuestionTitle($question[
"id"]));
465 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
466 if (is_array($answeredquestion))
468 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
469 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
473 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
475 $this->tpl->parseCurrentBlock();
478 $this->tpl->touchBlock(
"question_stats");
498 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
502 $question_object->deliverFileUploadZIPFile($this->object->getTestId(), $this->object->getTitle());
506 $this->ctrl->redirect($this,
"singleResults");
523 global $ilAccess, $ilToolbar;
525 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
529 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
532 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
533 $eval =& $this->
object->getCompleteEvaluationData();
535 $foundParticipants =& $eval->getParticipants();
536 if (count($foundParticipants))
538 $ilToolbar->setFormName(
'form_output_eval');
539 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportAggregatedResults'));
540 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
541 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
542 $export_type->setOptions(array(
543 'excel' => $this->lng->txt(
'exp_type_excel'),
544 'csv' => $this->lng->txt(
'exp_type_spss')
546 $ilToolbar->addInputItem($export_type,
true);
547 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
549 $button->setCommand(
'exportAggregatedResults');
550 $button->setCaption(
'export');
551 $button->getOmitPreventDoubleSubmission();
552 $ilToolbar->addButtonInstance($button);
554 array_push(
$data, array(
555 'result' => $this->lng->txt(
"tst_eval_total_persons"),
556 'value' => count($foundParticipants)
558 $total_finished = $this->
object->evalTotalFinished();
559 array_push(
$data, array(
560 'result' => $this->lng->txt(
"tst_eval_total_finished"),
561 'value' => $total_finished
563 $average_time = $this->
object->evalTotalStartedAverageTime();
564 $diff_seconds = $average_time;
565 $diff_hours = floor($diff_seconds/3600);
566 $diff_seconds -= $diff_hours * 3600;
567 $diff_minutes = floor($diff_seconds/60);
568 $diff_seconds -= $diff_minutes * 60;
569 array_push(
$data, array(
570 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
571 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
574 $total_passed_reached = 0;
575 $total_passed_max = 0;
576 $total_passed_time = 0;
577 foreach ($foundParticipants as $userdata)
579 if ($userdata->getPassed())
582 $total_passed_reached += $userdata->getReached();
583 $total_passed_max += $userdata->getMaxpoints();
584 $total_passed_time += $userdata->getTimeOfWork();
587 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
588 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
589 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
590 array_push(
$data, array(
591 'result' => $this->lng->txt(
"tst_eval_total_passed"),
592 'value' => $total_passed
594 array_push(
$data, array(
595 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
596 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
598 $average_time = $average_passed_time;
599 $diff_seconds = $average_time;
600 $diff_hours = floor($diff_seconds/3600);
601 $diff_seconds -= $diff_hours * 3600;
602 $diff_minutes = floor($diff_seconds/60);
603 $diff_seconds -= $diff_minutes * 60;
604 array_push(
$data, array(
605 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
606 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
610 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
612 $table_gui->setData(
$data);
613 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
616 foreach ($eval->getQuestionTitles() as $question_id => $question_title)
621 foreach ($foundParticipants as $userdata)
623 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
625 if (is_object($userdata->getPass($i)))
627 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
628 if (is_array($question))
631 $reached += $question[
"reached"];
632 $max += $question[
"points"];
637 $percent = $max ? $reached/$max * 100.0 : 0;
639 $this->ctrl->setParameter($this,
"qid", $question_id);
641 $points_reached = ($answered ? $reached / $answered : 0);
642 $points_max = ($answered ? $max / $answered : 0);
645 'qid' => $question_id,
646 'title' => $question_title,
647 'points' => $points_reached,
648 'points_reached' => $points_reached,
649 'points_max' => $points_max,
650 'percentage' => (
float)$percent,
651 'answers' => $answered
655 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
657 $table_gui->setData($rows);
658 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
667 if (array_key_exists(
"g_filterby",
$_GET))
669 $filterby =
$_GET[
"g_filterby"];
673 if (array_key_exists(
"g_userfilter",
$_GET))
675 $filtertext =
$_GET[
"g_userfilter"];
679 if (array_key_exists(
"g_passedonly",
$_GET))
681 if (
$_GET[
"g_passedonly"] == 1)
687 switch (
$_POST[
"export_type"])
690 require_once
'./Modules/Test/classes/class.ilTestExport.php';
691 $exportObj =
new ilTestExport($this->
object,
"results");
692 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
696 require_once
'./Modules/Test/classes/class.ilTestExport.php';
697 $exportObj =
new ilTestExport($this->
object,
"results");
698 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
704 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
706 if (strlen($filtertext))
708 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
710 $this->ctrl->redirect($this,
"exportCertificate");
722 switch (
$_POST[
"export_type"])
725 include_once
"./Modules/Test/classes/class.ilTestExport.php";
726 $exportObj =
new ilTestExport($this->
object,
"aggregated");
727 $exportObj->exportToExcel($deliver = TRUE);
730 include_once
"./Modules/Test/classes/class.ilTestExport.php";
731 $exportObj =
new ilTestExport($this->
object,
"aggregated");
732 $exportObj->exportToCSV($deliver = TRUE);
747 include_once
"./Services/Utilities/classes/class.ilUtil.php";
748 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
749 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
752 $total_users = array();
753 $total_users =& $this->
object->evalTotalPersonsArray();
754 if (count($total_users))
756 foreach ($total_users as $active_id => $name)
758 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
761 "active_id" => $active_id,
762 "userfilter" => $userfilter,
763 "passedonly" => $passedonly
772 $zipArchive =
$certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
785 if ($original_id > 0)
804 global $ilTabs, $ilAccess, $ilObjDataCache;
806 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
810 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
813 $this->ctrl->saveParameter($this,
"active_id");
814 $active_id = (int)
$_GET[
"active_id"];
815 $testSession = $this->testSessionFactory->getSession($active_id);
818 if( $testSession->getTestId() != $this->
object->getTestId() )
821 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
824 $this->ctrl->saveParameter($this,
"pass");
827 if ( isset(
$_GET[
'statistics']) &&
$_GET[
'statistics'] == 1)
829 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
830 $this->ctrl->saveParameter($this,
'statistics');
832 $ilTabs->setBackTarget(
833 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
836 elseif ($this->object->getNrOfTries() == 1)
838 $ilTabs->setBackTarget(
839 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
844 $ilTabs->setBackTarget(
845 $this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
849 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
852 $objectivesList =
null;
856 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
857 $testSequence->loadFromDb();
858 $testSequence->loadQuestions();
860 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
864 $objectivesList->loadObjectivesTitles();
866 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
867 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
868 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
869 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
870 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
873 $result_array = $this->
object->getTestResult(
878 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
880 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
882 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
886 $this->ctrl->setParameter($this,
'pdf',
'1');
887 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails') );
888 $this->ctrl->setParameter($this,
'pdf',
'');
890 if( isset(
$_GET[
'show_best_solutions']) )
892 $_SESSION[
'tst_results_show_best_solutions'] =
true;
894 elseif( isset(
$_GET[
'hide_best_solutions']) )
896 $_SESSION[
'tst_results_show_best_solutions'] =
false;
898 elseif( !isset(
$_SESSION[
'tst_results_show_best_solutions']) )
900 $_SESSION[
'tst_results_show_best_solutions'] =
false;
903 if(
$_SESSION[
'tst_results_show_best_solutions'] )
905 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
906 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
907 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
911 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
912 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
913 $this->ctrl->setParameter($this,
'show_best_solutions',
'');
917 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
922 $gradingMessageBuilder->buildList();
924 $template->setCurrentBlock(
'grading_message');
925 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
926 $template->parseCurrentBlock();
929 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder);
930 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
931 $template->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
935 $template->setVariable(
"USER_DATA", $user_data);
937 $uname = $this->
object->userLookupFullName($user_id);
938 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
940 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
943 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
948 if ($this->object->getShowSolutionAnswersOnly())
956 require_once
'class.ilTestPDFGenerator.php';
961 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
972 global $ilTabs, $ilAccess, $ilObjDataCache;
974 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
978 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
981 $active_id = (int)
$_GET[
"active_id"];
982 $testSession = $this->testSessionFactory->getSession($active_id);
985 if( $testSession->getTestId() != $this->
object->getTestId() )
988 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
991 if ($this->object->getNrOfTries() == 1)
993 $this->ctrl->setParameter($this,
"active_id", $active_id);
995 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
998 $ilTabs->setBackTarget(
999 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
1002 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
1006 $this->ctrl->setParameter($this,
'pdf',
'1');
1007 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, __FUNCTION__) );
1008 $this->ctrl->setParameter($this,
'pdf',
'');
1011 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1013 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1017 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1018 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1019 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1020 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1021 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1024 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1026 $testPassesSelector->setActiveId($testSession->getActiveId());
1027 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1030 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1031 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1032 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1033 $passOverViewTableGUI->init();
1034 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true));
1035 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1036 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1041 $gradingMessageBuilder->buildList();
1043 $template->setCurrentBlock(
'grading_message');
1044 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1045 $template->parseCurrentBlock();
1049 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1053 if ($this->object->getAnonymity())
1055 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1059 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1060 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1061 $template->setVariable(
"USER_DATA", $user_data);
1065 $template->parseCurrentBlock();
1069 if ($this->object->getShowSolutionAnswersOnly())
1074 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1079 $filename = $name[
'lastname'] .
'_' . $name[
'firstname'] .
'_' . $name[
'login'] .
'__'. $this->
object->getTitle();
1080 require_once
'class.ilTestPDFGenerator.php';
1087 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1094 $tableGUI->initFilter();
1095 $tableGUI->resetOffset();
1096 $tableGUI->writeFilterToSession();
1103 $tableGUI->initFilter();
1104 $tableGUI->resetOffset();
1105 $tableGUI->resetFilter();
1116 global $ilTabs,
$ilUser, $ilObjDataCache;
1120 if ($this->object->getNrOfTries() == 1)
1122 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen'));
1126 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1129 $testSession = $this->testSessionFactory->getSession();
1131 if( !$this->object->getShowPassDetails() )
1133 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1135 #if($executable["executable"])
1137 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1141 $active_id = $testSession->getActiveId();
1142 $user_id = $testSession->getUserId();
1144 $this->ctrl->saveParameter($this,
"pass");
1147 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1150 $objectivesList =
null;
1152 $considerHiddenQuestions =
true;
1153 $considerOptionalQuestions =
true;
1157 $considerHiddenQuestions =
false;
1159 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1160 $testSequence->loadFromDb();
1161 $testSequence->loadQuestions();
1163 if( $this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed() )
1165 $considerOptionalQuestions =
false;
1168 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1172 $objectivesList->loadObjectivesTitles();
1174 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1175 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1176 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1177 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1178 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1183 $command_solution_details =
"";
1184 if ($this->object->getShowSolutionDetails())
1186 $command_solution_details =
"outCorrectSolution";
1188 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1190 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1196 $this->ctrl->setParameter($this,
'pdf',
'1');
1197 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outUserPassDetails') );
1198 $this->ctrl->setParameter($this,
'pdf',
'');
1200 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1201 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1203 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1208 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1210 $tpl->setCurrentBlock(
'signature');
1212 $tpl->parseCurrentBlock();
1214 if ($this->object->isShowExamIdInTestResultsEnabled())
1216 $tpl->setCurrentBlock(
'exam_id');
1217 $tpl->setVariable(
'EXAM_ID', $this->object->lookupExamId(
1218 $testSession->getActiveId(),
$pass
1220 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1221 $tpl->parseCurrentBlock();
1229 $gradingMessageBuilder->buildMessage();
1230 $gradingMessageBuilder->sendMessage();
1232 #$template->setCurrentBlock('grading_message');
1233 #$template->setVariable('GRADING_MESSAGE', );
1234 #$template->parseCurrentBlock();
1238 $result_array, $active_id,
$pass, $this,
"outUserPassDetails",
1239 $command_solution_details, $questionAnchorNav, $objectivesList
1241 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1242 $tpl->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1244 if( $this->object->canShowSolutionPrintview() )
1247 $result_array, $active_id,
$pass, $this->object->getShowSolutionListComparison(),
1248 false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder
1250 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1253 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass+1));
1254 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1256 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1260 if($this->object->getAnonymity())
1262 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1265 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1266 $tpl->setVariable(
"USER_DATA", $user_data);
1273 if ($this->object->getShowSolutionAnswersOnly())
1280 require_once
'class.ilTestPDFGenerator.php';
1285 $this->tpl->setContent(
$tpl->get());
1296 global
$ilUser, $ilTabs, $ilObjDataCache;
1300 $ilTabs->setBackTarget(
1301 $this->lng->txt(
'tst_results_back_introduction'),
1302 $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen')
1305 $testSession = $this->testSessionFactory->getSession();
1306 $active_id = $testSession->getActiveId();
1308 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1310 if( !$this->object->canShowTestResults($testSession) )
1312 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1315 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1316 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1320 $this->ctrl->setParameter($this,
'pdf',
'1');
1321 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outUserResultsOverview') );
1322 $this->ctrl->setParameter($this,
'pdf',
'');
1324 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1325 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1327 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1332 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1334 $passDetailsEnabled = $this->
object->getShowPassDetails();
1335 #if (!$passDetailsEnabled)
1337 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1338 # if (!$executable["executable"]) $passDetailsEnabled = true;
1341 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1345 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1346 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1347 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1348 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1349 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1352 $template->setCurrentBlock(
"pass_overview");
1354 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1356 $testPassesSelector->setActiveId($testSession->getActiveId());
1357 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1360 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1361 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1362 if($passDetailsEnabled)
1364 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1366 if( $this->object->isPassDeletionAllowed() )
1368 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1370 $passOverViewTableGUI->init();
1371 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1372 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1373 $overview = $passOverViewTableGUI->getHTML();
1376 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1379 $loStatus->setUsrId($testSession->getUserId());
1380 $overview .=
"<br />".$loStatus->getHTML();
1382 $template->setVariable(
"PASS_OVERVIEW", $overview);
1383 $template->parseCurrentBlock();
1388 $gradingMessageBuilder->buildMessage();
1389 $gradingMessageBuilder->sendMessage();
1391 #$template->setCurrentBlock('grading_message');
1392 #$template->setVariable('GRADING_MESSAGE', );
1393 #$template->parseCurrentBlock();
1400 if ($this->object->getAnonymity())
1402 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1406 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1407 $template->setVariable(
"USER_DATA", $user_data);
1412 if ($this->object->getShowSolutionAnswersOnly())
1416 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1421 require_once
'class.ilTestPDFGenerator.php';
1426 $this->tpl->setContent($templatehead->get());
1439 global
$ilUser, $ilObjDataCache;
1441 if (!$this->object->getShowSolutionPrintview())
1444 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1447 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1450 if (array_key_exists(
"pass",
$_GET))
1456 $testSession = $this->testSessionFactory->getSession();
1457 $active_id = $testSession->getActiveId();
1460 if ($this->object->getNrOfTries() == 1)
1466 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1468 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1470 $testPassesSelector->setActiveId($testSession->getActiveId());
1471 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1474 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1475 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1476 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1477 $passOverViewTableGUI->init();
1478 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1479 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1485 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1488 $objectivesList =
null;
1492 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1493 $testSequence->loadFromDb();
1494 $testSequence->loadQuestions();
1496 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1500 $objectivesList->loadObjectivesTitles();
1502 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1503 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1504 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1505 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1506 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1509 $result_array = $this->
object->getTestResult(
1514 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1515 $showAllAnswers = TRUE;
1516 if ($this->object->isExecutable($testSession, $user_id))
1518 $showAllAnswers = FALSE;
1521 $answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass, FALSE, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1522 $template->setVariable(
"PASS_DETAILS", $answers);
1524 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1525 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1526 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1527 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1528 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1531 $template->setVariable(
"USER_DATA", $user_data);
1532 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1533 if (strlen($signature))
1535 $template->setVariable(
"SIGNATURE", $signature);
1537 if (!is_null(
$pass) && $this->object->isShowExamIdInTestResultsEnabled())
1539 $template->setCurrentBlock(
'exam_id_footer');
1540 $template->setVariable(
'EXAM_ID_VAL', $this->object->lookupExamId(
1541 $testSession->getActiveId(),
$pass
1543 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1544 $template->parseCurrentBlock();
1546 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1549 if ($this->object->getShowSolutionAnswersOnly())
1564 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1566 $this->ctrl->saveParameter($this,
"pass");
1567 $this->ctrl->saveParameter($this,
"active_id");
1568 $this->outTestResults(
false,
$_GET[
"pass"]);
1572 $this->outTestResults(
false);
1584 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1588 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1591 $data =& $this->
object->getCompleteEvaluationData();
1592 $color_class = array(
"tblrow1",
"tblrow2");
1594 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1595 $foundParticipants =&
$data->getParticipants();
1596 if (count($foundParticipants) == 0)
1604 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
1609 foreach ($foundParticipants as $userdata)
1611 $pass = $userdata->getScoredPass();
1612 if (is_object($userdata->getPass(
$pass)))
1614 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1615 if (is_array($question))
1622 $this->ctrl->setParameter($this,
"qid", $question_id);
1623 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1628 if ($question_object->hasFileUploads($this->object->getTestId()))
1630 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants").
"\">" . $this->lng->txt(
"download") .
"</a>";
1635 'qid' => $question_id,
1636 'question_title' => $question_title,
1637 'number_of_answers' => $answered,
1638 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1639 'file_uploads' => $download
1645 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1647 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1648 $table_gui->setData($rows);
1650 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1654 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1664 $testSession = $this->testSessionFactory->getSession();
1666 require_once
'./Services/Certificate/classes/class.ilCertificate.php';
1667 require_once
'./Modules/Test/classes/class.ilTestCertificateAdapter.php';
1671 "active_id" => $testSession->getActiveId(),
1679 if( isset(
$_GET[
'context']) && strlen(
$_GET[
'context']) )
1681 $context =
$_GET[
'context'];
1688 if( !$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest() )
1693 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1696 $confirm->build((
int)
$_GET[
'active_id'], (
int)
$_GET[
'pass'], $context);
1699 $tpl->setContent($this->ctrl->getHTML($confirm));
1709 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1715 $this->ctrl->redirect($this,
'outUserResultsOverview');
1719 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1723 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1727 public function performDeletePass()
1729 if( isset(
$_POST[
'context']) && strlen(
$_POST[
'context']) )
1731 $context =
$_POST[
'context'];
1738 if( !$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest() )
1748 if( isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id'] )
1750 $active_fi =
$_POST[
'active_id'];
1753 if( isset(
$_POST[
'pass']) && is_numeric(
$_POST[
'pass']) )
1758 if( is_null($active_fi) || is_null(
$pass) )
1760 $this->ctrl->redirect($this,
'outUserResultsOverview');
1763 if( !$this->object->isDynamicTest() &&
$pass == $this->object->_getResultPass($active_fi) )
1765 $this->ctrl->redirect($this,
'outUserResultsOverview');
1770 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1772 LEFT JOIN tst_sequence
1773 ON tst_sequence.active_fi = tst_active.active_id
1774 AND tst_sequence.pass = tst_active.tries
1775 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1780 $tries =
$row[
'tries'];
1781 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1783 if(
$pass < $lastFinishedPass )
1785 $isActivePass =
false;
1786 $must_renumber =
true;
1788 elseif(
$pass == $lastFinishedPass )
1790 $isActivePass =
false;
1792 if( $tries ==
$row[
'pass'] )
1794 $must_renumber =
true;
1798 $must_renumber =
false;
1803 $isActivePass =
true;
1804 $must_renumber =
false;
1808 throw new ilTestException (
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1811 if( !$this->object->isDynamicTest() && $isActivePass )
1813 $this->ctrl->redirect($this,
'outUserResultsOverview');
1817 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1818 || ($isActivePass ==
true)
1835 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1838 elseif( !$isActivePass )
1842 SET tries = ' .
$ilDB->quote($tries-1,
'integer') .
',
1843 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass-1,
'integer') .
'
1844 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1851 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1852 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1858 'UPDATE tst_manual_fb
1860 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1861 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1870 FROM tst_pass_result
1871 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1872 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1878 'UPDATE tst_pass_result
1880 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1881 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1894 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1895 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1901 'UPDATE tst_sequence
1903 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1904 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1908 if( $this->object->isDynamicTest() )
1911 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked'
1914 foreach($tables as $table)
1918 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1919 AND pass = {$ilDB->quote($pass, 'integer')}
1922 if( $must_renumber )
1927 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1928 AND pass > {$ilDB->quote($pass, 'integer')}
1938 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1939 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1945 'UPDATE tst_solutions
1947 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1948 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1955 FROM tst_test_result
1956 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1957 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1963 'UPDATE tst_test_result
1965 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1966 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1976 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1977 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1985 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1986 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1990 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
1997 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
2000 if( $this->object->isDynamicTest() )
2002 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
2011 global
$ilDB, $ilPluginAdmin;
2013 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions);
2014 $questionIds = array();
2015 foreach($resultData as $resultItemKey => $resultItemValue)
2017 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
2022 $questionIds[] = $resultItemValue[
'qid'];
2026 $table_gui->initFilter();
2028 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2031 $questionList->setIncludeQuestionIdsFilter($questionIds);
2032 $questionList->setQuestionInstanceTypeFilter(
null);
2034 foreach ($table_gui->getFilterItems() as $item)
2036 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
2038 $v = $item->getValue();
2040 if( is_array($v) && count($v) && !(
int)$v[0] )
2045 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
2046 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(),
'tst');
2048 elseif( $item->getValue() !==
false )
2050 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2054 $questionList->load();
2056 $filteredTestResult = array();
2058 foreach($resultData as $resultItemKey => $resultItemValue)
2060 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
2065 if( !$questionList->isInList($resultItemValue[
'qid']) )
2070 $filteredTestResult[] = $resultItemValue;
2073 return $filteredTestResult;
_updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
@TODO Move this to a proper place.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
_isComplete($adapter)
Checks the status of the certificate.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
TableGUI class for evaluation of all users.
static getInstance(ilTestSession $a_test_session)
_getLogLanguage()
retrieve the log language for assessment logging
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
_lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _lookupName($a_user_id)
lookup user name
TableGUI class for results by question.
special template class to simplify handling of ITX/PEAR
Test certificate adapter.
Output class for assessment test evaluation.
exportFileUploadsForAllParticipants()
Creates a ZIP file containing all file uploads for a given question in a test.
outCertificate()
Output of a test certificate.
singleResults()
Creates user results for single questions.
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
passDetails()
Output of the learners view of an existing test pass.
__construct(ilObjTest $a_object)
ilTestEvaluationGUI constructor
exportCertificate()
Exports the user results as PDF certificates using XSL-FO via XML:RPC calls.
exportAggregatedResults()
Exports the aggregated results.
& executeCommand()
execute command
detailedEvaluation()
Creates the detailed evaluation output for a selected participant.
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
exportQuestionForAllParticipants()
Creates a PDF representation of the answers for a given question in a test.
outUserPassDetailsResetTableFilter()
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
getEvaluationQuestionId($question_id, $original_id="")
Returns the ID of a question for evaluation purposes.
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
exportEvaluation()
Exports the evaluation data to a selected file format.
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
redirectToPassDeletionContext($context)
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions)
outUserPassDetailsSetTableFilter()
Base Exception for all Exceptions relating to Modules/Test.
const PDF_OUTPUT_DOWNLOAD
static generatePDF($pdf_output, $output_mode, $filename=null)
const CONTEXT_INFO_SCREEN
const CONTEXT_DYN_TEST_PLAYER
const CONTEXT_PASS_OVERVIEW
Service GUI class for tests.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null)
getGradingMessageBuilder($activeId)
getObjectiveOrientedContainer()
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
populatePassFinishDate($tpl, $passFinishDate)
getResultsSignature()
Returns HTML code for a signature field.
getCommand($cmd)
Retrieves the ilCtrl command.
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
buildUserTestResultsToolbarGUI()
setContextResultPresentation($contextResultPresentation)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
isGradingMessageRequired()
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Interface ilObjFileHandlingQuestionType.
if(!is_array($argv)) $options