ILIAS  release_8 Revision v8.24
class.ilObjExercise.php
Go to the documentation of this file.
1<?php
2
24
27
36{
37 public const TUTOR_FEEDBACK_MAIL = 1;
38 public const TUTOR_FEEDBACK_TEXT = 2;
39 public const TUTOR_FEEDBACK_FILE = 4;
40
41 public const PASS_MODE_NR = "nr";
42 public const PASS_MODE_ALL = "all";
43 public const PASS_MODE_RANDOM = "random";
44
45 protected ilObjUser $user;
48 protected int $timestamp = 0;
49 protected int $hour = 0;
50 protected int $minutes = 0;
51 protected int $day = 0;
52 protected int $month = 0;
53 protected int $year = 0;
54 protected string $instruction = "";
55 protected int $certificate_visibility = 0;
56 protected int $tutor_feedback = 7; // [int]
57 protected int $nr_random_mand = 0; // number of mandatory assignments in random pass mode
58 protected bool $completion_by_submission = false; // completion by submission is enabled or not
61 protected int $pass_nr = 0;
63 protected string $pass_mode = self::PASS_MODE_ALL;
64 protected bool $show_submissions = false;
65
69 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
70 {
72 global $DIC;
73
74 $this->db = $DIC->database();
75 $this->app_event_handler = $DIC["ilAppEventHandler"];
76 $this->lng = $DIC->language();
77 $this->user = $DIC->user();
78 $this->setPassMode("all");
79 $this->type = "exc";
80 $this->webFilesystem = $DIC->filesystem()->web();
81 $this->service = $DIC->exercise()->internal();
82
83 parent::__construct($a_id, $a_call_by_reference);
84 $this->mandatory_manager = $this->service->domain()->assignment()->mandatoryAssignments($this);
85 }
86
90 public function setId(int $a_id): void
91 {
92 parent::setId($a_id);
93 // this is needed, since e.g. ilObjectFactory initialises the object with id 0 and later sets the id
94 $this->mandatory_manager = $this->service->domain()->assignment()->mandatoryAssignments($this);
95 }
96
97 public function setDate(
98 int $a_hour,
99 int $a_minutes,
100 int $a_day,
101 int $a_month,
102 int $a_year
103 ): void {
104 $this->hour = $a_hour;
105 $this->minutes = $a_minutes;
106 $this->day = $a_day;
107 $this->month = $a_month;
108 $this->year = $a_year;
109 $this->timestamp = mktime($this->hour, $this->minutes, 0, $this->month, $this->day, $this->year);
110 }
111
112 public function getTimestamp(): int
113 {
114 return $this->timestamp;
115 }
116
117 public function setTimestamp(
118 int $a_timestamp
119 ): void {
120 $this->timestamp = $a_timestamp;
121 }
122
123 public function setInstruction(
124 string $a_instruction
125 ): void {
126 $this->instruction = $a_instruction;
127 }
128
129 public function getInstruction(): string
130 {
131 return $this->instruction;
132 }
133
137 public function setPassMode(string $a_val): void
138 {
139 $this->pass_mode = $a_val;
140 }
141
142 public function getPassMode(): string
143 {
144 return $this->pass_mode;
145 }
146
150 public function setPassNr(int $a_val): void
151 {
152 $this->pass_nr = $a_val;
153 }
154
155 public function getPassNr(): int
156 {
157 return $this->pass_nr;
158 }
159
163 public function setShowSubmissions(bool $a_val): void
164 {
165 $this->show_submissions = $a_val;
166 }
167
168 public function getShowSubmissions(): bool
169 {
170 return $this->show_submissions;
171 }
172
176 public function setNrMandatoryRandom(int $a_val): void
177 {
178 $this->nr_random_mand = $a_val;
179 }
180
181 public function getNrMandatoryRandom(): int
182 {
183 return $this->nr_random_mand;
184 }
185
186 public function checkDate(): bool
187 {
188 return $this->hour == (int) date("H", $this->timestamp) and
189 $this->minutes == (int) date("i", $this->timestamp) and
190 $this->day == (int) date("d", $this->timestamp) and
191 $this->month == (int) date("m", $this->timestamp) and
192 $this->year == (int) date("Y", $this->timestamp);
193 }
194
195 public function hasTutorFeedbackText(): int
196 {
197 return $this->tutor_feedback & self::TUTOR_FEEDBACK_TEXT;
198 }
199
200 public function hasTutorFeedbackMail(): int
201 {
202 return $this->tutor_feedback & self::TUTOR_FEEDBACK_MAIL;
203 }
204
205 public function hasTutorFeedbackFile(): int
206 {
207 return $this->tutor_feedback & self::TUTOR_FEEDBACK_FILE;
208 }
209
210 protected function getTutorFeedback(): int
211 {
212 return $this->tutor_feedback;
213 }
214
215 public function setTutorFeedback(int $a_value): void
216 {
217 $this->tutor_feedback = $a_value;
218 }
219
220 public function saveData(): void
221 {
222 $ilDB = $this->db;
223
224 $ilDB->insert("exc_data", array(
225 "obj_id" => array("integer", $this->getId()),
226 "instruction" => array("clob", $this->getInstruction()),
227 "time_stamp" => array("integer", $this->getTimestamp()),
228 "pass_mode" => array("text", $this->getPassMode()),
229 "nr_mandatory_random" => array("integer", $this->getNrMandatoryRandom()),
230 "pass_nr" => array("text", $this->getPassNr()),
231 "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
232 'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
233 "certificate_visibility" => array("integer", $this->getCertificateVisibility()),
234 "tfeedback" => array("integer", $this->getTutorFeedback())
235 ));
236 }
237
248 public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_tree = false): ?ilObject
249 {
250 $ilDB = $this->db;
251
252 // Copy settings
254 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
255 $new_obj->setInstruction($this->getInstruction());
256 $new_obj->setTimestamp($this->getTimestamp());
257 $new_obj->setPassMode($this->getPassMode());
258 $new_obj->setNrMandatoryRandom($this->getNrMandatoryRandom());
259 $new_obj->saveData();
260 $new_obj->setPassNr($this->getPassNr());
261 $new_obj->setShowSubmissions($this->getShowSubmissions());
262 $new_obj->setCompletionBySubmission($this->isCompletionBySubmissionEnabled());
263 $new_obj->setTutorFeedback($this->getTutorFeedback());
264 $new_obj->setCertificateVisibility($this->getCertificateVisibility());
265 $new_obj->update();
266
267 $new_obj->saveCertificateVisibility($this->getCertificateVisibility());
268
269 // Copy criteria catalogues
270 $crit_cat_map = array();
271 foreach (ilExcCriteriaCatalogue::getInstancesByParentId($this->getId()) as $crit_cat) {
272 $new_id = $crit_cat->cloneObject($new_obj->getId());
273 $crit_cat_map[$crit_cat->getId()] = $new_id;
274 }
275
276 // Copy assignments
277 ilExAssignment::cloneAssignmentsOfExercise($this->getId(), $new_obj->getId(), $crit_cat_map);
278
279 // Copy learning progress settings
280 $obj_settings = new ilLPObjSettings($this->getId());
281 $obj_settings->cloneSettings($new_obj->getId());
282 unset($obj_settings);
283
284 $pathFactory = new ilCertificatePathFactory();
285 $templateRepository = new ilCertificateTemplateDatabaseRepository($ilDB);
286
287 $cloneAction = new ilCertificateCloneAction(
288 $ilDB,
289 $pathFactory,
290 $templateRepository,
291 $this->webFilesystem,
292 $this->log,
294 );
295
296 $cloneAction->cloneCertificate($this, $new_obj);
297
298 // additional features
299 foreach (ilContainer::_getContainerSettings($this->getId()) as $keyword => $value) {
300 ilContainer::_writeContainerSetting($new_obj->getId(), $keyword, $value);
301 }
302
303 // org unit setting
304 $orgu_object_settings = new ilOrgUnitObjectPositionSetting($new_obj->getId());
305 $orgu_object_settings->setActive(
306 (int) ilOrgUnitGlobalSettings::getInstance()->isPositionAccessActiveForObject($this->getId())
307 );
308 $orgu_object_settings->update();
309
310 return $new_obj;
311 }
312
316 public function delete(): bool
317 {
318 $ilDB = $this->db;
319 $ilAppEventHandler = $this->app_event_handler;
320
321 // always call parent delete function first!!
322 if (!parent::delete()) {
323 return false;
324 }
325
326 foreach (ilExAssignment::getAssignmentDataOfExercise($this->getId()) as $item) {
327 $ass = new ilExAssignment($item["id"]);
328 $ass->delete($this, false);
329 }
330
331 // members
332 $members = new ilExerciseMembers($this);
333 $members->delete();
334
335 // put here course specific stuff
336 $ilDB->manipulate("DELETE FROM exc_data " .
337 "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer"));
338
339 foreach (\ilExcCriteriaCatalogue::getInstancesByParentId($this->getId()) as $crit_cat) {
340 $crit_cat->delete();
341 }
342
343 // remove all notifications
345
346 $ilAppEventHandler->raise(
347 'Modules/Exercise',
348 'delete',
349 array('obj_id' => $this->getId())
350 );
351
352 return true;
353 }
354
359 public function read(): void
360 {
361 $ilDB = $this->db;
362
363 parent::read();
364
365 $query = "SELECT * FROM exc_data " .
366 "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
367
368 $res = $ilDB->query($query);
369 while ($row = $ilDB->fetchObject($res)) {
370 $this->setInstruction((string) $row->instruction);
371 $this->setTimestamp((int) $row->time_stamp);
372 $pm = ($row->pass_mode == "")
373 ? "all"
374 : $row->pass_mode;
375 $this->setPassMode((string) $pm);
376 $this->setShowSubmissions((bool) $row->show_submissions);
377 if ($row->pass_mode == "nr") {
378 $this->setPassNr((int) $row->pass_nr);
379 }
380 $this->setNrMandatoryRandom((int) $row->nr_mandatory_random);
381 $this->setCompletionBySubmission($row->compl_by_submission == 1);
382 $this->setCertificateVisibility((int) $row->certificate_visibility);
383 $this->setTutorFeedback((int) $row->tfeedback);
384 }
385
386 $this->members_obj = new ilExerciseMembers($this);
387 }
388
392 public function update(): bool
393 {
394 $ilDB = $this->db;
395
396 parent::update();
397
398 $ilDB->update("exc_data", array(
399 "instruction" => array("clob", $this->getInstruction()),
400 "time_stamp" => array("integer", $this->getTimestamp()),
401 "pass_mode" => array("text", $this->getPassMode()),
402 "pass_nr" => array("integer", $this->getPassNr()),
403 "nr_mandatory_random" => array("integer", $this->getNrMandatoryRandom()),
404 "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
405 'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
406 'tfeedback' => array('integer', $this->getTutorFeedback()),
407 ), array(
408 "obj_id" => array("integer", $this->getId())
409 ));
410
411 $this->updateAllUsersStatus();
412
413 return true;
414 }
415
416 // send exercise per mail to members
417
424 public function sendAssignment(ilExAssignment $a_ass, array $a_members): void
425 {
427 $ilUser = $this->user;
428
429 $lng->loadLanguageModule("exc");
430
431 // subject
432 $subject = $a_ass->getTitle()
433 ? $this->getTitle() . ": " . $a_ass->getTitle()
434 : $this->getTitle();
435
436
437 // body
438
439 $body = $a_ass->getInstruction();
440 $body .= "\n\n";
441
442 $body .= $lng->txt("exc_edit_until") . ": ";
443 $body .= (!$a_ass->getDeadline())
444 ? $lng->txt("exc_no_deadline_specified")
446 $body .= "\n\n";
447
448 $body .= ilLink::_getLink($this->getRefId(), "exc");
449
450
451 // files
452 $file_names = array();
453 $storage = new ilFSStorageExercise($a_ass->getExerciseId(), $a_ass->getId());
454 $files = $storage->getFiles();
455 $mfile_obj = null;
456 if ($files !== []) {
457 $mfile_obj = new ilFileDataMail($GLOBALS['DIC']['ilUser']->getId());
458 foreach ($files as $file) {
459 $mfile_obj->copyAttachmentFile($file["fullpath"], $file["name"]);
460 $file_names[] = $file["name"];
461 }
462 }
463
464 // recipients
465 $recipients = array();
466 foreach ($a_members as $member_id) {
468 $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
469 $recipients[] = $tmp_obj->getLogin();
470 unset($tmp_obj);
471 }
472 $recipients = implode(",", $recipients);
473
474 // send mail
475 $tmp_mail_obj = new ilMail($ilUser->getId());
476 $tmp_mail_obj->enqueue(
477 $recipients,
478 "",
479 "",
480 $subject,
481 $body,
482 $file_names
483 );
484 unset($tmp_mail_obj);
485
486 // remove tmp files
487 if (count($file_names) && $mfile_obj) {
488 $mfile_obj->unlinkFiles($file_names);
489 unset($mfile_obj);
490 }
491
492 // set recipients mail status
493 foreach ($a_members as $member_id) {
494 $member_status = $a_ass->getMemberStatus($member_id);
495 $member_status->setSent(true);
496 $member_status->update();
497 }
498 }
499
504 public function determinStatusOfUser(int $a_user_id = 0): array
505 {
506 $ilUser = $this->user;
507
508 $mandatory_manager = $this->mandatory_manager;
509
510 if ($a_user_id == 0) {
511 $a_user_id = $ilUser->getId();
512 }
513
515
516 $passed_all_mandatory = true;
517 $failed_a_mandatory = false;
518 $cnt_passed = 0;
519 $cnt_notgraded = 0;
520
522 foreach ($ass as $a) {
523 $stat = $a->getMemberStatus($a_user_id)->getStatus();
524 $mandatory = $mandatory_manager->isMandatoryForUser($a->getId(), $a_user_id);
525 if ($mandatory && ($stat == "failed" || $stat == "notgraded")) {
526 $passed_all_mandatory = false;
527 }
528 if ($mandatory && ($stat == "failed")) {
529 $failed_a_mandatory = true;
530 }
531 if ($stat == "passed") {
532 $cnt_passed++;
533 }
534 if ($stat == "notgraded") {
535 $cnt_notgraded++;
536 }
537 }
538
539 if (count($ass) == 0) {
540 $passed_all_mandatory = false;
541 }
542 $overall_stat = "notgraded";
543 if ($this->getPassMode() == self::PASS_MODE_ALL) {
544 $overall_stat = "notgraded";
545 if ($failed_a_mandatory) {
546 $overall_stat = "failed";
547 } elseif ($passed_all_mandatory && $cnt_passed > 0) {
548 $overall_stat = "passed";
549 }
550 } elseif ($this->getPassMode() == self::PASS_MODE_NR) {
551 $min_nr = $this->getPassNr();
552 $overall_stat = "notgraded";
553 if ($failed_a_mandatory || ($cnt_passed + $cnt_notgraded < $min_nr)) {
554 $overall_stat = "failed";
555 } elseif ($passed_all_mandatory && $cnt_passed >= $min_nr) {
556 $overall_stat = "passed";
557 }
558 } elseif ($this->getPassMode() == self::PASS_MODE_RANDOM) {
559 $overall_stat = "notgraded";
560 if ($failed_a_mandatory) {
561 $overall_stat = "failed";
562 } elseif ($passed_all_mandatory && $cnt_passed > 0) {
563 $overall_stat = "passed";
564 }
565 }
566
567 return array(
568 "overall_status" => $overall_stat,
569 "failed_a_mandatory" => $failed_a_mandatory);
570 }
571
576 public function updateUserStatus(int $a_user_id = 0): void
577 {
578 $ilUser = $this->user;
579
580 if ($a_user_id == 0) {
581 $a_user_id = $ilUser->getId();
582 }
583
584 $st = $this->determinStatusOfUser($a_user_id);
585
587 $this->getId(),
588 $a_user_id,
589 $st["overall_status"]
590 );
591 }
592
597 public function updateAllUsersStatus(): void
598 {
599 if (!isset($this->members_obj)) {
600 $this->members_obj = new ilExerciseMembers($this);
601 }
602
603 $mems = $this->members_obj->getMembers();
604 foreach ($mems as $mem) {
605 $this->updateUserStatus($mem);
606 }
607 }
608
614 public function exportGradesExcel(): void
615 {
616 $ass_data = ilExAssignment::getInstancesByExercise($this->getId());
617
618 $excel = new ilExcel();
619 $excel->addSheet($this->lng->txt("exc_status"));
620
621 //
622 // status
623 //
624
625 // header row
626 $row = $cnt = 1;
627 $excel->setCell($row, 0, $this->lng->txt("name"));
628 foreach ($ass_data as $ass) {
629 $excel->setCell($row, $cnt++, ($cnt / 2) . " - " . $this->lng->txt("exc_tbl_status"));
630 $excel->setCell($row, $cnt++, (($cnt - 1) / 2) . " - " . $this->lng->txt("exc_tbl_mark"));
631 }
632 $excel->setCell($row, $cnt++, $this->lng->txt("exc_total_exc"));
633 $excel->setCell($row, $cnt++, $this->lng->txt("exc_mark"));
634 $excel->setCell($row++, $cnt, $this->lng->txt("exc_comment_for_learner"));
635 $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
636
637 // data rows
638 $mem_obj = new ilExerciseMembers($this);
639
640 $filtered_members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
641 'edit_submissions_grades',
642 'edit_submissions_grades',
643 $this->getRefId(),
644 $mem_obj->getMembers()
645 );
646 $mems = [];
647 foreach ((array) $filtered_members as $user_id) {
648 $mems[$user_id] = ilObjUser::_lookupName($user_id);
649 }
650 $mems = ilArrayUtil::sortArray($mems, "lastname", "asc", false, true);
651
652 foreach ($mems as $user_id => $d) {
653 $col = 0;
654
655 // name
656 $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
657
658 reset($ass_data);
659 foreach ($ass_data as $ass) {
660 $status = $ass->getMemberStatus($user_id)->getStatus();
661 $mark = $ass->getMemberStatus($user_id)->getMark();
662 $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
663 $excel->setCell($row, $col++, $mark);
664 }
665
666 // total status
667 $status = ilExerciseMembers::_lookupStatus($this->getId(), $user_id);
668 $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
669
670 // #18096
671 $marks_obj = new ilLPMarks($this->getId(), $user_id);
672 $excel->setCell($row, $col++, $marks_obj->getMark());
673 $excel->setCell($row++, $col, $marks_obj->getComment());
674 }
675
676
677 //
678 // mark
679 //
680
681 $excel->addSheet($this->lng->txt("exc_mark"));
682
683 // header row
684 $row = $cnt = 1;
685 $excel->setCell($row, 0, $this->lng->txt("name"));
686 foreach ($ass_data as $ass) {
687 $excel->setCell($row, $cnt++, $cnt - 1);
688 }
689 $excel->setCell($row++, $cnt++, $this->lng->txt("exc_total_exc"));
690 $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
691
692 // data rows
693 reset($mems);
694 foreach ($mems as $user_id => $d) {
695 $col = 0;
696
697 // name
698 $d = ilObjUser::_lookupName($user_id);
699 $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
700
701 reset($ass_data);
702 foreach ($ass_data as $ass) {
703 $excel->setCell($row, $col++, $ass->getMemberStatus($user_id)->getMark());
704 }
705
706 // total mark
707 $excel->setCell($row++, $col, ilLPMarks::_lookupMark($user_id, $this->getId()));
708 }
709
710 $exc_name = ilFileUtils::getASCIIFilename(preg_replace("/\s/", "_", $this->getTitle()));
711 $excel->sendToClient($exc_name);
712 }
713
714 // Send feedback file notification to user
716 string $a_feedback_file,
717 array $user_ids,
718 int $a_ass_id,
719 bool $a_is_text_feedback = false
720 ): void {
721 $type = $a_is_text_feedback
722 ? ilExerciseMailNotification::TYPE_FEEDBACK_TEXT_ADDED
723 : ilExerciseMailNotification::TYPE_FEEDBACK_FILE_ADDED;
724
725 $not = new ilExerciseMailNotification();
726 $not->setType($type);
727 $not->setAssignmentId($a_ass_id);
728 $not->setObjId($this->getId());
729 if ($this->getRefId() > 0) {
730 $not->setRefId($this->getRefId());
731 }
732 $not->setRecipients($user_ids);
733 $not->send();
734 }
735
736 // Checks whether completion by submission is enabled or not
737 public function isCompletionBySubmissionEnabled(): bool
738 {
739 return $this->completion_by_submission;
740 }
741
742 // Enabled/Disable completion by submission
743 public function setCompletionBySubmission(bool $bool): self
744 {
745 $this->completion_by_submission = $bool;
746
747 return $this;
748 }
749
753 public function processExerciseStatus(
754 ilExAssignment $a_ass,
755 array $a_user_ids,
756 bool $a_has_submitted,
757 array $a_valid_submissions = null
758 ): void {
759 foreach ($a_user_ids as $user_id) {
760 $member_status = $a_ass->getMemberStatus($user_id);
761 $member_status->setReturned($a_has_submitted);
762 $member_status->update();
763
764 ilExerciseMembers::_writeReturned($this->getId(), $user_id, $a_has_submitted);
765 }
766
767 // re-evaluate exercise status
768 if ($this->isCompletionBySubmissionEnabled()) {
769 foreach ($a_user_ids as $user_id) {
770 $status = 'notgraded';
771 if ($a_has_submitted) {
772 if (!is_array($a_valid_submissions) ||
773 $a_valid_submissions[$user_id]) {
774 $status = 'passed';
775 }
776 }
777
778 $member_status = $a_ass->getMemberStatus($user_id);
779 $member_status->setStatus($status);
780 $member_status->update();
781 }
782 }
783 }
784
790 public static function _lookupFinishedUserExercises(int $a_user_id): array
791 {
792 global $DIC;
793
794 $ilDB = $DIC->database();
795
796 $set = $ilDB->query("SELECT obj_id, status FROM exc_members" .
797 " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
798 " AND (status = " . $ilDB->quote("passed", "text") .
799 " OR status = " . $ilDB->quote("failed", "text") . ")");
800
801 $all = array();
802 while ($row = $ilDB->fetchAssoc($set)) {
803 $all[$row["obj_id"]] = ($row["status"] == "passed");
804 }
805 return $all;
806 }
807
808
812 public function getCertificateVisibility(): int
813 {
814 return (strlen($this->certificate_visibility) !== 0) ? $this->certificate_visibility : 0;
815 }
816
820 public function setCertificateVisibility(int $a_value): void
821 {
822 $this->certificate_visibility = $a_value;
823 }
824
829 int $a_value
830 ): void {
831 $ilDB = $this->db;
832
833 $ilDB->manipulateF(
834 "UPDATE exc_data SET certificate_visibility = %s WHERE obj_id = %s",
835 array('integer', 'integer'),
836 array($a_value, $this->getId())
837 );
838 }
839}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
const IL_CAL_UNIX
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _getContainerSettings(int $a_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
Exercise assignment.
static getAssignmentDataOfExercise(int $a_exc_id)
static cloneAssignmentsOfExercise(int $a_old_exc_id, int $a_new_exc_id, array $a_crit_cat_map)
Clone assignments of exercise.
static getInstancesByExercise(int $a_exc_id)
getMemberStatus(?int $a_user_id=null)
static getInstancesByParentId(int $a_parent_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 _writeStatus(int $a_obj_id, int $a_user_id, string $a_status)
Write user status This information is determined by the assignment status and saved redundantly in th...
static _writeReturned(int $a_obj_id, int $a_user_id, int $a_status)
Write returned status.
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current status (notgraded|passed|failed)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class handles all operations on files (attachments) in directory ilias_data/mail.
static getASCIIFilename(string $a_filename)
static _lookupMark(int $a_usr_id, int $a_obj_id)
static removeForObject(int $type, int $id)
Remove all notifications for given object.
Class ilObjExercise.
ilExerciseMembers $members_obj
saveCertificateVisibility(int $a_value)
static _lookupFinishedUserExercises(int $a_user_id)
Get all finished exercises for user.
setDate(int $a_hour, int $a_minutes, int $a_day, int $a_month, int $a_year)
updateAllUsersStatus()
Update status of all users.
setPassMode(string $a_val)
setShowSubmissions(bool $a_val)
setCertificateVisibility(int $a_value)
ilFileDataMail $file_obj
sendFeedbackFileNotification(string $a_feedback_file, array $user_ids, int $a_ass_id, bool $a_is_text_feedback=false)
updateUserStatus(int $a_user_id=0)
Update exercise status of user.
setTimestamp(int $a_timestamp)
setTutorFeedback(int $a_value)
exportGradesExcel()
Exports grades as excel.
Filesystem $webFilesystem
InternalService $service
setCompletionBySubmission(bool $bool)
setNrMandatoryRandom(int $a_val)
setInstruction(string $a_instruction)
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, bool $a_has_submitted, array $a_valid_submissions=null)
MandatoryAssignmentsManager $mandatory_manager
User class.
static _lookupName(int $a_user_id)
lookup user name
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $id=0, bool $reference=true)
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
Definition: date.php:296
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
Interface Filesystem.
Definition: Filesystem.php:40
$res
Definition: ltiservices.php:69
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$query
$type
$lng