140 $this->tempZipFilePath =
ilUtil::ilTempnam($this->tempDirPath) . self::ZIP_FILE_EXTENSION;
143 str_replace(
' ',
'', $this->
getTestTitle() .
'_' . $this->question->getTitle())
150 SELECT tst_solutions.solution_id, tst_solutions.pass, tst_solutions.active_fi, tst_solutions.question_fi, 151 tst_solutions.value1, tst_solutions.value2, tst_solutions.tstamp 152 FROM tst_solutions, tst_active, qpl_questions 153 WHERE tst_solutions.active_fi = tst_active.active_id 154 AND tst_solutions.question_fi = qpl_questions.question_id 155 AND tst_solutions.question_fi = %s 156 AND tst_active.test_fi = %s 157 ORDER BY tst_solutions.active_fi, tst_solutions.tstamp 160 $res = $this->db->queryF(
162 array(
"integer",
"integer"),
166 $solutionData =
array();
168 while (
$row = $this->db->fetchAssoc(
$res)) {
169 if (!isset($solutionData[
$row[
'active_fi']])) {
170 $solutionData[ $row[
'active_fi'] ] =
array();
173 if (!isset($solutionData[ $row[
'active_fi'] ][ $row[
'pass'] ])) {
174 $solutionData[ $row[
'active_fi'] ][ $row[
'pass'] ] =
array();
177 $solutionData[ $row[
'active_fi'] ][ $row[
'pass'] ][] =
$row;
180 return $solutionData;
185 $activeIds =
array();
187 foreach ($solutionData as $activeId => $passes) {
188 $activeIds[] = $activeId;
191 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
193 $participantData->setActiveIds($activeIds);
194 $participantData->load($this->
getTestId());
196 return $participantData;
201 foreach ($solutionData as $activeId => $passes) {
204 $uploadedFileDir = $this->question->getFileUploadPath(
207 $this->question->getId()
211 if (!is_file($uploadedFileDir . $file[
'value1'])) {
215 $destinationDir = $this->tempDirPath .
'/' . $this->mainFolderName .
'/';
221 copy($uploadedFileDir . $file[
'value1'], $destinationDir . $file[
'value2']);
229 return $this->lng->txt(
'pass') .
'_' . (
$pass + 1);
234 ilUtil::zip($this->tempDirPath .
'/' . $this->mainFolderName, $this->tempZipFilePath);
236 $pathinfo = pathinfo($this->tempZipFilePath);
237 $this->finalZipFilePath = dirname($pathinfo[
'dirname']) .
'/' . $pathinfo[
'basename'];
240 require_once
'Services/Utilities/classes/class.ilFileUtils.php';
260 $this->mainFolderName . self::ZIP_FILE_EXTENSION
266 return self::ZIP_FILE_MIME_TYPE;
static makeDirParents($a_dir)
Create a new directory and all parent directories.
createFileUploadCollectionZipFile()
removeFileUploadCollection()
getFileUploadSolutionData()
collectUploadedFiles($solutionData, ilTestParticipantData $participantData)
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static rename($a_source, $a_target)
Rename a file.
foreach($_POST as $key=> $value) $res
__construct(ilDBInterface $db, ilLanguage $lng)
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 ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
getFileSystemCompliantFullnameByActiveId($activeId)
static getRootLogger()
The unique root logger has a fixed error level.
getParticipantData($solutionData)
Class to report exception.