4require_once 
'./Modules/Test/classes/inc.AssessmentConstants.php';
 
    5require_once 
'./Services/Utilities/classes/class.ilFormat.php';
 
    7require_once 
'Modules/TestQuestionPool/classes/class.assQuestion.php';
 
   49                $this->test_obj =& $a_test_obj;
 
   54                $this->mode = $a_mode;
 
   57                $this->inst_id = IL_INST_ID;
 
   60                $this->export_dir = $this->test_obj->getExportDirectory();
 
   64                                $this->subdir = $date.
"__".$this->inst_id.
"__".
 
   65                                        "tst__results_".$this->test_obj->getId();
 
   68                                $this->subdir = $date.
"__".$this->inst_id.
"__".
 
   69                                        "test__aggregated__results_".$this->test_obj->getId();
 
   72                                $this->subdir = $date.
"__".$this->inst_id.
"__".
 
   73                                        "tst".
"_".$this->test_obj->getId();
 
   74                                $this->filename = $this->subdir.
".xml";
 
   75                                $this->resultsfile = $date.
"__".$this->inst_id.
"__".
 
   76                                        "results".
"_".$this->test_obj->getId().
".xml";
 
   77                                $this->qti_filename = $date.
"__".$this->inst_id.
"__".
 
   78                                        "qti".
"_".$this->test_obj->getId().
".xml";
 
   81                $this->filename = $this->subdir.
".".$this->
getExtension();
 
   97                $this->resultExportingEnabledForTestExport = $resultExprtingEnabledForTestExport;
 
  101                switch ($this->mode) {
 
  143                $expDir = $this->test_obj->getExportDirectory();
 
  146                $this->test_obj->createExportDirectory();
 
  147                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  150                include_once 
'./Services/Logging/classes/class.ilLog.php';
 
  151                $expLog = 
new ilLog($expDir, 
"export.log");
 
  153                $expLog->setLogFormat(
"");
 
  154                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Of Results");
 
  157                $file = fopen($this->export_dir.
"/".$this->filename, 
"w");
 
  162                @copy($excelfile, $this->export_dir . 
"/" . str_replace($this->
getExtension(), 
"xls", $this->filename));
 
  165                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export of Results");
 
  177                $data = $this->test_obj->getAggregatedResultsData();
 
  178                include_once 
"./Services/Excel/classes/class.ilExcelWriterAdapter.php";
 
  181                $testname = 
ilUtil::getASCIIFilename(preg_replace(
"/\s/", 
"_", $this->test_obj->getTitle() . 
'_aggregated')) . 
".xls";
 
  182                $workbook = $adapter->getWorkbook();
 
  183                $workbook->setVersion(8); 
 
  185                $format_percent =& $workbook->addFormat();
 
  186                $format_percent->setNumFormat(
"0.00%");
 
  187                $format_title =& $workbook->addFormat();
 
  188                $format_title->setBold();
 
  189                $format_title->setColor(
'black');
 
  190                $format_title->setPattern(1);
 
  191                $format_title->setFgColor(
'silver');
 
  192                include_once 
"./Services/Excel/classes/class.ilExcelUtils.php";
 
  199                foreach (
$data[
"overview"] as $key => $value)
 
  215                foreach (
$data[
"questions"] as $key => $value)
 
  245                $data = $this->test_obj->getAggregatedResultsData();
 
  247                array_push($rows, array(
 
  248                        $this->lng->txt(
"result"),
 
  249                        $this->lng->txt(
"value")
 
  251                foreach (
$data[
"overview"] as $key => $value)
 
  253                        array_push($rows, array(
 
  258                array_push($rows, array(
 
  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(
 
  277                foreach ($rows as $evalrow)
 
  279                        $csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, 
$separator);
 
  303        public function exportToExcel($deliver = TRUE, $filterby = 
"", $filtertext = 
"", $passedonly = FALSE)
 
  307                require_once 
'./Services/Excel/classes/class.ilExcelWriterAdapter.php';
 
  310                $testname = $this->test_obj->getTitle();
 
  314                                $testname .= 
'_results';
 
  318                $workbook = $adapter->getWorkbook();
 
  319                $workbook->setVersion(8); 
 
  321                $format_bold =& $workbook->addFormat();
 
  322                $format_bold->setBold();
 
  323                $format_percent =& $workbook->addFormat();
 
  324                $format_percent->setNumFormat(
"0.00%");
 
  325                $format_datetime =& $workbook->addFormat();
 
  326                $format_datetime->setNumFormat(
"DD/MM/YYYY hh:mm:ss");
 
  327                $format_title =& $workbook->addFormat();
 
  328                $format_title->setBold();
 
  329                $format_title->setColor(
'black');
 
  330                $format_title->setPattern(1);
 
  331                $format_title->setFgColor(
'silver');
 
  332                require_once 
'./Services/Excel/classes/class.ilExcelUtils.php';
 
  334                $additionalFields = $this->test_obj->getEvaluationAdditionalFields();
 
  338                if ($this->test_obj->getAnonymity())
 
  347                if (count($additionalFields))
 
  349                        foreach ($additionalFields as $fieldname)
 
  357                if ($this->test_obj->getECTSOutput())
 
  379                $data =& $this->test_obj->getCompleteEvaluationData(TRUE, $filterby, $filtertext);
 
  380                $firstrowwritten = 
false;
 
  381                foreach (
$data->getParticipants() as $active_id => $userdata)
 
  383                        if ($passedonly && 
$data->getParticipant($active_id)->getPassed() == FALSE)
 
  392                        if($this->test_obj->isRandomTest())
 
  397                        if ($this->test_obj->getAnonymity())
 
  406                        if (count($additionalFields))
 
  409                                foreach ($additionalFields as $fieldname)
 
  411                                        if (strcmp($fieldname, 
"gender") == 0)
 
  424                        if ($this->test_obj->getECTSOutput())
 
  430                        $worksheet->write(
$row, $col++, 
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0, $format_percent);
 
  431                        $time = 
$data->getParticipant($active_id)->getTimeOfWork();
 
  432                        $time_seconds = $time;
 
  433                        $time_hours    = floor($time_seconds/3600);
 
  434                        $time_seconds -= $time_hours   * 3600;
 
  435                        $time_minutes  = floor($time_seconds/60);
 
  436                        $time_seconds -= $time_minutes * 60;
 
  438                        $time = 
$data->getParticipant($active_id)->getQuestionsWorkedThrough() ? 
$data->getParticipant($active_id)->getTimeOfWork() / 
$data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
 
  439                        $time_seconds = $time;
 
  440                        $time_hours    = floor($time_seconds/3600);
 
  441                        $time_seconds -= $time_hours   * 3600;
 
  442                        $time_minutes  = floor($time_seconds/60);
 
  443                        $time_seconds -= $time_minutes * 60;
 
  445                        $fv = getdate(
$data->getParticipant($active_id)->getFirstVisit());
 
  454                        $worksheet->write(
$row, $col++, $firstvisit, $format_datetime);
 
  455                        $lv = getdate(
$data->getParticipant($active_id)->getLastVisit());
 
  464                        $worksheet->write(
$row, $col++, $lastvisit, $format_datetime);
 
  466                        $median = 
$data->getStatistics()->getStatistics()->median();
 
  467                        $pct = 
$data->getParticipant($active_id)->getMaxpoints() ? $median / 
$data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
 
  468                        $mark = $this->test_obj->mark_schema->getMatchingMark($pct);
 
  469                        $mark_short_name = 
"";
 
  470                        if (is_object($mark))
 
  472                                $mark_short_name = $mark->getShortName();
 
  481                                $worksheet->write(
$row, $col++, 
$data->getParticipant($active_id)->getBestPass() + 1);
 
  485                                $worksheet->write(
$row, $col++, 
$data->getParticipant($active_id)->getLastPass() + 1);
 
  491                                $finishdate = $this->test_obj->getPassFinishDate($active_id, 
$pass);
 
  497                                                if ($this->test_obj->isRandomTest())
 
  503                                        if (is_object(
$data->getParticipant($active_id)) && is_array(
$data->getParticipant($active_id)->getQuestions(
$pass)))
 
  505                                                $evaluatedQuestions = 
$data->getParticipant($active_id)->getQuestions(
$pass);
 
  507                                                if( $this->test_obj->getShuffleQuestions() )
 
  511                                                        $questions = array();
 
  512                                                        foreach($this->test_obj->getQuestions() as $qId)
 
  514                                                                foreach($evaluatedQuestions as $evaledQst)
 
  516                                                                        if( $evaledQst[
'id'] != $qId )
 
  521                                                                        $questions[] = $evaledQst;
 
  527                                                        $questions = $evaluatedQuestions;
 
  530                                                foreach($questions as $question)
 
  532                                                        $question_data = 
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
 
  534                                                        if ($this->test_obj->isRandomTest())
 
  542                                                                if (
$pass == 0 && !$firstrowwritten)
 
  549                                                $firstrowwritten = 
true;
 
  555                if ($this->test_obj->getExportSettingsSingleChoiceShort() && !$this->test_obj->isRandomTest() && $this->test_obj->hasSingleChoiceQuestions())
 
  558                        $titles =& $this->test_obj->getQuestionTitlesAndIndexes();
 
  559                        $positions = array();
 
  562                        foreach ($titles as $id => $title)
 
  564                                $positions[$id] = $pos;
 
  567                        $usernames = array();
 
  568                        $participantcount = count(
$data->getParticipants());
 
  569                        $allusersheet = 
false;
 
  571                        $resultsheet =& $workbook->addWorksheet($this->lng->txt(
"eval_all_users"));
 
  576                        if (count($additionalFields))
 
  578                                foreach ($additionalFields as $fieldname)
 
  580                                        if (strcmp($fieldname, 
"matriculation") == 0)
 
  587                        foreach ($titles as $title)
 
  593                        foreach (
$data->getParticipants() as $active_id => $userdata)
 
  596                                if (array_key_exists($username, $usernames))
 
  598                                        $usernames[$username]++;
 
  599                                        $username .= 
" ($i)";
 
  603                                        $usernames[$username] = 1;
 
  606                                $resultsheet->write(
$row, $col++, $username);
 
  607                                $resultsheet->write(
$row, $col++, $userdata->getLogin());
 
  608                                if (count($additionalFields))
 
  611                                        foreach ($additionalFields as $fieldname)
 
  613                                                if (strcmp($fieldname, 
"matriculation") == 0)
 
  615                                                        if (strlen($userfields[$fieldname]))
 
  627                                $pass = $userdata->getScoredPass();
 
  628                                if (is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
 
  630                                        foreach ($userdata->getQuestions(
$pass) as $question)
 
  633                                                if(is_object($objQuestion) && strcmp($objQuestion->getQuestionType(), 
'assSingleChoice') == 0)
 
  635                                                        $solution = $objQuestion->getSolutionValues($active_id, 
$pass);
 
  636                                                        $pos = $positions[$question[
"id"]];
 
  637                                                        $selectedanswer = 
"x";
 
  638                                                        foreach ($objQuestion->getAnswers() as $id => $answer)
 
  640                                                                if (strlen($solution[0][
"value1"]) && $id == $solution[0][
"value1"])
 
  642                                                                        $selectedanswer = $answer->getAnswertext();
 
  651                        if ($this->test_obj->isSingleChoiceTestWithoutShuffle())
 
  656                                $usernames = array();
 
  657                                $allusersheet = 
false;
 
  659                                $resultsheet =& $workbook->addWorksheet($this->lng->txt(
"eval_all_users") . 
" (2)");
 
  664                                if (count($additionalFields))
 
  666                                        foreach ($additionalFields as $fieldname)
 
  668                                                if (strcmp($fieldname, 
"matriculation") == 0)
 
  675                                foreach ($titles as $title)
 
  681                                foreach (
$data->getParticipants() as $active_id => $userdata)
 
  684                                        if (array_key_exists($username, $usernames))
 
  686                                                $usernames[$username]++;
 
  687                                                $username .= 
" ($i)";
 
  691                                                $usernames[$username] = 1;
 
  694                                        $resultsheet->write(
$row, $col++, $username);
 
  695                                        $resultsheet->write(
$row, $col++, $userdata->getLogin());
 
  696                                        if (count($additionalFields))
 
  699                                                foreach ($additionalFields as $fieldname)
 
  701                                                        if (strcmp($fieldname, 
"matriculation") == 0)
 
  703                                                                if (strlen($userfields[$fieldname]))
 
  715                                        $pass = $userdata->getScoredPass();
 
  716                                        if (is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
 
  718                                                foreach ($userdata->getQuestions(
$pass) as $question)
 
  720                                                        $objQuestion =& $this->test_obj->_instanciateQuestion($question[
"aid"]);
 
  721                                                        if (is_object($objQuestion) && strcmp($objQuestion->getQuestionType(), 
'assSingleChoice') == 0)
 
  723                                                                $solution = $objQuestion->getSolutionValues($active_id, 
$pass);
 
  724                                                                $pos = $positions[$question[
"aid"]];
 
  725                                                                $selectedanswer = chr(65+$solution[0][
"value1"]);
 
  737                        $usernames = array();
 
  738                        $participantcount = count(
$data->getParticipants());
 
  739                        $allusersheet = 
false;
 
  742                        foreach (
$data->getParticipants() as $active_id => $userdata)
 
  747                                if (array_key_exists($username, $usernames))
 
  749                                        $usernames[$username]++;
 
  750                                        $username .= 
" ($i)";
 
  754                                        $usernames[$username] = 1;
 
  756                                if ($participantcount > 250) {
 
  757                                        if (!$allusersheet || ($pages-1) < floor(
$row / 64000)) {
 
  758                                                $resultsheet =& $workbook->addWorksheet($this->lng->txt(
"eval_all_users") . (($pages > 0) ? 
" (".($pages+1).
")" : 
""));
 
  759                                                $allusersheet = 
true;
 
  764                                        $resultsheet =& $workbook->addWorksheet(utf8_decode($username));
 
  766                                if (method_exists($resultsheet, 
"writeString"))
 
  768                                        $pass = $userdata->getScoredPass();
 
  772                                        if (is_object($userdata) && is_array($userdata->getQuestions(
$pass)))
 
  774                                                foreach ($userdata->getQuestions(
$pass) as $question)
 
  776                                                        require_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  778                                                        if (is_object($question))
 
  780                                                                $row = $question->setExportDetailsXLS($resultsheet, 
$row, $active_id, 
$pass, $format_title, $format_bold);
 
  808        function exportToCSV($deliver = TRUE, $filterby = 
"", $filtertext = 
"", $passedonly = FALSE)
 
  817                if ($this->test_obj->getAnonymity())
 
  819                        array_push($datarow, $this->lng->txt(
"counter"));
 
  824                        array_push($datarow, $this->lng->txt(
"name"));
 
  826                        array_push($datarow, $this->lng->txt(
"login"));
 
  829                $additionalFields = $this->test_obj->getEvaluationAdditionalFields();
 
  830                if (count($additionalFields))
 
  832                        foreach ($additionalFields as $fieldname)
 
  834                                array_push($datarow, $this->lng->txt($fieldname));
 
  838                array_push($datarow, $this->lng->txt(
"tst_stat_result_resultspoints"));
 
  840                array_push($datarow, $this->lng->txt(
"maximum_points"));
 
  842                array_push($datarow, $this->lng->txt(
"tst_stat_result_resultsmarks"));
 
  844                if ($this->test_obj->getECTSOutput())
 
  846                        array_push($datarow, $this->lng->txt(
"ects_grade"));
 
  849                array_push($datarow, $this->lng->txt(
"tst_stat_result_qworkedthrough"));
 
  851                array_push($datarow, $this->lng->txt(
"tst_stat_result_qmax"));
 
  853                array_push($datarow, $this->lng->txt(
"tst_stat_result_pworkedthrough"));
 
  855                array_push($datarow, $this->lng->txt(
"tst_stat_result_timeofwork"));
 
  857                array_push($datarow, $this->lng->txt(
"tst_stat_result_atimeofwork"));
 
  859                array_push($datarow, $this->lng->txt(
"tst_stat_result_firstvisit"));
 
  861                array_push($datarow, $this->lng->txt(
"tst_stat_result_lastvisit"));
 
  864                array_push($datarow, $this->lng->txt(
"tst_stat_result_mark_median"));
 
  866                array_push($datarow, $this->lng->txt(
"tst_stat_result_rank_participant"));
 
  868                array_push($datarow, $this->lng->txt(
"tst_stat_result_rank_median"));
 
  870                array_push($datarow, $this->lng->txt(
"tst_stat_result_total_participants"));
 
  872                array_push($datarow, $this->lng->txt(
"tst_stat_result_median"));
 
  874                array_push($datarow, $this->lng->txt(
"scored_pass"));
 
  877                array_push($datarow, $this->lng->txt(
"pass"));
 
  880                $data =& $this->test_obj->getCompleteEvaluationData(TRUE, $filterby, $filtertext);
 
  881                $headerrow = $datarow;
 
  883                foreach (
$data->getParticipants() as $active_id => $userdata)
 
  885                        $datarow = $headerrow;
 
  889                                if (
$data->getParticipant($active_id)->getPassed() == FALSE)
 
  897                                if ($this->test_obj->getAnonymity())
 
  899                                        array_push($datarow2, $counter);
 
  903                                        array_push($datarow2, 
$data->getParticipant($active_id)->getName());
 
  904                                        array_push($datarow2, 
$data->getParticipant($active_id)->getLogin());
 
  906                                if (count($additionalFields))
 
  909                                        foreach ($additionalFields as $fieldname)
 
  911                                                if (strcmp($fieldname, 
"gender") == 0)
 
  913                                                        array_push($datarow2, $this->lng->txt(
"gender_" . $userfields[$fieldname]));
 
  917                                                        array_push($datarow2, $userfields[$fieldname]);
 
  921                                array_push($datarow2, 
$data->getParticipant($active_id)->getReached());
 
  922                                array_push($datarow2, 
$data->getParticipant($active_id)->getMaxpoints());
 
  923                                array_push($datarow2, 
$data->getParticipant($active_id)->getMark());
 
  924                                if ($this->test_obj->getECTSOutput())
 
  926                                        array_push($datarow2, 
$data->getParticipant($active_id)->getECTSMark());
 
  928                                array_push($datarow2, 
$data->getParticipant($active_id)->getQuestionsWorkedThrough());
 
  929                                array_push($datarow2, 
$data->getParticipant($active_id)->getNumberOfQuestions());
 
  930                                array_push($datarow2, 
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0);
 
  931                                $time = 
$data->getParticipant($active_id)->getTimeOfWork();
 
  932                                $time_seconds = $time;
 
  933                                $time_hours    = floor($time_seconds/3600);
 
  934                                $time_seconds -= $time_hours   * 3600;
 
  935                                $time_minutes  = floor($time_seconds/60);
 
  936                                $time_seconds -= $time_minutes * 60;
 
  937                                array_push($datarow2, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
 
  938                                $time = 
$data->getParticipant($active_id)->getQuestionsWorkedThrough() ? 
$data->getParticipant($active_id)->getTimeOfWork() / 
$data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
 
  939                                $time_seconds = $time;
 
  940                                $time_hours    = floor($time_seconds/3600);
 
  941                                $time_seconds -= $time_hours   * 3600;
 
  942                                $time_minutes  = floor($time_seconds/60);
 
  943                                $time_seconds -= $time_minutes * 60;
 
  944                                array_push($datarow2, sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
 
  946                                $fv = 
$data->getParticipant($active_id)->getFirstVisit();
 
  947                                $lv = 
$data->getParticipant($active_id)->getLastVisit();
 
  948                                foreach(array($fv, $lv) as $ts)
 
  953                                                array_push($datarow2, $visit);
 
  957                                                array_push($datarow2, 
"");
 
  961                                $median = 
$data->getStatistics()->getStatistics()->median();
 
  962                                $pct = 
$data->getParticipant($active_id)->getMaxpoints() ? $median / 
$data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
 
  963                                $mark = $this->test_obj->mark_schema->getMatchingMark($pct);
 
  964                                $mark_short_name = 
"";
 
  965                                if (is_object($mark))
 
  967                                        $mark_short_name = $mark->getShortName();
 
  969                                array_push($datarow2, $mark_short_name);
 
  970                                array_push($datarow2, 
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
 
  971                                array_push($datarow2, 
$data->getStatistics()->getStatistics()->rank_median());
 
  972                                array_push($datarow2, 
$data->getStatistics()->getStatistics()->count());
 
  973                                array_push($datarow2, $median);
 
  976                                        array_push($datarow2, 
$data->getParticipant($active_id)->getBestPass() + 1);
 
  980                                        array_push($datarow2, 
$data->getParticipant($active_id)->getLastPass() + 1);
 
  984                                        $finishdate = $this->test_obj->getPassFinishDate($active_id, 
$pass);
 
  989                                                        for ($i = 1; $i < $col-1; $i++)
 
  991                                                                array_push($datarow2, 
"");
 
  992                                                                array_push($datarow, 
"");
 
  994                                                        array_push($datarow, 
"");
 
  996                                                array_push($datarow2, 
$pass+1);
 
  997                                                if (is_object(
$data->getParticipant($active_id)) && is_array(
$data->getParticipant($active_id)->getQuestions(
$pass)))
 
  999                                                        foreach (
$data->getParticipant($active_id)->getQuestions(
$pass) as $question)
 
 1001                                                                $question_data = 
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
 
 1002                                                                array_push($datarow2, $question_data[
"reached"]);
 
 1003                                                                array_push($datarow, preg_replace(
"/<.*?>/", 
"", 
$data->getQuestionTitle($question[
"id"])));
 
 1006                                                if ($this->test_obj->isRandomTest() || $this->test_obj->getShuffleQuestions() || ($counter == 1 && 
$pass == 0))
 
 1008                                                        array_push($rows, $datarow);
 
 1011                                                array_push($rows, $datarow2);
 
 1012                                                $datarow2 = array();
 
 1020                foreach ($rows as $evalrow)
 
 1022                        $csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, 
$separator);
 
 1043                $ilBench->start(
"TestExport", 
"buildExportFile");
 
 1045                include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
 
 1049                $this->xml->
xmlSetDtdDef(
"<!DOCTYPE Test SYSTEM \"http://www.ilias.uni-koeln.de/download/dtd/ilias_co.dtd\">");
 
 1052                $this->xml->xmlSetGenCmt(
"Export of ILIAS Test ".
 
 1053                        $this->test_obj->getId().
" of installation ".$this->inst.
".");
 
 1056                $this->xml->xmlHeader();
 
 1059                $this->test_obj->createExportDirectory();
 
 1060                include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
 1065                $expDir = $this->test_obj->getExportDirectory();
 
 1066                include_once 
"./Services/Logging/classes/class.ilLog.php";
 
 1067                $expLog = 
new ilLog($expDir, 
"export.log");
 
 1069                $expLog->setLogFormat(
"");
 
 1070                $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
 
 1073                $qti_file = fopen($this->export_dir.
"/".$this->subdir.
"/".$this->qti_filename, 
"w");
 
 1074                fwrite($qti_file, $this->test_obj->toXML());
 
 1078                $ilBench->start(
"TestExport", 
"buildExportFile_getXML");
 
 1079                $this->test_obj->exportPagesXML($this->xml, $this->inst_id,
 
 1080                        $this->export_dir.
"/".$this->subdir, $expLog);
 
 1081                $ilBench->stop(
"TestExport", 
"buildExportFile_getXML");
 
 1091                $ilBench->start(
"TestExport", 
"buildExportFile_dumpToFile");
 
 1092                $this->xml->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->filename
 
 1094                $ilBench->stop(
"TestExport", 
"buildExportFile_dumpToFile");
 
 1099                        include_once 
"./Modules/Test/classes/class.ilTestResultsToXML.php";
 
 1100                        $resultwriter = 
new ilTestResultsToXML($this->test_obj->getTestId(), $this->test_obj->getAnonymity());
 
 1101                        $ilBench->start(
"TestExport", 
"buildExportFile_results");
 
 1102                        $resultwriter->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->resultsfile, 
false);
 
 1103                        $ilBench->stop(
"TestExport", 
"buildExportFile_results");
 
 1107                $ilBench->start(
"QuestionpoolExport", 
"buildExportFile_saveAdditionalMobs");
 
 1109                $ilBench->stop(
"QuestionpoolExport", 
"buildExportFile_saveAdditionalMobs");
 
 1112                $ilBench->start(
"TestExport", 
"buildExportFile_zipFile");
 
 1114                        $this->export_dir.
"/".$this->subdir.
".zip");
 
 1115                $ilBench->stop(
"TestExport", 
"buildExportFile_zipFile");
 
 1118                $this->xml->_XmlWriter;
 
 1120                $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
 
 1121                $ilBench->stop(
"TestExport", 
"buildExportFile");
 
 1123                return $this->export_dir.
"/".$this->subdir.
".zip";
 
 1128                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1131                foreach (
$mobs as $mob)
 
 1136                                $mob_obj->exportFiles($a_export_dir);
 
 1140                foreach ($this->test_obj->questions as $question_id)
 
 1143                        foreach (
$mobs as $mob)
 
 1148                                        $mob_obj->exportFiles($a_export_dir);
 
static _instantiateQuestion($question_id)
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
_convert_text($a_text, $a_target="has been removed")
Class ilExcelWriterAdapter.
_lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
__construct(&$a_test_obj, $a_mode="xml")
Constructor.
aggregatedResultsToExcel($deliver=TRUE)
Exports the aggregated results to the Microsoft Excel file format.
exportToExcel($deliver=TRUE, $filterby="", $filtertext="", $passedonly=FALSE)
Exports the evaluation data to the Microsoft Excel file format.
exportXHTMLMediaObjects($a_export_dir)
buildExportResultFile()
build xml export file
buildExportFile()
build export file (complete zip file)
aggregatedResultsToCSV($deliver=TRUE)
Exports the aggregated results to CSV.
isResultExportingEnabledForTestExport()
buildExportFileXML()
build xml export file
exportToCSV($deliver=TRUE, $filterby="", $filtertext="", $passedonly=FALSE)
Exports the evaluation data to the CSV file format.
$resultExportingEnabledForTestExport
setResultExportingEnabledForTestExport($resultExprtingEnabledForTestExport)
Test results to XML class.
static excelTime($year="", $month="", $day="", $hour="", $minute="", $second="")
Calculates a Microsoft Excel date/time value.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
xmlSetDtdDef($dtdDef)
Sets dtd definition.
redirection script todo: (a better solution should control the processing via a xml file)