4 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
48 $this->test_obj =& $a_test_obj;
53 $this->mode = $a_mode;
56 $this->inst_id = IL_INST_ID;
59 $this->export_dir = $this->test_obj->getExportDirectory();
63 $this->subdir = $date.
"__".$this->inst_id.
"__".
64 "tst__results_".$this->test_obj->getId();
67 $this->subdir = $date.
"__".$this->inst_id.
"__".
68 "test__aggregated__results_".$this->test_obj->getId();
71 $this->subdir = $date.
"__".$this->inst_id.
"__".
72 "tst".
"_".$this->test_obj->getId();
73 $this->filename = $this->subdir.
".xml";
74 $this->resultsfile = $date.
"__".$this->inst_id.
"__".
75 "results".
"_".$this->test_obj->getId().
".xml";
76 $this->qti_filename = $date.
"__".$this->inst_id.
"__".
77 "qti".
"_".$this->test_obj->getId().
".xml";
80 $this->filename = $this->subdir.
".".$this->
getExtension();
96 $this->resultExportingEnabledForTestExport = $resultExprtingEnabledForTestExport;
100 switch ($this->mode) {
142 $expDir = $this->test_obj->getExportDirectory();
145 $this->test_obj->createExportDirectory();
146 include_once
"./Services/Utilities/classes/class.ilUtil.php";
149 include_once
'./Services/Logging/classes/class.ilLog.php';
150 $expLog =
new ilLog($expDir,
"export.log");
152 $expLog->setLogFormat(
"");
153 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export Of Results");
156 $file = fopen($this->export_dir.
"/".$this->filename,
"w");
161 @copy($excelfile, $this->export_dir .
"/" . str_replace($this->
getExtension(),
"xlsx", $this->filename));
164 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export of Results");
176 $data = $this->test_obj->getAggregatedResultsData();
178 require_once
'Modules/TestQuestionPool/classes/class.ilAssExcelFormatHelper.php';
180 $worksheet->addSheet($this->lng->txt(
'tst_results_aggregated'));
190 foreach(
$data[
'overview'] as $key => $value)
201 $worksheet->setCell(
$row, $col++, $this->lng->txt(
'question_id'));
202 $worksheet->setCell(
$row, $col++, $this->lng->txt(
'question_title'));
203 $worksheet->setCell(
$row, $col++, $this->lng->txt(
'average_reached_points'));
206 $worksheet->setCell(
$row, $col++, $this->lng->txt(
'number_of_answers'));
211 foreach(
$data[
'questions'] as $key => $value)
233 return $excelfile .
'.xlsx';
244 $data = $this->test_obj->getAggregatedResultsData();
246 array_push($rows,
array(
247 $this->lng->txt(
"result"),
248 $this->lng->txt(
"value")
250 foreach (
$data[
"overview"] as $key => $value)
252 array_push($rows,
array(
257 array_push($rows,
array(
258 $this->lng->txt(
"question_id"),
259 $this->lng->txt(
"question_title"),
260 $this->lng->txt(
"average_reached_points"),
261 $this->lng->txt(
"points"),
262 $this->lng->txt(
"percentage"),
263 $this->lng->txt(
"number_of_answers")
265 foreach (
$data[
"questions"] as $key => $value)
267 array_push($rows,
array(
278 foreach ($rows as $evalrow)
280 $csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, $separator);
281 $csv .= join($csvrow, $separator) .
"\n";
304 public function exportToExcel($deliver = TRUE, $filterby =
"", $filtertext =
"", $passedonly = FALSE)
308 require_once
'Modules/TestQuestionPool/classes/class.ilAssExcelFormatHelper.php';
311 $worksheet->addSheet($this->lng->txt(
'tst_results'));
313 $additionalFields = $this->test_obj->getEvaluationAdditionalFields();
318 if($this->test_obj->getAnonymity())
328 if(count($additionalFields))
330 foreach($additionalFields as $fieldname)
336 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_resultspoints'));
338 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_resultsmarks'));
340 if($this->test_obj->getECTSOutput())
345 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_qworkedthrough'));
346 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_qmax'));
347 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_pworkedthrough'));
348 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_timeofwork'));
349 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_atimeofwork'));
350 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_firstvisit'));
351 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_lastvisit'));
352 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_mark_median'));
353 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_rank_participant'));
354 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_rank_median'));
355 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_total_participants'));
356 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col++) .
$row, $this->lng->txt(
'tst_stat_result_median'));
363 $data = $this->test_obj->getCompleteEvaluationData(TRUE, $filterby, $filtertext);
364 $firstrowwritten =
false;
365 foreach(
$data->getParticipants() as $active_id => $userdata)
367 if($passedonly &&
$data->getParticipant($active_id)->getPassed() == FALSE)
376 if($this->test_obj->isRandomTest())
381 if($this->test_obj->getAnonymity())
391 if(count($additionalFields))
394 foreach ($additionalFields as $fieldname)
396 if(strcmp($fieldname,
'gender') == 0)
398 $worksheet->setCell(
$row, $col++, $this->lng->txt(
'gender_' . $userfields[$fieldname]));
411 if($this->test_obj->getECTSOutput())
416 $worksheet->setCell(
$row, $col++,
$data->getParticipant($active_id)->getQuestionsWorkedThrough());
417 $worksheet->setCell(
$row, $col++,
$data->getParticipant($active_id)->getNumberOfQuestions());
418 $worksheet->setCell(
$row, $col++,
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() .
'%');
420 $time =
$data->getParticipant($active_id)->getTimeOfWork();
421 $time_seconds = $time;
422 $time_hours = floor($time_seconds/3600);
423 $time_seconds -= $time_hours * 3600;
424 $time_minutes = floor($time_seconds/60);
425 $time_seconds -= $time_minutes * 60;
426 $worksheet->setCell(
$row, $col++, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
427 $time =
$data->getParticipant($active_id)->getQuestionsWorkedThrough() ?
$data->getParticipant($active_id)->getTimeOfWork() /
$data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
428 $time_seconds = $time;
429 $time_hours = floor($time_seconds/3600);
430 $time_seconds -= $time_hours * 3600;
431 $time_minutes = floor($time_seconds/60);
432 $time_seconds -= $time_minutes * 60;
433 $worksheet->setCell(
$row, $col++, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
437 $median =
$data->getStatistics()->getStatistics()->median();
438 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? $median /
$data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
439 $mark = $this->test_obj->mark_schema->getMatchingMark($pct);
440 $mark_short_name =
"";
444 $mark_short_name = $mark->getShortName();
448 $worksheet->setCell(
$row, $col++,
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
467 $finishdate = $this->test_obj->getPassFinishDate($active_id,
$pass);
473 if ($this->test_obj->isRandomTest())
479 if(is_object(
$data->getParticipant($active_id)) && is_array(
$data->getParticipant($active_id)->getQuestions(
$pass)))
481 $evaluatedQuestions =
$data->getParticipant($active_id)->getQuestions(
$pass);
483 if( $this->test_obj->getShuffleQuestions() )
487 $questions =
array();
488 foreach($this->test_obj->getQuestions() as $qId)
490 foreach($evaluatedQuestions as $evaledQst)
492 if( $evaledQst[
'id'] != $qId )
497 $questions[] = $evaledQst;
503 $questions = $evaluatedQuestions;
506 foreach($questions as $question)
508 $question_data =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
510 if($this->test_obj->isRandomTest())
514 $worksheet->setFormattedExcelTitle(
$worksheet->getColumnCoord($col) . (
$row - 1), preg_replace(
"/<.*?>/",
"",
$data->getQuestionTitle($question[
"id"])));
518 if(
$pass == 0 && !$firstrowwritten)
525 $firstrowwritten =
true;
532 if($this->test_obj->getExportSettingsSingleChoiceShort() && !$this->test_obj->isRandomTest() && $this->test_obj->hasSingleChoiceQuestions())
535 $titles = $this->test_obj->getQuestionTitlesAndIndexes();
536 $positions =
array();
539 foreach($titles as $id =>
$title)
541 $positions[$id] = $pos;
545 $usernames =
array();
546 $participantcount = count(
$data->getParticipants());
547 $allusersheet =
false;
550 $worksheet->addSheet($this->lng->txt(
'eval_all_users'));
555 if(count($additionalFields))
557 foreach($additionalFields as $fieldname)
559 if(strcmp($fieldname,
"matriculation") == 0)
566 foreach($titles as
$title)
573 foreach(
$data->getParticipants() as $active_id => $userdata)
575 $username = (!is_null($userdata) && $userdata->getName()) ? $userdata->getName() :
"ID $active_id";
576 if (array_key_exists($username, $usernames))
578 $usernames[$username]++;
579 $username .=
" ($usernames[$username])";
583 $usernames[$username] = 1;
588 if (count($additionalFields))
591 foreach ($additionalFields as $fieldname)
593 if (strcmp($fieldname,
"matriculation") == 0)
595 if (strlen($userfields[$fieldname]))
607 $pass = $userdata->getScoredPass();
608 if(is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
610 foreach($userdata->getQuestions(
$pass) as $question)
613 if(is_object($objQuestion) && strcmp($objQuestion->getQuestionType(),
'assSingleChoice') == 0)
615 $solution = $objQuestion->getSolutionValues($active_id,
$pass);
616 $pos = $positions[$question[
"id"]];
617 $selectedanswer =
"x";
618 foreach ($objQuestion->getAnswers() as $id => $answer)
620 if (strlen($solution[0][
"value1"]) && $id == $solution[0][
"value1"])
622 $selectedanswer = $answer->getAnswertext();
632 if($this->test_obj->isSingleChoiceTestWithoutShuffle())
637 $usernames =
array();
638 $allusersheet =
false;
641 $worksheet->addSheet($this->lng->txt(
'eval_all_users').
' (2)');
646 if (count($additionalFields))
648 foreach ($additionalFields as $fieldname)
650 if (strcmp($fieldname,
"matriculation") == 0)
657 foreach($titles as $title)
664 foreach (
$data->getParticipants() as $active_id => $userdata)
666 $username = (!is_null($userdata) && $userdata->getName()) ? $userdata->getName() :
"ID $active_id";
667 if (array_key_exists($username, $usernames))
669 $usernames[$username]++;
670 $username .=
" ($usernames[$username])";
674 $usernames[$username] = 1;
679 if (count($additionalFields))
682 foreach ($additionalFields as $fieldname)
684 if (strcmp($fieldname,
"matriculation") == 0)
686 if (strlen($userfields[$fieldname]))
698 $pass = $userdata->getScoredPass();
699 if(is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
701 foreach($userdata->getQuestions(
$pass) as $question)
704 if(is_object($objQuestion) && strcmp($objQuestion->getQuestionType(),
'assSingleChoice') == 0)
706 $solution = $objQuestion->getSolutionValues($active_id,
$pass);
707 $pos = $positions[$question[
"aid"]];
708 $selectedanswer = chr(65+$solution[0][
"value1"]);
720 $usernames =
array();
721 $participantcount = count(
$data->getParticipants());
722 $allusersheet =
false;
725 foreach(
$data->getParticipants() as $active_id => $userdata)
729 $username = (!is_null($userdata) && $userdata->getName()) ? $userdata->getName() :
"ID $active_id";
730 if(array_key_exists($username, $usernames))
732 $usernames[$username]++;
733 $username .=
" ($i)";
737 $usernames[$username] = 1;
740 if($participantcount > 250)
742 if(!$allusersheet || ($pages-1) < floor(
$row / 64000))
744 $worksheet->addSheet($this->lng->txt(
"eval_all_users") . (($pages > 0) ?
" (".($pages+1).
")" :
""));
745 $allusersheet =
true;
752 $resultsheet =
$worksheet->addSheet($username);
755 $pass = $userdata->getScoredPass();
757 $worksheet->setCell(
$row, 0, sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass+1, $userdata->getName()));
760 if(is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
762 foreach($userdata->getQuestions(
$pass) as $question)
764 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
766 if(is_object($question))
777 $testname = $this->test_obj->getTitle();
781 $testname .=
'_results';
791 return $excelfile .
'.xlsx';
806 function exportToCSV($deliver = TRUE, $filterby =
"", $filtertext =
"", $passedonly = FALSE)
815 if ($this->test_obj->getAnonymity())
817 array_push($datarow, $this->lng->txt(
"counter"));
822 array_push($datarow, $this->lng->txt(
"name"));
824 array_push($datarow, $this->lng->txt(
"login"));
827 $additionalFields = $this->test_obj->getEvaluationAdditionalFields();
828 if (count($additionalFields))
830 foreach ($additionalFields as $fieldname)
832 array_push($datarow, $this->lng->txt($fieldname));
836 array_push($datarow, $this->lng->txt(
"tst_stat_result_resultspoints"));
838 array_push($datarow, $this->lng->txt(
"maximum_points"));
840 array_push($datarow, $this->lng->txt(
"tst_stat_result_resultsmarks"));
842 if ($this->test_obj->getECTSOutput())
844 array_push($datarow, $this->lng->txt(
"ects_grade"));
847 array_push($datarow, $this->lng->txt(
"tst_stat_result_qworkedthrough"));
849 array_push($datarow, $this->lng->txt(
"tst_stat_result_qmax"));
851 array_push($datarow, $this->lng->txt(
"tst_stat_result_pworkedthrough"));
853 array_push($datarow, $this->lng->txt(
"tst_stat_result_timeofwork"));
855 array_push($datarow, $this->lng->txt(
"tst_stat_result_atimeofwork"));
857 array_push($datarow, $this->lng->txt(
"tst_stat_result_firstvisit"));
859 array_push($datarow, $this->lng->txt(
"tst_stat_result_lastvisit"));
862 array_push($datarow, $this->lng->txt(
"tst_stat_result_mark_median"));
864 array_push($datarow, $this->lng->txt(
"tst_stat_result_rank_participant"));
866 array_push($datarow, $this->lng->txt(
"tst_stat_result_rank_median"));
868 array_push($datarow, $this->lng->txt(
"tst_stat_result_total_participants"));
870 array_push($datarow, $this->lng->txt(
"tst_stat_result_median"));
872 array_push($datarow, $this->lng->txt(
"scored_pass"));
875 array_push($datarow, $this->lng->txt(
"pass"));
878 $data =& $this->test_obj->getCompleteEvaluationData(TRUE, $filterby, $filtertext);
879 $headerrow = $datarow;
881 foreach (
$data->getParticipants() as $active_id => $userdata)
883 $datarow = $headerrow;
887 if (
$data->getParticipant($active_id)->getPassed() == FALSE)
895 if ($this->test_obj->getAnonymity())
901 array_push($datarow2,
$data->getParticipant($active_id)->getName());
902 array_push($datarow2,
$data->getParticipant($active_id)->getLogin());
904 if (count($additionalFields))
907 foreach ($additionalFields as $fieldname)
909 if (strcmp($fieldname,
"gender") == 0)
911 array_push($datarow2, $this->lng->txt(
"gender_" . $userfields[$fieldname]));
915 array_push($datarow2, $userfields[$fieldname]);
919 array_push($datarow2,
$data->getParticipant($active_id)->getReached());
920 array_push($datarow2,
$data->getParticipant($active_id)->getMaxpoints());
921 array_push($datarow2,
$data->getParticipant($active_id)->getMark());
922 if ($this->test_obj->getECTSOutput())
924 array_push($datarow2,
$data->getParticipant($active_id)->getECTSMark());
926 array_push($datarow2,
$data->getParticipant($active_id)->getQuestionsWorkedThrough());
927 array_push($datarow2,
$data->getParticipant($active_id)->getNumberOfQuestions());
928 array_push($datarow2,
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0);
929 $time =
$data->getParticipant($active_id)->getTimeOfWork();
930 $time_seconds = $time;
931 $time_hours = floor($time_seconds/3600);
932 $time_seconds -= $time_hours * 3600;
933 $time_minutes = floor($time_seconds/60);
934 $time_seconds -= $time_minutes * 60;
935 array_push($datarow2, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
936 $time =
$data->getParticipant($active_id)->getQuestionsWorkedThrough() ?
$data->getParticipant($active_id)->getTimeOfWork() /
$data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
937 $time_seconds = $time;
938 $time_hours = floor($time_seconds/3600);
939 $time_seconds -= $time_hours * 3600;
940 $time_minutes = floor($time_seconds/60);
941 $time_seconds -= $time_minutes * 60;
942 array_push($datarow2, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
944 $fv =
$data->getParticipant($active_id)->getFirstVisit();
945 $lv =
$data->getParticipant($active_id)->getLastVisit();
946 foreach(
array($fv, $lv) as $ts)
951 array_push($datarow2, $visit);
955 array_push($datarow2,
"");
959 $median =
$data->getStatistics()->getStatistics()->median();
960 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? $median /
$data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
961 $mark = $this->test_obj->mark_schema->getMatchingMark($pct);
962 $mark_short_name =
"";
963 if (is_object($mark))
965 $mark_short_name = $mark->getShortName();
967 array_push($datarow2, $mark_short_name);
968 array_push($datarow2,
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
969 array_push($datarow2,
$data->getStatistics()->getStatistics()->rank_median());
970 array_push($datarow2,
$data->getStatistics()->getStatistics()->count());
971 array_push($datarow2, $median);
974 array_push($datarow2,
$data->getParticipant($active_id)->getBestPass() + 1);
978 array_push($datarow2,
$data->getParticipant($active_id)->getLastPass() + 1);
982 $finishdate = $this->test_obj->getPassFinishDate($active_id,
$pass);
987 for ($i = 1; $i < $col-1; $i++)
989 array_push($datarow2,
"");
990 array_push($datarow,
"");
992 array_push($datarow,
"");
994 array_push($datarow2,
$pass+1);
995 if (is_object(
$data->getParticipant($active_id)) && is_array(
$data->getParticipant($active_id)->getQuestions(
$pass)))
997 foreach (
$data->getParticipant($active_id)->getQuestions(
$pass) as $question)
999 $question_data =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
1000 array_push($datarow2, $question_data[
"reached"]);
1001 array_push($datarow, preg_replace(
"/<.*?>/",
"",
$data->getQuestionTitle($question[
"id"])));
1004 if ($this->test_obj->isRandomTest() || $this->test_obj->getShuffleQuestions() || (
$counter == 1 &&
$pass == 0))
1006 array_push($rows, $datarow);
1009 array_push($rows, $datarow2);
1010 $datarow2 =
array();
1018 foreach ($rows as $evalrow)
1020 $csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, $separator);
1021 $csv .= join($csvrow, $separator) .
"\n";
1045 $ilBench->start(
"TestExport",
"buildExportFile");
1049 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
1053 $this->xml->
xmlSetDtdDef(
"<!DOCTYPE Test SYSTEM \"http://www.ilias.uni-koeln.de/download/dtd/ilias_co.dtd\">");
1056 $this->xml->xmlSetGenCmt(
"Export of ILIAS Test ".
1057 $this->test_obj->getId().
" of installation ".$this->inst.
".");
1060 $this->xml->xmlHeader();
1062 $this->xml->xmlStartTag(
"ContentObject",
array(
'Type' =>
'Test'));
1065 $this->test_obj->createExportDirectory();
1066 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1071 $expDir = $this->test_obj->getExportDirectory();
1072 include_once
"./Services/Logging/classes/class.ilLog.php";
1073 $expLog =
new ilLog($expDir,
"export.log");
1075 $expLog->setLogFormat(
"");
1076 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
1079 $qti_file = fopen($this->export_dir.
"/".$this->subdir.
"/".$this->qti_filename,
"w");
1084 $ilBench->start(
"TestExport",
"buildExportFile_getXML");
1085 $this->test_obj->exportPagesXML($this->xml, $this->inst_id,
1086 $this->export_dir.
"/".$this->subdir, $expLog);
1087 $ilBench->stop(
"TestExport",
"buildExportFile_getXML");
1095 $this->xml->xmlEndTag(
"ContentObject");
1105 $ilBench->start(
"TestExport",
"buildExportFile_dumpToFile");
1106 $this->xml->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->filename
1108 $ilBench->stop(
"TestExport",
"buildExportFile_dumpToFile");
1113 include_once
"./Modules/Test/classes/class.ilTestResultsToXML.php";
1114 $resultwriter =
new ilTestResultsToXML($this->test_obj->getTestId(), $this->test_obj->getAnonymity());
1116 $ilBench->start(
"TestExport",
"buildExportFile_results");
1117 $resultwriter->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->resultsfile,
false);
1118 $ilBench->stop(
"TestExport",
"buildExportFile_results");
1122 $ilBench->start(
"QuestionpoolExport",
"buildExportFile_saveAdditionalMobs");
1124 $ilBench->stop(
"QuestionpoolExport",
"buildExportFile_saveAdditionalMobs");
1127 $ilBench->start(
"TestExport",
"buildExportFile_zipFile");
1129 $this->export_dir.
"/".$this->subdir.
".zip");
1130 $ilBench->stop(
"TestExport",
"buildExportFile_zipFile");
1133 $this->xml->_XmlWriter;
1135 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
1136 $ilBench->stop(
"TestExport",
"buildExportFile");
1138 return $this->export_dir.
"/".$this->subdir.
".zip";
1145 $tstQtiXml = $this->test_obj->toXML();
1148 if (strpos($tstQtiXml,
"</section>") !==
false)
1150 $qtiXml = str_replace(
"</section>",
"$qstQtiXml</section>", $tstQtiXml);
1154 $qtiXml = str_replace(
"<section ident=\"1\"/>",
"<section ident=\"1\">\n$qstQtiXml</section>", $tstQtiXml);
1164 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1166 $xml = $questionOBJ->toXML(
false);
1169 $xml = preg_replace(
"/<questestinterop>/",
"", $xml);
1170 $xml = preg_replace(
"/<\/questestinterop>/",
"", $xml);
1177 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1180 foreach (
$mobs as $mob)
1185 $mob_obj->exportFiles($a_export_dir);
1192 foreach (
$mobs as $mob)
1197 $mob_obj->exportFiles($a_export_dir);
1210 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentExporter.php';
1212 $skillQuestionAssignmentExporter->setXmlWriter($a_xml_writer);
1213 $skillQuestionAssignmentExporter->setQuestionIds($questions);
1214 $skillQuestionAssignmentExporter->setAssignmentList($assignmentList);
1215 $skillQuestionAssignmentExporter->export();
1222 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
1224 $thresholdList->setTestId($this->test_obj->getTestId());
1225 $thresholdList->loadFromDb();
1227 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdExporter.php';
1229 $skillLevelThresholdExporter->setXmlWriter($a_xml_writer);
1230 $skillLevelThresholdExporter->setAssignmentList($assignmentList);
1231 $skillLevelThresholdExporter->setThresholdList($thresholdList);
1232 $skillLevelThresholdExporter->export();
1242 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
1244 $assignmentList->setParentObjId($this->test_obj->getId());
1245 $assignmentList->loadFromDb();
1246 $assignmentList->loadAdditionalSkillData();
1248 return $assignmentList;
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
setIncludeRandomTestQuestionsEnabled($includeRandomTestQuestionsEnabled)
exportToExcel($deliver=TRUE, $filterby="", $filtertext="", $passedonly=FALSE)
Exports the evaluation data to the Microsoft Excel file format.
buildQuestionSkillAssignmentList()
aggregatedResultsToExcel($deliver=TRUE)
Exports the aggregated results to the Microsoft Excel file format.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
getQuestionQtiXml($questionId)
populateQuestionSkillAssignmentsXml(ilXmlWriter $a_xml_writer, ilAssQuestionSkillAssignmentList $assignmentList, $questions)
$resultExportingEnabledForTestExport
buildExportFileXML()
build xml export file
Test results to XML class.
isResultExportingEnabledForTestExport()
aggregatedResultsToCSV($deliver=TRUE)
Exports the aggregated results to CSV.
exportToCSV($deliver=TRUE, $filterby="", $filtertext="", $passedonly=FALSE)
Exports the evaluation data to the CSV file format.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
__construct(&$a_test_obj, $a_mode="xml")
Constructor.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
buildExportFile()
build export file (complete zip file)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static formatDate(ilDateTime $date)
Format a date public.
exportXHTMLMediaObjects($a_export_dir)
redirection script todo: (a better solution should control the processing via a xml file) ...
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
static _instantiateQuestion($question_id)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
setResultExportingEnabledForTestExport($resultExprtingEnabledForTestExport)
populateSkillLevelThresholdsXml(ilXmlWriter $a_xml_writer, ilAssQuestionSkillAssignmentList $assignmentList)
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
buildExportResultFile()
build xml export file
populateQuestionSetConfigXml(ilXmlWriter $xmlWriter)