24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
25 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
27 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
66 $cmd = $this->ctrl->getCmd();
67 $next_class = $this->ctrl->getNextClass($this);
68 $this->ctrl->saveParameter($this,
"sequence");
69 $this->ctrl->saveParameter($this,
"active_id");
82 $headernames = array();
83 if ($this->object->getAnonymity())
85 array_push($headernames, $this->lng->txt(
"counter"));
89 array_push($headernames, $this->lng->txt(
"name"));
90 array_push($headernames, $this->lng->txt(
"login"));
92 $additionalFields = $this->
object->getEvaluationAdditionalFields();
93 if (count($additionalFields))
95 foreach ($additionalFields as $fieldname)
97 array_push($headernames, $this->lng->txt($fieldname));
100 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
101 array_push($headernames, $this->lng->txt(
"tst_mark"));
102 if ($this->object->ects_output)
104 array_push($headernames, $this->lng->txt(
"ects_grade"));
106 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
107 array_push($headernames, $this->lng->txt(
"working_time"));
108 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
114 $headervars = array();
115 if ($this->object->getAnonymity())
117 array_push($headervars,
"counter");
121 array_push($headervars,
"name");
122 array_push($headervars,
"login");
124 array_push($headervars,
"resultspoints");
125 array_push($headervars,
"resultsmarks");
126 if ($this->object->ects_output)
128 array_push($headervars,
"ects_grade");
130 array_push($headervars,
"qworkedthrough");
131 array_push($headervars,
"timeofwork");
132 array_push($headervars,
"");
138 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
140 $table_gui->writeFilterToSession();
141 $this->ctrl->redirect($this,
"outEvaluation");
146 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
148 $table_gui->resetFilter();
149 $this->ctrl->redirect($this,
"outEvaluation");
161 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
165 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
168 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
171 $this,
'outEvaluation', $this->object->getAnonymity(), $this->
object->isOfferingQuestionHintsEnabled()
175 $arrFilter = array();
177 foreach ($table_gui->getFilterItems() as $item)
179 if ($item->getValue() !==
false)
181 switch ($item->getPostVar())
186 $arrFilter[$item->getPostVar()] = $item->getValue();
189 $passedonly = $item->getChecked();
194 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
196 $eval->setFilterArray($arrFilter);
197 $foundParticipants =& $eval->getParticipants();
199 if (count($foundParticipants) > 0)
201 if ($this->object->ects_output)
203 $passed_array =& $this->
object->getTotalPointsPassedArray();
205 foreach ($foundParticipants as $active_id => $userdata)
212 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
214 if( $mark_obj->getPassed() == FALSE || !$userdata->areObligationsAnswered() )
222 $evaluationrow = array();
223 if ($this->object->getAnonymity())
225 $evaluationrow[
'name'] = $counter;
226 $evaluationrow[
'login'] =
'';
230 $evaluationrow[
'name'] = $userdata->getName();
231 if (strlen($userdata->getLogin()))
233 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
237 $evaluationrow[
'login'] =
'';
241 $evaluationrow[
'reached'] = $userdata->getReached();
242 $evaluationrow[
'max'] = $userdata->getMaxpoints();
243 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
244 $percentage = $userdata->getReachedPointsInPercent();
245 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
246 if (is_object($mark))
248 $evaluationrow[
'mark'] = $mark->getShortName();
250 if ($this->object->ects_output)
252 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
253 $evaluationrow[
'ects_grade'] = $ects_mark;
255 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
256 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
257 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
258 $time_seconds = $userdata->getTimeOfWork();
259 $time_hours = floor($time_seconds/3600);
260 $time_seconds -= $time_hours * 3600;
261 $time_minutes = floor($time_seconds/60);
262 $time_seconds -= $time_minutes * 60;
263 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
264 $this->ctrl->setParameter($this,
"active_id", $active_id);
265 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
266 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
267 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
269 $evaluationrow[
'gender'] = $userfields[
'gender'];
270 $evaluationrow[
'email'] = $userfields[
'email'];
271 $evaluationrow[
'institution'] = $userfields[
'institution'];
272 $evaluationrow[
'street'] = $userfields[
'street'];
273 $evaluationrow[
'city'] = $userfields[
'city'];
274 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
275 $evaluationrow[
'country'] = $userfields[
'country'];
276 $evaluationrow[
'department'] = $userfields[
'department'];
277 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
279 $data[] = $evaluationrow;
285 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation.html",
"Modules/Test");
286 $this->tpl->setVariable(
'EVALUATION_DATA', $table_gui->getHTML());
287 if (count($foundParticipants) > 0)
289 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
290 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
291 if (!$this->object->getAnonymity())
293 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
294 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
297 $template->setVariable(
"TEXT_CERTIFICATE", $this->lng->txt(
"exp_type_certificate"));
300 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
301 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
302 $template->setVariable(
"CMD_EXPORT",
"exportEvaluation");
303 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
304 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
305 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
306 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportEvaluation"));
307 $exportoutput = $template->get();
308 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
312 if ($this->object->getShowSolutionAnswersOnly())
329 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
332 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
335 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
337 $active_id =
$_GET[
"active_id"];
338 if (strlen($active_id) == 0)
340 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
341 $this->ctrl->redirect($this,
"outEvaluation");
346 $data =& $this->
object->getCompleteEvaluationData();
347 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
348 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
349 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
350 $data->getParticipant($active_id)->getName())
352 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
353 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
354 $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()) .
" %" .
")");
355 if (strlen(
$data->getParticipant($active_id)->getMark()))
357 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
358 $this->tpl->setVariable(
"VALUE_RESULTSMARKS",
$data->getParticipant($active_id)->getMark());
359 if (strlen(
$data->getParticipant($active_id)->getECTSMark()))
361 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
362 $this->tpl->setVariable(
"VALUE_ECTS",
$data->getParticipant($active_id)->getECTSMark());
366 if( $this->object->isOfferingQuestionHintsEnabled() )
368 $this->tpl->setVariable(
"TXT_REQUESTED_HINTS_COUNT", $this->lng->txt(
"tst_question_hints_requested_hint_count_header"));
369 $this->tpl->setVariable(
"VALUE_REQUESTED_HINTS_COUNT",
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
372 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
373 $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()) .
" %" .
")");
375 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
376 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
377 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
378 $time_hours = floor($time_seconds/3600);
379 $time_seconds -= $time_hours * 3600;
380 $time_minutes = floor($time_seconds/60);
381 $time_seconds -= $time_minutes * 60;
382 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
383 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
384 $time_hours = floor($atime_seconds/3600);
385 $atime_seconds -= $time_hours * 3600;
386 $time_minutes = floor($atime_seconds/60);
387 $atime_seconds -= $time_minutes * 60;
388 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
389 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
390 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
391 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
395 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
396 #$this->tpl->setVariable("VALUE_LASTVISIT",
397 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
402 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
403 $this->tpl->setVariable(
"VALUE_NROFPASSES",
$data->getParticipant($active_id)->getLastPass() + 1);
404 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
407 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getBestPass() + 1);
411 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getLastPass() + 1);
414 $median =
$data->getStatistics()->getStatistics()->median();
415 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
416 $mark = $this->
object->mark_schema->getMatchingMark($pct);
417 if (is_object($mark))
419 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
420 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
423 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
424 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT",
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
425 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
426 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN",
$data->getStatistics()->getStatistics()->rank_median());
427 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
428 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS",
$data->getStatistics()->getStatistics()->count());
429 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
430 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
434 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
437 $this->tpl->setCurrentBlock(
"question_header");
438 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
439 $this->tpl->parseCurrentBlock();
441 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
443 $this->tpl->setCurrentBlock(
"question_footer");
444 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
445 $this->ctrl->setParameter($this,
"statistics",
"1");
446 $this->ctrl->setParameter($this,
"active_id", $active_id);
447 $this->ctrl->setParameter($this,
"pass",
$pass);
448 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
449 $this->tpl->parseCurrentBlock();
451 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
452 if (!is_array($questions))
454 $questions =
$data->getParticipant($active_id)->getQuestions(0);
457 foreach ($questions as $question)
459 $this->tpl->setCurrentBlock(
"question_row");
460 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
461 $this->tpl->setVariable(
"QUESTION_TITLE",
$data->getQuestionTitle($question[
"id"]));
462 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
463 if (is_array($answeredquestion))
465 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
466 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
470 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
472 $this->tpl->parseCurrentBlock();
475 $this->tpl->touchBlock(
"question_stats");
499 if (method_exists($question_object,
"getFileUploadZIPFile"))
501 $question_object->getFileUploadZIPFile($this->object->getTestId());
505 $this->ctrl->redirect($this,
"singleResults");
520 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
524 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
527 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
528 $eval =& $this->
object->getCompleteEvaluationData();
530 $foundParticipants =& $eval->getParticipants();
531 if (count($foundParticipants))
533 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
534 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
535 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
536 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
537 $template->setVariable(
"CMD_EXPORT",
"exportAggregatedResults");
538 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
539 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
540 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
541 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportAggregatedResults"));
542 $exportoutput = $template->get();
543 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
545 array_push(
$data, array(
546 'result' => $this->lng->txt(
"tst_eval_total_persons"),
547 'value' => count($foundParticipants)
549 $total_finished = $this->
object->evalTotalFinished();
550 array_push(
$data, array(
551 'result' => $this->lng->txt(
"tst_eval_total_finished"),
552 'value' => $total_finished
554 $average_time = $this->
object->evalTotalStartedAverageTime();
555 $diff_seconds = $average_time;
556 $diff_hours = floor($diff_seconds/3600);
557 $diff_seconds -= $diff_hours * 3600;
558 $diff_minutes = floor($diff_seconds/60);
559 $diff_seconds -= $diff_minutes * 60;
560 array_push(
$data, array(
561 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
562 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
565 $total_passed_reached = 0;
566 $total_passed_max = 0;
567 $total_passed_time = 0;
568 foreach ($foundParticipants as $userdata)
570 if ($userdata->getPassed())
573 $total_passed_reached += $userdata->getReached();
574 $total_passed_max += $userdata->getMaxpoints();
575 $total_passed_time += $userdata->getTimeOfWork();
578 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
579 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
580 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
581 array_push(
$data, array(
582 'result' => $this->lng->txt(
"tst_eval_total_passed"),
583 'value' => $total_passed
585 array_push(
$data, array(
586 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
587 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
589 $average_time = $average_passed_time;
590 $diff_seconds = $average_time;
591 $diff_hours = floor($diff_seconds/3600);
592 $diff_seconds -= $diff_hours * 3600;
593 $diff_minutes = floor($diff_seconds/60);
594 $diff_seconds -= $diff_minutes * 60;
595 array_push(
$data, array(
596 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
597 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
601 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
603 $table_gui->setData(
$data);
604 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
607 foreach ($eval->getQuestionTitles() as $question_id => $question_title)
612 foreach ($foundParticipants as $userdata)
614 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
616 if (is_object($userdata->getPass($i)))
618 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
619 if (is_array($question))
622 $reached += $question[
"reached"];
623 $max += $question[
"points"];
628 $percent = $max ? $reached/$max * 100.0 : 0;
630 $this->ctrl->setParameter($this,
"qid", $question_id);
633 'title' => $question_title,
634 'points' => sprintf(
"%.2f", $answered ? $reached / $answered : 0) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%.2f", $answered ? $max / $answered : 0),
635 'percentage' => (float)$percent,
636 'answers' => $answered
640 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
642 $table_gui->setData($rows);
643 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
654 if (array_key_exists(
"g_filterby",
$_GET))
656 $filterby =
$_GET[
"g_filterby"];
659 if (array_key_exists(
"g_userfilter",
$_GET))
661 $filtertext =
$_GET[
"g_userfilter"];
664 if (array_key_exists(
"g_passedonly",
$_GET))
666 if (
$_GET[
"g_passedonly"] == 1)
671 switch (
$_POST[
"export_type"])
674 include_once
"./Modules/Test/classes/class.ilTestExport.php";
675 $exportObj =
new ilTestExport($this->
object,
"results");
676 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
679 include_once
"./Modules/Test/classes/class.ilTestExport.php";
680 $exportObj =
new ilTestExport($this->
object,
"results");
681 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
686 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
688 if (strlen($filtertext))
690 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
692 $this->ctrl->redirect($this,
"exportCertificate");
704 switch (
$_POST[
"export_type"])
707 include_once
"./Modules/Test/classes/class.ilTestExport.php";
708 $exportObj =
new ilTestExport($this->
object,
"aggregated");
709 $exportObj->exportToExcel($deliver = TRUE);
712 include_once
"./Modules/Test/classes/class.ilTestExport.php";
713 $exportObj =
new ilTestExport($this->
object,
"aggregated");
714 $exportObj->exportToCSV($deliver = TRUE);
729 include_once
"./Services/Utilities/classes/class.ilUtil.php";
730 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
731 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
733 $archive_dir = $certificate->createArchiveDirectory();
734 $total_users = array();
735 $total_users =& $this->
object->evalTotalPersonsArray();
736 if (count($total_users))
738 foreach ($total_users as $active_id => $name)
740 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
741 $pdf = $certificate->outCertificate(
743 "active_id" => $active_id,
744 "userfilter" => $userfilter,
745 "passedonly" => $passedonly
751 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id .
"_" . str_replace(
" ",
"_",
ilUtil::getASCIIFilename($name)) .
".pdf");
754 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
767 if ($original_id > 0)
788 $this->ctrl->saveParameter($this,
"pass");
790 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
794 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
797 $this->ctrl->saveParameter($this,
"active_id");
798 $active_id =
$_GET[
"active_id"];
800 $testSession = $this->
object->getTestSession($active_id);
803 if( $testSession->getTestId() != $this->
object->getTestId() )
806 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
809 $this->ctrl->saveParameter($this,
"pass");
812 $result_array =& $this->
object->getTestResult($active_id,
$pass);
816 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
818 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
820 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
823 $this->ctrl->setParameter($this,
"pdf",
"1");
824 $template->setCurrentBlock(
"pdf_export");
825 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
826 $this->ctrl->setParameter($this,
"pdf",
"");
827 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
828 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
830 $template->parseCurrentBlock();
833 if (array_key_exists(
"statistics",
$_GET) && (
$_GET[
"statistics"] == 1))
835 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
836 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
837 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilTestEvaluationGUI",
"detailedEvaluation"));
841 if ($this->object->getNrOfTries() == 1)
843 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
844 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
848 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outParticipantsResultsOverview"));
849 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
852 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
853 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
855 if ($this->object->getNrOfTries() == 1)
858 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
859 if (strlen($statement[
"markects"]))
861 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
866 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
867 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
868 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
869 $template->setVariable(
"PASS_DETAILS", $overview);
870 $template->setVariable(
"USER_DETAILS", $user_data);
871 $uname = $this->
object->userLookupFullName($user_id);
872 $template->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
875 if ($this->object->getShowSolutionAnswersOnly())
880 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
882 $this->
object->deliverPDFfromHTML($template->get());
886 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
899 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
903 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
906 $active_id = (int)
$_GET[
"active_id"];
907 $testSession = $this->
object->getTestSession($active_id);
910 if( $testSession->getTestId() != $this->
object->getTestId() )
913 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
916 if ($this->object->getNrOfTries() == 1)
918 $this->ctrl->setParameter($this,
"active_id", $active_id);
920 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
923 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
925 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
928 $this->ctrl->setParameter($this,
"pdf",
"1");
929 $template->setCurrentBlock(
"pdf_export");
930 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsResultsOverview"));
931 $this->ctrl->setParameter($this,
"pdf",
"");
932 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
933 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
935 $template->parseCurrentBlock();
938 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outParticipantsPassDetails");
939 $template->setVariable(
"PASS_OVERVIEW", $overview);
940 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
941 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
942 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
943 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
944 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
947 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
949 $template->setVariable(
"USER_DATA", $user_data);
950 $template->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"tst_results_overview"));
951 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
952 if (strlen($statement[
"markects"]))
954 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
956 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
957 $template->parseCurrentBlock();
960 if ($this->object->getShowSolutionAnswersOnly())
965 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
967 $this->
object->deliverPDFfromHTML($template->get(), $this->
object->getTitle());
971 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
984 $testSession = $this->
object->getTestSession();
986 $active_id = $testSession->getActiveId();
987 $user_id = $testSession->getUserId();
989 $this->ctrl->saveParameter($this,
"pass");
991 $result_array =& $this->
object->getTestResult($active_id,
$pass);
993 $command_solution_details =
"";
994 if ($this->object->getShowSolutionDetails())
996 $command_solution_details =
"outCorrectSolution";
998 $overview = $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserPassDetails", $command_solution_details);
1000 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_pass_details_overview_participants.html",
"Modules/Test");
1002 if ($this->object->getNrOfTries() == 1)
1004 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1005 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1009 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outUserResultsOverview"));
1010 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
1013 $this->tpl->parseCurrentBlock();
1015 if ($this->object->getNrOfTries() == 1)
1018 $this->tpl->setVariable(
"USER_MARK", $statement[
"mark"]);
1019 if (strlen($statement[
"markects"]))
1021 $this->tpl->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1027 $this->tpl->setCurrentBlock(
"adm_content");
1028 $this->tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1029 $this->tpl->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1030 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1031 $this->tpl->setVariable(
"PASS_DETAILS", $overview);
1032 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1033 $this->tpl->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1034 $this->tpl->parseCurrentBlock();
1037 if ($this->object->getShowSolutionAnswersOnly())
1054 if (!$this->object->canShowTestResults($ilUser->getId())) $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1055 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
1056 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1057 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1060 $user_id = $ilUser->getId();
1061 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1062 $active_id = $this->
object->getTestSession()->getActiveId();
1063 $hide_details = !$this->
object->getShowPassDetails();
1066 $executable = $this->
object->isExecutable($ilUser->getId());
1067 if (!$executable[
"executable"]) $hide_details = FALSE;
1069 $begin = microtime(
true);
1070 if (($this->object->getNrOfTries() == 1) && (!$hide_details))
1076 $template->setCurrentBlock(
"pass_overview");
1077 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserResultsOverview", FALSE, $hide_details);
1078 $template->setVariable(
"PASS_OVERVIEW", $overview);
1079 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results_overview"));
1080 $template->parseCurrentBlock();
1083 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
1088 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1091 $this->ctrl->setParameter($this,
"pass",
$pass);
1092 $this->ctrl->setParameter($this,
"pdf",
"1");
1093 $templatehead->setCurrentBlock(
"pdf_export");
1094 $templatehead->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1095 $this->ctrl->setParameter($this,
"pass",
"");
1096 $this->ctrl->setParameter($this,
"pdf",
"");
1097 $templatehead->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
1098 $templatehead->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
1100 $templatehead->parseCurrentBlock();
1101 if ($this->object->canShowCertificate($user_id, $active_id))
1103 $templatehead->setVariable(
"CERTIFICATE_URL", $this->ctrl->getLinkTarget($this,
"outCertificate"));
1104 $templatehead->setVariable(
"CERTIFICATE_TEXT", $this->lng->txt(
"certificate"));
1107 $templatehead->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1108 $templatehead->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1109 $templatehead->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1110 $templatehead->setVariable(
"PRINT_URL",
"javascript:window.print();");
1116 $this->ctrl->saveParameter($this,
"pass");
1117 $this->ctrl->saveParameter($this,
"active_id");
1118 if (!is_null(
$pass))
1120 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1121 $command_solution_details =
"";
1122 if ($this->object->getShowSolutionDetails())
1124 $command_solution_details =
"outCorrectSolution";
1126 $detailsoverview = (!$hide_details) ? $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserResultsOverview", $command_solution_details) :
'';
1128 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1130 if (!$hide_details && $this->object->canShowSolutionPrintview())
1134 else if ($this->object->getShowSolutionDetails())
1140 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1141 $template->setVariable(
"PASS_RESULTS_OVERVIEW", sprintf($this->lng->txt(
"tst_results_overview_pass"),
$pass + 1));
1142 $template->setVariable(
"PASS_DETAILS", $detailsoverview);
1145 $template->setVariable(
"SIGNATURE", $signature);
1147 if ($this->object->getAnonymity()) {
1148 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1151 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1152 $template->setVariable(
"USER_DATA", $user_data);
1154 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
1155 if (strlen($statement[
"markects"]))
1157 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1159 $template->parseCurrentBlock();
1162 if ($this->object->getShowSolutionAnswersOnly())
1166 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1168 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1170 $this->
object->deliverPDFfromHTML($template->get(), sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1174 $this->tpl->setVariable(
"PRINT_CONTENT", $templatehead->get());
1189 if (!$this->object->getShowSolutionPrintview())
1192 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1195 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1198 if (array_key_exists(
"pass",
$_GET))
1202 $user_id = $ilUser->getId();
1203 $active_id = $this->
object->getTestSession()->getActiveId();
1205 if ($this->object->getNrOfTries() == 1)
1211 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserListOfAnswerPasses", TRUE);
1212 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1213 $template->setVariable(
"PASS_OVERVIEW", $overview);
1220 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1221 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1222 $showAllAnswers = TRUE;
1223 if ($this->object->isExecutable($user_id))
1225 $showAllAnswers = FALSE;
1228 $template->setVariable(
"PASS_DETAILS", $answers);
1230 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1231 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1232 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1233 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1234 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1237 $template->setVariable(
"USER_DATA", $user_data);
1238 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1239 if (strlen($signature))
1241 $template->setVariable(
"SIGNATURE", $signature);
1243 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1246 if ($this->object->getShowSolutionAnswersOnly())
1261 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1263 $this->ctrl->saveParameter($this,
"pass");
1264 $this->ctrl->saveParameter($this,
"active_id");
1265 $this->outTestResults(
false,
$_GET[
"pass"]);
1269 $this->outTestResults(
false);
1280 if( !$this->object->getShowSolutionDetails() )
1283 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1286 $testSession = $this->
object->getTestSession();
1287 $activeId = $testSession->getActiveId();
1289 if( !($activeId > 0) )
1291 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1294 if( !$this->object->canShowTestResults($testSession, $testSession->getUserId()) )
1296 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1299 $this->ctrl->saveParameter($this,
"pass");
1302 $questionId = (int)
$_GET[
'evaluation'];
1304 $testSequence = $this->
object->getTestSequence($activeId,
$pass);
1306 if( !$testSequence->questionExists($questionId) )
1308 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1311 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1313 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1314 $this->tpl->setCurrentBlock(
"ContentStyle");
1316 $this->tpl->parseCurrentBlock();
1318 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1320 $this->tpl->parseCurrentBlock();
1323 if ($this->object->getShowSolutionAnswersOnly())
1328 $this->tpl->setCurrentBlock(
"adm_content");
1330 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1331 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1332 $this->ctrl->saveParameter($this,
"pass");
1333 $this->ctrl->saveParameter($this,
"active_id");
1334 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1335 $this->tpl->parseCurrentBlock();
1347 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1351 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1354 $data =& $this->
object->getCompleteEvaluationData();
1355 $color_class = array(
"tblrow1",
"tblrow2");
1357 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1358 $foundParticipants =&
$data->getParticipants();
1359 if (count($foundParticipants) == 0)
1367 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
1372 foreach ($foundParticipants as $userdata)
1374 $pass = $userdata->getScoredPass();
1375 if (is_object($userdata->getPass(
$pass)))
1377 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1378 if (is_array($question))
1385 $this->ctrl->setParameter($this,
"qid", $question_id);
1388 if (method_exists($question_object,
"hasFileUploads"))
1390 if ($question_object->hasFileUploads($this->object->getTestId()))
1392 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants").
"\">" . $this->lng->txt(
"download") .
"</a>";
1399 "<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants").
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1406 include_once(
"./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php");
1409 $table_gui->
setTitle($this->lng->txt(
"tst_answered_questions_test"));
1410 $table_gui->setData($rows);
1412 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1416 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1428 $active_id = $this->
object->getTestSession()->getActiveId();
1430 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
1431 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
1433 $certificate->outCertificate(array(
"active_id" => $active_id,
"pass" => $counted_pass));
1438 if( !$this->object->isPassDeletionAllowed() )
1440 $this->ctrl->redirect($this,
'outUserResultsOverview');
1444 require_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1446 $confirm->addHiddenItem(
'active_id',
$_GET[
'active_id']);
1447 $confirm->addHiddenItem(
'pass',
$_GET[
'pass']);
1448 $confirm->setHeaderText($this->lng->txt(
'conf_delete_pass'));
1449 $confirm->setFormAction($this->ctrl->getFormAction($this,
'post'));
1450 $confirm->setHeaderText($this->lng->txt(
'conf_delete_pass'));
1451 $confirm->setCancel($this->lng->txt(
'cancel'),
'outUserResultsOverview');
1452 $confirm->setConfirm($this->lng->txt(
'delete'),
'performDeletePass');
1454 $tpl->setContent($confirm->getHTML());
1459 if( !$this->object->isPassDeletionAllowed() )
1461 $this->ctrl->redirect($this,
'outUserResultsOverview');
1466 $active_fi =
$_GET[
'active_id'];
1469 if( !$this->object->isDynamicTest() &&
$pass == $this->
object->_getResultPass($active_fi) )
1471 $this->ctrl->redirect($this,
'outUserResultsOverview');
1476 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1478 LEFT JOIN tst_sequence
1479 ON tst_sequence.active_fi = tst_active.active_id
1480 AND tst_sequence.pass = tst_active.tries
1481 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1486 $tries =
$row[
'tries'];
1487 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1489 if(
$pass < $lastFinishedPass )
1491 $isActivePass =
false;
1492 $must_renumber =
true;
1494 elseif(
$pass == $lastFinishedPass )
1496 $isActivePass =
false;
1498 if( $tries ==
$row[
'pass'] )
1500 $must_renumber =
true;
1504 $must_renumber =
false;
1509 $isActivePass =
true;
1510 $must_renumber =
false;
1513 if( !$this->object->isDynamicTest() && $isActivePass )
1515 $this->ctrl->redirect($this,
'outUserResultsOverview');
1519 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1520 || ($isActivePass ==
true)
1537 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1540 elseif( !$isActivePass )
1544 SET tries = ' . $ilDB->quote($tries-1,
'integer') .
',
1545 last_finished_pass = ' . $ilDB->quote($lastFinishedPass-1,
'integer') .
'
1546 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1554 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1555 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1561 'UPDATE tst_manual_fb
1563 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1564 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1573 FROM tst_pass_result
1574 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1575 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1581 'UPDATE tst_pass_result
1583 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1584 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1597 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1598 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1604 'UPDATE tst_sequence
1606 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1607 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1615 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1616 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1622 'UPDATE tst_solutions
1624 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1625 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1640 FROM tst_test_result
1641 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1642 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1648 'UPDATE tst_test_result
1650 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1651 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1661 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1662 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1670 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1671 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1675 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
1682 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1685 $this->ctrl->redirectByClass(
'iltestoutputgui',
'outuserresultsoverview');