24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
25 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
63 $cmd = $this->ctrl->getCmd();
64 $next_class = $this->ctrl->getNextClass($this);
65 $this->ctrl->saveParameter($this,
"sequence");
66 $this->ctrl->saveParameter($this,
"active_id");
79 $headernames = array();
80 if ($this->object->getAnonymity())
82 array_push($headernames, $this->lng->txt(
"counter"));
86 array_push($headernames, $this->lng->txt(
"name"));
87 array_push($headernames, $this->lng->txt(
"login"));
89 $additionalFields = $this->
object->getEvaluationAdditionalFields();
90 if (count($additionalFields))
92 foreach ($additionalFields as $fieldname)
94 array_push($headernames, $this->lng->txt($fieldname));
97 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
98 array_push($headernames, $this->lng->txt(
"tst_mark"));
99 if ($this->object->ects_output)
101 array_push($headernames, $this->lng->txt(
"ects_grade"));
103 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
104 array_push($headernames, $this->lng->txt(
"working_time"));
105 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
111 $headervars = array();
112 if ($this->object->getAnonymity())
114 array_push($headervars,
"counter");
118 array_push($headervars,
"name");
119 array_push($headervars,
"login");
121 array_push($headervars,
"resultspoints");
122 array_push($headervars,
"resultsmarks");
123 if ($this->object->ects_output)
125 array_push($headervars,
"ects_grade");
127 array_push($headervars,
"qworkedthrough");
128 array_push($headervars,
"timeofwork");
129 array_push($headervars,
"");
135 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
137 $table_gui->writeFilterToSession();
138 $this->ctrl->redirect($this,
"outEvaluation");
143 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
145 $table_gui->resetFilter();
146 $this->ctrl->redirect($this,
"outEvaluation");
158 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
162 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
165 if (!$this->object->getAnonymity())
167 $additionalFields = $this->
object->getEvaluationAdditionalFields();
171 $additionalFields = array();
173 if ($this->object->ects_output)
175 array_push($additionalFields,
'ects_grade');
177 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
178 $table_gui =
new ilEvaluationAllTableGUI($this,
'outEvaluation', $additionalFields, $this->object->getAnonymity());
180 $arrFilter = array();
181 foreach ($table_gui->getFilterItems() as $item)
183 if ($item->getValue() !==
false)
185 switch ($item->getPostVar())
190 $arrFilter[$item->getPostVar()] = $item->getValue();
193 $passedonly = $item->getChecked();
198 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
200 $eval->setFilterArray($arrFilter);
201 $foundParticipants =& $eval->getParticipants();
203 if (count($foundParticipants) > 0)
205 if ($this->object->ects_output)
207 $passed_array =& $this->
object->getTotalPointsPassedArray();
209 foreach ($foundParticipants as $active_id => $userdata)
214 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
215 if ($mark_obj->getPassed() == FALSE)
224 foreach ($userfields as
$key => $value)
226 $evaluationrow[
$key] = strlen($value) ? $value :
' ';
228 $evaluationrow = array();
230 if ($this->object->getAnonymity())
232 $fullname = $counter;
233 $evaluationrow[
'name'] = $fullname;
234 $evaluationrow[
'login'] =
'';
238 $evaluationrow[
'name'] = $userdata->getName();
239 if (strlen($userdata->getLogin()))
241 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
245 $evaluationrow[
'login'] =
'';
249 $evaluationrow[
'reached'] = $userdata->getReached();
250 $evaluationrow[
'max'] = $userdata->getMaxpoints();
251 $percentage = $userdata->getReachedPointsInPercent();
252 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
253 if (is_object($mark))
255 $evaluationrow[
'mark'] = $mark->getShortName();
257 if ($this->object->ects_output)
259 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
260 $evaluationrow[
'ects_grade'] = $ects_mark;
262 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThrough() .
" " . strtolower($this->lng->txt(
"of")) .
" " . $userdata->getNumberOfQuestions() .
" (" . sprintf(
"%2.2f", $userdata->getQuestionsWorkedThroughInPercent()) .
" %" .
")";
263 $time_seconds = $userdata->getTimeOfWork();
264 $time_hours = floor($time_seconds/3600);
265 $time_seconds -= $time_hours * 3600;
266 $time_minutes = floor($time_seconds/60);
267 $time_seconds -= $time_minutes * 60;
268 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
269 $this->ctrl->setParameter($this,
"active_id", $active_id);
270 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
271 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
272 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
274 $evaluationrow[
'gender'] = $userfields[
'gender'];
275 $evaluationrow[
'email'] = $userfields[
'email'];
276 $evaluationrow[
'institution'] = $userfields[
'institution'];
277 $evaluationrow[
'street'] = $userfields[
'street'];
278 $evaluationrow[
'city'] = $userfields[
'city'];
279 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
280 $evaluationrow[
'country'] = $userfields[
'country'];
281 $evaluationrow[
'departement'] = $userfields[
'departement'];
282 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
284 array_push($data, $evaluationrow);
289 $table_gui->setData($data);
290 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation.html",
"Modules/Test");
291 $this->tpl->setVariable(
'EVALUATION_DATA', $table_gui->getHTML());
292 if (count($foundParticipants) > 0)
294 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
295 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
296 if (!$this->object->getAnonymity())
298 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
299 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
302 $template->setVariable(
"TEXT_CERTIFICATE", $this->lng->txt(
"exp_type_certificate"));
305 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
306 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
307 $template->setVariable(
"CMD_EXPORT",
"exportEvaluation");
308 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
309 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
310 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
311 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportEvaluation"));
312 $exportoutput = $template->get();
313 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
317 if ($this->object->getShowSolutionAnswersOnly())
334 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
337 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
340 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
342 $active_id =
$_GET[
"active_id"];
343 if (strlen($active_id) == 0)
345 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
346 $this->ctrl->redirect($this,
"outEvaluation");
351 $data =& $this->
object->getCompleteEvaluationData();
352 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
353 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
354 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
355 $data->getParticipant($active_id)->getName())
357 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
358 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
359 $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()) .
" %" .
")");
360 if (strlen(
$data->getParticipant($active_id)->getMark()))
362 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
363 $this->tpl->setVariable(
"VALUE_RESULTSMARKS",
$data->getParticipant($active_id)->getMark());
364 if (strlen(
$data->getParticipant($active_id)->getECTSMark()))
366 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
367 $this->tpl->setVariable(
"VALUE_ECTS",
$data->getParticipant($active_id)->getECTSMark());
370 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
371 $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()) .
" %" .
")");
373 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
374 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
375 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
376 $time_hours = floor($time_seconds/3600);
377 $time_seconds -= $time_hours * 3600;
378 $time_minutes = floor($time_seconds/60);
379 $time_seconds -= $time_minutes * 60;
380 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
381 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
382 $time_hours = floor($atime_seconds/3600);
383 $atime_seconds -= $time_hours * 3600;
384 $time_minutes = floor($atime_seconds/60);
385 $atime_seconds -= $time_minutes * 60;
386 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
387 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
388 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
389 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
393 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
394 #$this->tpl->setVariable("VALUE_LASTVISIT",
395 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
400 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
401 $this->tpl->setVariable(
"VALUE_NROFPASSES",
$data->getParticipant($active_id)->getLastPass() + 1);
402 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
405 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getBestPass() + 1);
409 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getLastPass() + 1);
412 $median =
$data->getStatistics()->getStatistics()->median();
413 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
414 $mark = $this->
object->mark_schema->getMatchingMark($pct);
415 if (is_object($mark))
417 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
418 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
421 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
422 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT",
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
423 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
424 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN",
$data->getStatistics()->getStatistics()->rank_median());
425 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
426 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS",
$data->getStatistics()->getStatistics()->count());
427 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
428 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
432 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
435 $this->tpl->setCurrentBlock(
"question_header");
436 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
437 $this->tpl->parseCurrentBlock();
439 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
441 $this->tpl->setCurrentBlock(
"question_footer");
442 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
443 $this->ctrl->setParameter($this,
"statistics",
"1");
444 $this->ctrl->setParameter($this,
"active_id", $active_id);
445 $this->ctrl->setParameter($this,
"pass",
$pass);
446 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
447 $this->tpl->parseCurrentBlock();
449 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
450 if (!is_array($questions))
452 $questions =
$data->getParticipant($active_id)->getQuestions(0);
455 foreach ($questions as $question)
457 $this->tpl->setCurrentBlock(
"question_row");
458 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
459 $this->tpl->setVariable(
"QUESTION_TITLE",
$data->getQuestionTitle($question[
"id"]));
460 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
461 if (is_array($answeredquestion))
463 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
464 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
468 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
470 $this->tpl->parseCurrentBlock();
473 $this->tpl->touchBlock(
"question_stats");
497 if (method_exists($question_object,
"getFileUploadZIPFile"))
499 $question_object->getFileUploadZIPFile($this->object->getTestId());
503 $this->ctrl->redirect($this,
"singleResults");
518 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
522 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
525 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
526 $eval =& $this->
object->getCompleteEvaluationData();
528 $foundParticipants =& $eval->getParticipants();
529 if (count($foundParticipants))
531 $template =
new ilTemplate(
"tpl.il_as_tst_evaluation_export.html", TRUE, TRUE,
"Modules/Test");
532 $template->setVariable(
"EXPORT_DATA", $this->lng->txt(
"exp_eval_data"));
533 $template->setVariable(
"TEXT_EXCEL", $this->lng->txt(
"exp_type_excel"));
534 $template->setVariable(
"TEXT_CSV", $this->lng->txt(
"exp_type_spss"));
535 $template->setVariable(
"CMD_EXPORT",
"exportAggregatedResults");
536 $template->setVariable(
"BTN_EXPORT", $this->lng->txt(
"export"));
537 $template->setVariable(
"BTN_PRINT", $this->lng->txt(
"print"));
538 $template->setVariable(
"BTN_COMMAND", $this->ctrl->getCmd());
539 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"exportAggregatedResults"));
540 $exportoutput = $template->get();
541 $this->tpl->setVariable(
"EVALUATION_EXPORT", $exportoutput);
543 array_push(
$data, array(
544 'result' => $this->lng->txt(
"tst_eval_total_persons"),
545 'value' => count($foundParticipants)
547 $total_finished = $this->
object->evalTotalFinished();
548 array_push(
$data, array(
549 'result' => $this->lng->txt(
"tst_eval_total_finished"),
550 'value' => $total_finished
552 $average_time = $this->
object->evalTotalStartedAverageTime();
553 $diff_seconds = $average_time;
554 $diff_hours = floor($diff_seconds/3600);
555 $diff_seconds -= $diff_hours * 3600;
556 $diff_minutes = floor($diff_seconds/60);
557 $diff_seconds -= $diff_minutes * 60;
558 array_push(
$data, array(
559 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
560 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
563 $total_passed_reached = 0;
564 $total_passed_max = 0;
565 $total_passed_time = 0;
566 foreach ($foundParticipants as $userdata)
568 if ($userdata->getPassed())
571 $total_passed_reached += $userdata->getReached();
572 $total_passed_max += $userdata->getMaxpoints();
573 $total_passed_time += $userdata->getTimeOfWork();
576 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
577 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
578 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
579 array_push(
$data, array(
580 'result' => $this->lng->txt(
"tst_eval_total_passed"),
581 'value' => $total_passed
583 array_push(
$data, array(
584 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
585 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
587 $average_time = $average_passed_time;
588 $diff_seconds = $average_time;
589 $diff_hours = floor($diff_seconds/3600);
590 $diff_seconds -= $diff_hours * 3600;
591 $diff_minutes = floor($diff_seconds/60);
592 $diff_seconds -= $diff_minutes * 60;
593 array_push(
$data, array(
594 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
595 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
599 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
601 $table_gui->setData(
$data);
602 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
605 foreach ($eval->getQuestionTitles() as $question_id => $question_title)
610 foreach ($foundParticipants as $userdata)
612 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
614 if (is_object($userdata->getPass($i)))
616 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
617 if (is_array($question))
620 $reached += $question[
"reached"];
621 $max += $question[
"points"];
626 $percent = $max ? $reached/$max * 100.0 : 0;
628 $this->ctrl->setParameter($this,
"qid", $question_id);
631 'title' => $question_title,
632 'points' => sprintf(
"%.2f", $answered ? $reached / $answered : 0) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%.2f", $answered ? $max / $answered : 0),
633 'percentage' => (float)$percent,
634 'answers' => $answered
638 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
640 $table_gui->setData($rows);
641 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
652 if (array_key_exists(
"g_filterby",
$_GET))
654 $filterby =
$_GET[
"g_filterby"];
657 if (array_key_exists(
"g_userfilter",
$_GET))
659 $filtertext =
$_GET[
"g_userfilter"];
662 if (array_key_exists(
"g_passedonly",
$_GET))
664 if (
$_GET[
"g_passedonly"] == 1)
669 switch (
$_POST[
"export_type"])
672 include_once
"./Modules/Test/classes/class.ilTestExport.php";
673 $exportObj =
new ilTestExport($this->
object,
"results");
674 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
677 include_once
"./Modules/Test/classes/class.ilTestExport.php";
678 $exportObj =
new ilTestExport($this->
object,
"results");
679 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
684 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
686 if (strlen($filtertext))
688 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
690 $this->ctrl->redirect($this,
"exportCertificate");
702 switch (
$_POST[
"export_type"])
705 include_once
"./Modules/Test/classes/class.ilTestExport.php";
706 $exportObj =
new ilTestExport($this->
object,
"aggregated");
707 $exportObj->exportToExcel($deliver = TRUE);
710 include_once
"./Modules/Test/classes/class.ilTestExport.php";
711 $exportObj =
new ilTestExport($this->
object,
"aggregated");
712 $exportObj->exportToCSV($deliver = TRUE);
727 include_once
"./Services/Utilities/classes/class.ilUtil.php";
728 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
729 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
731 $archive_dir = $certificate->createArchiveDirectory();
732 $total_users = array();
733 $total_users =& $this->
object->evalTotalPersonsArray();
734 if (count($total_users))
736 foreach ($total_users as $active_id =>
$name)
738 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
739 $pdf = $certificate->outCertificate(
741 "active_id" => $active_id,
742 "userfilter" => $userfilter,
743 "passedonly" => $passedonly
749 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id .
"_" . str_replace(
" ",
"_",
ilUtil::getASCIIFilename(
$name)) .
".pdf");
752 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
765 if ($original_id > 0)
778 $additionalFields = array();
781 if (preg_match(
"/cb_(\w+)/",
$key, $matches) && ($value == 1))
783 array_push($additionalFields, $matches[1]);
786 $this->
object->setEvaluationAdditionalFields($additionalFields);
788 $this->ctrl->redirect($this,
"evalSettings");
795 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
799 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
802 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
804 $form->setFormAction($this->ctrl->getFormAction($this,
"saveEvalSettings"));
805 $form->setTitle($this->lng->txt(
"assessment_eval_settings"));
808 $fields = array(
"gender",
"email",
"institution",
"street",
"city",
"zipcode",
"country",
"department",
"matriculation");
809 $additionalFields = $this->
object->getEvaluationAdditionalFields();
811 foreach ($fields as $dbfield)
814 if ($this->object->getAnonymity())
820 if (in_array($dbfield, $additionalFields)) $checkbox->setChecked(TRUE);
822 $form->addItem($checkbox);
824 $form->addCommandButton(
"saveEvalSettings", $this->lng->txt(
"save"));
826 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
840 $this->ctrl->saveParameter($this,
"pass");
841 $this->ctrl->saveParameter($this,
"active_id");
842 $active_id =
$_GET[
"active_id"];
844 $result_array =& $this->
object->getTestResult($active_id,
$pass);
848 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
850 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
852 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
855 $this->ctrl->setParameter($this,
"pdf",
"1");
856 $template->setCurrentBlock(
"pdf_export");
857 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
858 $this->ctrl->setParameter($this,
"pdf",
"");
859 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
860 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
862 $template->parseCurrentBlock();
865 if (array_key_exists(
"statistics",
$_GET) && (
$_GET[
"statistics"] == 1))
867 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
868 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
869 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilTestEvaluationGUI",
"detailedEvaluation"));
873 if ($this->object->getNrOfTries() == 1)
875 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
876 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
880 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outParticipantsResultsOverview"));
881 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
884 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
885 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
887 if ($this->object->getNrOfTries() == 1)
890 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
891 if (strlen($statement[
"markects"]))
893 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
898 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
899 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
900 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
901 $template->setVariable(
"PASS_DETAILS", $overview);
902 $template->setVariable(
"USER_DETAILS", $user_data);
903 $uname = $this->
object->userLookupFullName($user_id);
904 $template->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
907 if ($this->object->getShowSolutionAnswersOnly())
912 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
914 $this->
object->deliverPDFfromHTML($template->get());
918 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
933 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
935 $active_id =
$_GET[
"active_id"];
936 if ($this->object->getNrOfTries() == 1)
938 $this->ctrl->setParameter($this,
"active_id", $active_id);
940 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
943 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
946 $this->ctrl->setParameter($this,
"pdf",
"1");
947 $template->setCurrentBlock(
"pdf_export");
948 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outParticipantsResultsOverview"));
949 $this->ctrl->setParameter($this,
"pdf",
"");
950 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
951 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
953 $template->parseCurrentBlock();
956 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outParticipantsPassDetails");
957 $template->setVariable(
"PASS_OVERVIEW", $overview);
958 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
959 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"back"));
960 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"participants"));
961 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
962 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
965 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
967 $template->setVariable(
"USER_DATA", $user_data);
968 $template->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"tst_results_overview"));
969 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
970 if (strlen($statement[
"markects"]))
972 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
974 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
975 $template->parseCurrentBlock();
978 if ($this->object->getShowSolutionAnswersOnly())
983 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
985 $this->
object->deliverPDFfromHTML($template->get(), $this->
object->getTitle());
989 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1002 $this->ctrl->saveParameter($this,
"pass");
1003 $this->ctrl->saveParameter($this,
"active_id");
1004 $active_id =
$_GET[
"active_id"];
1006 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1008 $command_solution_details =
"";
1009 if ($this->object->getShowSolutionDetails())
1011 $command_solution_details =
"outCorrectSolution";
1013 $overview = $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserPassDetails", $command_solution_details);
1015 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1017 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_pass_details_overview_participants.html",
"Modules/Test");
1019 if ($this->object->getNrOfTries() == 1)
1021 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1022 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1026 $this->tpl->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(get_class($this),
"outUserResultsOverview"));
1027 $this->tpl->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_overview"));
1030 $this->tpl->parseCurrentBlock();
1032 if ($this->object->getNrOfTries() == 1)
1035 $this->tpl->setVariable(
"USER_MARK", $statement[
"mark"]);
1036 if (strlen($statement[
"markects"]))
1038 $this->tpl->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1044 $this->tpl->setCurrentBlock(
"adm_content");
1045 $this->tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1046 $this->tpl->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1047 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1048 $this->tpl->setVariable(
"PASS_DETAILS", $overview);
1049 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1050 $this->tpl->setVariable(
"USER_NAME", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1051 $this->tpl->parseCurrentBlock();
1054 if ($this->object->getShowSolutionAnswersOnly())
1071 if (!$this->object->canShowTestResults($ilUser->getId())) $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1072 include_once(
"./classes/class.ilTemplate.php");
1073 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1074 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1077 $user_id = $ilUser->getId();
1078 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1079 $active_id = $this->
object->getTestSession()->getActiveId();
1080 $hide_details = !$this->
object->getShowPassDetails();
1083 $executable = $this->
object->isExecutable($ilUser->getId());
1084 if (!$executable[
"executable"]) $hide_details = FALSE;
1086 $begin = microtime(
true);
1087 if (($this->object->getNrOfTries() == 1) && (!$hide_details))
1093 $template->setCurrentBlock(
"pass_overview");
1094 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserResultsOverview", FALSE, $hide_details);
1095 $template->setVariable(
"PASS_OVERVIEW", $overview);
1096 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results_overview"));
1097 $template->parseCurrentBlock();
1100 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
1105 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1108 $this->ctrl->setParameter($this,
"pass",
$pass);
1109 $this->ctrl->setParameter($this,
"pdf",
"1");
1110 $templatehead->setCurrentBlock(
"pdf_export");
1111 $templatehead->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1112 $this->ctrl->setParameter($this,
"pass",
"");
1113 $this->ctrl->setParameter($this,
"pdf",
"");
1114 $templatehead->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
1115 $templatehead->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
1117 $templatehead->parseCurrentBlock();
1118 if ($this->object->canShowCertificate($user_id, $active_id))
1120 $templatehead->setVariable(
"CERTIFICATE_URL", $this->ctrl->getLinkTarget($this,
"outCertificate"));
1121 $templatehead->setVariable(
"CERTIFICATE_TEXT", $this->lng->txt(
"certificate"));
1124 $templatehead->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1125 $templatehead->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1126 $templatehead->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1127 $templatehead->setVariable(
"PRINT_URL",
"javascript:window.print();");
1133 $this->ctrl->saveParameter($this,
"pass");
1134 $this->ctrl->saveParameter($this,
"active_id");
1135 if (!is_null(
$pass))
1137 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1138 $command_solution_details =
"";
1139 if ($this->object->getShowSolutionDetails())
1141 $command_solution_details =
"outCorrectSolution";
1143 $detailsoverview = (!$hide_details) ? $this->
getPassDetailsOverview($result_array, $active_id,
$pass,
"iltestevaluationgui",
"outUserResultsOverview", $command_solution_details) :
'';
1145 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1147 if (!$hide_details && $this->object->canShowSolutionPrintview())
1151 else if ($this->object->getShowSolutionDetails())
1157 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1158 $template->setVariable(
"PASS_RESULTS_OVERVIEW", sprintf($this->lng->txt(
"tst_results_overview_pass"),
$pass + 1));
1159 $template->setVariable(
"PASS_DETAILS", $detailsoverview);
1162 $template->setVariable(
"SIGNATURE", $signature);
1164 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1165 $template->setVariable(
"USER_DATA", $user_data);
1166 $template->setVariable(
"USER_MARK", $statement[
"mark"]);
1167 if (strlen($statement[
"markects"]))
1169 $template->setVariable(
"USER_MARK_ECTS", $statement[
"markects"]);
1171 $template->parseCurrentBlock();
1174 if ($this->object->getShowSolutionAnswersOnly())
1178 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1180 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1182 $this->
object->deliverPDFfromHTML($template->get(), sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1186 $this->tpl->setVariable(
"PRINT_CONTENT", $templatehead->get());
1201 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1204 if (array_key_exists(
"pass",
$_GET))
1208 $user_id = $ilUser->getId();
1209 $active_id = $this->
object->getTestSession()->getActiveId();
1211 if ($this->object->getNrOfTries() == 1)
1217 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserListOfAnswerPasses", TRUE);
1218 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1219 $template->setVariable(
"PASS_OVERVIEW", $overview);
1226 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1227 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1228 $showAllAnswers = TRUE;
1229 if ($this->object->isExecutable($user_id))
1231 $showAllAnswers = FALSE;
1234 $template->setVariable(
"PASS_DETAILS", $answers);
1236 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1237 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1238 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1239 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1240 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1243 $template->setVariable(
"USER_DATA", $user_data);
1244 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1245 if (strlen($signature))
1247 $template->setVariable(
"SIGNATURE", $signature);
1249 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1252 if ($this->object->getShowSolutionAnswersOnly())
1267 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1269 $this->ctrl->saveParameter($this,
"pass");
1270 $this->ctrl->saveParameter($this,
"active_id");
1271 $this->outTestResults(
false,
$_GET[
"pass"]);
1275 $this->outTestResults(
false);
1286 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_correct_solution.html",
"Modules/Test");
1288 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1289 $this->tpl->setCurrentBlock(
"ContentStyle");
1291 $this->tpl->parseCurrentBlock();
1293 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1295 $this->tpl->parseCurrentBlock();
1298 if ($this->object->getShowSolutionAnswersOnly())
1303 $this->tpl->setCurrentBlock(
"adm_content");
1305 $this->tpl->setVariable(
"OUTPUT_SOLUTION", $solution);
1306 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
1307 $this->ctrl->saveParameter($this,
"pass");
1308 $this->ctrl->saveParameter($this,
"active_id");
1309 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outUserResultsOverview"));
1310 $this->tpl->parseCurrentBlock();
1322 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1326 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1329 $data =& $this->
object->getCompleteEvaluationData();
1330 $color_class = array(
"tblrow1",
"tblrow2");
1332 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1333 $foundParticipants =&
$data->getParticipants();
1334 if (count($foundParticipants) == 0)
1342 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
1347 foreach ($foundParticipants as $userdata)
1349 $pass = $userdata->getScoredPass();
1350 if (is_object($userdata->getPass(
$pass)))
1352 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1353 if (is_array($question))
1360 $this->ctrl->setParameter($this,
"qid", $question_id);
1363 if (method_exists($question_object,
"hasFileUploads"))
1365 if ($question_object->hasFileUploads($this->object->getTestId()))
1367 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants").
"\">" . $this->lng->txt(
"download") .
"</a>";
1374 "<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants").
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1381 include_once(
"./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php");
1384 $table_gui->
setTitle($this->lng->txt(
"tst_answered_questions_test"));
1385 $table_gui->setData($rows);
1387 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1391 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1403 $active_id = $this->
object->getTestSession()->getActiveId();
1405 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
1406 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
1408 $certificate->outCertificate(array(
"active_id" => $active_id,
"pass" => $counted_pass));