4 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
6 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
44 $cmd = $this->ctrl->getCmd();
45 $next_class = $this->ctrl->getNextClass($this);
46 $this->ctrl->saveParameter($this,
"sequence");
47 $this->ctrl->saveParameter($this,
"active_id");
60 $headernames = array();
61 if ($this->object->getAnonymity())
63 array_push($headernames, $this->lng->txt(
"counter"));
67 array_push($headernames, $this->lng->txt(
"name"));
68 array_push($headernames, $this->lng->txt(
"login"));
70 $additionalFields = $this->
object->getEvaluationAdditionalFields();
71 if (count($additionalFields))
73 foreach ($additionalFields as $fieldname)
75 array_push($headernames, $this->lng->txt($fieldname));
78 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
79 array_push($headernames, $this->lng->txt(
"tst_mark"));
80 if ($this->object->ects_output)
82 array_push($headernames, $this->lng->txt(
"ects_grade"));
84 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
85 array_push($headernames, $this->lng->txt(
"working_time"));
86 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
92 $headervars = array();
93 if ($this->object->getAnonymity())
95 array_push($headervars,
"counter");
99 array_push($headervars,
"name");
100 array_push($headervars,
"login");
102 array_push($headervars,
"resultspoints");
103 array_push($headervars,
"resultsmarks");
104 if ($this->object->ects_output)
106 array_push($headervars,
"ects_grade");
108 array_push($headervars,
"qworkedthrough");
109 array_push($headervars,
"timeofwork");
110 array_push($headervars,
"");
116 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
118 $table_gui->writeFilterToSession();
119 $this->ctrl->redirect($this,
"outEvaluation");
124 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
126 $table_gui->resetFilter();
127 $this->ctrl->redirect($this,
"outEvaluation");
139 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
143 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
146 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
149 $this,
'outEvaluation', $this->object->getAnonymity(), $this->
object->isOfferingQuestionHintsEnabled()
153 $arrFilter = array();
155 foreach ($table_gui->getFilterItems() as $item)
157 if ($item->getValue() !==
false)
159 switch ($item->getPostVar())
164 $arrFilter[$item->getPostVar()] = $item->getValue();
167 $passedonly = $item->getChecked();
172 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
174 $eval->setFilterArray($arrFilter);
175 $foundParticipants =& $eval->getParticipants();
177 if (count($foundParticipants) > 0)
179 if ($this->object->ects_output)
181 $passed_array =& $this->
object->getTotalPointsPassedArray();
183 foreach ($foundParticipants as $active_id => $userdata)
190 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
192 if( $mark_obj->getPassed() == FALSE || !$userdata->areObligationsAnswered() )
200 $evaluationrow = array();
201 if ($this->object->getAnonymity())
203 $evaluationrow[
'name'] = $counter;
204 $evaluationrow[
'login'] =
'';
208 $evaluationrow[
'name'] = $userdata->getName();
209 if (strlen($userdata->getLogin()))
211 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
215 $evaluationrow[
'login'] =
'';
219 $evaluationrow[
'reached'] = $userdata->getReached();
220 $evaluationrow[
'max'] = $userdata->getMaxpoints();
221 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
222 $percentage = $userdata->getReachedPointsInPercent();
223 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
224 if (is_object($mark))
226 $evaluationrow[
'mark'] = $mark->getShortName();
228 if ($this->object->ects_output)
230 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
231 $evaluationrow[
'ects_grade'] = $ects_mark;
233 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
234 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
235 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
236 $time_seconds = $userdata->getTimeOfWork();
237 $time_hours = floor($time_seconds/3600);
238 $time_seconds -= $time_hours * 3600;
239 $time_minutes = floor($time_seconds/60);
240 $time_seconds -= $time_minutes * 60;
241 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
242 $this->ctrl->setParameter($this,
"active_id", $active_id);
243 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
244 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
245 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
247 $evaluationrow[
'gender'] = $userfields[
'gender'];
248 $evaluationrow[
'email'] = $userfields[
'email'];
249 $evaluationrow[
'institution'] = $userfields[
'institution'];
250 $evaluationrow[
'street'] = $userfields[
'street'];
251 $evaluationrow[
'city'] = $userfields[
'city'];
252 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
253 $evaluationrow[
'country'] = $userfields[
'country'];
254 $evaluationrow[
'department'] = $userfields[
'department'];
255 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
257 $data[] = $evaluationrow;
263 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation.html",
"Modules/Test");
264 $this->tpl->setVariable(
'EVALUATION_DATA', $table_gui->getHTML());
265 if (count($foundParticipants) > 0)
267 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
268 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
269 if (!$this->object->getAnonymity())
271 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
272 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
275 $template->setVariable(
"TEXT_CERTIFICATE", $this->lng->txt(
"exp_type_certificate"));
278 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
279 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
280 $template->setVariable(
"CMD_EXPORT",
"exportEvaluation");
281 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
282 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
283 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
284 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportEvaluation"));
285 $exportoutput = $template->get();
286 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
290 if ($this->object->getShowSolutionAnswersOnly())
307 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
310 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
313 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
315 $active_id =
$_GET[
"active_id"];
316 if (strlen($active_id) == 0)
318 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
319 $this->ctrl->redirect($this,
"outEvaluation");
324 $data =& $this->
object->getCompleteEvaluationData();
325 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
326 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
327 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
328 $data->getParticipant($active_id)->getName())
330 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
331 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
332 $this->tpl->setVariable(
"VALUE_RESULTSPOINTS", $data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " . $data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f", $data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")");
333 if (strlen($data->getParticipant($active_id)->getMark()))
335 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
336 $this->tpl->setVariable(
"VALUE_RESULTSMARKS", $data->getParticipant($active_id)->getMark());
337 if (strlen($data->getParticipant($active_id)->getECTSMark()))
339 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
340 $this->tpl->setVariable(
"VALUE_ECTS", $data->getParticipant($active_id)->getECTSMark());
344 if( $this->object->isOfferingQuestionHintsEnabled() )
346 $this->tpl->setVariable(
"TXT_REQUESTED_HINTS_COUNT", $this->lng->txt(
"tst_question_hints_requested_hint_count_header"));
347 $this->tpl->setVariable(
"VALUE_REQUESTED_HINTS_COUNT", $data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
350 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
351 $this->tpl->setVariable(
"VALUE_QWORKEDTHROUGH", $data->getParticipant($active_id)->getQuestionsWorkedThrough() .
" " . strtolower($this->lng->txt(
"of")) .
" " . $data->getParticipant($active_id)->getNumberOfQuestions() .
" (" . sprintf(
"%2.2f", $data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent()) .
" %" .
")");
353 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
354 $time_seconds = $data->getParticipant($active_id)->getTimeOfWork();
355 $atime_seconds = $data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds / $data->getParticipant($active_id)->getNumberOfQuestions() : 0;
356 $time_hours = floor($time_seconds/3600);
357 $time_seconds -= $time_hours * 3600;
358 $time_minutes = floor($time_seconds/60);
359 $time_seconds -= $time_minutes * 60;
360 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
361 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
362 $time_hours = floor($atime_seconds/3600);
363 $atime_seconds -= $time_hours * 3600;
364 $time_minutes = floor($atime_seconds/60);
365 $atime_seconds -= $time_minutes * 60;
366 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
367 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
368 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
369 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
373 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
374 #$this->tpl->setVariable("VALUE_LASTVISIT",
375 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
380 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
381 $this->tpl->setVariable(
"VALUE_NROFPASSES", $data->getParticipant($active_id)->getLastPass() + 1);
382 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
385 $this->tpl->setVariable(
"VALUE_SCOREDPASS", $data->getParticipant($active_id)->getBestPass() + 1);
389 $this->tpl->setVariable(
"VALUE_SCOREDPASS", $data->getParticipant($active_id)->getLastPass() + 1);
392 $median = $data->getStatistics()->getStatistics()->median();
393 $pct = $data->getParticipant($active_id)->getMaxpoints() ? ($median / $data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
394 $mark = $this->
object->mark_schema->getMatchingMark($pct);
395 if (is_object($mark))
397 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
398 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
401 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
402 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT", $data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
403 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
404 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN", $data->getStatistics()->getStatistics()->rank_median());
405 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
406 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS", $data->getStatistics()->getStatistics()->count());
407 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
408 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
410 for (
$pass = 0;
$pass <= $data->getParticipant($active_id)->getLastPass();
$pass++)
412 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
415 $this->tpl->setCurrentBlock(
"question_header");
416 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
417 $this->tpl->parseCurrentBlock();
419 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
421 $this->tpl->setCurrentBlock(
"question_footer");
422 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
423 $this->ctrl->setParameter($this,
"statistics",
"1");
424 $this->ctrl->setParameter($this,
"active_id", $active_id);
425 $this->ctrl->setParameter($this,
"pass",
$pass);
426 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
427 $this->tpl->parseCurrentBlock();
429 $questions = $data->getParticipant($active_id)->getQuestions(
$pass);
430 if (!is_array($questions))
432 $questions = $data->getParticipant($active_id)->getQuestions(0);
435 foreach ($questions as $question)
437 $this->tpl->setCurrentBlock(
"question_row");
438 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
439 $this->tpl->setVariable(
"QUESTION_ID", $question[
"id"]);
440 $this->tpl->setVariable(
"QUESTION_ID_TXT", $this->lng->txt(
'question_id_short'));
441 $this->tpl->setVariable(
"QUESTION_TITLE", $data->getQuestionTitle($question[
"id"]));
442 $answeredquestion = $data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
443 if (is_array($answeredquestion))
445 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
446 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
450 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
452 $this->tpl->parseCurrentBlock();
455 $this->tpl->touchBlock(
"question_stats");
475 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
479 $question_object->getFileUploadZIPFile($this->object->getTestId());
483 $this->ctrl->redirect($this,
"singleResults");
498 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
502 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
505 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
506 $eval =& $this->
object->getCompleteEvaluationData();
508 $foundParticipants =& $eval->getParticipants();
509 if (count($foundParticipants))
511 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
512 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
513 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
514 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
515 $template->setVariable(
"CMD_EXPORT",
"exportAggregatedResults");
516 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
517 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
518 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
519 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportAggregatedResults"));
520 $exportoutput = $template->get();
521 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
523 array_push($data, array(
524 'result' => $this->lng->txt(
"tst_eval_total_persons"),
525 'value' => count($foundParticipants)
527 $total_finished = $this->
object->evalTotalFinished();
528 array_push($data, array(
529 'result' => $this->lng->txt(
"tst_eval_total_finished"),
530 'value' => $total_finished
532 $average_time = $this->
object->evalTotalStartedAverageTime();
533 $diff_seconds = $average_time;
534 $diff_hours = floor($diff_seconds/3600);
535 $diff_seconds -= $diff_hours * 3600;
536 $diff_minutes = floor($diff_seconds/60);
537 $diff_seconds -= $diff_minutes * 60;
538 array_push($data, array(
539 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
540 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
543 $total_passed_reached = 0;
544 $total_passed_max = 0;
545 $total_passed_time = 0;
546 foreach ($foundParticipants as $userdata)
548 if ($userdata->getPassed())
551 $total_passed_reached += $userdata->getReached();
552 $total_passed_max += $userdata->getMaxpoints();
553 $total_passed_time += $userdata->getTimeOfWork();
556 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
557 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
558 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
559 array_push($data, array(
560 'result' => $this->lng->txt(
"tst_eval_total_passed"),
561 'value' => $total_passed
563 array_push($data, array(
564 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
565 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
567 $average_time = $average_passed_time;
568 $diff_seconds = $average_time;
569 $diff_hours = floor($diff_seconds/3600);
570 $diff_seconds -= $diff_hours * 3600;
571 $diff_minutes = floor($diff_seconds/60);
572 $diff_seconds -= $diff_minutes * 60;
573 array_push($data, array(
574 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
575 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
579 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
581 $table_gui->setData($data);
582 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
585 foreach ($eval->getQuestionTitles() as $question_id => $question_title)
590 foreach ($foundParticipants as $userdata)
592 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
594 if (is_object($userdata->getPass($i)))
596 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
597 if (is_array($question))
600 $reached += $question[
"reached"];
601 $max += $question[
"points"];
606 $percent = $max ? $reached/$max * 100.0 : 0;
608 $this->ctrl->setParameter($this,
"qid", $question_id);
611 'qid' => $question_id,
612 'title' => $question_title,
613 'points' => sprintf(
"%.2f", $answered ? $reached / $answered : 0) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%.2f", $answered ? $max / $answered : 0),
614 'percentage' => (float)$percent,
615 'answers' => $answered
619 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
621 $table_gui->setData($rows);
622 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
631 if (array_key_exists(
"g_filterby",
$_GET))
633 $filterby =
$_GET[
"g_filterby"];
637 if (array_key_exists(
"g_userfilter",
$_GET))
639 $filtertext =
$_GET[
"g_userfilter"];
643 if (array_key_exists(
"g_passedonly",
$_GET))
645 if (
$_GET[
"g_passedonly"] == 1)
651 switch (
$_POST[
"export_type"])
654 require_once
'./Modules/Test/classes/class.ilTestExport.php';
655 $exportObj =
new ilTestExport($this->
object,
"results");
656 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
660 require_once
'./Modules/Test/classes/class.ilTestExport.php';
661 $exportObj =
new ilTestExport($this->
object,
"results");
662 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
668 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
670 if (strlen($filtertext))
672 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
674 $this->ctrl->redirect($this,
"exportCertificate");
686 switch (
$_POST[
"export_type"])
689 include_once
"./Modules/Test/classes/class.ilTestExport.php";
690 $exportObj =
new ilTestExport($this->
object,
"aggregated");
691 $exportObj->exportToExcel($deliver = TRUE);
694 include_once
"./Modules/Test/classes/class.ilTestExport.php";
695 $exportObj =
new ilTestExport($this->
object,
"aggregated");
696 $exportObj->exportToCSV($deliver = TRUE);
711 include_once
"./Services/Utilities/classes/class.ilUtil.php";
712 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
713 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
715 $archive_dir = $certificate->createArchiveDirectory();
716 $total_users = array();
717 $total_users =& $this->
object->evalTotalPersonsArray();
718 if (count($total_users))
720 foreach ($total_users as $active_id => $name)
722 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
723 $pdf = $certificate->outCertificate(
725 "active_id" => $active_id,
726 "userfilter" => $userfilter,
727 "passedonly" => $passedonly
733 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id .
"_" . str_replace(
" ",
"_",
ilUtil::getASCIIFilename($name)) .
".pdf");
736 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
749 if ($original_id > 0)
768 global $ilTabs, $ilAccess;
770 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
774 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
777 $this->ctrl->saveParameter($this,
"active_id");
778 $active_id = (int)
$_GET[
"active_id"];
779 $testSession = $this->testSessionFactory->getSession($active_id);
782 if( $testSession->getTestId() != $this->
object->getTestId() )
785 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
788 $this->ctrl->saveParameter($this,
"pass");
791 $result_array =& $this->
object->getTestResult($active_id,
$pass);
795 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
797 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
799 $this->ctrl->setParameter($this,
"pdf",
"1");
800 $template->setCurrentBlock(
"pdf_export");
801 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
802 $this->ctrl->setParameter($this,
"pdf",
"");
803 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
804 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
806 $template->parseCurrentBlock();
808 if (array_key_exists(
"statistics",
$_GET) && (
$_GET[
"statistics"] == 1))
810 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
811 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
812 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilTestEvaluationGUI",
"detailedEvaluation"));
816 if ($this->object->getNrOfTries() == 1)
818 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
819 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
823 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outParticipantsResultsOverview"));
824 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
827 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
828 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
830 if ($this->object->getNrOfTries() == 1)
833 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
834 if (strlen($statement[
"markects"]))
836 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
841 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
842 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
843 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
844 $template->setVariable(
"PASS_DETAILS", $overview);
845 $template->setVariable(
"USER_DETAILS", $user_data);
846 $uname = $this->
object->userLookupFullName($user_id);
847 $template->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
850 if ($this->object->getShowSolutionAnswersOnly())
855 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
858 require_once
'class.ilTestPDFGenerator.php';
863 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
876 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
880 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
883 $active_id = (int)
$_GET[
"active_id"];
884 $testSession = $this->testSessionFactory->getSession($active_id);
887 if( $testSession->getTestId() != $this->
object->getTestId() )
890 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
893 if ($this->object->getNrOfTries() == 1)
895 $this->ctrl->setParameter($this,
"active_id", $active_id);
897 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
900 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
902 $this->ctrl->setParameter($this,
"pdf",
"1");
903 $template->setCurrentBlock(
"pdf_export");
904 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsResultsOverview"));
905 $this->ctrl->setParameter($this,
"pdf",
"");
906 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
907 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
909 $template->parseCurrentBlock();
911 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outParticipantsPassDetails");
912 $template->setVariable(
"PASS_OVERVIEW", $overview);
913 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
914 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
915 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
916 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
917 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
920 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
922 $template->setVariable(
"USER_DATA", $user_data);
923 $template->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"tst_results_overview"));
924 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
925 if (strlen($statement[
"markects"]))
927 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
929 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
930 $template->parseCurrentBlock();
933 if ($this->object->getShowSolutionAnswersOnly())
938 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
943 $filename = $name[
'lastname'] .
'_' . $name[
'firstname'] .
'_' . $name[
'login'] .
'__'. $this->
object->getTitle();
944 require_once
'class.ilTestPDFGenerator.php';
951 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
964 $testSession = $this->testSessionFactory->getSession();
966 $active_id = $testSession->getActiveId();
967 $user_id = $testSession->getUserId();
969 $this->ctrl->saveParameter($this,
"pass");
971 $result_array =& $this->
object->getTestResult($active_id,
$pass);
973 $command_solution_details =
"";
974 if ($this->object->getShowSolutionDetails())
976 $command_solution_details =
"outCorrectSolution";
978 $overview = $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserPassDetails", $command_solution_details);
980 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_pass_details_overview_participants.html",
"Modules/Test");
982 if ($this->object->getNrOfTries() == 1)
985 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
986 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
990 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outUserResultsOverview"));
991 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
994 $this->tpl->parseCurrentBlock();
996 if ($this->object->getNrOfTries() == 1)
999 $this->tpl->setVariable(
"USER_MARK", $statement[
"mark"]);
1000 if (strlen($statement[
"markects"]))
1002 $this->tpl->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1008 $this->tpl->setCurrentBlock(
"adm_content");
1009 $this->tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1010 $this->tpl->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1011 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1012 $this->tpl->setVariable(
"PASS_DETAILS", $overview);
1013 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1014 $this->tpl->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1015 $this->tpl->parseCurrentBlock();
1018 if ($this->object->getShowSolutionAnswersOnly())
1035 $testSession = $this->testSessionFactory->getSession();
1037 if (!$this->object->canShowTestResults($testSession, $ilUser->getId())) $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1038 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
1039 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1040 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1043 $user_id = $ilUser->getId();
1044 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1045 $active_id = $testSession->getActiveId();
1046 $hide_details = !$this->
object->getShowPassDetails();
1049 $executable = $this->
object->isExecutable($testSession, $ilUser->getId());
1050 if (!$executable[
"executable"]) $hide_details = FALSE;
1052 $begin = microtime(
true);
1053 if (($this->object->getNrOfTries() == 1) && (!$hide_details))
1059 $template->setCurrentBlock(
"pass_overview");
1060 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserResultsOverview", FALSE, $hide_details);
1061 $template->setVariable(
"PASS_OVERVIEW", $overview);
1062 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results_overview"));
1063 $template->parseCurrentBlock();
1066 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
1072 $this->ctrl->setParameter($this,
"pass",
$pass);
1073 $this->ctrl->setParameter($this,
"pdf",
"1");
1074 $templatehead->setCurrentBlock(
"pdf_export");
1075 $templatehead->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1076 $this->ctrl->setParameter($this,
"pass",
"");
1077 $this->ctrl->setParameter($this,
"pdf",
"");
1078 $templatehead->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
1079 $templatehead->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
1081 $templatehead->parseCurrentBlock();
1083 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1086 if ($this->object->canShowCertificate($testSession, $user_id, $active_id))
1088 $templatehead->setVariable(
"CERTIFICATE_URL", $this->ctrl->getLinkTarget($this,
"outCertificate"));
1089 $templatehead->setVariable(
"CERTIFICATE_TEXT", $this->lng->txt(
"certificate"));
1092 $templatehead->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1093 $templatehead->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1094 $templatehead->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1095 $templatehead->setVariable(
"PRINT_URL",
"javascript:window.print();");
1101 $this->ctrl->saveParameter($this,
"pass");
1102 $this->ctrl->saveParameter($this,
"active_id");
1103 if (!is_null(
$pass))
1105 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1106 $command_solution_details =
"";
1107 if ($this->object->getShowSolutionDetails())
1109 $command_solution_details =
"outCorrectSolution";
1111 $detailsoverview = (!$hide_details) ? $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserResultsOverview", $command_solution_details) :
'';
1113 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1115 if (!$hide_details && $this->object->canShowSolutionPrintview())
1117 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass, $this->object->getShowSolutionListComparison());
1119 else if ($this->object->getShowSolutionDetails())
1125 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1126 $template->setVariable(
"PASS_RESULTS_OVERVIEW", sprintf($this->lng->txt(
"tst_results_overview_pass"),
$pass + 1));
1127 $template->setVariable(
"PASS_DETAILS", $detailsoverview);
1130 $template->setVariable(
"SIGNATURE", $signature);
1131 if ($this->object->isShowExamIdInTestResultsEnabled())
1133 $template->setCurrentBlock(
'exam_id_footer');
1134 $template->setVariable(
'EXAM_ID_VAL', $this->object->lookupExamId(
1135 $testSession->getActiveId(),
$pass
1137 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1138 $template->parseCurrentBlock();
1141 if ($this->object->getAnonymity()) {
1142 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1145 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1146 $template->setVariable(
"USER_DATA", $user_data);
1148 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
1149 if (strlen($statement[
"markects"]))
1151 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1153 $template->parseCurrentBlock();
1156 if ($this->object->getShowSolutionAnswersOnly())
1160 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1162 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1165 require_once
'class.ilTestPDFGenerator.php';
1166 $content = $template->get();
1172 $this->tpl->setVariable(
"PRINT_CONTENT", $templatehead->get());
1187 if (!$this->object->getShowSolutionPrintview())
1190 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1193 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1196 if (array_key_exists(
"pass",
$_GET))
1200 $user_id = $ilUser->getId();
1202 $testSession = $this->testSessionFactory->getSession();
1203 $active_id = $testSession->getActiveId();
1206 if ($this->object->getNrOfTries() == 1)
1212 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserListOfAnswerPasses", TRUE);
1213 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1214 $template->setVariable(
"PASS_OVERVIEW", $overview);
1221 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1222 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1223 $showAllAnswers = TRUE;
1224 if ($this->object->isExecutable($testSession, $user_id))
1226 $showAllAnswers = FALSE;
1229 $template->setVariable(
"PASS_DETAILS", $answers);
1231 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1232 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1233 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1234 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1235 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1238 $template->setVariable(
"USER_DATA", $user_data);
1239 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1240 if (strlen($signature))
1242 $template->setVariable(
"SIGNATURE", $signature);
1244 if ($this->object->isShowExamIdInTestResultsEnabled())
1246 $template->setCurrentBlock(
'exam_id_footer');
1247 $template->setVariable(
'EXAM_ID_VAL', $this->object->lookupExamId(
1248 $testSession->getActiveId(),
$pass
1250 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1251 $template->parseCurrentBlock();
1253 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1256 if ($this->object->getShowSolutionAnswersOnly())
1271 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1273 $this->ctrl->saveParameter($this,
"pass");
1274 $this->ctrl->saveParameter($this,
"active_id");
1275 $this->outTestResults(
false,
$_GET[
"pass"]);
1279 $this->outTestResults(
false);
1290 if( !$this->object->getShowSolutionDetails() )
1293 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1296 $testSession = $this->testSessionFactory->getSession();
1297 $activeId = $testSession->getActiveId();
1299 if( !($activeId > 0) )
1301 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1304 if( !$this->object->canShowTestResults($testSession, $testSession->getUserId()) )
1306 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1309 $this->ctrl->saveParameter($this,
"pass");
1312 $testSequence = $this->testSequenceFactory->getSequenceByPass($testSession,
$pass);
1313 $testSequence->loadFromDb();
1314 $testSequence->loadQuestions();
1316 $questionId = (int)
$_GET[
'evaluation'];
1318 if( !$testSequence->questionExists($questionId) )
1320 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1323 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1325 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1326 $this->tpl->setCurrentBlock(
"ContentStyle");
1328 $this->tpl->parseCurrentBlock();
1330 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1332 $this->tpl->parseCurrentBlock();
1335 if ($this->object->getShowSolutionAnswersOnly())
1340 $this->tpl->setCurrentBlock(
"adm_content");
1342 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1343 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1344 $this->ctrl->saveParameter($this,
"pass");
1345 $this->ctrl->saveParameter($this,
"active_id");
1346 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1347 $this->tpl->parseCurrentBlock();
1358 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1362 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1365 $data =& $this->
object->getCompleteEvaluationData();
1366 $color_class = array(
"tblrow1",
"tblrow2");
1368 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1369 $foundParticipants =& $data->getParticipants();
1370 if (count($foundParticipants) == 0)
1378 foreach ($data->getQuestionTitles() as $question_id => $question_title)
1383 foreach ($foundParticipants as $userdata)
1385 $pass = $userdata->getScoredPass();
1386 if (is_object($userdata->getPass(
$pass)))
1388 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1389 if (is_array($question))
1396 $this->ctrl->setParameter($this,
"qid", $question_id);
1397 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1402 if ($question_object->hasFileUploads($this->object->getTestId()))
1404 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants").
"\">" . $this->lng->txt(
"download") .
"</a>";
1409 'qid' => $question_id,
1410 'question_title' => $question_title,
1411 'number_of_answers' => $answered,
1412 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1413 'file_uploads' => $download
1419 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1421 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1422 $table_gui->setData($rows);
1424 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1428 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1438 $testSession = $this->testSessionFactory->getSession();
1440 require_once
'./Services/Certificate/classes/class.ilCertificate.php';
1441 require_once
'./Modules/Test/classes/class.ilTestCertificateAdapter.php';
1443 $certificate->outCertificate(
1445 "active_id" => $testSession->getActiveId(),
1453 if( !$this->object->isPassDeletionAllowed() )
1455 $this->ctrl->redirect($this,
'outUserResultsOverview');
1458 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1460 if( isset(
$_GET[
'context']) && strlen(
$_GET[
'context']) )
1462 $context =
$_GET[
'context'];
1470 $confirm->build((
int)
$_GET[
'active_id'], (
int)$_GET[
'pass'], $context);
1473 $tpl->setContent($this->ctrl->getHTML($confirm));
1483 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1489 $this->ctrl->redirect($this,
'outUserResultsOverview');
1493 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1497 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1501 public function performDeletePass()
1503 if( !$this->object->isPassDeletionAllowed() )
1505 $this->ctrl->redirect($this,
'outUserResultsOverview');
1513 if( isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id'] )
1515 $active_fi = $_POST[
'active_id'];
1518 if( isset($_POST[
'pass']) && is_numeric($_POST[
'pass']) )
1520 $pass = $_POST[
'pass'];
1523 if( is_null($active_fi) || is_null(
$pass) )
1525 $this->ctrl->redirect($this,
'outUserResultsOverview');
1528 if( !$this->object->isDynamicTest() &&
$pass == $this->
object->_getResultPass($active_fi) )
1530 $this->ctrl->redirect($this,
'outUserResultsOverview');
1535 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1537 LEFT JOIN tst_sequence
1538 ON tst_sequence.active_fi = tst_active.active_id
1539 AND tst_sequence.pass = tst_active.tries
1540 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1545 $tries =
$row[
'tries'];
1546 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1548 if(
$pass < $lastFinishedPass )
1550 $isActivePass =
false;
1551 $must_renumber =
true;
1553 elseif(
$pass == $lastFinishedPass )
1555 $isActivePass =
false;
1557 if( $tries ==
$row[
'pass'] )
1559 $must_renumber =
true;
1563 $must_renumber =
false;
1568 $isActivePass =
true;
1569 $must_renumber =
false;
1572 if( !$this->object->isDynamicTest() && $isActivePass )
1574 $this->ctrl->redirect($this,
'outUserResultsOverview');
1578 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1579 || ($isActivePass ==
true)
1596 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1599 elseif( !$isActivePass )
1603 SET tries = ' . $ilDB->quote($tries-1,
'integer') .
',
1604 last_finished_pass = ' . $ilDB->quote($lastFinishedPass-1,
'integer') .
'
1605 WHERE active_id = ' . $ilDB->quote($active_fi,
'integer')
1612 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1613 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1619 'UPDATE tst_manual_fb
1621 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1622 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1631 FROM tst_pass_result
1632 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1633 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1639 'UPDATE tst_pass_result
1641 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1642 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1655 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1656 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1662 'UPDATE tst_sequence
1664 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1665 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1669 if( $this->object->isDynamicTest() )
1672 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked'
1675 foreach($tables as $table)
1679 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1680 AND pass = {$ilDB->quote($pass, 'integer')}
1683 if( $must_renumber )
1688 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1689 AND pass > {$ilDB->quote($pass, 'integer')}
1699 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1700 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1706 'UPDATE tst_solutions
1708 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1709 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1716 FROM tst_test_result
1717 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1718 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1724 'UPDATE tst_test_result
1726 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1727 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1737 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer') .
'
1738 AND pass = ' . $ilDB->quote(
$pass,
'integer')
1746 WHERE active_fi = ' . $ilDB->quote($active_fi,
'integer').
'
1747 AND pass > ' . $ilDB->quote(
$pass,
'integer')
1751 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
1758 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1761 if( $this->object->isDynamicTest() )
1763 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';