63 protected int $id = 0;
110 $this->db =
$DIC->database();
111 $this->
lng = $DIC->language();
112 $this->
user = $DIC->user();
113 $this->app_event_handler =
$DIC[
"ilAppEventHandler"];
115 $this->
access = $DIC->access();
117 $this->
setType(self::TYPE_UPLOAD);
126 $this->string_transform =
$DIC->refinery()
141 $set =
$ilDB->query(
"SELECT * FROM exc_assignment " .
142 " WHERE exc_id = " .
$ilDB->quote($a_exc_id,
"integer") .
143 " ORDER BY order_nr");
147 while ($rec =
$ilDB->fetchAssoc($set)) {
149 $rec[
"order_val"] = $order_val;
152 $ass->initFromDB($rec);
177 FROM exc_ass_file_order
178 WHERE assignment_id = {$db->quote($a_ass_id, 'integer')}
179 AND filename = {$db->quote($a_file_data['entry'], 'text')}
185 $order_val = (
int) $row[
'order_nr'];
186 $order_id = (
int) $row[
'id'];
188 return array($order_val, $order_id);
193 return $this->ass_type->usesTeams();
196 public function setId(
int $a_val): void
208 $this->exc_id = $a_val;
213 return $this->exc_id;
218 $this->start_time = $a_val;
223 return $this->start_time;
228 $this->deadline = $a_val;
233 return $this->deadline;
242 $this->deadline_mode = $a_val;
247 return $this->deadline_mode;
252 $this->relative_deadline = $a_val;
257 return $this->relative_deadline;
262 $this->rel_deadline_last_subm = $a_val;
267 return $this->rel_deadline_last_subm;
277 if ($this->ass_type->usesTeams()) {
281 return $this->getDeadline();
283 $a_user_id = $team_id;
287 $set =
$ilDB->query(
"SELECT tstamp FROM exc_idl" .
288 " WHERE ass_id = " .
$ilDB->quote($this->getId(),
"integer") .
289 " AND member_id = " .
$ilDB->quote($a_user_id,
"integer") .
290 " AND is_team = " .
$ilDB->quote($is_team,
"integer"));
291 $row =
$ilDB->fetchAssoc($set);
294 return max(($row[
"tstamp"] ?? 0), $this->getDeadline());
302 $set =
$ilDB->query(
"SELECT MAX(tstamp) FROM exc_idl" .
303 " WHERE ass_id = " .
$ilDB->quote($this->getId(),
"integer"));
304 $row =
$ilDB->fetchAssoc($set);
305 return $row[
"tstamp"] ?? 0;
311 $this->deadline2 = $a_val;
316 return $this->deadline2;
321 $this->instruction = $a_val;
326 return $this->instruction;
331 $inst = $this->getInstruction();
333 $is_html = (strlen($inst) != strlen(strip_tags($inst)));
336 $this->string_transform->makeClickable()->transform($inst)
345 $this->title = $a_val;
355 $this->mandatory = $a_val;
360 return $this->mandatory;
365 $this->order_nr = $a_val;
370 return $this->order_nr;
380 if ($this->isValidType($a_value)) {
381 $this->type = $a_value;
383 $this->ass_type = $this->types->getById($a_value);
385 if ($this->ass_type->usesTeams()) {
386 $this->setPeerReview(
false);
393 return $this->ass_type;
408 return $this->types->isValidId($a_value);
413 $this->peer = $a_value;
423 $this->peer_min = $a_value;
428 return $this->peer_min;
433 $this->peer_unlock = $a_value;
438 return $this->peer_unlock;
446 $this->peer_dl = $a_val;
451 return $this->peer_dl;
461 $this->peer_valid = $a_value;
466 return $this->peer_valid;
471 $this->peer_rating = $a_val;
476 return $this->peer_rating;
481 $this->peer_text = $a_val;
486 return $this->peer_text;
491 $this->peer_file = $a_val;
496 return $this->peer_file;
501 $this->peer_personal = $a_val;
506 return $this->peer_personal;
511 $a_value = (is_numeric($a_value) && (
int) $a_value > 0)
514 $this->peer_char = $a_value;
519 return $this->peer_char;
524 $this->crit_cat = $a_value;
529 return $this->crit_cat;
532 public function getPeerReviewCriteriaCatalogueItems(): array
534 if ($this->crit_cat) {
539 if ($this->peer_rating) {
543 if ($this->peer_text) {
546 if ($this->peer_char) {
547 $crit->setMinChars($this->peer_char);
552 if ($this->peer_file) {
562 $this->feedback_file = $a_value;
567 return $this->feedback_file;
575 $this->feedback_cron = $a_value;
580 return $this->feedback_cron;
586 $this->feedback_date = $a_value;
591 return $this->feedback_date;
600 $this->feedback_date_custom = $a_value;
605 return $this->feedback_date_custom;
611 $this->team_tutor = $a_value;
616 return $this->team_tutor;
622 $this->max_file = $a_value;
627 return $this->max_file;
633 $this->portfolio_template = $a_val;
638 return $this->portfolio_template;
649 "SELECT * FROM exc_assignment " .
650 " WHERE id = " .
$ilDB->quote($this->getId(),
"integer")
652 $rec =
$ilDB->fetchAssoc($set);
655 if (is_array($rec)) {
656 $this->initFromDB($rec);
667 $this->setId((
int) $a_set[
"id"]);
668 $this->setExerciseId((
int) $a_set[
"exc_id"]);
669 $this->setDeadline((
int) $a_set[
"time_stamp"]);
670 $this->setExtendedDeadline((
int) $a_set[
"deadline2"]);
671 $this->setInstruction((
string) $a_set[
"instruction"]);
672 $this->setTitle((
string) $a_set[
"title"]);
673 $this->setStartTime((
int) $a_set[
"start_time"]);
674 $this->setOrderNr((
int) $a_set[
"order_nr"]);
675 $this->setMandatory((
bool) $a_set[
"mandatory"]);
676 $this->setType((
int) $a_set[
"type"]);
677 $this->setPeerReview((
bool) $a_set[
"peer"]);
678 $this->setPeerReviewMin((
int) $a_set[
"peer_min"]);
679 $this->setPeerReviewSimpleUnlock((
bool) $a_set[
"peer_unlock"]);
680 $this->setPeerReviewDeadline((
int) $a_set[
"peer_dl"]);
681 $this->setPeerReviewValid((
int) $a_set[
"peer_valid"]);
682 $this->setPeerReviewFileUpload((
bool) $a_set[
"peer_file"]);
683 $this->setPeerReviewPersonalized((
bool) $a_set[
"peer_prsl"]);
684 $this->setPeerReviewChars((
int) $a_set[
"peer_char"]);
685 $this->setPeerReviewText((
bool) $a_set[
"peer_text"]);
686 $this->setPeerReviewRating((
bool) $a_set[
"peer_rating"]);
687 $this->setPeerReviewCriteriaCatalogue((
int) $a_set[
"peer_crit_cat"]);
688 $this->setFeedbackFile((
string) $a_set[
"fb_file"]);
689 $this->setFeedbackDate((
int) $a_set[
"fb_date"]);
690 $this->setFeedbackDateCustom((
int) $a_set[
"fb_date_custom"]);
691 $this->setFeedbackCron((
bool) $a_set[
"fb_cron"]);
692 $this->setTeamTutor((
bool) $a_set[
"team_tutor"]);
693 $this->setMaxFile((
int) $a_set[
"max_file"]);
694 $this->setPortfolioTemplateId((
int) $a_set[
"portfolio_template"]);
695 $this->setMinCharLimit((
int) $a_set[
"min_char_limit"]);
696 $this->setMaxCharLimit((
int) $a_set[
"max_char_limit"]);
697 $this->setDeadlineMode((
int) $a_set[
"deadline_mode"]);
698 $this->setRelativeDeadline((
int) $a_set[
"relative_deadline"]);
699 $this->setRelDeadlineLastSubmission((
int) $a_set[
"rel_deadline_last_subm"]);
709 if ($this->getOrderNr() == 0) {
711 self::lookupMaxOrderNrForEx($this->getExerciseId())
716 $next_id =
$ilDB->nextId(
"exc_assignment");
717 $ilDB->insert(
"exc_assignment", array(
718 "id" => array(
"integer", $next_id),
719 "exc_id" => array(
"integer", $this->getExerciseId()),
720 "time_stamp" => array(
"integer", $this->getDeadline()),
721 "deadline2" => array(
"integer", $this->getExtendedDeadline()),
722 "instruction" => array(
"clob", $this->getInstruction()),
723 "title" => array(
"text", $this->getTitle()),
724 "start_time" => array(
"integer", $this->getStartTime()),
725 "order_nr" => array(
"integer", $this->getOrderNr()),
726 "mandatory" => array(
"integer", $this->getMandatory()),
727 "type" => array(
"integer", $this->getType()),
728 "peer" => array(
"integer", $this->getPeerReview()),
729 "peer_min" => array(
"integer", $this->getPeerReviewMin()),
730 "peer_unlock" => array(
"integer", $this->getPeerReviewSimpleUnlock()),
731 "peer_dl" => array(
"integer", $this->getPeerReviewDeadline()),
732 "peer_valid" => array(
"integer", $this->getPeerReviewValid()),
733 "peer_file" => array(
"integer", $this->hasPeerReviewFileUpload()),
734 "peer_prsl" => array(
"integer", $this->hasPeerReviewPersonalized()),
735 "peer_char" => array(
"integer", $this->getPeerReviewChars()),
736 "peer_text" => array(
"integer", (
int) $this->hasPeerReviewText()),
737 "peer_rating" => array(
"integer", (
int) $this->hasPeerReviewRating()),
738 "peer_crit_cat" => array(
"integer", $this->getPeerReviewCriteriaCatalogue()),
739 "fb_file" => array(
"text", $this->getFeedbackFile()),
740 "fb_date" => array(
"integer", $this->getFeedbackDate()),
741 "fb_date_custom" => array(
"integer", $this->getFeedbackDateCustom()),
742 "fb_cron" => array(
"integer", $this->hasFeedbackCron()),
743 "team_tutor" => array(
"integer", $this->getTeamTutor()),
744 "max_file" => array(
"integer", $this->getMaxFile()),
745 "portfolio_template" => array(
"integer", $this->getPortfolioTemplateId()),
746 "min_char_limit" => array(
"integer", $this->getMinCharLimit()),
747 "max_char_limit" => array(
"integer", $this->getMaxCharLimit()),
748 "relative_deadline" => array(
"integer", $this->getRelativeDeadline()),
749 "rel_deadline_last_subm" => array(
"integer", $this->getRelDeadlineLastSubmission()),
750 "deadline_mode" => array(
"integer", $this->getDeadlineMode())
752 $this->setId($next_id);
754 $exc->updateAllUsersStatus();
755 self::createNewAssignmentRecords($next_id, $exc);
757 $this->handleCalendarEntries(
"create", $exc);
770 "exc_id" => array(
"integer", $this->getExerciseId()),
771 "time_stamp" => array(
"integer", $this->getDeadline()),
772 "deadline2" => array(
"integer", $this->getExtendedDeadline()),
773 "instruction" => array(
"clob", $this->getInstruction()),
774 "title" => array(
"text", $this->getTitle()),
775 "start_time" => array(
"integer", $this->getStartTime()),
776 "order_nr" => array(
"integer", $this->getOrderNr()),
777 "mandatory" => array(
"integer", $this->getMandatory()),
778 "type" => array(
"integer", $this->getType()),
779 "peer" => array(
"integer", $this->getPeerReview()),
780 "peer_min" => array(
"integer", $this->getPeerReviewMin()),
781 "peer_unlock" => array(
"integer", $this->getPeerReviewSimpleUnlock()),
782 "peer_dl" => array(
"integer", $this->getPeerReviewDeadline()),
783 "peer_valid" => array(
"integer", $this->getPeerReviewValid()),
784 "peer_file" => array(
"integer", $this->hasPeerReviewFileUpload()),
785 "peer_prsl" => array(
"integer", $this->hasPeerReviewPersonalized()),
786 "peer_char" => array(
"integer", $this->getPeerReviewChars()),
787 "peer_text" => array(
"integer", (
int) $this->hasPeerReviewText()),
788 "peer_rating" => array(
"integer", (
int) $this->hasPeerReviewRating()),
789 "peer_crit_cat" => array(
"integer", $this->getPeerReviewCriteriaCatalogue()),
790 "fb_file" => array(
"text", $this->getFeedbackFile()),
791 "fb_date" => array(
"integer", $this->getFeedbackDate()),
792 "fb_date_custom" => array(
"integer", $this->getFeedbackDateCustom()),
793 "fb_cron" => array(
"integer", $this->hasFeedbackCron()),
794 "team_tutor" => array(
"integer", $this->getTeamTutor()),
795 "max_file" => array(
"integer", $this->getMaxFile()),
796 "portfolio_template" => array(
"integer", $this->getPortfolioTemplateId()),
797 "min_char_limit" => array(
"integer", $this->getMinCharLimit()),
798 "max_char_limit" => array(
"integer", $this->getMaxCharLimit()),
799 "deadline_mode" => array(
"integer", $this->getDeadlineMode()),
800 "relative_deadline" => array(
"integer", $this->getRelativeDeadline()),
801 "rel_deadline_last_subm" => array(
"integer", $this->getRelDeadlineLastSubmission())
804 "id" => array(
"integer", $this->
getId()),
808 $exc->updateAllUsersStatus();
810 $this->handleCalendarEntries(
"update", $exc);
816 public function delete(
818 bool $update_status =
true
824 foreach ($exc_members->getMembers() as $mem) {
826 $submission->deleteAllFiles();
830 "DELETE FROM exc_usr_tutor " .
833 array($this->
getId())
836 $this->deleteGlobalFeedbackFile();
839 if ($this->getPeerReview()) {
841 $peer_review->resetPeerReviews();
845 "DELETE FROM exc_ass_file_order" .
846 " WHERE assignment_id = " .
$ilDB->quote($this->getId(),
'integer')
850 "DELETE FROM exc_mem_ass_status" .
851 " WHERE ass_id = " .
$ilDB->quote($this->getId(),
'integer')
855 "DELETE FROM exc_assignment WHERE " .
856 " id = " .
$ilDB->quote($this->getId(),
"integer")
859 if ($update_status) {
864 $this->handleCalendarEntries(
"delete", $exc);
867 $reminder->deleteReminders($this->
getId());
880 $set =
$ilDB->query(
"SELECT * FROM exc_assignment " .
881 " WHERE exc_id = " .
$ilDB->quote($a_exc_id,
"integer") .
882 " ORDER BY order_nr");
886 while ($rec =
$ilDB->fetchAssoc($set)) {
888 "id" => (
int) $rec[
"id"],
889 "exc_id" => (
int) $rec[
"exc_id"],
890 "deadline" => (
int) $rec[
"time_stamp"],
891 "deadline2" => (
int) $rec[
"deadline2"],
892 "instruction" => (
string) $rec[
"instruction"],
893 "title" => (
string) $rec[
"title"],
894 "start_time" => (
int) $rec[
"start_time"],
895 "order_val" => $order_val,
896 "mandatory" => (
bool) $rec[
"mandatory"],
897 "type" => (
int) $rec[
"type"],
898 "peer" => (
bool) $rec[
"peer"],
899 "peer_min" => (
int) $rec[
"peer_min"],
900 "peer_dl" => (
int) $rec[
"peer_dl"],
901 "peer_file" => (
bool) $rec[
"peer_file"],
902 "peer_prsl" => (
bool) $rec[
"peer_prsl"],
903 "fb_file" => (
string) $rec[
"fb_file"],
904 "fb_date" => (
int) $rec[
"fb_date"],
905 "fb_cron" => (
bool) $rec[
"fb_cron"],
906 "deadline_mode" => (
int) $rec[
"deadline_mode"],
907 "relative_deadline" => (
int) $rec[
"relative_deadline"],
908 "rel_deadline_last_subm" => (
int) $rec[
"rel_deadline_last_subm"]
925 array $a_crit_cat_map
927 $ass_data = self::getInstancesByExercise($a_old_exc_id);
928 foreach ($ass_data as
$d) {
931 $new_ass->setExerciseId($a_new_exc_id);
932 $new_ass->setTitle(
$d->getTitle());
933 $new_ass->setDeadline(
$d->getDeadline());
934 $new_ass->setExtendedDeadline(
$d->getExtendedDeadline());
935 $new_ass->setInstruction(
$d->getInstruction());
936 $new_ass->setMandatory(
$d->getMandatory());
937 $new_ass->setOrderNr(
$d->getOrderNr());
938 $new_ass->setStartTime(
$d->getStartTime());
939 $new_ass->setType(
$d->getType());
940 $new_ass->setPeerReview(
$d->getPeerReview());
941 $new_ass->setPeerReviewMin(
$d->getPeerReviewMin());
942 $new_ass->setPeerReviewDeadline(
$d->getPeerReviewDeadline());
943 $new_ass->setPeerReviewFileUpload(
$d->hasPeerReviewFileUpload());
944 $new_ass->setPeerReviewPersonalized(
$d->hasPeerReviewPersonalized());
945 $new_ass->setPeerReviewValid(
$d->getPeerReviewValid());
946 $new_ass->setPeerReviewChars(
$d->getPeerReviewChars());
947 $new_ass->setPeerReviewText(
$d->hasPeerReviewText());
948 $new_ass->setPeerReviewRating(
$d->hasPeerReviewRating());
949 $new_ass->setPeerReviewCriteriaCatalogue(
$d->getPeerReviewCriteriaCatalogue());
950 $new_ass->setPeerReviewSimpleUnlock(
$d->getPeerReviewSimpleUnlock());
951 $new_ass->setFeedbackFile(
$d->getFeedbackFile());
952 $new_ass->setFeedbackDate(
$d->getFeedbackDate());
953 $new_ass->setFeedbackDateCustom(
$d->getFeedbackDateCustom());
954 $new_ass->setFeedbackCron(
$d->hasFeedbackCron());
955 $new_ass->setTeamTutor(
$d->getTeamTutor());
956 $new_ass->setMaxFile(
$d->getMaxFile());
957 $new_ass->setMinCharLimit(
$d->getMinCharLimit());
958 $new_ass->setMaxCharLimit(
$d->getMaxCharLimit());
959 $new_ass->setPortfolioTemplateId(
$d->getPortfolioTemplateId());
960 $new_ass->setDeadlineMode(
$d->getDeadlineMode());
961 $new_ass->setRelativeDeadline(
$d->getRelativeDeadline());
962 $new_ass->setRelDeadlineLastSubmission(
$d->getRelDeadlineLastSubmission());
965 if (
$d->getPeerReviewCriteriaCatalogue() &&
966 array_key_exists(
$d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map)) {
967 $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[
$d->getPeerReviewCriteriaCatalogue()]);
976 $new_web_storage->create();
977 if (is_dir($old_web_storage->getAbsolutePath())) {
978 ilFileUtils::rCopy($old_web_storage->getAbsolutePath(), $new_web_storage->getAbsolutePath());
980 $order =
$d->getInstructionFilesOrder();
981 foreach ($order as $file) {
988 $new_storage->create();
989 if (is_dir($old_storage->getGlobalFeedbackPath())) {
990 ilFileUtils::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
998 if ($rmd_sub->getReminderStatus()) {
1000 $new_rmd_sub->setReminderStatus($rmd_sub->getReminderStatus());
1001 $new_rmd_sub->setReminderStart($rmd_sub->getReminderStart());
1002 $new_rmd_sub->setReminderEnd($rmd_sub->getReminderEnd());
1003 $new_rmd_sub->setReminderFrequency($rmd_sub->getReminderFrequency());
1004 $new_rmd_sub->setReminderMailTemplate($rmd_sub->getReminderMailTemplate());
1005 $new_rmd_sub->save();
1011 $ass_type =
$d->getAssignmentType();
1018 $this->log->debug(
"getting files from class.ilExAssignment using ilFSWebStorageExercise");
1020 return $storage->getFiles();
1027 $set =
$ilDB->query(
1028 "SELECT filename, order_nr, id FROM exc_ass_file_order " .
1029 " WHERE assignment_id = " .
$ilDB->quote($this->getId(),
"integer")
1033 while ($rec =
$ilDB->fetchAssoc($set)) {
1034 $data[$rec[
'filename']] = $rec;
1047 $set =
$ilDB->query(
1048 "SELECT MAX(order_nr) mnr FROM exc_assignment " .
1049 " WHERE exc_id = " .
$ilDB->quote($a_exc_id,
"integer")
1051 if ($rec =
$ilDB->fetchAssoc($set)) {
1052 return (
int) $rec[
"mnr"];
1063 $query =
"SELECT id FROM exc_assignment " .
1064 "WHERE start_time <= " .
$ilDB->quote(time(),
'integer') .
' ' .
1065 "AND time_stamp >= " .
$ilDB->quote(time(),
'integer') .
' ' .
1066 "AND id = " .
$ilDB->quote($a_ass_id,
'integer');
1069 return (
bool)
$res->numRows();
1077 $query =
"SELECT exc_id FROM exc_assignment " .
1078 "WHERE id = " .
$ilDB->quote($a_ass_id,
'integer');
1081 return (
int) (
$res[
"exc_id"] ?? 0);
1084 private static function lookup(
int $a_id,
string $a_field): string
1090 $set =
$ilDB->query(
1091 "SELECT " . $a_field .
" FROM exc_assignment " .
1092 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
1095 $rec =
$ilDB->fetchAssoc($set);
1097 return $rec[$a_field] ??
"";
1102 return self::lookup($a_id,
"title");
1107 return self::lookup($a_id,
"type");
1119 foreach ($a_order as $k => $v) {
1122 "UPDATE exc_assignment SET " .
1123 " order_nr = " .
$ilDB->quote($nr,
"integer") .
1124 " WHERE id = " .
$ilDB->quote((
int) $k,
"integer") .
1125 " AND exc_id = " .
$ilDB->quote($a_ex_id,
"integer")
1137 $set =
$ilDB->query(
1138 "SELECT id FROM exc_assignment " .
1139 " WHERE exc_id = " .
$ilDB->quote($a_ex_id,
"integer") .
1140 " ORDER BY time_stamp"
1143 while ($rec =
$ilDB->fetchAssoc($set)) {
1145 "UPDATE exc_assignment SET " .
1146 " order_nr = " .
$ilDB->quote($nr,
"integer") .
1147 " WHERE id = " .
$ilDB->quote($rec[
"id"],
"integer")
1160 $set =
$ilDB->query(
1161 "SELECT count(*) cntm FROM exc_assignment " .
1162 " WHERE exc_id = " .
$ilDB->quote($a_ex_id,
"integer") .
1163 " AND mandatory = " .
$ilDB->quote(1,
"integer")
1165 $rec =
$ilDB->fetchAssoc($set);
1166 return (
int) $rec[
"cntm"];
1176 $set =
$ilDB->query(
1177 "SELECT count(*) cntm FROM exc_assignment " .
1178 " WHERE exc_id = " .
$ilDB->quote($a_ex_id,
"integer")
1180 $rec =
$ilDB->fetchAssoc($set);
1181 return $rec[
"cntm"];
1191 $set =
$ilDB->query(
1192 "SELECT * FROM exc_assignment " .
1193 " WHERE exc_id = " .
$ilDB->quote($a_ex_id,
"integer") .
1194 " AND id = " .
$ilDB->quote($a_ass_id,
"integer")
1196 if (
$ilDB->fetchAssoc($set)) {
1209 $set =
$ilDB->query(
"SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login" .
1210 " FROM exc_members excm" .
1211 " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)" .
1212 " WHERE excm.obj_id = " .
$ilDB->quote($this->getExerciseId(),
"integer"));
1213 while ($rec =
$ilDB->fetchAssoc($set)) {
1214 $mem[$rec[
"usr_id"]] =
1216 "name" => $rec[
"lastname"] .
", " . $rec[
"firstname"],
1217 "login" => $rec[
"login"],
1218 "usr_id" => $rec[
"usr_id"],
1219 "lastname" => $rec[
"lastname"],
1220 "firstname" => $rec[
"firstname"]
1226 $idl = $this->getIndividualDeadlines();
1227 if (!$this->ass_type->usesTeams()) {
1228 foreach ($idl as $user_id => $v) {
1229 if (!isset($mem[$user_id])) {
1234 "name" =>
$name[
"lastname"] .
", " .
$name[
"firstname"],
1235 "login" =>
$name[
"login"],
1236 "usr_id" => $user_id,
1237 "lastname" =>
$name[
"lastname"],
1238 "firstname" =>
$name[
"firstname"]
1245 $q =
"SELECT * FROM exc_mem_ass_status " .
1246 "WHERE ass_id = " .
$ilDB->quote($this->
getId(),
"integer");
1247 $set =
$ilDB->query($q);
1248 while ($rec =
$ilDB->fetchAssoc($set)) {
1249 if (isset($mem[$rec[
"usr_id"]])) {
1252 $mem[$rec[
"usr_id"]][
"sent_time"] = $rec[
"sent_time"];
1253 $mem[$rec[
"usr_id"]][
"submission"] = $sub->getLastSubmission();
1254 $mem[$rec[
"usr_id"]][
"status_time"] = $rec[
"status_time"];
1255 $mem[$rec[
"usr_id"]][
"feedback_time"] = $rec[
"feedback_time"];
1256 $mem[$rec[
"usr_id"]][
"notice"] = $rec[
"notice"];
1257 $mem[$rec[
"usr_id"]][
"status"] = $rec[
"status"];
1258 $mem[$rec[
"usr_id"]][
"mark"] = $rec[
"mark"];
1259 $mem[$rec[
"usr_id"]][
"comment"] = $rec[
"u_comment"];
1271 string $a_grade =
""
1277 if (in_array($a_grade, array(
"notgraded",
"passed",
"failed"))) {
1278 $and_grade =
" AND status = " .
$ilDB->quote($a_grade,
"text");
1281 $q =
"SELECT * FROM exc_mem_ass_status " .
1282 "WHERE ass_id = " .
$ilDB->quote($this->
getId(),
"integer") .
1283 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
1286 $set =
$ilDB->query($q);
1289 while ($rec =
$ilDB->fetchAssoc($set)) {
1292 $data[
"sent_time"] = $rec[
"sent_time"];
1293 $data[
"submission"] = $sub->getLastSubmission();
1294 $data[
"status_time"] = $rec[
"status_time"];
1295 $data[
"feedback_time"] = $rec[
"feedback_time"];
1296 $data[
"notice"] = $rec[
"notice"];
1297 $data[
"status"] = $rec[
"status"];
1298 $data[
"mark"] = $rec[
"mark"];
1299 $data[
"comment"] = $rec[
"u_comment"];
1314 $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1315 foreach ($ass_data as $ass) {
1317 $ilDB->replace(
"exc_mem_ass_status", array(
1318 "ass_id" => array(
"integer", $ass[
"id"]),
1319 "usr_id" => array(
"integer", $a_user_id)
1321 "status" => array(
"text",
"notgraded")
1336 $mems = $exmem->getMembers();
1338 foreach ($mems as $mem) {
1339 $ilDB->replace(
"exc_mem_ass_status", array(
1340 "ass_id" => array(
"integer", $a_ass_id),
1341 "usr_id" => array(
"integer", $mem)
1343 "status" => array(
"text",
"notgraded")
1357 $storage->uploadAssignmentFiles($a_files);
1370 $access = $this->access;
1373 $deliverFilename = trim(str_replace(
" ",
"_", $this->getTitle() .
"_" . $this->
getId()));
1375 $deliverFilename =
"multi_feedback_" . $deliverFilename;
1384 $mfdir = $tmpdir .
"/" . $deliverFilename;
1389 $mems = $exmem->getMembers();
1392 'edit_submissions_grades',
1393 'edit_submissions_grades',
1397 foreach ($mems as $mem) {
1399 $subdir =
$name[
"lastname"] .
"_" .
$name[
"firstname"] .
"_" .
$name[
"login"] .
"_" .
$name[
"user_id"];
1406 $tmpzipfile = $tmpdir .
"/multi_feedback.zip";
1423 if (!is_file($a_file[
"tmp_name"])) {
1428 $mfu = $storage->getMultiFeedbackUploadPath(
$ilUser->getId());
1433 $subdir =
"notfound";
1434 foreach ($subdirs as $s => $j) {
1435 if ($j[
"type"] ==
"dir" && substr($s, 0, 14) ==
"multi_feedback") {
1440 if (!is_dir($mfu .
"/" . $subdir)) {
1455 if ($a_user_id == 0) {
1456 $a_user_id =
$ilUser->getId();
1459 $mf_files = array();
1464 $mems = $exmem->getMembers();
1468 $mfu = $storage->getMultiFeedbackUploadPath($a_user_id);
1472 $subdir =
"notfound";
1473 foreach ($subdirs as $s => $j) {
1474 if ($j[
"type"] ==
"dir" && substr($s, 0, 14) ==
"multi_feedback") {
1480 foreach ($items as $k =>
$i) {
1482 if (
$i[
"type"] ==
"dir" && !in_array($k, array(
".",
".."))) {
1484 $parts = explode(
"_",
$i[
"entry"]);
1486 if (in_array($user_id, $mems)) {
1490 foreach ($files as $k2 =>
$f) {
1492 if (
$f[
"type"] ==
"file" && substr($k2, 0, 1) !=
".") {
1493 $mf_files[] = array(
1494 "lastname" =>
$name[
"lastname"],
1495 "firstname" =>
$name[
"firstname"],
1496 "login" =>
$name[
"login"],
1497 "user_id" =>
$name[
"user_id"],
1498 "full_path" => $mfu .
"/" . $subdir .
"/" . $k .
"/" . $k2,
1516 $mfu = $storage->getMultiFeedbackUploadPath(
$ilUser->getId());
1527 if ($this->getExerciseId() != $a_exc->
getId()) {
1532 $fstorage->create();
1534 $mf_files = $this->getMultiFeedbackFiles();
1535 foreach ($mf_files as
$f) {
1536 $user_id =
$f[
"user_id"];
1537 $file_path =
$f[
"full_path"];
1538 $file_name =
$f[
"file"];
1541 if (is_array($a_files[$user_id] ??
false) && in_array(md5($file_name), $a_files[$user_id])) {
1543 $feedback_id = $submission->getFeedbackId();
1544 $noti_rec_ids = $submission->getUserIds();
1547 $fb_path = $fstorage->getFeedbackPath($feedback_id);
1548 $target = $fb_path .
"/" . $file_name;
1549 if (is_file($target)) {
1555 if ($noti_rec_ids) {
1556 foreach ($noti_rec_ids as $user_id) {
1557 $member_status = $this->getMemberStatus($user_id);
1558 $member_status->setFeedback(
true);
1559 $member_status->update();
1572 $this->clearMultiFeedbackDirectory();
1583 $ilAppEventHandler = $this->app_event_handler;
1585 $dl_id = $this->
getId() .
"0";
1586 $fbdl_id = $this->
getId() .
"1";
1588 $context_ids = array($dl_id, $fbdl_id);
1591 if ($a_event !=
"delete") {
1596 $app->setSubtitle(
"cal_exc_deadline");
1597 $app->setTitle($this->getTitle());
1598 $app->setFullday(
false);
1606 if ($this->getPeerReview() &&
1607 $this->getPeerReviewDeadline()) {
1610 $app->setSubtitle(
"cal_exc_peer_review_deadline");
1611 $app->setTitle($this->getTitle());
1612 $app->setFullday(
false);
1619 $ilAppEventHandler->raise(
1621 $a_event .
'Assignment',
1624 'obj_id' => $exc->
getId(),
1625 'context_ids' => $context_ids,
1626 'appointments' => $apps)
1638 $set =
$ilDB->query(
"SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
1639 " WHERE fb_cron = " .
$ilDB->quote(1,
"integer") .
1640 " AND (fb_date = " .
$ilDB->quote(self::FEEDBACK_DATE_DEADLINE,
"integer") .
1641 " AND time_stamp IS NOT NULL" .
1642 " AND time_stamp > " .
$ilDB->quote(0,
"integer") .
1643 " AND time_stamp < " .
$ilDB->quote(time(),
"integer") .
1644 " AND fb_cron_done = " .
$ilDB->quote(0,
"integer") .
1645 ") OR (fb_date = " .
$ilDB->quote(self::FEEDBACK_DATE_CUSTOM,
"integer") .
1646 " AND fb_date_custom IS NOT NULL" .
1647 " AND fb_date_custom > " .
$ilDB->quote(0,
"integer") .
1648 " AND fb_date_custom < " .
$ilDB->quote(time(),
"integer") .
1649 " AND fb_cron_done = " .
$ilDB->quote(0,
"integer") .
")");
1653 while ($row =
$ilDB->fetchAssoc($set)) {
1654 if ($row[
'fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
1655 $max = max($row[
'time_stamp'], $row[
'deadline2']);
1656 if (trim($row[
"fb_file"]) && $max <= time()) {
1657 $res[] = $row[
"id"];
1659 } elseif ($row[
'fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
1660 if (trim($row[
"fb_file"] ??
"") && ($row[
'fb_date_custom'] ?? 0) <= time()) {
1661 $res[] = $row[
"id"];
1674 int $a_user_id =
null
1680 $ass =
new self($a_ass_id);
1683 if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
1689 $set =
$ilDB->query(
"SELECT fb_cron_done" .
1690 " FROM exc_assignment" .
1691 " WHERE id = " .
$ilDB->quote($a_ass_id,
"integer"));
1692 $row =
$ilDB->fetchAssoc($set);
1693 if ($row[
"fb_cron_done"]) {
1699 $ntf->setLangModules(array(
"exc"));
1700 $ntf->setObjId($ass->getExerciseId());
1701 $ntf->setSubjectLangId(
"exc_feedback_notification_subject");
1702 $ntf->setIntroductionLangId(
"exc_feedback_notification_body");
1703 $ntf->addAdditionalInfo(
"exc_assignment", $ass->getTitle());
1704 $ntf->setGotoLangId(
"exc_feedback_notification_link");
1705 $ntf->setReasonLangId(
"exc_feedback_notification_reason");
1710 $ilDB->manipulate(
"UPDATE exc_assignment" .
1711 " SET fb_cron_done = " .
$ilDB->quote(1,
"integer") .
1712 " WHERE id = " .
$ilDB->quote($a_ass_id,
"integer"));
1714 $ntf->sendMail(array($a_user_id));
1729 $idl = $this->getPersonalDeadline(
$ilUser->getId());
1732 $deadline = max($this->deadline, $this->deadline2, $idl);
1733 return ($deadline - time() <= 0);
1741 $idl = $a_include_personal
1742 ? $this->getLastPersonalDeadline()
1746 $deadline = max($this->deadline, $this->deadline2, $idl);
1750 if ($idl && $deadline == $idl) {
1751 return ($deadline - time() <= 0);
1755 return ($deadline > 0 &&
1756 $this->afterDeadline());
1764 $date_custom = $this->getFeedbackDateCustom();
1769 return ($date_custom - time() <= 0);
1776 return !$this->afterDeadlineStrict();
1781 return (time() - $this->start_time <= 0);
1792 return $storage->getGlobalFeedbackPath();
1805 $path = $this->getGlobalFeedbackFileStoragePath();
1808 $this->setFeedbackFile($a_file[
"name"]);
1816 $file = $this->getFeedbackFile();
1818 $path = $this->getGlobalFeedbackFileStoragePath();
1819 return $path .
"/" . $file;
1829 $a_user_id =
$ilUser->getId();
1831 if (!array_key_exists($a_user_id, $this->member_status)) {
1834 return $this->member_status[$a_user_id];
1846 $ext_deadline = $this->getExtendedDeadline();
1849 $id = $file[
"returned_id"];
1853 $deadline = $this->getPersonalDeadline($file[
"user_id"]);
1854 $last_deadline = max($deadline, $this->getExtendedDeadline());
1859 if ($file[
"late"] &&
1862 $uploaded < $deadline)) {
1866 elseif (!$file[
"late"] &&
1869 $uploaded > $deadline) {
1873 if ($late !==
null) {
1874 $ilDB->manipulate(
"UPDATE exc_returned" .
1875 " SET late = " .
$ilDB->quote($late,
"integer") .
1876 " WHERE returned_id = " .
$ilDB->quote(
$id,
"integer"));
1891 if (!is_numeric(
$id)) {
1907 $set =
$ilDB->query(
"SELECT * FROM exc_idl" .
1908 " WHERE ass_id = " .
$ilDB->quote($this->getId(),
"integer"));
1909 while ($row =
$ilDB->fetchAssoc($set)) {
1910 if ($row[
"is_team"]) {
1911 $row[
"member_id"] =
"t" . $row[
"member_id"];
1914 $res[$row[
"member_id"]] = $row[
"tstamp"];
1922 return (
bool) $this->getDeadline() || (bool) $this->getRelativeDeadline();
1927 if (!$this->ass_type->usesTeams() &&
1928 $this->getPeerReview()) {
1931 if ($peer_review->hasPeerReviewGroups()) {
1945 $db =
$DIC->database();
1947 asort($a_order, SORT_NUMERIC);
1950 foreach (array_keys($a_order) as $k) {
1953 "UPDATE exc_ass_file_order SET " .
1954 " order_nr = " . $db->
quote($nr,
"integer") .
1955 " WHERE id = " . $db->
quote((
int) $k,
"integer") .
1956 " AND assignment_id = " . $db->
quote($a_ass_id,
"integer")
1968 $db =
$DIC->database();
1969 $id = $db->
nextId(
"exc_ass_file_order");
1971 "exc_ass_file_order",
1973 "id" => [
"integer",
$id],
1974 "order_nr" => [
"integer", $a_order_nr],
1975 "assignment_id" => [
"integer", $a_ass_id],
1976 "filename" => [
"text", $a_filename]
1989 $db =
$DIC->database();
1995 if (self::instructionFileExistsInDb(
$filename, $a_ass_id) == 0) {
1996 if ($a_order_nr == 0) {
1997 $order_val = self::instructionFileOrderGetMax($a_ass_id);
1998 $order = $order_val + 10;
2000 $order = $a_order_nr;
2003 $id = $db->nextID(
'exc_ass_file_order');
2004 $db->
manipulate(
"INSERT INTO exc_ass_file_order " .
2005 "(id, assignment_id, filename, order_nr) VALUES (" .
2007 $db->
quote($a_ass_id,
"integer") .
"," .
2009 $db->
quote($order,
"integer") .
2024 $db =
$DIC->database();
2027 foreach ($a_file as $v) {
2029 "DELETE FROM exc_ass_file_order " .
2030 "WHERE filename = " . $db->
quote($v,
'text') .
2031 " AND assignment_id = " . $db->
quote($a_ass_id,
'integer')
2043 $db =
$DIC->database();
2047 "DELETE FROM exc_ass_file_order" .
2048 " WHERE assignment_id = " . $db->
quote($a_ass_id,
'integer') .
2049 " AND filename = " . $db->
quote($a_new_name,
'text')
2053 "UPDATE exc_ass_file_order SET" .
2054 " filename = " . $db->
quote($a_new_name,
'text') .
2055 " WHERE assignment_id = " . $db->
quote($a_ass_id,
'integer') .
2056 " AND filename = " . $db->
quote($a_old_name,
'text')
2067 $db =
$DIC->database();
2070 $result = $db->
query(
2071 "SELECT id FROM exc_ass_file_order" .
2072 " WHERE assignment_id = " . $db->
quote($a_ass_id,
'integer') .
2073 " AND filename = " . $db->
quote($a_filename,
'text')
2086 $files = array_map(
function ($v) {
2088 }, $this->getFiles());
2090 $set = $db->
query(
"SELECT * FROM exc_ass_file_order " .
2091 " WHERE assignment_id = " . $db->
quote($this->getId(),
"integer") .
2092 " ORDER BY order_nr");
2094 $numbered_files = array();
2097 if (in_array($rec[
"filename"], $files)) {
2099 "UPDATE exc_ass_file_order SET " .
2100 " order_nr = " . $db->
quote($order_nr,
"integer") .
2101 " WHERE assignment_id = " . $db->
quote($this->getId(),
"integer") .
2102 " AND id = " . $db->
quote($rec[
"id"],
"integer")
2105 $numbered_files[] = $rec[
"filename"];
2108 "DELETE FROM exc_ass_file_order " .
2109 " WHERE assignment_id = " . $db->
quote($this->getId(),
"integer") .
2110 " AND id = " . $db->
quote($rec[
"id"],
"integer")
2114 foreach ($files as
$f) {
2115 if (!in_array(
$f, $numbered_files)) {
2116 self::instructionFileInsertOrder(
$f, $this->
getId());
2122 array $a_entries = array()
2124 $this->fixInstructionFileOrdering();
2126 $order = $this->getInstructionFilesOrder();
2127 foreach ($a_entries as $k =>
$e) {
2128 $a_entries[$k][
"order_val"] = $order[
$e[
"file"]][
"order_nr"] ?? 0;
2129 $a_entries[$k][
"order_id"] = $order[
$e[
"file"]][
"id"] ??
"";
2139 $db =
$DIC->database();
2143 "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
2145 array($db->
quote($a_ass_id,
'integer'))
2150 $order_val = (
int) $row[
'max_order'];
2159 $this->min_char_limit = $a_val;
2164 return $this->min_char_limit;
2170 $this->max_char_limit = $a_val;
2175 return $this->max_char_limit;
2188 $calculated_deadlines = array(
2193 if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
2195 $type = $ts[
"is_team"]
2199 $calculated_deadlines[
$type][$ts[
"member_id"]] = array(
2200 "calculated_deadline" => $ts[
"starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
2204 return $calculated_deadlines;
2210 if ($this->hasTeam()) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class DirectoryNotFoundException.
Class FileNotFoundException.
Apointment templates are used for automatic generated apointments.
@classDescription Date and time handling
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
ILIAS Refinery String Group $string_transform
saveMultiFeedbackFiles(array $a_files, ilObjExercise $a_exc)
static getAssignmentDataOfExercise(int $a_exc_id)
static lookupExerciseId(int $a_ass_id)
ilAppEventHandler $app_event_handler
deleteGlobalFeedbackFile()
setTeamTutor(bool $a_value)
static lookupMaxOrderNrForEx(int $a_exc_id)
ilExAssignmentTypes $types
hasPeerReviewPersonalized()
static saveInstructionFilesOrderOfAssignment(int $a_ass_id, array $a_order)
static lookup(int $a_id, string $a_field)
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getLastPersonalDeadline()
static saveAssOrderOfExercise(int $a_ex_id, array $a_order)
uploadAssignmentFiles(array $a_files)
Upload assignment files (from creation form)
setRelativeDeadline(int $a_val)
setPeerReviewMin(int $a_value)
ilExAssignmentTypeInterface $ass_type
static instructionFileOrderGetMax(int $a_ass_id)
fixInstructionFileOrdering()
static instructionFileGetFileOrderData(array $a_file_data, int $a_ass_id)
static count(int $a_ex_id)
static lookupType(int $a_id)
const TEAMS_FORMED_BY_TUTOR
setExtendedDeadline(?int $a_val)
static cloneAssignmentsOfExercise(int $a_old_exc_id, int $a_new_exc_id, array $a_crit_cat_map)
Clone assignments of exercise.
setPeerReviewText(bool $a_val)
setPeerReviewCriteriaCatalogue(?int $a_value)
static countMandatory(int $a_ex_id)
setPeerReview(bool $a_value)
isValidType(int $a_value)
getInstructionFilesOrder()
const PEER_REVIEW_VALID_NONE
static instructionFileDeleteOrder(int $a_ass_id, array $a_file)
getType()
Get type this will most probably become an non public function in the future (or become obsolete)
const TEAMS_FORMED_BY_PARTICIPANTS
static isInExercise(int $a_ass_id, int $a_ex_id)
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
getInstructionPresentation()
const PEER_REVIEW_VALID_ALL
setMinCharLimit(int $a_val)
static insertFileOrderNr(int $a_ass_id, string $a_filename, int $a_order_nr)
handleGlobalFeedbackFileUpload(array $a_file)
setStartTime(?int $a_val)
setDeadlineMode(int $a_val)
Set deadline mode.
setFeedbackCron(bool $a_value)
Toggle (global) feedback file cron.
static sendFeedbackNotifications(int $a_ass_id, int $a_user_id=null)
getCalculatedDeadlines()
Get calculated deadlines for user/team members.
static renameInstructionFile(string $a_old_name, string $a_new_name, int $a_ass_id)
setPeerReviewValid(int $a_value)
Set peer review validation.
static instructionFileInsertOrder(string $a_filename, int $a_ass_id, int $a_order_nr=0)
getRelDeadlineLastSubmission()
static getInstancesByExercise(int $a_exc_id)
setPeerReviewPersonalized(bool $a_val)
static createNewUserRecords(int $a_user_id, int $a_exc_id)
int $feedback_date_custom
const TEAMS_FORMED_BY_RANDOM
getExerciseMemberAssignmentData(int $a_user_id, string $a_grade="")
Get submission data for an specific user,exercise and assignment.
static getPendingFeedbackNotifications()
initFromDB(array $a_set)
Import DB record.
__construct($a_id=0)
Constructor.
hasPeerReviewFileUpload()
int $rel_deadline_last_subm
sendMultiFeedbackStructureFile(ilObjExercise $exercise)
Create member status record for a new assignment for all participants.
setInstruction(string $a_val)
setPortfolioTemplateId(int $a_val)
recalculateLateSubmissions()
getPeerReviewSimpleUnlock()
getGlobalFeedbackFileStoragePath()
const TYPE_UPLOAD
direct checks against const should be avoided, use type objects instead
const FEEDBACK_DATE_CUSTOM
static createNewAssignmentRecords(int $a_ass_id, ilObjExercise $a_exc)
const TEAMS_FORMED_BY_ASSIGNMENT
getPersonalDeadline(int $a_user_id)
const FEEDBACK_DATE_DEADLINE
setRelDeadlineLastSubmission(int $a_val)
getMemberStatus(?int $a_user_id=null)
setFeedbackFile(?string $a_value)
setPeerReviewSimpleUnlock(bool $a_value)
const PEER_REVIEW_VALID_ONE
getGlobalFeedbackFilePath()
setPeerReviewChars(?int $a_value)
uploadMultiFeedbackFile(array $a_file)
setPeerReviewRating(bool $a_val)
getPeerReviewCriteriaCatalogue()
setType(int $a_value)
Set type this will most probably become an non public function in the future (or become obsolete)
static orderAssByDeadline(int $a_ex_id)
setPeerReviewDeadline(int $a_val)
const FEEDBACK_DATE_SUBMISSION
fileAddOrder(array $a_entries=array())
setFeedbackDateCustom(int $a_value)
Set (global) feedback file availability using a custom date.
setFeedbackDate(int $a_value)
setIndividualDeadline(string $id, ilDateTime $date)
canParticipantReceiveFeedback(int $part_id)
setMaxFile(?int $a_value)
getMultiFeedbackFiles(int $a_user_id=0)
Get multi feedback files (of uploader)
static lookupAssignmentOnline(int $a_ass_id)
setMandatory(bool $a_val)
setMaxCharLimit(int $a_val)
setPeerReviewFileUpload(bool $a_val)
static instructionFileExistsInDb(string $a_filename, int $a_ass_id)
static lookupTitle(int $a_id)
setExerciseId(int $a_val)
afterDeadlineStrict(bool $a_include_personal=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllAssignmentFiles(int $a_exc_id, int $a_ass_id)
static getInstancesByParentId(int $a_parent_id)
static getInstanceByType(string $a_type)
static getStartingTimestamps(int $a_ass_id)
Get starting timestamp data for an assignment.
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getMembers(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static getASCIIFilename(string $a_filename)
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static zip(string $a_dir, string $a_file, bool $compress_content=false)
zips given directory/file into given zip.file
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static rename(string $a_source, string $a_target)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getSafeFilename(string $a_initial_filename)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
updateAllUsersStatus()
Update status of all users.
sendFeedbackFileNotification(string $a_feedback_file, array $user_ids, int $a_ass_id, bool $a_is_text_feedback=false)
static _lookupName(int $a_user_id)
lookup user name
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert(string $table_name, array $values)
nextId(string $table_name)
setLimit(int $limit, int $offset=0)
numRows(ilDBStatement $statement)
quote($value, string $type)
manipulate(string $query)
Run a (write) Query on the database.
query(string $query)
Run a (read-only) Query on the database.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cloneSpecificProperties(ilExAssignment $source, ilExAssignment $target)
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts