Esempio n. 1
0
         echo rtrim($line['extref']) . "\n";
         echo "\nLICENSE\n";
         echo rtrim($line['license']) . "\n";
         echo "\nANCESTORAUTHORS\n";
         echo rtrim($line['ancestorauthors']) . "\n";
         echo "\nOTHERATTRIBUTION\n";
         echo rtrim($line['otherattribution']) . "\n";
         if ($line['hasimg'] == 1) {
             echo "\nQIMGS\n";
             $query = "SELECT var,filename FROM imas_qimages WHERE qsetid='{$line['id']}'";
             $r2 = mysql_query($query) or die("Query failed : " . mysql_error());
             while ($row = mysql_fetch_row($r2)) {
                 $row[1] = trim($row[1]);
                 echo $row[0] . ',' . $row[1] . "\n";
                 if ($GLOBALS['filehandertypecfiles'] == 's3') {
                     copyqimage($row[1], realpath("../assessment/qimages") . DIRECTORY_SEPARATOR . $row[1]);
                 }
                 $imgfiles[] = realpath("../assessment/qimages") . DIRECTORY_SEPARATOR . $row[1];
             }
         }
     }
     // need to work on
     include "../includes/tar.class.php";
     if (file_exists("../course/files/qimages.tar.gz")) {
         unlink("../course/files/qimages.tar.gz");
     }
     $tar = new tar();
     $tar->addFiles($imgfiles);
     $tar->toTar("../course/files/qimages.tar.gz", TRUE);
     exit;
 } else {
Esempio n. 2
0
             echo "\nQIMGS\n";
             $query = "SELECT var,filename FROM imas_qimages WHERE qsetid='{$line['id']}'";
             $r2 = mysql_query($query) or die("Query failed : " . mysql_error());
             while ($row = mysql_fetch_row($r2)) {
                 echo $row[0] . ',' . $row[1] . "\n";
             }
         }
         echo "END QSET\n";
     }
     include "../includes/filehandler.php";
     $query = "SELECT DISTINCT filename FROM imas_qimages WHERE qsetid IN ({$qstoexportlist})";
     $r2 = mysql_query($query) or die("Query failed : " . mysql_error());
     while ($row = mysql_fetch_row($r2)) {
         if ($GLOBALS['filehandertypecfiles'] == 's3') {
             if (!file_exists("../assessment/qimages" . DIRECTORY_SEPARATOR . trim($row[0]))) {
                 copyqimage($row[0], realpath("../assessment/qimages") . DIRECTORY_SEPARATOR . trim($row[0]));
             }
         }
         $imgfiles[] = realpath("../assessment/qimages") . DIRECTORY_SEPARATOR . trim($row[0]);
     }
 }
 // need to work on
 /*include("../includes/tar.class.php");
 	if (file_exists("../course/files/qimages.tar.gz")) {
 		unlink("../course/files/qimages.tar.gz");
 	}
 	$tar = new tar();
 	$tar->addFiles($imgfiles);
 	$tar->toTar("../course/files/qimages.tar.gz",TRUE);
 	*/
 if (class_exists('ZipArchive')) {