4 require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
43 parent::__construct($a_object);
47 require_once
'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
59 $cmd = $this->ctrl->getCmd();
60 $next_class = $this->ctrl->getNextClass($this);
61 $this->ctrl->saveParameter($this,
"sequence");
62 $this->ctrl->saveParameter($this,
"active_id");
64 switch ($next_class) {
65 case 'iltestpassdetailsoverviewtablegui':
66 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
69 $tableGUI->initFilter();
70 $this->ctrl->forwardCommand($tableGUI);
82 $headernames =
array();
83 if ($this->
object->getAnonymity()) {
84 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)) {
91 foreach ($additionalFields as $fieldname) {
92 array_push($headernames, $this->lng->txt($fieldname));
95 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
96 array_push($headernames, $this->lng->txt(
"tst_mark"));
97 if ($this->
object->getECTSOutput()) {
98 array_push($headernames, $this->lng->txt(
"ects_grade"));
100 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
101 array_push($headernames, $this->lng->txt(
"working_time"));
102 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
108 $headervars =
array();
109 if ($this->
object->getAnonymity()) {
110 array_push($headervars,
"counter");
112 array_push($headervars,
"name");
113 array_push($headervars,
"login");
115 array_push($headervars,
"resultspoints");
116 array_push($headervars,
"resultsmarks");
117 if ($this->
object->getECTSOutput()) {
118 array_push($headervars,
"ects_grade");
120 array_push($headervars,
"qworkedthrough");
121 array_push($headervars,
"timeofwork");
122 array_push($headervars,
"");
128 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
130 $table_gui->writeFilterToSession();
131 $this->ctrl->redirect($this,
"outEvaluation");
136 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
138 $table_gui->resetFilter();
139 $this->ctrl->redirect($this,
"outEvaluation");
147 public function outEvaluation()
153 global $ilAccess, $ilToolbar;
155 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))) {
158 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
161 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
166 $this->
object->getAnonymity(),
167 $this->
object->isOfferingQuestionHintsEnabled()
171 $arrFilter =
array();
173 foreach ($table_gui->getFilterItems() as $item) {
174 if ($item->getValue() !==
false) {
175 switch ($item->getPostVar()) {
179 $arrFilter[$item->getPostVar()] = $item->getValue();
182 $passedonly = $item->getChecked();
187 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
189 $eval->setFilterArray($arrFilter);
190 $foundParticipants =&$eval->getParticipants();
192 if (count($foundParticipants) > 0) {
193 if ($this->
object->getECTSOutput()) {
194 $passed_array =&$this->
object->getTotalPointsPassedArray();
196 foreach ($foundParticipants as $active_id =>
$userdata) {
201 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark(
$userdata->getReachedPointsInPercent());
203 if ($mark_obj->getPassed() ==
false || !
$userdata->areObligationsAnswered()) {
209 $evaluationrow =
array();
210 if ($this->
object->getAnonymity()) {
212 $evaluationrow[
'login'] =
'';
214 $evaluationrow[
'name'] =
$userdata->getName();
216 $evaluationrow[
'login'] =
"[" .
$userdata->getLogin() .
"]";
218 $evaluationrow[
'login'] =
'';
222 $evaluationrow[
'reached'] =
$userdata->getReached();
223 $evaluationrow[
'max'] =
$userdata->getMaxpoints();
224 $evaluationrow[
'hint_count'] =
$userdata->getRequestedHintsCountFromScoredPass();
225 $percentage =
$userdata->getReachedPointsInPercent();
226 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
227 if (is_object($mark)) {
228 $evaluationrow[
'mark'] = $mark->getShortName();
230 if ($this->
object->getECTSOutput()) {
231 $ects_mark = $this->
object->getECTSGrade($passed_array,
$userdata->getReached(),
$userdata->getMaxPoints());
232 $evaluationrow[
'ects_grade'] = $ects_mark;
234 $evaluationrow[
'answered'] =
$userdata->getQuestionsWorkedThroughInPercent();
235 $evaluationrow[
'questions_worked_through'] =
$userdata->getQuestionsWorkedThrough();
236 $evaluationrow[
'number_of_questions'] =
$userdata->getNumberOfQuestions();
237 $time_seconds =
$userdata->getTimeOfWork();
238 $time_hours = floor($time_seconds/3600);
239 $time_seconds -= $time_hours * 3600;
240 $time_minutes = floor($time_seconds/60);
241 $time_seconds -= $time_minutes * 60;
242 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
243 $this->ctrl->setParameter($this,
"active_id", $active_id);
244 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
245 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
246 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
248 $evaluationrow[
'gender'] = $userfields[
'gender'];
249 $evaluationrow[
'email'] = $userfields[
'email'];
250 $evaluationrow[
'institution'] = $userfields[
'institution'];
251 $evaluationrow[
'street'] = $userfields[
'street'];
252 $evaluationrow[
'city'] = $userfields[
'city'];
253 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
254 $evaluationrow[
'country'] = $userfields[
'country'];
255 $evaluationrow[
'sel_country'] = $userfields[
'sel_country'];
256 $evaluationrow[
'department'] = $userfields[
'department'];
257 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
259 $data[] = $evaluationrow;
265 if (count($foundParticipants) > 0) {
266 $ilToolbar->setFormName(
'form_output_eval');
267 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportEvaluation'));
268 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
269 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
271 'excel' => $this->lng->txt(
'exp_type_excel'),
272 'csv' => $this->lng->txt(
'exp_type_spss')
275 if (!$this->
object->getAnonymity()) {
276 include_once
'Services/Certificate/classes/class.ilCertificate.php';
277 include_once
'Modules/Test/classes/class.ilTestCertificateAdapter.php';
279 $options[
'certificate'] = $this->lng->txt(
'exp_type_certificate');
285 $ilToolbar->addInputItem($export_type,
true);
286 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
288 $button->setCommand(
'exportEvaluation');
289 $button->setCaption(
'export');
290 $button->getOmitPreventDoubleSubmission();
291 $ilToolbar->addButtonInstance($button);
295 if ($this->
object->getShowSolutionAnswersOnly()) {
299 $this->tpl->setContent($table_gui->getHTML());
313 if ((!$DIC->access()->checkAccess(
'tst_statistics',
'', $this->ref_id)) && (!$DIC->access()->checkAccess(
'write',
'', $this->ref_id))) {
315 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
318 $active_id =
$_GET[
'active_id'];
319 if (strlen($active_id) == 0) {
320 ilUtil::sendInfo($this->lng->txt(
'detailed_evaluation_missing_active_id'),
true);
321 $this->ctrl->redirect($this,
'outEvaluation');
326 $toolbar = $DIC[
'ilToolbar'];
328 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
330 $backBtn->setCaption(
'back');
331 $backBtn->setUrl($this->ctrl->getLinkTarget($this,
'outEvaluation'));
332 $toolbar->addInputItem($backBtn);
334 $data =&$this->
object->getCompleteEvaluationData();
336 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
338 $form->setTitle(sprintf(
339 $this->lng->txt(
'detailed_evaluation_for'),
340 $data->getParticipant($active_id)->getName()
344 $resultPoints->
setValue(
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")");
345 $form->addItem($resultPoints);
347 if (strlen(
$data->getParticipant($active_id)->getMark())) {
349 $resultMarks->
setValue(
$data->getParticipant($active_id)->getMark());
350 $form->addItem($resultMarks);
351 if (strlen(
$data->getParticipant($active_id)->getECTSMark())) {
353 $ectsGrade->
setValue(
$data->getParticipant($active_id)->getECTSMark());
354 $form->addItem($ectsGrade);
358 if ($this->
object->isOfferingQuestionHintsEnabled()) {
359 $requestHints =
new ilNonEditableValueGUI($this->lng->txt(
'tst_question_hints_requested_hint_count_header'));
360 $requestHints->
setValue(
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
361 $form->addItem($requestHints);
364 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
365 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
366 $time_hours = floor($time_seconds/3600);
367 $time_seconds -= $time_hours * 3600;
368 $time_minutes = floor($time_seconds/60);
369 $time_seconds -= $time_minutes * 60;
371 $timeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
372 $form->addItem($timeOfWork);
374 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
""));
375 $time_hours = floor($atime_seconds/3600);
376 $atime_seconds -= $time_hours * 3600;
377 $time_minutes = floor($atime_seconds/60);
378 $atime_seconds -= $time_minutes * 60;
380 $avgTimeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
381 $form->addItem($avgTimeOfWork);
385 $form->addItem($firstVisit);
389 $form->addItem($lastVisit);
392 $nrPasses->
setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
393 $form->addItem($nrPasses);
397 $scoredPass->
setValue(
$data->getParticipant($active_id)->getBestPass() + 1);
399 $scoredPass->setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
401 $form->addItem($scoredPass);
403 $median =
$data->getStatistics()->getStatistics()->median();
404 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
405 $mark = $this->
object->mark_schema->getMatchingMark($pct);
406 if (is_object($mark)) {
408 $markMedian->
setValue($mark->getShortName());
409 $form->addItem($markMedian);
413 $rankParticipant->
setValue(
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
414 $form->addItem($rankParticipant);
417 $rankMedian->
setValue(
$data->getStatistics()->getStatistics()->rank_median());
418 $form->addItem($rankMedian);
420 $totalParticipants =
new ilNonEditableValueGUI($this->lng->txt(
'tst_stat_result_total_participants'));
421 $totalParticipants->
setValue(
$data->getStatistics()->getStatistics()->count());
422 $form->addItem($totalParticipants);
426 $form->addItem($medianField);
428 $this->tpl->setContent(
$form->getHTML());
434 if ($finishdate > 0) {
435 if (($DIC->access()->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id']))) {
436 $this->ctrl->setParameter($this,
'statistics',
'1');
437 $this->ctrl->setParameter($this,
'active_id', $active_id);
438 $this->ctrl->setParameter($this,
'pass',
$pass);
440 $this->ctrl->setParameter($this,
'statistics',
'');
441 $this->ctrl->setParameter($this,
'active_id',
'');
442 $this->ctrl->setParameter($this,
'pass',
'');
445 require_once
'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
447 $table->setTitle(sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass + 1));
448 if (($DIC->access()->checkAccess(
'write',
'', (
int) $_GET[
'ref_id']))) {
449 $table->addCommandButton(
'outParticipantsPassDetails', $this->lng->txt(
'tst_show_answer_sheet'));
452 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
453 if (!is_array($questions)) {
454 $questions =
$data->getParticipant($active_id)->getQuestions(0);
457 $tableData =
array();
460 foreach ((
array) $questions as $question) {
461 $userDataData =
array(
463 'id' => $question[
'id'],
464 'id_txt' => $this->lng->txt(
'question_id_short'),
465 'title' =>
$data->getQuestionTitle($question[
'id'])
468 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
469 if (is_array($answeredquestion)) {
470 $percent = $answeredquestion[
'points'] ? $answeredquestion[
'reached'] / $answeredquestion[
'points'] * 100.0 : 0;
471 $userDataData[
'points'] = $answeredquestion[
'reached'] .
' ' . strtolower($this->lng->txt(
'of')) .
" " . $answeredquestion[
'points'] .
' (' . sprintf(
"%.2f", $percent) .
' %)';
473 $userDataData[
'points'] =
'0 ' . strtolower($this->lng->txt(
'of')) .
' ' . $question[
'points'] .
' (' . sprintf(
"%.2f", 0) .
' %) - ' . $this->lng->txt(
'question_not_answered');
476 $tableData[] = $userDataData;
478 $table->setData($tableData);
480 $tables[] =
$table->getHTML();
484 $GLOBALS[
'tpl']->setContent(
$form->getHTML() . implode(
'', $tables));
502 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
505 $question_object->deliverFileUploadZIPFile($this->
object->getTestId(), $this->
object->getTitle());
507 $this->ctrl->redirect($this,
"singleResults");
518 public function eval_a()
524 global $ilAccess, $ilToolbar;
526 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)) {
537 $ilToolbar->setFormName(
'form_output_eval');
538 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportAggregatedResults'));
539 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
540 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
542 'excel' => $this->lng->txt(
'exp_type_excel'),
543 'csv' => $this->lng->txt(
'exp_type_spss')
545 $ilToolbar->addInputItem($export_type,
true);
546 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
548 $button->setCommand(
'exportAggregatedResults');
549 $button->setCaption(
'export');
550 $button->getOmitPreventDoubleSubmission();
551 $ilToolbar->addButtonInstance($button);
554 'result' => $this->lng->txt(
"tst_eval_total_persons"),
555 'value' => count($foundParticipants)
557 $total_finished = $this->
object->evalTotalFinished();
559 'result' => $this->lng->txt(
"tst_eval_total_finished"),
560 'value' => $total_finished
562 $average_time = $this->
object->evalTotalStartedAverageTime();
563 $diff_seconds = $average_time;
564 $diff_hours = floor($diff_seconds/3600);
565 $diff_seconds -= $diff_hours * 3600;
566 $diff_minutes = floor($diff_seconds/60);
567 $diff_seconds -= $diff_minutes * 60;
569 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
570 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
573 $total_passed_reached = 0;
574 $total_passed_max = 0;
575 $total_passed_time = 0;
576 foreach ($foundParticipants as
$userdata) {
577 if ($userdata->getPassed()) {
579 $total_passed_reached += $userdata->getReached();
580 $total_passed_max += $userdata->getMaxpoints();
581 $total_passed_time += $userdata->getTimeOfWork();
584 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
585 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
586 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
588 'result' => $this->lng->txt(
"tst_eval_total_passed"),
589 'value' => $total_passed
592 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
593 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
595 $average_time = $average_passed_time;
596 $diff_seconds = $average_time;
597 $diff_hours = floor($diff_seconds/3600);
598 $diff_seconds -= $diff_hours * 3600;
599 $diff_minutes = floor($diff_seconds/60);
600 $diff_seconds -= $diff_minutes * 60;
602 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
603 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
607 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
609 $table_gui->setData(
$data);
610 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
613 foreach ($eval->getQuestionTitles() as $question_id => $question_title) {
617 foreach ($foundParticipants as
$userdata) {
618 for (
$i = 0;
$i <= $userdata->getLastPass();
$i++) {
619 if (is_object($userdata->getPass(
$i))) {
620 $question =&$userdata->getPass(
$i)->getAnsweredQuestionByQuestionId($question_id);
621 if (is_array($question)) {
623 $reached += $question[
"reached"];
624 $max += $question[
"points"];
629 $percent = $max ? $reached/$max * 100.0 : 0;
631 $this->ctrl->setParameter($this,
"qid", $question_id);
633 $points_reached = ($answered ? $reached / $answered : 0);
634 $points_max = ($answered ? $max / $answered : 0);
638 'qid' => $question_id,
639 'title' => $question_title,
640 'points' => $points_reached,
641 'points_reached' => $points_reached,
642 'points_max' => $points_max,
643 'percentage' => (
float) $percent,
644 'answers' => $answered
648 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
650 $table_gui->setData(
$rows);
651 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
660 if (array_key_exists(
"g_filterby",
$_GET)) {
661 $filterby =
$_GET[
"g_filterby"];
665 if (array_key_exists(
"g_userfilter",
$_GET)) {
666 $filtertext =
$_GET[
"g_userfilter"];
670 if (array_key_exists(
"g_passedonly",
$_GET)) {
671 if (
$_GET[
"g_passedonly"] == 1) {
676 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
679 switch (
$_POST[
"export_type"]) {
681 $expFactory->getExporter(
'results')->exportToExcel(
690 $expFactory->getExporter(
'results')->exportToCSV(
700 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
702 if (strlen($filtertext)) {
703 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
705 $this->ctrl->redirect($this,
"exportCertificate");
717 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
719 $exportObj = $expFactory->getExporter(
'aggregated');
721 switch (
$_POST[
"export_type"]) {
723 $exportObj->exportToExcel($deliver =
true);
726 $exportObj->exportToCSV($deliver =
true);
741 include_once
"./Services/Utilities/classes/class.ilUtil.php";
742 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
743 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
746 $total_users =
array();
747 $total_users =&$this->
object->evalTotalPersonsArray();
748 if (count($total_users)) {
749 foreach ($total_users as $active_id =>
$name) {
750 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
753 "active_id" => $active_id,
754 "userfilter" => $userfilter,
755 "passedonly" => $passedonly
763 $zipArchive =
$certificate->zipCertificatesInArchiveDirectory($archive_dir,
true);
775 if ($original_id > 0) {
791 global $ilTabs, $ilAccess, $ilObjDataCache;
793 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
796 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
799 $this->ctrl->saveParameter($this,
"active_id");
800 $active_id = (int)
$_GET[
"active_id"];
801 $testSession = $this->testSessionFactory->getSession($active_id);
804 if ($testSession->getTestId() != $this->
object->getTestId()) {
806 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
809 $this->ctrl->saveParameter($this,
"pass");
812 if (isset(
$_GET[
'statistics']) &&
$_GET[
'statistics'] == 1) {
813 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
814 $this->ctrl->saveParameter($this,
'statistics');
816 $ilTabs->setBackTarget(
817 $this->lng->txt(
'back'),
818 $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
820 } elseif ($this->
object->getNrOfTries() == 1) {
821 $ilTabs->setBackTarget(
822 $this->lng->txt(
'back'),
823 $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
826 $ilTabs->setBackTarget(
827 $this->lng->txt(
'tst_results_back_overview'),
828 $this->ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
834 require_once
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
838 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
841 $objectivesList = null;
844 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
845 $testSequence->loadFromDb();
846 $testSequence->loadQuestions();
848 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
852 $objectivesList->loadObjectivesTitles();
854 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
855 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
856 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
857 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
858 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
864 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
866 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
868 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html",
true,
true,
"Modules/Test");
872 $this->ctrl->setParameter($this,
'pdf',
'1');
873 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
874 $this->ctrl->setParameter($this,
'pdf',
'');
876 if (isset(
$_GET[
'show_best_solutions'])) {
877 $_SESSION[
'tst_results_show_best_solutions'] =
true;
878 } elseif (isset(
$_GET[
'hide_best_solutions'])) {
879 $_SESSION[
'tst_results_show_best_solutions'] =
false;
880 } elseif (!isset(
$_SESSION[
'tst_results_show_best_solutions'])) {
881 $_SESSION[
'tst_results_show_best_solutions'] =
false;
884 if (
$_SESSION[
'tst_results_show_best_solutions']) {
885 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
886 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
887 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
889 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
890 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
891 $this->ctrl->setParameter($this,
'show_best_solutions',
'');
895 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
899 $gradingMessageBuilder->buildList();
901 $template->setCurrentBlock(
'grading_message');
902 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
906 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder);
907 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
908 $template->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
911 $template->setVariable(
"USER_DATA", $user_data);
913 $uname = $this->
object->userLookupFullName($user_id);
914 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
916 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
919 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
924 if ($this->
object->getShowSolutionAnswersOnly()) {
929 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
932 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
943 global $ilTabs, $ilAccess, $ilObjDataCache;
945 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
948 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
951 $active_id = (int)
$_GET[
"active_id"];
952 $testSession = $this->testSessionFactory->getSession($active_id);
955 if ($testSession->getTestId() != $this->
object->getTestId()) {
957 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
960 if ($this->
object->getNrOfTries() == 1) {
961 $this->ctrl->setParameter($this,
"active_id", $active_id);
963 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
966 $ilTabs->setBackTarget(
967 $this->lng->txt(
'back'),
968 $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
973 require_once
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
977 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html",
true,
true,
"Modules/Test");
981 $this->ctrl->setParameter($this,
'pdf',
'1');
982 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
983 $this->ctrl->setParameter($this,
'pdf',
'');
986 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
988 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
991 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
992 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
993 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
994 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
995 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
998 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1000 $testPassesSelector->setActiveId($testSession->getActiveId());
1001 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1004 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1005 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1006 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1007 $passOverViewTableGUI->init();
1008 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true,
true));
1009 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1010 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1014 $gradingMessageBuilder->buildList();
1016 $template->setCurrentBlock(
'grading_message');
1017 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1022 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1025 if ($this->
object->getAnonymity()) {
1026 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1028 $uname = $this->
object->userLookupFullName($user_id,
true);
1029 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1030 $template->setVariable(
"USER_DATA", $user_data);
1038 if ($this->
object->getShowSolutionAnswersOnly()) {
1042 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1)) {
1046 $filename =
$name[
'lastname'] .
'_' .
$name[
'firstname'] .
'_' .
$name[
'login'] .
'__' . $this->
object->getTitleFilenameCompliant();
1047 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1052 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1059 $tableGUI->initFilter();
1060 $tableGUI->resetOffset();
1061 $tableGUI->writeFilterToSession();
1068 $tableGUI->initFilter();
1069 $tableGUI->resetOffset();
1070 $tableGUI->resetFilter();
1077 $tableGUI->initFilter();
1078 $tableGUI->resetOffset();
1079 $tableGUI->writeFilterToSession();
1086 $tableGUI->initFilter();
1087 $tableGUI->resetOffset();
1088 $tableGUI->resetFilter();
1099 global $ilTabs,
$ilUser, $ilObjDataCache;
1103 if ($this->
object->getNrOfTries() == 1) {
1104 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen'));
1106 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1109 $testSession = $this->testSessionFactory->getSession();
1111 if (!$this->
object->getShowPassDetails()) {
1112 #$executable = $this->object->isExecutable($testSession, $ilUser->getId()); 1114 #if($executable["executable"]) 1116 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1120 $active_id = $testSession->getActiveId();
1121 $user_id = $testSession->getUserId();
1123 $this->ctrl->saveParameter($this,
"pass");
1128 require_once
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1132 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1135 $objectivesList = null;
1137 $considerHiddenQuestions =
true;
1138 $considerOptionalQuestions =
true;
1141 $considerHiddenQuestions =
false;
1143 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1144 $testSequence->loadFromDb();
1145 $testSequence->loadQuestions();
1147 if ($this->
object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1148 $considerOptionalQuestions =
false;
1151 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1155 $objectivesList->loadObjectivesTitles();
1157 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1158 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1159 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1160 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1161 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1166 $command_solution_details =
"";
1167 if ($this->
object->getShowSolutionDetails()) {
1168 $command_solution_details =
"outCorrectSolution";
1170 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1172 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1177 $this->ctrl->setParameter($this,
'pdf',
'1');
1178 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserPassDetails'));
1179 $this->ctrl->setParameter($this,
'pdf',
'');
1181 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1182 if ($this->
object->canShowCertificate($testSession, $user_id, $active_id)) {
1183 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1188 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1190 $tpl->setCurrentBlock(
'signature');
1192 $tpl->parseCurrentBlock();
1194 if ($this->
object->isShowExamIdInTestResultsEnabled()) {
1195 $tpl->setCurrentBlock(
'exam_id');
1197 $testSession->getActiveId(),
1200 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1201 $tpl->parseCurrentBlock();
1208 $gradingMessageBuilder->buildMessage();
1209 $gradingMessageBuilder->sendMessage();
1211 #$template->setCurrentBlock('grading_message'); 1212 #$template->setVariable('GRADING_MESSAGE', ); 1213 #$template->parseCurrentBlock(); 1221 "outUserPassDetails",
1222 $command_solution_details,
1226 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1227 $tpl->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1229 if ($this->
object->canShowSolutionPrintview()) {
1234 $this->
object->getShowSolutionListComparison(),
1240 $testResultHeaderLabelBuilder
1242 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1245 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass+1));
1246 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1248 $uname = $this->
object->userLookupFullName($user_id,
true);
1251 if ($this->
object->getAnonymity()) {
1252 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1254 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1255 $tpl->setVariable(
"USER_DATA", $user_data);
1262 if ($this->
object->getShowSolutionAnswersOnly()) {
1267 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1270 $this->tpl->setContent(
$tpl->get());
1281 global
$ilUser, $ilTabs, $ilObjDataCache;
1285 $ilTabs->setBackTarget(
1286 $this->lng->txt(
'tst_results_back_introduction'),
1287 $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen')
1290 $testSession = $this->testSessionFactory->getSession();
1291 $active_id = $testSession->getActiveId();
1292 $user_id = $ilUser->getId();
1293 $uname = $this->
object->userLookupFullName($user_id,
true);
1295 if (!$this->
object->canShowTestResults($testSession)) {
1296 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1301 require_once
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
1305 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html",
true,
true,
"Modules/Test");
1306 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
1310 $this->ctrl->setParameter($this,
'pdf',
'1');
1311 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1312 $this->ctrl->setParameter($this,
'pdf',
'');
1314 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1315 if ($this->
object->canShowCertificate($testSession, $user_id, $active_id)) {
1316 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1321 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1323 $passDetailsEnabled = $this->
object->getShowPassDetails();
1324 #if (!$passDetailsEnabled) 1326 # $executable = $this->object->isExecutable($testSession, $ilUser->getId()); 1327 # if (!$executable["executable"]) $passDetailsEnabled = true; 1330 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1333 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1334 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1335 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1336 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1337 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1340 $template->setCurrentBlock(
"pass_overview");
1342 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1344 $testPassesSelector->setActiveId($testSession->getActiveId());
1345 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1348 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1349 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1350 if ($passDetailsEnabled) {
1351 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1353 if ($this->
object->isPassDeletionAllowed()) {
1354 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1356 $passOverViewTableGUI->init();
1357 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1358 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1359 $overview = $passOverViewTableGUI->getHTML();
1361 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1364 $loStatus->setUsrId($testSession->getUserId());
1365 $overview .=
"<br />" . $loStatus->getHTML();
1367 $template->setVariable(
"PASS_OVERVIEW", $overview);
1372 $gradingMessageBuilder->buildMessage();
1373 $gradingMessageBuilder->sendMessage();
1375 #$template->setCurrentBlock('grading_message'); 1376 #$template->setVariable('GRADING_MESSAGE', ); 1377 #$template->parseCurrentBlock(); 1383 if ($this->
object->getAnonymity()) {
1384 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1386 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1387 $template->setVariable(
"USER_DATA", $user_data);
1392 if ($this->
object->getShowSolutionAnswersOnly()) {
1395 $templatehead->setVariable(
"RESULTS_PARTICIPANT",
$template->get());
1399 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1402 $this->tpl->setContent($templatehead->get());
1415 global
$ilUser, $ilObjDataCache;
1417 if (!$this->
object->getShowSolutionPrintview()) {
1419 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1422 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html",
true,
true,
"Modules/Test");
1425 if (array_key_exists(
"pass",
$_GET)) {
1426 if (strlen(
$_GET[
"pass"])) {
1430 $user_id = $ilUser->getId();
1432 $testSession = $this->testSessionFactory->getSession();
1433 $active_id = $testSession->getActiveId();
1436 if ($this->
object->getNrOfTries() == 1) {
1439 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1441 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1443 $testPassesSelector->setActiveId($testSession->getActiveId());
1444 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1447 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1448 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1449 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1450 $passOverViewTableGUI->init();
1451 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1452 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1456 if (strlen(
$pass)) {
1457 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1460 $objectivesList = null;
1463 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1464 $testSequence->loadFromDb();
1465 $testSequence->loadQuestions();
1467 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1471 $objectivesList->loadObjectivesTitles();
1473 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1474 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1475 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1476 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1477 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1480 $result_array = $this->
object->getTestResult(
1488 $user_id =&$this->
object->_getUserIdFromActiveId($active_id);
1489 $showAllAnswers =
true;
1490 if ($this->
object->isExecutable($testSession, $user_id)) {
1491 $showAllAnswers =
false;
1494 $answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
false, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1495 $template->setVariable(
"PASS_DETAILS", $answers);
1497 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1498 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1499 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1500 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1501 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1504 $template->setVariable(
"USER_DATA", $user_data);
1505 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1506 if (strlen($signature)) {
1507 $template->setVariable(
"SIGNATURE", $signature);
1509 if (!is_null(
$pass) && $this->
object->isShowExamIdInTestResultsEnabled()) {
1510 $template->setCurrentBlock(
'exam_id_footer');
1512 $testSession->getActiveId(),
1515 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1518 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1521 if ($this->
object->getShowSolutionAnswersOnly()) {
1535 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0)) {
1536 $this->ctrl->saveParameter($this,
"pass");
1537 $this->ctrl->saveParameter($this,
"active_id");
1538 $this->outTestResults(
false,
$_GET[
"pass"]);
1540 $this->outTestResults(
false);
1552 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))) {
1555 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1558 $data =&$this->
object->getCompleteEvaluationData();
1559 $color_class =
array(
"tblrow1",
"tblrow2");
1561 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1562 $foundParticipants =&
$data->getParticipants();
1563 if (count($foundParticipants) == 0) {
1568 foreach (
$data->getQuestionTitles() as $question_id => $question_title) {
1572 foreach ($foundParticipants as
$userdata) {
1573 $pass = $userdata->getScoredPass();
1574 if (is_object($userdata->getPass(
$pass))) {
1575 $question =&$userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1576 if (is_array($question)) {
1582 $this->ctrl->setParameter($this,
"qid", $question_id);
1583 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1587 if ($question_object->hasFileUploads($this->object->getTestId())) {
1588 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants") .
"\">" . $this->lng->txt(
"download") .
"</a>";
1594 'qid' => $question_id,
1595 'question_title' => $question_title,
1596 'number_of_answers' => $answered,
1597 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1598 'file_uploads' => $download
1603 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1605 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1606 $table_gui->setData(
$rows);
1608 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1610 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1620 $testSession = $this->testSessionFactory->getSession();
1622 require_once
'./Services/Certificate/classes/class.ilCertificate.php';
1623 require_once
'./Modules/Test/classes/class.ilTestCertificateAdapter.php';
1627 "active_id" => $testSession->getActiveId(),
1635 if (isset(
$_GET[
'context']) && strlen(
$_GET[
'context'])) {
1636 $context =
$_GET[
'context'];
1641 if (!$this->
object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1645 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1648 $confirm->build((
int)
$_GET[
'active_id'], (
int) $_GET[
'pass'], $context);
1651 $tpl->setContent($this->ctrl->getHTML($confirm));
1661 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1666 $this->ctrl->redirect($this,
'outUserResultsOverview');
1671 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1676 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1680 public function performDeletePass()
1682 if (isset(
$_POST[
'context']) && strlen(
$_POST[
'context'])) {
1683 $context =
$_POST[
'context'];
1688 if (!$this->
object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1697 if (isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id']) {
1698 $active_fi = $_POST[
'active_id'];
1701 if (isset($_POST[
'pass']) && is_numeric($_POST[
'pass'])) {
1702 $pass = $_POST[
'pass'];
1705 if (is_null($active_fi) || is_null(
$pass)) {
1706 $this->ctrl->redirect($this,
'outUserResultsOverview');
1709 if (!$this->
object->isDynamicTest() &&
$pass == $this->
object->_getResultPass($active_fi)) {
1710 $this->ctrl->redirect($this,
'outUserResultsOverview');
1715 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass 1717 LEFT JOIN tst_sequence 1718 ON tst_sequence.active_fi = tst_active.active_id 1719 AND tst_sequence.pass = tst_active.tries 1720 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')} 1725 $tries =
$row[
'tries'];
1726 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1728 if (
$pass < $lastFinishedPass) {
1729 $isActivePass =
false;
1730 $must_renumber =
true;
1731 } elseif (
$pass == $lastFinishedPass) {
1732 $isActivePass =
false;
1734 if ($tries ==
$row[
'pass']) {
1735 $must_renumber =
true;
1737 $must_renumber =
false;
1740 $isActivePass =
true;
1741 $must_renumber =
false;
1743 throw new ilTestException(
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1746 if (!$this->
object->isDynamicTest() && $isActivePass) {
1747 $this->ctrl->redirect($this,
'outUserResultsOverview');
1751 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1752 || ($isActivePass ==
true)
1765 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1767 } elseif (!$isActivePass) {
1770 SET tries = ' . $ilDB->quote($tries-1,
'integer') .
', 1771 last_finished_pass = ' . $ilDB->quote($lastFinishedPass-1,
'integer') .
' 1772 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1779 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1780 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1783 if ($must_renumber) {
1785 'UPDATE tst_manual_fb 1787 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1788 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1797 FROM tst_pass_result 1798 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1799 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1802 if ($must_renumber) {
1804 'UPDATE tst_pass_result 1806 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1807 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1820 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1821 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1824 if ($must_renumber) {
1826 'UPDATE tst_sequence 1828 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1829 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1833 if ($this->
object->isDynamicTest()) {
1835 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked' 1838 foreach ($tables as
$table) {
1841 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1842 AND pass = {$ilDB->quote($pass, 'integer')} 1845 if ($must_renumber) {
1849 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1850 AND pass > {$ilDB->quote($pass, 'integer')} 1860 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1861 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1864 if ($must_renumber) {
1866 'UPDATE tst_solutions 1868 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1869 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1876 FROM tst_test_result 1877 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1878 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1881 if ($must_renumber) {
1883 'UPDATE tst_test_result 1885 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1886 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1896 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1897 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1900 if ($must_renumber) {
1904 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
' 1905 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1909 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
1915 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1918 if ($this->
object->isDynamicTest()) {
1919 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
1928 global
$ilDB, $ilPluginAdmin;
1930 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions);
1931 $questionIds =
array();
1932 foreach ($resultData as $resultItemKey => $resultItemValue) {
1933 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
1937 $questionIds[] = $resultItemValue[
'qid'];
1941 $table_gui->initFilter();
1943 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1946 $questionList->setIncludeQuestionIdsFilter($questionIds);
1947 $questionList->setQuestionInstanceTypeFilter(null);
1949 foreach ($table_gui->getFilterItems() as $item) {
1950 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
1951 $v = $item->getValue();
1953 if (is_array($v) && count($v) && !(
int) $v[0]) {
1957 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1958 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
1959 } elseif ($item->getValue() !==
false) {
1960 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1964 $questionList->load();
1966 $filteredTestResult =
array();
1968 foreach ($resultData as $resultItemKey => $resultItemValue) {
1969 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
1973 if (!$questionList->isInList($resultItemValue[
'qid'])) {
1977 $filteredTestResult[] = $resultItemValue;
1980 return $filteredTestResult;
1985 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1987 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
1988 $cgui->setHeaderText($this->lng->txt(
"finish_pass_for_user_confirmation"));
1989 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
1990 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForUser");
1991 $this->tpl->setContent($cgui->getHTML());
1996 require_once
'Modules/Test/classes/class.ilTestPassFinishTasks.php';
1997 $active_id = (int)
$_GET[
"active_id"];
2004 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2006 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
2007 $cgui->setHeaderText($this->lng->txt(
"finish_pass_for_all_users"));
2008 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2009 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForAllUser");
2010 $this->tpl->setContent($cgui->getHTML());
2015 require_once
'Modules/Test/classes/class.ilTestPassFinishTasks.php';
2016 $participants = $this->
object->getTestParticipants();
2017 foreach ($participants as $participant) {
2018 if (array_key_exists(
'unfinished_passes', $participant) && $participant[
'unfinished_passes'] == 1) {
2027 $this->processLockerFactory->setActiveId($active_id);
2028 $processLocker = $this->processLockerFactory->getLocker();
2031 $test_pass_finisher->performFinishTasks($processLocker);
2036 $this->ctrl->redirectByClass(
"ilobjtestgui",
"participants");
static _lookupName($a_user_id)
lookup user name
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
Class ilTestPassFinishTasks.
singleResults()
Creates user results for single questions.
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
setContextResultPresentation($contextResultPresentation)
setValue($a_value)
Set Value.
exportEvaluation()
Exports the evaluation data to a selected file format.
confirmFinishTestPassForAllUser()
outCertificate()
Output of a test certificate.
static _isComplete($adapter)
Checks the status of the certificate.
exportCertificate()
Exports the user results as PDF certificates using XSL-FO via XML:RPC calls.
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static lookupPassResultsUpdateTimestamp($active_id, $pass)
getObjectiveOrientedContainer()
passDetails()
Output of the learners view of an existing test pass.
const PDF_USER_RESULT
PDF Purposes.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
TableGUI class for results by question.
executeCommand()
execute command
exportAggregatedResults()
Exports the aggregated results.
Interface ilObjFileHandlingQuestionType.
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
getResultsSignature()
Returns HTML code for a signature field.
TableGUI class for evaluation of all users.
__construct(ilObjTest $a_object)
ilTestEvaluationGUI constructor
confirmFinishTestPassForUser()
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
Base Exception for all Exceptions relating to Modules/Test.
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static _getLogLanguage()
retrieve the log language for assessment logging
getEvaluationQuestionId($question_id, $original_id="")
Returns the ID of a question for evaluation purposes.
static getInstance(ilTestSession $a_test_session)
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
finishTestPass($active_id, $obj_id)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
if(isset($_POST['submit'])) $form
const CONTEXT_PASS_OVERVIEW
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
outUserPassDetailsResetTableFilter()
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
getCommand($cmd)
Retrieves the ilCtrl command.
special template class to simplify handling of ITX/PEAR
outParticipantsPassDetailsSetTableFilter()
finishTestPassForSingleUser()
Output class for assessment test evaluation.
redirectBackToParticipantsScreen()
static lookupLastTestPassAccess($activeId, $passIndex)
Create styles array
The data for the language used.
const CONTEXT_INFO_SCREEN
exportFileUploadsForAllParticipants()
Creates a ZIP file containing all file uploads for a given question in a test.
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
detailedEvaluation()
Creates the detailed evaluation output for a selected participant.
redirectToPassDeletionContext($context)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
getGradingMessageBuilder($activeId)
Class ilTestDetailedEvaluationStatisticsTableGUI.
exportQuestionForAllParticipants()
Creates a PDF representation of the answers for a given question in a test.
populatePassFinishDate($tpl, $passFinishDate)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
Service GUI class for tests.
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
if(empty($password)) $table
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
const PDF_OUTPUT_DOWNLOAD
outParticipantsPassDetailsResetTableFilter()
outUserPassDetailsSetTableFilter()
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.
const CONTEXT_DYN_TEST_PLAYER
Test certificate adapter.
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.
static lookupExamId($active_id, $pass)