43        $this->
user = $DIC->user();
 
   44        $this->db = 
$DIC->database();
 
   45        $this->lng = 
$DIC->language();
 
   46        $this->ctrl = 
$DIC->ctrl();
 
   49        $this->assignment = $a_ass;
 
   50        $this->user_id = $a_user_id;
 
   51        $this->is_tutor = (bool) $a_is_tutor;
 
   52        $this->public_submissions = (bool) $a_public_submissions;
 
   56                include_once 
"Modules/Exercise/classes/class.ilExAssignmentTeam.php";
 
   59                $this->team = $a_team;
 
   63        if ($this->assignment->getPeerReview()) {
 
   64            include_once 
"Modules/Exercise/classes/class.ilExPeerReview.php";
 
   71        switch ($this->assignment->getType()) {
 
  117            if ($this->peer_review) {
 
  135            return $this->team->getMembers();
 
  139        return array($this->user_id);
 
  145            return "t" . $this->team->getId();
 
  153        return (
bool) 
sizeof($this->
getFiles(
null, 
true));
 
  167            !$this->assignment->notStartedYet() &&
 
  168            $this->assignment->beforeDeadline());
 
  178            $this->public_submissions) {
 
  183        if ($this->peer_review) {
 
  185            foreach ($this->peer_review->getPeerReviewsByPeerId($this->getUserId()) as $giver) {
 
  186                if ($giver[
"giver_id"] == 
$ilUser->getId()) {
 
  202        if ($this->assignment->hasTeam() &&
 
  203            !$this->team->getId()) {
 
  216        return in_array($a_user_id, $this->
getUserIds());
 
  223        return (
$ilUser->getId() == $this->getUserId());
 
  228        return ($this->peer_review &&
 
  229            $this->peer_review->hasPeerReviewAccess($this->user_id));
 
  240            $max <= 
sizeof($this->
getFiles())) {
 
  254        $dl = $this->assignment->getPersonalDeadline($this->
getUserId());
 
  255        return ($dl && $dl < time());
 
  260        include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
 
  261        return new ilFSStorageExercise($this->assignment->getExerciseId(), $this->assignment->getId());
 
  267    public function uploadFile($a_http_post_files, $unzip = 
false)
 
  275        $deliver_result = $this->
initStorage()->uploadFile($a_http_post_files, $this->
getUserId(), $unzip);
 
  277        if ($deliver_result) {
 
  278            $next_id = 
$ilDB->nextId(
"exc_returned");
 
  280                "INSERT INTO exc_returned " .
 
  281                             "(returned_id, obj_id, user_id, filename, filetitle, mimetype, ts, ass_id, late) " .
 
  282                             "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
 
  283                $ilDB->quote($next_id, 
"integer"),
 
  284                $ilDB->quote($this->assignment->getExerciseId(), 
"integer"),
 
  285                $ilDB->quote($this->getUserId(), 
"integer"),
 
  286                $ilDB->quote($deliver_result[
"fullname"], 
"text"),
 
  288                $ilDB->quote($deliver_result[
"mimetype"], 
"text"),
 
  290                $ilDB->quote($this->assignment->getId(), 
"integer"),
 
  291                $ilDB->quote($this->isLate(), 
"integer")
 
  296                $this->team->writeLog(
 
  298                    $a_http_post_files[
"name"]
 
  318        include_once(
"Services/Utilities/classes/class.ilFileUtils.php");
 
  327            $max_num = $this->assignment->getMaxFile();
 
  329                $current_num = 
sizeof($this->
getFiles());
 
  330                $zip_num = 
sizeof($filearray[
"file"]);
 
  331                if ($current_num + $zip_num > $max_num) {
 
  340                    $a_http_post_files[
"type"] = 
"other";
 
  341                    $a_http_post_files[
"tmp_name"] = $filearray[
"path"][
$key] . 
"/" . 
$filename;
 
  342                    $a_http_post_files[
"error"] = 0;
 
  343                    $a_http_post_files[
"size"] = filesize($filearray[
"path"][
$key] . 
"/" . 
$filename);
 
  345                    if (!$this->
uploadFile($a_http_post_files, 
true)) {
 
  366        $query = 
"SELECT * FROM exc_returned" .
 
  367            " WHERE ass_id = " . 
$ilDB->quote($a_ass_id, 
"integer") .
 
  368            " AND (filename IS NOT NULL OR atext IS NOT NULL)" .
 
  369            " AND ts IS NOT NULL";
 
  380        include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
 
  382        $path = $storage->getAbsoluteSubmissionPath();
 
  384        $query = 
"SELECT * FROM exc_returned WHERE ass_id = " .
 
  385            $ilDB->quote($a_ass_id, 
"integer");
 
  390            $row[
"filename"] = 
$path . 
"/" . 
$row[
"user_id"] . 
"/" . basename(
$row[
"filename"]);
 
  394        return $delivered ? $delivered : array();
 
  397    public function getFiles(array $a_file_ids = 
null, $a_only_valid = 
false, $a_min_timestamp = 
null)
 
  401        $sql = 
"SELECT * FROM exc_returned" .
 
  406            $sql .= 
" AND " . 
$ilDB->in(
"returned_id", $a_file_ids, 
false, 
"integer");
 
  409        if ($a_min_timestamp) {
 
  410            $sql .= 
" AND ts > " . 
$ilDB->quote($a_min_timestamp, 
"timestamp");
 
  415        $delivered_files = array();
 
  423                    !(trim(
$row[
"atext"]))) {
 
  429                $row[
"timestamp14"] = substr(
$row[
"ts"], 0, 4) .
 
  430                    substr(
$row[
"ts"], 5, 2) . substr(
$row[
"ts"], 8, 2) .
 
  431                    substr(
$row[
"ts"], 11, 2) . substr(
$row[
"ts"], 14, 2) .
 
  432                    substr(
$row[
"ts"], 17, 2);
 
  434                    "/" . 
$row[
"user_id"] . 
"/" . basename(
$row[
"filename"]);
 
  437                if (is_file(
$row[
"filename"]) || (!in_array(
 
  438                    $this->assignment->getType(),
 
  441                    array_push($delivered_files, 
$row);
 
  446        return $delivered_files;
 
  464        $q = 
"SELECT exc_returned.returned_id AS id " .
 
  465            "FROM exc_usr_tutor, exc_returned " .
 
  466            "WHERE exc_returned.ass_id = exc_usr_tutor.ass_id " .
 
  467            " AND exc_returned.user_id = exc_usr_tutor.usr_id " .
 
  468            " AND exc_returned.ass_id = " . 
$ilDB->quote($this->
getAssignment()->getId(), 
"integer") .
 
  469            " AND " . 
$ilDB->in(
"exc_returned.user_id", $this->getUserIds(), 
"", 
"integer") .
 
  470            " AND exc_usr_tutor.tutor_id = " . 
$ilDB->quote($tutor, 
"integer") .
 
  471            " AND exc_usr_tutor.download_time < exc_returned.ts ";
 
  473        $new_up_set = 
$ilDB->query($q);
 
  476        while ($new_up_rec = 
$ilDB->fetchAssoc($new_up_set)) {
 
  477            $new_up[] = $new_up_rec[
"id"];
 
  495        $set = 
$ilDB->query(
"SELECT obj_id" .
 
  496            " FROM exc_returned" .
 
  497            " WHERE returned_id = " . 
$ilDB->quote($a_returned_id, 
"integer"));
 
  499        return (
int) 
$row[
"obj_id"];
 
  516        $set = 
$ilDB->query(
"SELECT obj_id, ass_id" .
 
  517            " FROM exc_returned" .
 
  518            " WHERE user_id = " . 
$ilDB->quote($a_user_id, 
"integer") .
 
  519            " AND filetitle = " . 
$ilDB->quote($a_filetitle, 
"text"));
 
  530        foreach ($this->
getFiles() as $item) {
 
  531            $files[] = $item[
"returned_id"];
 
  550            !
sizeof($file_id_array)) {
 
  554        if (count($file_id_array)) {
 
  556                " WHERE " . 
$ilDB->in(
"returned_id", $file_id_array, 
false, 
"integer") .
 
  557                " AND " . 
$ilDB->in(
"user_id", $user_ids, 
"", 
"integer"));
 
  560                $result_array = array();
 
  563                    array_push($result_array, 
$row);
 
  567                $ilDB->manipulate(
"DELETE FROM exc_returned" .
 
  568                    " WHERE " . 
$ilDB->in(
"returned_id", $file_id_array, 
false, 
"integer") .
 
  569                    " AND " . 
$ilDB->in(
"user_id", $user_ids, 
"", 
"integer"));
 
  573                foreach ($result_array as 
$key => $value) {
 
  574                    if ($value[
"filename"]) {
 
  576                            $this->team->writeLog(
 
  582                        $filename = 
$path . 
"/" . $value[
"user_id"] . 
"/" . basename($value[
"filename"]);
 
  598        include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
 
  601            $submission = 
new self($ass, $a_user_id);
 
  602            $submission->deleteAllFiles();
 
  605            $team = $submission->getTeam();
 
  607                $team->removeTeamMember($a_user_id);
 
  611            $member_status = $ass->getMemberStatus($a_user_id);
 
  612            $member_status->setStatus(
"notgraded");
 
  613            $member_status->update();
 
  622        $q = 
"SELECT download_time FROM exc_usr_tutor WHERE " .
 
  624            $ilDB->in(
"usr_id", $a_user_ids, 
"", 
"integer") . 
" AND " .
 
  625            " tutor_id = " . 
$ilDB->quote(
$ilUser->getId(), 
"integer");
 
  626        $lu_set = 
$ilDB->query($q);
 
  627        $lu_rec = 
$ilDB->fetchAssoc($lu_set);
 
  628        return $lu_rec[
"download_time"];
 
  631    public function downloadFiles(array $a_file_ids = 
null, $a_only_new = 
false, $a_peer_review_mask_filename = 
false)
 
  637        $is_team = $this->assignment->hasTeam();
 
  640        $download_time = 
null;
 
  645        if ($this->is_tutor) {
 
  649        if ($a_peer_review_mask_filename) {
 
  652            foreach ($this->peer_review->getPeerReviewsByGiver(
$ilUser->getId()) as $idx => $item) {
 
  653                if ($item[
"peer_id"] == $this->
getUserId()) {
 
  665            if (
sizeof(
$files) == 1) {
 
  668                switch ($this->assignment->getType()) {
 
  673                            $this->assignment->getTitle() . 
" - " .
 
  674                            $file[
"filetitle"][
"firstname"] . 
" " .
 
  675                            $file[
"filetitle"][
"lastname"] . 
" (" .
 
  676                            $file[
"filetitle"][
"login"] . 
").zip";
 
  683                if ($a_peer_review_mask_filename) {
 
  684                    $suffix = array_pop(explode(
".", 
$file[
"filetitle"]));
 
  685                    $file[
"filetitle"] = $this->assignment->getTitle() . 
"_peer" . $peer_id . 
"." . $suffix;
 
  686                } elseif (
$file[
"late"]) {
 
  687                    $file[
"filetitle"] = 
$lng->txt(
"exc_late_submission") . 
" - " .
 
  693                $array_files = array();
 
  695                    $src = basename(
$file[
"filename"]);
 
  696                    if ($a_peer_review_mask_filename) {
 
  697                        $suffix = array_pop(explode(
".", $src));
 
  698                        $tgt = $this->assignment->getTitle() . 
"_peer" . $peer_id .
 
  699                            "_" . (++$seq) . 
"." . $suffix;
 
  701                        $array_files[
$file[
"user_id"]][] = array(
 
  706                        $array_files[
$file[
"user_id"]][] = array(
 
  708                            "late" => 
$file[
"late"]
 
  732        $exc_id = $this->assignment->getExerciseId();
 
  733        $ass_id = $this->assignment->getId();
 
  737                "DELETE FROM exc_usr_tutor " .
 
  738                "WHERE ass_id = %s AND usr_id = %s AND tutor_id = %s",
 
  739                array(
"integer", 
"integer", 
"integer"),
 
  744                "INSERT INTO exc_usr_tutor (ass_id, obj_id, usr_id, tutor_id, download_time) VALUES " .
 
  745                "(%s, %s, %s, %s, %s)",
 
  746                array(
"integer", 
"integer", 
"integer", 
"integer", 
"timestamp"),
 
  755            "/" . $a_user_id . 
"/" . basename(
$filename);
 
  771        $tmpzipfile = $tmpfile . 
".zip";
 
  777        $deliverFilename = str_replace(
" ", 
"_", $assTitle);
 
  778        if ($a_user_id > 0 && !$a_multi_user) {
 
  780            $deliverFilename .= 
"_" . $userName[
"lastname"] . 
"_" . $userName[
"firstname"];
 
  782            $deliverFilename .= 
"_files";
 
  784        $orgDeliverFilename = trim($deliverFilename);
 
  787        chdir($tmpdir . 
"/" . $deliverFilename);
 
  790        $parsed_files = $duplicates = array();
 
  805                    $pos = strpos($newFilename, 
"_");
 
  806                    if ($pos !== 
false) {
 
  807                        $newFilename = substr($newFilename, $pos + 1);
 
  810                    $chkName = strtolower($newFilename);
 
  811                    if (array_key_exists($chkName, $duplicates)) {
 
  812                        $suffix = strrpos($newFilename, 
".");
 
  813                        $newFilename = substr($newFilename, 0, $suffix) .
 
  814                            " (" . (++$duplicates[$chkName]) . 
")" .
 
  815                            substr($newFilename, $suffix);
 
  817                        $duplicates[$chkName] = 1;
 
  821                        $newFilename = 
$lng->txt(
"exc_late_submission") . 
" - " .
 
  827                $newFilename = $tmpdir . DIRECTORY_SEPARATOR . $deliverFilename . DIRECTORY_SEPARATOR . $newFilename;
 
  829                $oldFilename =  $pathname . DIRECTORY_SEPARATOR . 
$filename;
 
  830                if (!copy($oldFilename, $newFilename)) {
 
  831                    echo 
'Could not copy ' . $oldFilename . 
' to ' . $newFilename;
 
  833                touch($newFilename, filectime($oldFilename));
 
  834                $parsed_files[] =  
ilUtil::escapeShellArg($deliverFilename . DIRECTORY_SEPARATOR . basename($newFilename));
 
  861        include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
 
  868        $savepath = $storage->getAbsoluteSubmissionPath();
 
  876        if (!is_dir($savepath)) {
 
  881        chdir($storage->getTempPath());
 
  891        foreach (array_keys($members) as 
$id) {
 
  892            $directory = $savepath . DIRECTORY_SEPARATOR . 
$id;
 
  895        if ($dirsize > disk_free_space($tmpdir)) {
 
  906            $team_dirs = array();
 
  909        foreach ($members as 
$id => $item) {
 
  910            $user = $item[
"name"];
 
  911            $user_files = $item[
"files"];
 
  913            $sourcedir = $savepath . DIRECTORY_SEPARATOR . 
$id;
 
  914            if (!is_dir($sourcedir)) {
 
  922            if (is_array($team_map) &&
 
  923                array_key_exists(
$id, $team_map)) {
 
  924                $team_id = $team_map[
$id];
 
  925                if (!array_key_exists($team_id, $team_dirs)) {
 
  926                    $team_dir = 
$lng->txt(
"exc_team") . 
" " . $team_id;
 
  928                    $team_dirs[$team_id] = $team_dir;
 
  930                $team_dir = $team_dirs[$team_id] . DIRECTORY_SEPARATOR;
 
  934                trim($userName[
"lastname"]) . 
"_" .
 
  935                trim($userName[
"firstname"]) . 
"_" .
 
  936                trim($userName[
"login"]) . 
"_" .
 
  941            $sourcefiles = scandir($sourcedir);
 
  942            $duplicates = array();
 
  943            foreach ($sourcefiles as $sourcefile) {
 
  944                if ($sourcefile == 
"." || $sourcefile == 
"..") {
 
  948                $targetfile = trim(basename($sourcefile));
 
  949                $pos = strpos($targetfile, 
"_");
 
  950                if ($pos !== 
false) {
 
  951                    $targetfile= substr($targetfile, $pos + 1);
 
  955                if (array_key_exists($targetfile, $duplicates)) {
 
  956                    $suffix = strrpos($targetfile, 
".");
 
  957                    $targetfile = substr($targetfile, 0, $suffix) .
 
  958                        " (" . (++$duplicates[$targetfile]) . 
")" .
 
  959                        substr($targetfile, $suffix);
 
  961                    $duplicates[$targetfile] = 1;
 
  965                if (is_array($user_files)) {    
 
  966                    foreach ($user_files as 
$file) {
 
  967                        if (basename(
$file[
"filename"]) == $sourcefile) {
 
  969                                $targetfile = 
$lng->txt(
"exc_late_submission") . 
" - " .
 
  978                $targetfile = $targetdir . DIRECTORY_SEPARATOR . $targetfile;
 
  979                $sourcefile = $sourcedir . DIRECTORY_SEPARATOR . $sourcefile;
 
  981                if (!copy($sourcefile, $targetfile)) {
 
  982                    include_once 
"Modules/Exercise/exceptions/class.ilExerciseException.php";
 
  983                    throw new ilExerciseException(
"Could not copy " . basename($sourcefile) . 
" to '" . $targetfile . 
"'.");
 
  986                    touch($targetfile, filectime($sourcefile));
 
  999        $tmpzipfile = $tmpfile . 
".zip";
 
 1008            ? strtolower(
$lng->txt(
"exc_assignment"))
 
 1009            : $assTitle) . 
".zip", 
"", 
false, 
true);
 
 1023        $q = 
"SELECT obj_id,user_id,ts FROM exc_returned" .
 
 1024            " WHERE ass_id = " . 
$ilDB->quote($this->assignment->getId(), 
"integer") .
 
 1026            " AND (filename IS NOT NULL OR atext IS NOT NULL)" .
 
 1027            " AND ts IS NOT NULL" .
 
 1028            " ORDER BY ts DESC";
 
 1029        $usr_set = 
$ilDB->query($q);
 
 1030        $array = 
$ilDB->fetchAssoc($usr_set);
 
 1049        $next_id = 
$ilDB->nextId(
"exc_returned");
 
 1051            "INSERT INTO exc_returned " .
 
 1052                         "(returned_id, obj_id, user_id, filetitle, ass_id, ts, atext, late) " .
 
 1053                         "VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
 
 1054            $ilDB->quote($next_id, 
"integer"),
 
 1055            $ilDB->quote($this->assignment->getExerciseId(), 
"integer"),
 
 1056            $ilDB->quote($this->getUserId(), 
"integer"),
 
 1057            $ilDB->quote($a_wsp_id, 
"text"),
 
 1058            $ilDB->quote($this->assignment->getId(), 
"integer"),
 
 1060            $ilDB->quote($a_text, 
"text"),
 
 1061            $ilDB->quote($this->isLate(), 
"integer")
 
 1077        $ilDB->manipulate(
"DELETE FROM exc_returned" .
 
 1078            " WHERE obj_id = " . 
$ilDB->quote($this->assignment->getExerciseId(), 
"integer") .
 
 1079            " AND user_id = " . 
$ilDB->quote($this->getUserId(), 
"integer") .
 
 1080            " AND ass_id = " . 
$ilDB->quote($this->assignment->getId(), 
"integer") .
 
 1081            " AND returned_id = " . 
$ilDB->quote($a_returned_id, 
"integer"));
 
 1097        if (!trim($a_text)) {
 
 1108                $ilDB->manipulate(
"UPDATE exc_returned" .
 
 1109                    " SET atext = " . 
$ilDB->quote($a_text, 
"text") .
 
 1111                    ", late = " . 
$ilDB->quote($this->isLate(), 
"integer") .
 
 1112                    " WHERE returned_id = " . 
$ilDB->quote(
$id, 
"integer"));
 
 1131        $result[
"files"][
"count"] = 
"---";
 
 1147        $result[
"last_submission"][
"txt"] = 
$lng->txt(
"exc_last_submission");
 
 1148        $result[
"last_submission"][
"value"] = $last_sub;
 
 1151        $ilCtrl->setParameterByClass(
"ilexsubmissionfilegui", 
"member_id", $this->
getUserId());
 
 1154        switch ($this->assignment->getType()) {
 
 1162                foreach ($all_files as 
$file) {
 
 1163                    if (
$file[
"late"]) {
 
 1169                $result[
"files"][
"txt"] = 
$lng->txt(
"exc_files_returned");
 
 1171                    $result[
"files"][
"txt"].= 
' - <span class="warning">' . 
$lng->txt(
"exc_late_submission") . 
" (" . $late_files . 
")</span>";
 
 1173                $sub_cnt = count($all_files);
 
 1175                if (count(
$new) > 0) {
 
 1179                $result[
"files"][
"count"] = $sub_cnt;
 
 1183                    $result[
"files"][
"download_url"] =
 
 1184                        $ilCtrl->getLinkTargetByClass(
"ilexsubmissionfilegui", 
"downloadReturned");
 
 1186                    if (count(
$new) <= 0) {
 
 1187                        $result[
"files"][
"download_txt"] = 
$lng->txt(
"exc_tbl_action_download_files");
 
 1189                        $result[
"files"][
"download_txt"] = 
$lng->txt(
"exc_tbl_action_download_all_files");
 
 1193                    if (count(
$new) > 0) {
 
 1194                        $result[
"files"][
"download_new_url"] =
 
 1195                            $ilCtrl->getLinkTargetByClass(
"ilexsubmissionfilegui", 
"downloadNewReturned");
 
 1197                        $result[
"files"][
"download_new_txt"] = 
$lng->txt(
"exc_tbl_action_download_new_files");
 
 1203                $result[
"files"][
"txt"] =
$lng->txt(
"exc_blog_returned");
 
 1206                    $blogs = array_pop($blogs);
 
 1207                    if ($blogs && substr($blogs[
"filename"], -1) != 
"/") {
 
 1208                        if ($blogs[
"late"]) {
 
 1209                            $result[
"files"][
"txt"].= 
' - <span class="warning">' . 
$lng->txt(
"exc_late_submission") . 
"</span>";
 
 1212                        $result[
"files"][
"count"] = 1;
 
 1214                        $result[
"files"][
"download_url"] =
 
 1215                            $ilCtrl->getLinkTargetByClass(
"ilexsubmissionfilegui", 
"downloadReturned");
 
 1217                        $result[
"files"][
"download_txt"] = 
$lng->txt(
"exc_tbl_action_download_files");
 
 1223                $result[
"files"][
"txt"] = 
$lng->txt(
"exc_portfolio_returned");
 
 1226                    $portfolios = array_pop($portfolios);
 
 1227                    if ($portfolios && substr($portfolios[
"filename"], -1) != 
"/") {
 
 1228                        if ($portfolios[
"late"]) {
 
 1229                            $result[
"files"][
"txt"].= 
' - <span class="warning">' . 
$lng->txt(
"exc_late_submission") . 
"</span>";
 
 1232                        $result[
"files"][
"count"] = 1;
 
 1234                        $result[
"files"][
"download_url"] =
 
 1235                            $ilCtrl->getLinkTargetByClass(
"ilexsubmissionfilegui", 
"downloadReturned");
 
 1237                        $result[
"files"][
"download_txt"] = 
$lng->txt(
"exc_tbl_action_download_files");
 
 1243                $result[
"files"][
"txt"] = 
$lng->txt(
"exc_files_returned_text");
 
 1246                    $result[
"files"][
"count"] = 1;
 
 1249                    if (trim(
$files[
"atext"])) {
 
 1251                            $result[
"files"][
"txt"].= 
' - <span class="warning">' . 
$lng->txt(
"exc_late_submission") . 
"</span>";
 
 1254                        $result[
"files"][
"download_url"] =
 
 1255                            $ilCtrl->getLinkTargetByClass(
"ilexsubmissiontextgui", 
"showAssignmentText");
 
 1257                        $result[
"files"][
"download_txt"] = 
$lng->txt(
"exc_tbl_action_text_assignment_show");
 
 1263        $ilCtrl->setParameterByClass(
"ilexsubmissionfilegui", 
"member_id", 
"");
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
Exercise assignment team.
const TEAM_LOG_REMOVE_FILE
static getAssignmentTeamMap($a_ass_id)
Get team structure for assignment.
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
getExerciseId()
Get exercise id.
getId()
Get assignment id.
static getInstancesByExercise($a_exc_id)
static lookupTitle($a_id)
Lookup title.
static deleteUser($a_exc_id, $a_user_id)
Delete all delivered files of user.
static getAllAssignmentFiles($a_exc_id, $a_ass_id)
downloadSingleFile($a_user_id, $filename, $filetitle)
processUploadedZipFile($fileTmp)
processes errorhandling etc for uploaded archive
addResourceObject($a_wsp_id, $a_text=null)
Add personal resource to assigment.
downloadMultipleFiles($a_filenames, $a_user_id, $a_multi_user=false)
isInTeam($a_user_id=null)
static lookupExerciseIdForReturnedId($a_returned_id)
Get exercise from submission id (used in ilObjMediaObject)
static hasAnySubmissions($a_ass_id)
static downloadAllAssignmentFiles(ilExAssignment $a_ass, array $members)
Download all submitted files of an assignment (all user)
deleteSelectedFiles(array $file_id_array)
Deletes already delivered files.
lookupNewFiles($a_tutor=null)
Check how much files have been uploaded by the learner after the last download of the tutor.
__construct(ilExAssignment $a_ass, $a_user_id, ilExAssignmentTeam $a_team=null, $a_is_tutor=false, $a_public_submissions=false)
downloadFiles(array $a_file_ids=null, $a_only_new=false, $a_peer_review_mask_filename=false)
updateTutorDownloadTime()
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
updateTextSubmission($a_text)
Handle text assignment submissions.
uploadFile($a_http_post_files, $unzip=false)
Save submitted file of user.
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
getDownloadedFilesInfoForTableGUIS($a_parent_obj, $a_parent_cmd=null)
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
getLastSubmission()
Get the date of the last submission of a user for the assignment.
getLastDownloadTime(array $a_user_ids)
Exercise exceptions class.
Class to report exception.
static getValidFilename($a_filename)
Get valid filename.
static processZipFile($a_directory, $a_file, $structure, $ref_id=null, $containerType=null, $tree=null, $access_handler=null)
unzips in given directory and processes uploaded zip for use as single files
static utf8_encode($string)
utf8-encodes string if it is not a valid utf8-string.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
static _lookupName($a_user_id)
lookup user name
static _lookupTitle($a_id)
lookup object title
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getMySQLTimestamp($a_ts)
Get MySQL timestamp in 4.1.x or higher format (yyyy-mm-dd hh:mm:ss) This function converts a timestam...
static escapeShellArg($a_arg)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static now()
Return current timestamp in Y-m-d H:i:s format.
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static dirsize($directory)
get size of a directory or a file.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res