ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjExercise.php
Go to the documentation of this file.
1 <?php
2 
24 
27 
35 class ilObjExercise extends ilObject
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  {
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 
266  $this->cloneMetaData($new_obj);
267 
268  $new_obj->update();
269 
270  $new_obj->saveCertificateVisibility($this->getCertificateVisibility());
271 
272  // Copy criteria catalogues
273  $crit_cat_map = array();
274  foreach (ilExcCriteriaCatalogue::getInstancesByParentId($this->getId()) as $crit_cat) {
275  $new_id = $crit_cat->cloneObject($new_obj->getId());
276  $crit_cat_map[$crit_cat->getId()] = $new_id;
277  }
278 
279  // Copy assignments
280  ilExAssignment::cloneAssignmentsOfExercise($this->getId(), $new_obj->getId(), $crit_cat_map);
281 
282  // Copy learning progress settings
283  $obj_settings = new ilLPObjSettings($this->getId());
284  $obj_settings->cloneSettings($new_obj->getId());
285  unset($obj_settings);
286 
287  $pathFactory = new ilCertificatePathFactory();
288  $templateRepository = new ilCertificateTemplateDatabaseRepository($ilDB);
289 
290  $cloneAction = new ilCertificateCloneAction(
291  $ilDB,
292  $pathFactory,
293  $templateRepository,
295  $this->webFilesystem,
297  );
298 
299  $cloneAction->cloneCertificate($this, $new_obj);
300 
301  // additional features
302  foreach (ilContainer::_getContainerSettings($this->getId()) as $keyword => $value) {
303  ilContainer::_writeContainerSetting($new_obj->getId(), $keyword, $value);
304  }
305 
306  // org unit setting
307  $orgu_object_settings = new ilOrgUnitObjectPositionSetting($new_obj->getId());
308  $orgu_object_settings->setActive(
309  (int) ilOrgUnitGlobalSettings::getInstance()->isPositionAccessActiveForObject($this->getId())
310  );
311  $orgu_object_settings->update();
312 
313  return $new_obj;
314  }
315 
319  public function delete(): bool
320  {
321  $ilDB = $this->db;
322  $ilAppEventHandler = $this->app_event_handler;
323 
324  // always call parent delete function first!!
325  if (!parent::delete()) {
326  return false;
327  }
328 
329  $em = $this->service->domain()->exercise($this->getId());
330  $em->delete($this);
331 
332  // members
333  $members = new ilExerciseMembers($this);
334  $members->delete();
335 
336  // put here course specific stuff
337  $this->deleteMetaData();
338 
339  $ilDB->manipulate("DELETE FROM exc_data " .
340  "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer"));
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 
389  public function create(): int
390  {
391  $id = parent::create();
392  $this->createMetaData();
393  return $id;
394  }
395 
399  public function update(): bool
400  {
401  $ilDB = $this->db;
402 
403  parent::update();
404 
405  $ilDB->update("exc_data", array(
406  "instruction" => array("clob", $this->getInstruction()),
407  "time_stamp" => array("integer", $this->getTimestamp()),
408  "pass_mode" => array("text", $this->getPassMode()),
409  "pass_nr" => array("integer", $this->getPassNr()),
410  "nr_mandatory_random" => array("integer", $this->getNrMandatoryRandom()),
411  "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
412  'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
413  'tfeedback' => array('integer', $this->getTutorFeedback()),
414  ), array(
415  "obj_id" => array("integer", $this->getId())
416  ));
417 
418  $this->updateAllUsersStatus();
419  $this->updateMetaData();
420 
421  return true;
422  }
423 
424  // send exercise per mail to members
425 
432  public function sendAssignment(ilExAssignment $a_ass, array $a_members): void
433  {
434  $lng = $this->lng;
435  $ilUser = $this->user;
436 
437  $lng->loadLanguageModule("exc");
438 
439  // subject
440  $subject = $a_ass->getTitle()
441  ? $this->getTitle() . ": " . $a_ass->getTitle()
442  : $this->getTitle();
443 
444 
445  // body
446 
447  $body = $a_ass->getInstruction();
448  $body .= "\n\n";
449 
450  $body .= $lng->txt("exc_edit_until") . ": ";
451  $body .= (!$a_ass->getDeadline())
452  ? $lng->txt("exc_no_deadline_specified")
454  $body .= "\n\n";
455 
456  $body .= ilLink::_getLink($this->getRefId(), "exc");
457 
458 
459  // files
460  $file_names = array();
461  $storage = new ilFSStorageExercise($a_ass->getExerciseId(), $a_ass->getId());
462  $files = $storage->getFiles();
463  $mfile_obj = null;
464  if ($files !== []) {
465  $mfile_obj = new ilFileDataMail($GLOBALS['DIC']['ilUser']->getId());
466  foreach ($files as $file) {
467  $mfile_obj->copyAttachmentFile($file["fullpath"], $file["name"]);
468  $file_names[] = $file["name"];
469  }
470  }
471 
472  // recipients
473  $recipients = array();
474  foreach ($a_members as $member_id) {
476  $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
477  $recipients[] = $tmp_obj->getLogin();
478  unset($tmp_obj);
479  }
480  $recipients = implode(",", $recipients);
481 
482  // send mail
483  $tmp_mail_obj = new ilMail($ilUser->getId());
484  $tmp_mail_obj->enqueue(
485  $recipients,
486  "",
487  "",
488  $subject,
489  $body,
490  $file_names
491  );
492  unset($tmp_mail_obj);
493 
494  // remove tmp files
495  if (count($file_names) && $mfile_obj) {
496  $mfile_obj->unlinkFiles($file_names);
497  unset($mfile_obj);
498  }
499 
500  // set recipients mail status
501  foreach ($a_members as $member_id) {
502  $member_status = $a_ass->getMemberStatus($member_id);
503  $member_status->setSent(true);
504  $member_status->update();
505  }
506  }
507 
512  public function determinStatusOfUser(int $a_user_id = 0): array
513  {
514  $ilUser = $this->user;
515 
516  $mandatory_manager = $this->mandatory_manager;
517 
518  if ($a_user_id == 0) {
519  $a_user_id = $ilUser->getId();
520  }
521 
523 
524  $passed_all_mandatory = true;
525  $failed_a_mandatory = false;
526  $cnt_passed = 0;
527  $cnt_notgraded = 0;
528 
530  foreach ($ass as $a) {
531  $stat = $a->getMemberStatus($a_user_id)->getStatus();
532  $mandatory = $mandatory_manager->isMandatoryForUser($a->getId(), $a_user_id);
533  if ($mandatory && ($stat == "failed" || $stat == "notgraded")) {
534  $passed_all_mandatory = false;
535  }
536  if ($mandatory && ($stat == "failed")) {
537  $failed_a_mandatory = true;
538  }
539  if ($stat == "passed") {
540  $cnt_passed++;
541  }
542  if ($stat == "notgraded") {
543  $cnt_notgraded++;
544  }
545  }
546 
547  if (count($ass) == 0) {
548  $passed_all_mandatory = false;
549  }
550  $overall_stat = "notgraded";
551  if ($this->getPassMode() == self::PASS_MODE_ALL) {
552  $overall_stat = "notgraded";
553  if ($failed_a_mandatory) {
554  $overall_stat = "failed";
555  } elseif ($passed_all_mandatory && $cnt_passed > 0) {
556  $overall_stat = "passed";
557  }
558  } elseif ($this->getPassMode() == self::PASS_MODE_NR) {
559  $min_nr = $this->getPassNr();
560  $overall_stat = "notgraded";
561  if ($failed_a_mandatory || ($cnt_passed + $cnt_notgraded < $min_nr)) {
562  $overall_stat = "failed";
563  } elseif ($passed_all_mandatory && $cnt_passed >= $min_nr) {
564  $overall_stat = "passed";
565  }
566  } elseif ($this->getPassMode() == self::PASS_MODE_RANDOM) {
567  $overall_stat = "notgraded";
568  if ($failed_a_mandatory) {
569  $overall_stat = "failed";
570  } elseif ($passed_all_mandatory && $cnt_passed > 0) {
571  $overall_stat = "passed";
572  }
573  }
574 
575  return array(
576  "overall_status" => $overall_stat,
577  "failed_a_mandatory" => $failed_a_mandatory);
578  }
579 
584  public function updateUserStatus(int $a_user_id = 0): void
585  {
586  $ilUser = $this->user;
587 
588  if ($a_user_id == 0) {
589  $a_user_id = $ilUser->getId();
590  }
591 
592  $st = $this->determinStatusOfUser($a_user_id);
593 
595  $this->getId(),
596  $a_user_id,
597  $st["overall_status"]
598  );
599  }
600 
605  public function updateAllUsersStatus(): void
606  {
607  if (!isset($this->members_obj)) {
608  $this->members_obj = new ilExerciseMembers($this);
609  }
610 
611  $mems = $this->members_obj->getMembers();
612  foreach ($mems as $mem) {
613  $this->updateUserStatus($mem);
614  }
615  }
616 
622  public function exportGradesExcel(): void
623  {
624  $ass_data = ilExAssignment::getInstancesByExercise($this->getId());
625 
626  $excel = new ilExcel();
627  $excel->addSheet($this->lng->txt("exc_status"));
628 
629  //
630  // status
631  //
632 
633  // header row
634  $row = $cnt = 1;
635  $excel->setCell($row, 0, $this->lng->txt("name"));
636  foreach ($ass_data as $ass) {
637  $excel->setCell($row, $cnt++, ($cnt / 2) . " - " . $this->lng->txt("exc_tbl_status"));
638  $excel->setCell($row, $cnt++, (($cnt - 1) / 2) . " - " . $this->lng->txt("exc_tbl_mark"));
639  }
640  $excel->setCell($row, $cnt++, $this->lng->txt("exc_total_exc"));
641  $excel->setCell($row, $cnt++, $this->lng->txt("exc_mark"));
642  $excel->setCell($row++, $cnt, $this->lng->txt("exc_comment_for_learner"));
643  $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
644 
645  // data rows
646  $mem_obj = new ilExerciseMembers($this);
647 
648  $filtered_members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
649  'edit_submissions_grades',
650  'edit_submissions_grades',
651  $this->getRefId(),
652  $mem_obj->getMembers()
653  );
654  $mems = [];
655  foreach ((array) $filtered_members as $user_id) {
656  $mems[$user_id] = ilObjUser::_lookupName($user_id);
657  }
658  $mems = ilArrayUtil::sortArray($mems, "lastname", "asc", false, true);
659 
660  foreach ($mems as $user_id => $d) {
661  $col = 0;
662 
663  // name
664  $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
665 
666  reset($ass_data);
667  foreach ($ass_data as $ass) {
668  $status = $ass->getMemberStatus($user_id)->getStatus();
669  $mark = $ass->getMemberStatus($user_id)->getMark();
670  $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
671  $excel->setCell($row, $col++, $mark);
672  }
673 
674  // total status
675  $status = ilExerciseMembers::_lookupStatus($this->getId(), $user_id);
676  $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
677 
678  // #18096
679  $marks_obj = new ilLPMarks($this->getId(), $user_id);
680  $excel->setCell($row, $col++, $marks_obj->getMark());
681  $excel->setCell($row++, $col, $marks_obj->getComment());
682  }
683 
684 
685  //
686  // mark
687  //
688 
689  $excel->addSheet($this->lng->txt("exc_mark"));
690 
691  // header row
692  $row = $cnt = 1;
693  $excel->setCell($row, 0, $this->lng->txt("name"));
694  foreach ($ass_data as $ass) {
695  $excel->setCell($row, $cnt++, $cnt - 1);
696  }
697  $excel->setCell($row++, $cnt++, $this->lng->txt("exc_total_exc"));
698  $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
699 
700  // data rows
701  reset($mems);
702  foreach ($mems as $user_id => $d) {
703  $col = 0;
704 
705  // name
706  $d = ilObjUser::_lookupName($user_id);
707  $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
708 
709  reset($ass_data);
710  foreach ($ass_data as $ass) {
711  $excel->setCell($row, $col++, $ass->getMemberStatus($user_id)->getMark());
712  }
713 
714  // total mark
715  $excel->setCell($row++, $col, ilLPMarks::_lookupMark($user_id, $this->getId()));
716  }
717 
718  $exc_name = ilFileUtils::getASCIIFilename(preg_replace("/\s/", "_", $this->getTitle()));
719  $excel->sendToClient($exc_name);
720  }
721 
722 
723  // Checks whether completion by submission is enabled or not
724  public function isCompletionBySubmissionEnabled(): bool
725  {
727  }
728 
729  // Enabled/Disable completion by submission
730  public function setCompletionBySubmission(bool $bool): self
731  {
732  $this->completion_by_submission = $bool;
733 
734  return $this;
735  }
736 
740  public function processExerciseStatus(
741  ilExAssignment $a_ass,
742  array $a_user_ids,
743  bool $a_has_submitted,
744  array $a_valid_submissions = null
745  ): void {
746  foreach ($a_user_ids as $user_id) {
747  $member_status = $a_ass->getMemberStatus($user_id);
748  $member_status->setReturned($a_has_submitted);
749  $member_status->update();
750 
751  ilExerciseMembers::_writeReturned($this->getId(), $user_id, $a_has_submitted);
752  }
753 
754  // re-evaluate exercise status
755  if ($this->isCompletionBySubmissionEnabled()) {
756  foreach ($a_user_ids as $user_id) {
757  $status = 'notgraded';
758  if ($a_has_submitted) {
759  if (!is_array($a_valid_submissions) ||
760  $a_valid_submissions[$user_id]) {
761  $status = 'passed';
762  }
763  }
764 
765  $member_status = $a_ass->getMemberStatus($user_id);
766  $member_status->setStatus($status);
767  $member_status->update();
768  }
769  }
770  }
771 
777  public static function _lookupFinishedUserExercises(int $a_user_id): array
778  {
779  global $DIC;
780 
781  $ilDB = $DIC->database();
782 
783  $set = $ilDB->query("SELECT obj_id, status FROM exc_members" .
784  " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
785  " AND (status = " . $ilDB->quote("passed", "text") .
786  " OR status = " . $ilDB->quote("failed", "text") . ")");
787 
788  $all = array();
789  while ($row = $ilDB->fetchAssoc($set)) {
790  $all[$row["obj_id"]] = ($row["status"] == "passed");
791  }
792  return $all;
793  }
794 
795 
799  public function getCertificateVisibility(): int
800  {
801  return (strlen($this->certificate_visibility) !== 0) ? $this->certificate_visibility : 0;
802  }
803 
807  public function setCertificateVisibility(int $a_value): void
808  {
809  $this->certificate_visibility = $a_value;
810  }
811 
815  public function saveCertificateVisibility(
816  int $a_value
817  ): void {
818  $ilDB = $this->db;
819 
820  $ilDB->manipulateF(
821  "UPDATE exc_data SET certificate_visibility = %s WHERE obj_id = %s",
822  array('integer', 'integer'),
823  array($a_value, $this->getId())
824  );
825  }
826 }
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 cloneAssignmentsOfExercise(int $a_old_exc_id, int $a_new_exc_id, array $a_crit_cat_map)
Clone assignments of exercise.
setActive(bool $a_status)
Set active for object.
static _writeReturned(int $a_obj_id, int $a_user_id, int $a_status)
Write returned status.
$res
Definition: ltiservices.php:69
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
MandatoryAssignmentsManager $mandatory_manager
Exercise assignment.
Class ilExerciseMembers.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setCompletionBySubmission(bool $bool)
This class handles all operations on files (attachments) in directory ilias_data/mail.
Filesystem $webFilesystem
setPassMode(string $a_val)
getMemberStatus(?int $a_user_id=null)
ilFileDataMail $file_obj
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _lookupName(int $a_user_id)
lookup user name
Exercise internal service.
static getInstancesByParentId(int $a_parent_id)
setTimestamp(int $a_timestamp)
loadLanguageModule(string $a_module)
Load language module.
const IL_CAL_UNIX
setCertificateVisibility(int $a_value)
InternalService $service
static getASCIIFilename(string $a_filename)
global $DIC
Definition: feed.php:28
updateAllUsersStatus()
Update status of all users.
ilAppEventHandler $app_event_handler
Class ilObjExercise.
cloneMetaData(ilObject $target_obj)
Copy meta data.
__construct(VocabulariesInterface $vocabularies)
updateUserStatus(int $a_user_id=0)
Update exercise status of user.
$GLOBALS["DIC"]
Definition: wac.php:31
static _lookupFinishedUserExercises(int $a_user_id)
Get all finished exercises for user.
ilExerciseMembers $members_obj
ilLanguage $lng
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, bool $a_has_submitted, array $a_valid_submissions=null)
ilDBInterface $db
saveCertificateVisibility(int $a_value)
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current status (notgraded|passed|failed)
const CLIENT_WEB_DIR
Definition: constants.php:47
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static getInstancesByExercise(int $a_exc_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupMark(int $a_usr_id, int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setNrMandatoryRandom(int $a_val)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
setShowSubmissions(bool $a_val)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static removeForObject(int $type, int $id)
Remove all notifications for given object.
exportGradesExcel()
Exports grades as excel.
setInstruction(string $a_instruction)
setDate(int $a_hour, int $a_minutes, int $a_day, int $a_month, int $a_year)
static _getContainerSettings(int $a_id)
setTutorFeedback(int $a_value)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)