ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjExercise.php
Go to the documentation of this file.
1<?php
2
26
35{
36 public const TUTOR_FEEDBACK_MAIL = 1;
37 public const TUTOR_FEEDBACK_TEXT = 2;
38 public const TUTOR_FEEDBACK_FILE = 4;
39
40 public const PASS_MODE_NR = "nr";
41 public const PASS_MODE_ALL = "all";
42 public const PASS_MODE_RANDOM = "random";
43
44 protected ilObjUser $user;
47 protected int $timestamp = 0;
48 protected int $hour = 0;
49 protected int $minutes = 0;
50 protected int $day = 0;
51 protected int $month = 0;
52 protected int $year = 0;
53 protected string $instruction = "";
54 protected int $certificate_visibility = 0;
55 protected int $tutor_feedback = 7; // [int]
56 protected int $nr_random_mand = 0; // number of mandatory assignments in random pass mode
57 protected bool $completion_by_submission = false; // completion by submission is enabled or not
60 protected int $pass_nr = 0;
62 protected string $pass_mode = self::PASS_MODE_ALL;
63 protected bool $show_submissions = false;
64
68 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
69 {
71 global $DIC;
72
73 $this->db = $DIC->database();
74 $this->app_event_handler = $DIC["ilAppEventHandler"];
75 $this->lng = $DIC->language();
76 $this->user = $DIC->user();
77 $this->setPassMode("all");
78 $this->type = "exc";
79 $this->webFilesystem = $DIC->filesystem()->web();
80 $this->service = $DIC->exercise()->internal();
81
82 parent::__construct($a_id, $a_call_by_reference);
83 $this->mandatory_manager = $this->service->domain()->assignment()->mandatoryAssignments($this);
84 }
85
89 public function setId(int $a_id): void
90 {
91 parent::setId($a_id);
92 // this is needed, since e.g. ilObjectFactory initialises the object with id 0 and later sets the id
93 $this->mandatory_manager = $this->service->domain()->assignment()->mandatoryAssignments($this);
94 }
95
96 public function setDate(
97 int $a_hour,
98 int $a_minutes,
99 int $a_day,
100 int $a_month,
101 int $a_year
102 ): void {
103 $this->hour = $a_hour;
104 $this->minutes = $a_minutes;
105 $this->day = $a_day;
106 $this->month = $a_month;
107 $this->year = $a_year;
108 $this->timestamp = mktime($this->hour, $this->minutes, 0, $this->month, $this->day, $this->year);
109 }
110
111 public function getTimestamp(): int
112 {
113 return $this->timestamp;
114 }
115
116 public function setTimestamp(
117 int $a_timestamp
118 ): void {
119 $this->timestamp = $a_timestamp;
120 }
121
122 public function setInstruction(
123 string $a_instruction
124 ): void {
125 $this->instruction = $a_instruction;
126 }
127
128 public function getInstruction(): string
129 {
130 return $this->instruction;
131 }
132
136 public function setPassMode(string $a_val): void
137 {
138 $this->pass_mode = $a_val;
139 }
140
141 public function getPassMode(): string
142 {
143 return $this->pass_mode;
144 }
145
149 public function setPassNr(int $a_val): void
150 {
151 $this->pass_nr = $a_val;
152 }
153
154 public function getPassNr(): int
155 {
156 return $this->pass_nr;
157 }
158
162 public function setShowSubmissions(bool $a_val): void
163 {
164 $this->show_submissions = $a_val;
165 }
166
167 public function getShowSubmissions(): bool
168 {
169 return $this->show_submissions;
170 }
171
175 public function setNrMandatoryRandom(int $a_val): void
176 {
177 $this->nr_random_mand = $a_val;
178 }
179
180 public function getNrMandatoryRandom(): int
181 {
182 return $this->nr_random_mand;
183 }
184
185 public function checkDate(): bool
186 {
187 return $this->hour == (int) date("H", $this->timestamp) and
188 $this->minutes == (int) date("i", $this->timestamp) and
189 $this->day == (int) date("d", $this->timestamp) and
190 $this->month == (int) date("m", $this->timestamp) and
191 $this->year == (int) date("Y", $this->timestamp);
192 }
193
194 public function hasTutorFeedbackText(): int
195 {
196 return $this->tutor_feedback & self::TUTOR_FEEDBACK_TEXT;
197 }
198
199 public function hasTutorFeedbackMail(): int
200 {
201 return $this->tutor_feedback & self::TUTOR_FEEDBACK_MAIL;
202 }
203
204 public function hasTutorFeedbackFile(): int
205 {
206 return $this->tutor_feedback & self::TUTOR_FEEDBACK_FILE;
207 }
208
209 protected function getTutorFeedback(): int
210 {
211 return $this->tutor_feedback;
212 }
213
214 public function setTutorFeedback(int $a_value): void
215 {
216 $this->tutor_feedback = $a_value;
217 }
218
219 public function saveData(): void
220 {
221 $ilDB = $this->db;
222
223 $ilDB->insert("exc_data", array(
224 "obj_id" => array("integer", $this->getId()),
225 "instruction" => array("clob", $this->getInstruction()),
226 "time_stamp" => array("integer", $this->getTimestamp()),
227 "pass_mode" => array("text", $this->getPassMode()),
228 "nr_mandatory_random" => array("integer", $this->getNrMandatoryRandom()),
229 "pass_nr" => array("text", $this->getPassNr()),
230 "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
231 'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
232 "certificate_visibility" => array("integer", $this->getCertificateVisibility()),
233 "tfeedback" => array("integer", $this->getTutorFeedback())
234 ));
235 }
236
247 public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_tree = false): ?ilObject
248 {
249 $ilDB = $this->db;
250
251 // Copy settings
253 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
254 $new_obj->setInstruction($this->getInstruction());
255 $new_obj->setTimestamp($this->getTimestamp());
256 $new_obj->setPassMode($this->getPassMode());
257 $new_obj->setNrMandatoryRandom($this->getNrMandatoryRandom());
258 $new_obj->saveData();
259 $new_obj->setPassNr($this->getPassNr());
260 $new_obj->setShowSubmissions($this->getShowSubmissions());
261 $new_obj->setCompletionBySubmission($this->isCompletionBySubmissionEnabled());
262 $new_obj->setTutorFeedback($this->getTutorFeedback());
263 $new_obj->setCertificateVisibility($this->getCertificateVisibility());
264
265 $this->cloneMetaData($new_obj);
266
267 $new_obj->update();
268
269 $new_obj->saveCertificateVisibility($this->getCertificateVisibility());
270
271 // Copy criteria catalogues
272 $crit_cat_map = array();
273 foreach (ilExcCriteriaCatalogue::getInstancesByParentId($this->getId()) as $crit_cat) {
274 $new_id = $crit_cat->cloneObject($new_obj->getId());
275 $crit_cat_map[$crit_cat->getId()] = $new_id;
276 }
277
278 // Copy assignments
279 ilExAssignment::cloneAssignmentsOfExercise($this->getId(), $new_obj->getId(), $crit_cat_map);
280
281 // Copy learning progress settings
282 $obj_settings = new ilLPObjSettings($this->getId());
283 $obj_settings->cloneSettings($new_obj->getId());
284 unset($obj_settings);
285
286 $pathFactory = new ilCertificatePathFactory();
287 $templateRepository = new ilCertificateTemplateDatabaseRepository($ilDB);
288
289 $cloneAction = new ilCertificateCloneAction(
290 $ilDB,
291 $pathFactory,
292 $templateRepository,
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 $em = $this->service->domain()->exercise($this->getId());
327 $em->delete($this);
328
329 // members
330 $members = new ilExerciseMembers($this);
331 $members->delete();
332
333 // put here course specific stuff
334 $this->deleteMetaData();
335
336 $ilDB->manipulate("DELETE FROM exc_data " .
337 "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer"));
338
339
340 // remove all notifications
342
343 $ilAppEventHandler->raise(
344 'components/ILIAS/Exercise',
345 'delete',
346 array('obj_id' => $this->getId())
347 );
348
349 return true;
350 }
351
356 public function read(): void
357 {
358 $ilDB = $this->db;
359
360 parent::read();
361
362 $query = "SELECT * FROM exc_data " .
363 "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
364
365 $res = $ilDB->query($query);
366 while ($row = $ilDB->fetchObject($res)) {
367 $this->setInstruction((string) $row->instruction);
368 $this->setTimestamp((int) $row->time_stamp);
369 $pm = ($row->pass_mode == "")
370 ? "all"
371 : $row->pass_mode;
372 $this->setPassMode((string) $pm);
373 $this->setShowSubmissions((bool) $row->show_submissions);
374 if ($row->pass_mode == "nr") {
375 $this->setPassNr((int) $row->pass_nr);
376 }
377 $this->setNrMandatoryRandom((int) $row->nr_mandatory_random);
378 $this->setCompletionBySubmission($row->compl_by_submission == 1);
379 $this->setCertificateVisibility((int) $row->certificate_visibility);
380 $this->setTutorFeedback((int) $row->tfeedback);
381 }
382
383 $this->members_obj = new ilExerciseMembers($this);
384 }
385
386 public function create(): int
387 {
388 $id = parent::create();
389 $this->createMetaData();
390 return $id;
391 }
392
396 public function update(): bool
397 {
398 $ilDB = $this->db;
399
400 parent::update();
401
402 $ilDB->update("exc_data", array(
403 "instruction" => array("clob", $this->getInstruction()),
404 "time_stamp" => array("integer", $this->getTimestamp()),
405 "pass_mode" => array("text", $this->getPassMode()),
406 "pass_nr" => array("integer", $this->getPassNr()),
407 "nr_mandatory_random" => array("integer", $this->getNrMandatoryRandom()),
408 "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
409 'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
410 'tfeedback' => array('integer', $this->getTutorFeedback()),
411 ), array(
412 "obj_id" => array("integer", $this->getId())
413 ));
414
415 $this->updateAllUsersStatus();
416 $this->updateMetaData();
417
418 return true;
419 }
420
421 // send exercise per mail to members
422
429 public function sendAssignment(ilExAssignment $a_ass, array $a_members): void
430 {
432 $ilUser = $this->user;
433
434 $lng->loadLanguageModule("exc");
435
436 // subject
437 $subject = $a_ass->getTitle()
438 ? $this->getTitle() . ": " . $a_ass->getTitle()
439 : $this->getTitle();
440
441
442 // body
443
444 $body = $a_ass->getInstruction();
445 $body .= "\n\n";
446
447 $body .= $lng->txt("exc_edit_until") . ": ";
448 $body .= (!$a_ass->getDeadline())
449 ? $lng->txt("exc_no_deadline_specified")
451 $body .= "\n\n";
452
453 $body .= ilLink::_getLink($this->getRefId(), "exc");
454
455 // instruction files
456 $if = $this->service->domain()->assignment()->instructionFiles($a_ass->getId());
457 $files = $if->getFiles();
458 $file_names = [];
459 if (count($files) > 0) {
460 $mfile_obj = new ilFileDataMail($GLOBALS['DIC']['ilUser']->getId());
461 foreach ($if->getFiles() as $file) {
462 $file_names[] = $file["name"];
463 $mfile_obj->storeAsAttachment(
464 $file["name"],
465 $if->getStream($file["rid"])->getContents()
466 );
467 }
468 }
469
470 // recipients
471 $recipients = array();
472 foreach ($a_members as $member_id) {
474 $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
475 $recipients[] = $tmp_obj->getLogin();
476 unset($tmp_obj);
477 }
478 $recipients = implode(",", $recipients);
479
480 // send mail
481 $tmp_mail_obj = new ilMail($ilUser->getId());
482 $tmp_mail_obj->enqueue(
483 $recipients,
484 "",
485 "",
486 $subject,
487 $body,
488 $file_names
489 );
490 unset($tmp_mail_obj);
491
492 // remove tmp files
493 if (count($file_names) && $mfile_obj) {
494 $mfile_obj->unlinkFiles($file_names);
495 unset($mfile_obj);
496 }
497
498 // set recipients mail status
499 foreach ($a_members as $member_id) {
500 $member_status = $a_ass->getMemberStatus($member_id);
501 $member_status->setSent(true);
502 $member_status->update();
503 }
504 }
505
510 public function determinStatusOfUser(int $a_user_id = 0): array
511 {
512 $ilUser = $this->user;
513
514 $mandatory_manager = $this->mandatory_manager;
515
516 if ($a_user_id == 0) {
517 $a_user_id = $ilUser->getId();
518 }
519
521
522 $passed_all_mandatory = true;
523 $failed_a_mandatory = false;
524 $cnt_passed = 0;
525 $cnt_notgraded = 0;
526
528 foreach ($ass as $a) {
529 $stat = $a->getMemberStatus($a_user_id)->getStatus();
530 $mandatory = $mandatory_manager->isMandatoryForUser($a->getId(), $a_user_id);
531 if ($mandatory && ($stat == "failed" || $stat == "notgraded")) {
532 $passed_all_mandatory = false;
533 }
534 if ($mandatory && ($stat == "failed")) {
535 $failed_a_mandatory = true;
536 }
537 if ($stat == "passed") {
538 $cnt_passed++;
539 }
540 if ($stat == "notgraded") {
541 $cnt_notgraded++;
542 }
543 }
544
545 if (count($ass) == 0) {
546 $passed_all_mandatory = false;
547 }
548 $overall_stat = "notgraded";
549 if ($this->getPassMode() == self::PASS_MODE_ALL) {
550 $overall_stat = "notgraded";
551 if ($failed_a_mandatory) {
552 $overall_stat = "failed";
553 } elseif ($passed_all_mandatory && $cnt_passed > 0) {
554 $overall_stat = "passed";
555 }
556 } elseif ($this->getPassMode() == self::PASS_MODE_NR) {
557 $min_nr = $this->getPassNr();
558 $overall_stat = "notgraded";
559 if ($failed_a_mandatory || ($cnt_passed + $cnt_notgraded < $min_nr)) {
560 $overall_stat = "failed";
561 } elseif ($passed_all_mandatory && $cnt_passed >= $min_nr) {
562 $overall_stat = "passed";
563 }
564 } elseif ($this->getPassMode() == self::PASS_MODE_RANDOM) {
565 $overall_stat = "notgraded";
566 if ($failed_a_mandatory) {
567 $overall_stat = "failed";
568 } elseif ($passed_all_mandatory && $cnt_passed > 0) {
569 $overall_stat = "passed";
570 }
571 }
572
573 return array(
574 "overall_status" => $overall_stat,
575 "failed_a_mandatory" => $failed_a_mandatory);
576 }
577
582 public function updateUserStatus(int $a_user_id = 0): void
583 {
584 $ilUser = $this->user;
585
586 if ($a_user_id == 0) {
587 $a_user_id = $ilUser->getId();
588 }
589
590 $st = $this->determinStatusOfUser($a_user_id);
591
593 $this->getId(),
594 $a_user_id,
595 $st["overall_status"]
596 );
597 }
598
603 public function updateAllUsersStatus(): void
604 {
605 if (!isset($this->members_obj)) {
606 $this->members_obj = new ilExerciseMembers($this);
607 }
608
609 $mems = $this->members_obj->getMembers();
610 foreach ($mems as $mem) {
611 $this->updateUserStatus($mem);
612 }
613 }
614
620 public function exportGradesExcel(): void
621 {
622 $ass_data = ilExAssignment::getInstancesByExercise($this->getId());
623
624 $excel = new ilExcel();
625 $excel->addSheet($this->lng->txt("exc_status"));
626
627 //
628 // status
629 //
630
631 // header row
632 $row = $cnt = 1;
633 $excel->setCell($row, 0, $this->lng->txt("name"));
634 foreach ($ass_data as $ass) {
635 $excel->setCell($row, $cnt++, ($cnt / 2) . " - " . $this->lng->txt("exc_tbl_status"));
636 $excel->setCell($row, $cnt++, (($cnt - 1) / 2) . " - " . $this->lng->txt("exc_tbl_mark"));
637 }
638 $excel->setCell($row, $cnt++, $this->lng->txt("exc_total_exc"));
639 $excel->setCell($row, $cnt++, $this->lng->txt("exc_mark"));
640 $excel->setCell($row++, $cnt, $this->lng->txt("exc_comment_for_learner"));
641 $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
642
643 // data rows
644 $mem_obj = new ilExerciseMembers($this);
645
646 $filtered_members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
647 'edit_submissions_grades',
648 'edit_submissions_grades',
649 $this->getRefId(),
650 $mem_obj->getMembers()
651 );
652 $mems = [];
653 foreach ((array) $filtered_members as $user_id) {
655 }
656 $mems = ilArrayUtil::sortArray($mems, "lastname", "asc", false, true);
657
658 foreach ($mems as $user_id => $d) {
659 $col = 0;
660
661 // name
662 $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
663
664 reset($ass_data);
665 foreach ($ass_data as $ass) {
666 $status = $ass->getMemberStatus($user_id)->getStatus();
667 $mark = $ass->getMemberStatus($user_id)->getMark();
668 $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
669 $excel->setCell($row, $col++, $mark);
670 }
671
672 // total status
673 $status = ilExerciseMembers::_lookupStatus($this->getId(), $user_id);
674 $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
675
676 // #18096
677 $marks_obj = new ilLPMarks($this->getId(), $user_id);
678 $excel->setCell($row, $col++, $marks_obj->getMark());
679 $excel->setCell($row++, $col, $marks_obj->getComment());
680 }
681
682
683 //
684 // mark
685 //
686
687 $excel->addSheet($this->lng->txt("exc_mark"));
688
689 // header row
690 $row = $cnt = 1;
691 $excel->setCell($row, 0, $this->lng->txt("name"));
692 foreach ($ass_data as $ass) {
693 $excel->setCell($row, $cnt++, $cnt - 1);
694 }
695 $excel->setCell($row++, $cnt++, $this->lng->txt("exc_total_exc"));
696 $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
697
698 // data rows
699 reset($mems);
700 foreach ($mems as $user_id => $d) {
701 $col = 0;
702
703 // name
705 $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
706
707 reset($ass_data);
708 foreach ($ass_data as $ass) {
709 $excel->setCell($row, $col++, $ass->getMemberStatus($user_id)->getMark());
710 }
711
712 // total mark
713 $excel->setCell($row++, $col, ilLPMarks::_lookupMark($user_id, $this->getId()));
714 }
715
716 $exc_name = ilFileUtils::getASCIIFilename(preg_replace("/\s/", "_", $this->getTitle()));
717 $excel->sendToClient($exc_name);
718 }
719
720
721 // Checks whether completion by submission is enabled or not
722 public function isCompletionBySubmissionEnabled(): bool
723 {
724 return $this->completion_by_submission;
725 }
726
727 // Enabled/Disable completion by submission
728 public function setCompletionBySubmission(bool $bool): self
729 {
730 $this->completion_by_submission = $bool;
731
732 return $this;
733 }
734
738 public function processExerciseStatus(
739 ilExAssignment $a_ass,
740 array $a_user_ids,
741 bool $a_has_submitted,
742 ?array $a_valid_submissions = null
743 ): void {
744 foreach ($a_user_ids as $user_id) {
745 $member_status = $a_ass->getMemberStatus($user_id);
746 $member_status->setReturned($a_has_submitted);
747 $member_status->update();
748
749 ilExerciseMembers::_writeReturned($this->getId(), $user_id, $a_has_submitted);
750 }
751
752 // re-evaluate exercise status
753 if ($this->isCompletionBySubmissionEnabled()) {
754 foreach ($a_user_ids as $user_id) {
755 $status = 'notgraded';
756 if ($a_has_submitted) {
757 if (!is_array($a_valid_submissions) ||
758 $a_valid_submissions[$user_id]) {
759 $status = 'passed';
760 }
761 }
762
763 $member_status = $a_ass->getMemberStatus($user_id);
764 $member_status->setStatus($status);
765 $member_status->update();
766 }
767 }
768 }
769
775 public static function _lookupFinishedUserExercises(int $a_user_id): array
776 {
777 global $DIC;
778
779 $ilDB = $DIC->database();
780
781 $set = $ilDB->query("SELECT obj_id, status FROM exc_members" .
782 " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
783 " AND (status = " . $ilDB->quote("passed", "text") .
784 " OR status = " . $ilDB->quote("failed", "text") . ")");
785
786 $all = array();
787 while ($row = $ilDB->fetchAssoc($set)) {
788 $all[$row["obj_id"]] = ($row["status"] == "passed");
789 }
790 return $all;
791 }
792
793
797 public function getCertificateVisibility(): int
798 {
799 return (strlen($this->certificate_visibility) !== 0) ? $this->certificate_visibility : 0;
800 }
801
805 public function setCertificateVisibility(int $a_value): void
806 {
807 $this->certificate_visibility = $a_value;
808 }
809
814 int $a_value
815 ): void {
816 $ilDB = $this->db;
817
818 $ilDB->manipulateF(
819 "UPDATE exc_data SET certificate_visibility = %s WHERE obj_id = %s",
820 array('integer', 'integer'),
821 array($a_value, $this->getId())
822 );
823 }
824}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
Indicates that the directory is missing or not found.
Indicates that a file is missing or not found.
Indicates general problems with the input or output operations.
Definition: IOException.php:28
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, ?ilObjUser $user=null,)
@classDescription Date and time handling
Exercise assignment.
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)
Class ilExerciseMembers.
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)
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)
create()
note: title, description and type should be set when this function is called
updateAllUsersStatus()
Update status of all users.
setPassMode(string $a_val)
setShowSubmissions(bool $a_val)
setCertificateVisibility(int $a_value)
ilFileDataMail $file_obj
updateUserStatus(int $a_user_id=0)
Update exercise status of user.
setTimestamp(int $a_timestamp)
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, bool $a_has_submitted, ?array $a_valid_submissions=null)
setTutorFeedback(int $a_value)
exportGradesExcel()
Exports grades as excel.
Filesystem $webFilesystem
InternalService $service
setCompletionBySubmission(bool $bool)
setNrMandatoryRandom(int $a_val)
setInstruction(string $a_instruction)
MandatoryAssignmentsManager $mandatory_manager
User class.
static _lookupName(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObject Basic functions for all objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The filesystem interface provides the public interface for the Filesystem service API consumer.
Definition: Filesystem.php:37
$res
Definition: ltiservices.php:69
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54