ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjExercise.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "./Services/Object/classes/class.ilObject.php";
5 require_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
6 
19 class ilObjExercise extends ilObject
20 {
24  protected $user;
25 
26  public $file_obj;
27  public $members_obj;
28  public $files;
29 
30  public $timestamp;
31  public $hour;
32  public $minutes;
33  public $day;
34  public $month;
35  public $year;
36  public $instruction;
38 
39  public $tutor_feedback = 7; // [int]
40 
44 
53  protected $completion_by_submission = false;
54 
61  public function __construct($a_id = 0, $a_call_by_reference = true)
62  {
63  global $DIC;
64 
65  $this->db = $DIC->database();
66  $this->app_event_handler = $DIC["ilAppEventHandler"];
67  $this->lng = $DIC->language();
68  $this->user = $DIC->user();
69  $this->setPassMode("all");
70  $this->type = "exc";
71  parent::__construct($a_id, $a_call_by_reference);
72  }
73 
74  // SET, GET METHODS
75  public function setDate($a_hour, $a_minutes, $a_day, $a_month, $a_year)
76  {
77  $this->hour = (int) $a_hour;
78  $this->minutes = (int) $a_minutes;
79  $this->day = (int) $a_day;
80  $this->month = (int) $a_month;
81  $this->year = (int) $a_year;
82  $this->timestamp = mktime($this->hour, $this->minutes, 0, $this->month, $this->day, $this->year);
83  return true;
84  }
85  public function getTimestamp()
86  {
87  return $this->timestamp;
88  }
89  public function setTimestamp($a_timestamp)
90  {
91  $this->timestamp = $a_timestamp;
92  }
93  public function setInstruction($a_instruction)
94  {
95  $this->instruction = $a_instruction;
96  }
97  public function getInstruction()
98  {
99  return $this->instruction;
100  }
101 
107  public function setPassMode($a_val)
108  {
109  $this->pass_mode = $a_val;
110  }
111 
117  public function getPassMode()
118  {
119  return $this->pass_mode;
120  }
121 
127  public function setPassNr($a_val)
128  {
129  $this->pass_nr = $a_val;
130  }
131 
137  public function getPassNr()
138  {
139  return $this->pass_nr;
140  }
141 
147  public function setShowSubmissions($a_val)
148  {
149  $this->show_submissions = $a_val;
150  }
151 
157  public function getShowSubmissions()
158  {
159  return $this->show_submissions;
160  }
161 
162 
163  /* function getFiles()
164  {
165  return $this->files;
166  }*/
167 
168  public function checkDate()
169  {
170  return $this->hour == (int) date("H", $this->timestamp) and
171  $this->minutes == (int) date("i", $this->timestamp) and
172  $this->day == (int) date("d", $this->timestamp) and
173  $this->month == (int) date("m", $this->timestamp) and
174  $this->year == (int) date("Y", $this->timestamp);
175  }
176 
177  public function hasTutorFeedbackText()
178  {
179  return $this->tutor_feedback & self::TUTOR_FEEDBACK_TEXT;
180  }
181 
182  public function hasTutorFeedbackMail()
183  {
184  return $this->tutor_feedback & self::TUTOR_FEEDBACK_MAIL;
185  }
186 
187  public function hasTutorFeedbackFile()
188  {
189  return $this->tutor_feedback & self::TUTOR_FEEDBACK_FILE;
190  }
191 
192  protected function getTutorFeedback()
193  {
194  return $this->tutor_feedback;
195  }
196 
197  public function setTutorFeedback($a_value)
198  {
199  $this->tutor_feedback = $a_value;
200  }
201 
202  public function saveData()
203  {
204  $ilDB = $this->db;
205 
206  $ilDB->insert("exc_data", array(
207  "obj_id" => array("integer", $this->getId()),
208  "instruction" => array("clob", $this->getInstruction()),
209  "time_stamp" => array("integer", $this->getTimestamp()),
210  "pass_mode" => array("text", $this->getPassMode()),
211  "pass_nr" => array("text", $this->getPassNr()),
212  "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
213  'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
214  "certificate_visibility" => array("integer", (int) $this->getCertificateVisibility()),
215  "tfeedback" => array("integer", (int) $this->getTutorFeedback())
216  ));
217  return true;
218  }
219 
227  public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = false)
228  {
229  $ilDB = $this->db;
230 
231  // Copy settings
232  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
233  $new_obj->setInstruction($this->getInstruction());
234  $new_obj->setTimestamp($this->getTimestamp());
235  $new_obj->setPassMode($this->getPassMode());
236  $new_obj->saveData();
237  $new_obj->setPassNr($this->getPassNr());
238  $new_obj->setShowSubmissions($this->getShowSubmissions());
239  $new_obj->setCompletionBySubmission($this->isCompletionBySubmissionEnabled());
240  $new_obj->setTutorFeedback($this->getTutorFeedback());
241  $new_obj->setCertificateVisibility($this->getCertificateVisibility());
242  $new_obj->update();
243 
244  $new_obj->saveCertificateVisibility($this->getCertificateVisibility());
245 
246  // Copy criteria catalogues
247  $crit_cat_map = array();
248  include_once("./Modules/Exercise/classes/class.ilExcCriteriaCatalogue.php");
249  foreach (ilExcCriteriaCatalogue::getInstancesByParentId($this->getId()) as $crit_cat) {
250  $new_id = $crit_cat->cloneObject($new_obj->getId());
251  $crit_cat_map[$crit_cat->getId()] = $new_id;
252  }
253 
254  // Copy assignments
255  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
256  ilExAssignment::cloneAssignmentsOfExercise($this->getId(), $new_obj->getId(), $crit_cat_map);
257 
258  // Copy learning progress settings
259  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
260  $obj_settings = new ilLPObjSettings($this->getId());
261  $obj_settings->cloneSettings($new_obj->getId());
262  unset($obj_settings);
263 
264  // #18945
265  include_once "./Services/Certificate/classes/class.ilCertificate.php";
266  include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
267  $cert = new ilCertificate(new ilExerciseCertificateAdapter($this));
268  $newcert = new ilCertificate(new ilExerciseCertificateAdapter($new_obj));
269  $cert->cloneCertificate($newcert);
270 
271  return $new_obj;
272  }
273 
280  public function delete()
281  {
282  $ilDB = $this->db;
283  $ilAppEventHandler = $this->app_event_handler;
284 
285  // always call parent delete function first!!
286  if (!parent::delete()) {
287  return false;
288  }
289  // put here course specific stuff
290  $ilDB->manipulate("DELETE FROM exc_data " .
291  "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer"));
292 
293  include_once "Modules/Exercise/classes/class.ilExcCriteriaCatalogue.php";
295 
296  // remove all notifications
297  include_once "./Services/Notification/classes/class.ilNotification.php";
299 
300  $ilAppEventHandler->raise(
301  'Modules/Exercise',
302  'delete',
303  array('obj_id'=>$this->getId())
304  );
305 
306  return true;
307  }
308 
309  public function read()
310  {
311  $ilDB = $this->db;
312 
313  parent::read();
314 
315  $query = "SELECT * FROM exc_data " .
316  "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
317 
318  $res = $ilDB->query($query);
319  while ($row = $ilDB->fetchObject($res)) {
320  $this->setInstruction($row->instruction);
321  $this->setTimestamp($row->time_stamp);
322  $pm = ($row->pass_mode == "")
323  ? "all"
324  : $row->pass_mode;
325  $this->setPassMode($pm);
326  $this->setShowSubmissions($row->show_submissions);
327  if ($row->pass_mode == "nr") {
328  $this->setPassNr($row->pass_nr);
329  }
330  $this->setCompletionBySubmission($row->compl_by_submission == 1 ? true : false);
331  $this->setCertificateVisibility($row->certificate_visibility);
332  $this->setTutorFeedback($row->tfeedback);
333  }
334 
335  $this->members_obj = new ilExerciseMembers($this);
336 
337  return true;
338  }
339 
340  public function update()
341  {
342  $ilDB = $this->db;
343 
344  parent::update();
345 
346  if ($this->getPassMode() == "all") {
347  $pass_nr = null;
348  } else {
349  $pass_nr = $this->getPassNr();
350  }
351 
352  $ilDB->update("exc_data", array(
353  "instruction" => array("clob", $this->getInstruction()),
354  "time_stamp" => array("integer", $this->getTimestamp()),
355  "pass_mode" => array("text", $this->getPassMode()),
356  "pass_nr" => array("integer", $this->getPassNr()),
357  "show_submissions" => array("integer", (int) $this->getShowSubmissions()),
358  'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled()),
359  'tfeedback' => array('integer', (int) $this->getTutorFeedback()),
360  ), array(
361  "obj_id" => array("integer", $this->getId())
362  ));
363 
364  $this->updateAllUsersStatus();
365 
366  return true;
367  }
368 
372  public function sendAssignment(ilExAssignment $a_ass, $a_members)
373  {
374  $lng = $this->lng;
376 
377  $lng->loadLanguageModule("exc");
378 
379  // subject
380  $subject = $a_ass->getTitle()
381  ? $this->getTitle() . ": " . $a_ass->getTitle()
382  : $this->getTitle();
383 
384 
385  // body
386 
387  $body = $a_ass->getInstruction();
388  $body .= "\n\n";
389 
390  $body .= $lng->txt("exc_edit_until") . ": ";
391  $body .= (!$a_ass->getDeadline())
392  ? $lng->txt("exc_no_deadline_specified")
394  $body .= "\n\n";
395 
396  include_once "Services/Link/classes/class.ilLink.php";
397  $body .= ilLink::_getLink($this->getRefId(), "exc");
398 
399 
400  // files
401  $file_names = array();
402  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
403  $storage = new ilFSStorageExercise($a_ass->getExerciseId(), $a_ass->getId());
404  $files = $storage->getFiles();
405  if (count($files)) {
406  include_once "./Services/Mail/classes/class.ilFileDataMail.php";
407  $mfile_obj = new ilFileDataMail($GLOBALS['DIC']['ilUser']->getId());
408  foreach ($files as $file) {
409  $mfile_obj->copyAttachmentFile($file["fullpath"], $file["name"]);
410  $file_names[] = $file["name"];
411  }
412  }
413 
414  // recipients
415  $recipients = array();
416  foreach ($a_members as $member_id) {
417  $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
418  $recipients[] = $tmp_obj->getLogin();
419  unset($tmp_obj);
420  }
421  $recipients = implode(",", $recipients);
422 
423  // send mail
424  include_once "Services/Mail/classes/class.ilMail.php";
425  $tmp_mail_obj = new ilMail($ilUser->getId());
426  $message = $tmp_mail_obj->sendMail(
427  $recipients,
428  "",
429  "",
430  $subject,
431  $body,
432  $file_names,
433  array("normal")
434  );
435  unset($tmp_mail_obj);
436 
437  // remove tmp files
438  if (sizeof($file_names)) {
439  $mfile_obj->unlinkFiles($file_names);
440  unset($mfile_obj);
441  }
442 
443  // set recipients mail status
444  foreach ($a_members as $member_id) {
445  $member_status = $a_ass->getMemberStatus($member_id);
446  $member_status->setSent(true);
447  $member_status->update();
448  }
449 
450  return true;
451  }
452 
456  public function determinStatusOfUser($a_user_id = 0)
457  {
459 
460  if ($a_user_id == 0) {
461  $a_user_id = $ilUser->getId();
462  }
463 
464  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
466 
467  $passed_all_mandatory = true;
468  $failed_a_mandatory = false;
469  $cnt_passed = 0;
470  $cnt_notgraded = 0;
471  $passed_at_least_one = false;
472 
473  foreach ($ass as $a) {
474  $stat = $a->getMemberStatus($a_user_id)->getStatus();
475  if ($a->getMandatory() && ($stat == "failed" || $stat == "notgraded")) {
476  $passed_all_mandatory = false;
477  }
478  if ($a->getMandatory() && ($stat == "failed")) {
479  $failed_a_mandatory = true;
480  }
481  if ($stat == "passed") {
482  $cnt_passed++;
483  }
484  if ($stat == "notgraded") {
485  $cnt_notgraded++;
486  }
487  }
488 
489  if (count($ass) == 0) {
490  $passed_all_mandatory = false;
491  }
492 
493  if ($this->getPassMode() != "nr") {
494  //echo "5";
495  $overall_stat = "notgraded";
496  if ($failed_a_mandatory) {
497  //echo "6";
498  $overall_stat = "failed";
499  } elseif ($passed_all_mandatory && $cnt_passed > 0) {
500  //echo "7";
501  $overall_stat = "passed";
502  }
503  } else {
504  //echo "8";
505  $min_nr = $this->getPassNr();
506  $overall_stat = "notgraded";
507  //echo "*".$cnt_passed."*".$cnt_notgraded."*".$min_nr."*";
508  if ($failed_a_mandatory || ($cnt_passed + $cnt_notgraded < $min_nr)) {
509  //echo "9";
510  $overall_stat = "failed";
511  } elseif ($passed_all_mandatory && $cnt_passed >= $min_nr) {
512  //echo "A";
513  $overall_stat = "passed";
514  }
515  }
516 
517  $ret = array(
518  "overall_status" => $overall_stat,
519  "failed_a_mandatory" => $failed_a_mandatory);
520  //echo "<br>p:".$cnt_passed.":ng:".$cnt_notgraded;
521  //var_dump($ret);
522  return $ret;
523  }
524 
528  public function updateUserStatus($a_user_id = 0)
529  {
531 
532  if ($a_user_id == 0) {
533  $a_user_id = $ilUser->getId();
534  }
535 
536  $st = $this->determinStatusOfUser($a_user_id);
537 
538  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
540  $this->getId(),
541  $a_user_id,
542  $st["overall_status"]
543  );
544  }
545 
549  public function updateAllUsersStatus()
550  {
551  if (!is_object($this->members_obj)) {
552  $this->members_obj = new ilExerciseMembers($this);
553  }
554 
555  $mems = $this->members_obj->getMembers();
556  foreach ($mems as $mem) {
557  $this->updateUserStatus($mem);
558  }
559  }
560 
564  public function exportGradesExcel()
565  {
566  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
567  $ass_data = ilExAssignment::getInstancesByExercise($this->getId());
568 
569  include_once "./Services/Excel/classes/class.ilExcel.php";
570  $excel = new ilExcel();
571  $excel->addSheet($this->lng->txt("exc_status"));
572 
573 
574  //
575  // status
576  //
577 
578  // header row
579  $row = $cnt = 1;
580  $excel->setCell($row, 0, $this->lng->txt("name"));
581  foreach ($ass_data as $ass) {
582  $excel->setCell($row, $cnt++, $cnt-1);
583  }
584  $excel->setCell($row, $cnt++, $this->lng->txt("exc_total_exc"));
585  $excel->setCell($row, $cnt++, $this->lng->txt("exc_mark"));
586  $excel->setCell($row++, $cnt, $this->lng->txt("exc_comment_for_learner"));
587  $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
588 
589  // data rows
590  $mem_obj = new ilExerciseMembers($this);
591 
592  $filtered_members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
593  'etit_submissions_grades',
594  'edit_submissions_grades',
595  $this->getRefId(),
596  (array) $mem_obj->getMembers()
597  );
598 
599  foreach ((array) $filtered_members as $user_id) {
600  $mems[$user_id] = ilObjUser::_lookupName($user_id);
601  }
602  $mems = ilUtil::sortArray($mems, "lastname", "asc", false, true);
603 
604  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
605  foreach ($mems as $user_id => $d) {
606  $col = 0;
607 
608  // name
609  $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
610 
611  reset($ass_data);
612  foreach ($ass_data as $ass) {
613  $status = $ass->getMemberStatus($user_id)->getStatus();
614  $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
615  }
616 
617  // total status
618  $status = ilExerciseMembers::_lookupStatus($this->getId(), $user_id);
619  $excel->setCell($row, $col++, $this->lng->txt("exc_" . $status));
620 
621  // #18096
622  $marks_obj = new ilLPMarks($this->getId(), $user_id);
623  $excel->setCell($row, $col++, $marks_obj->getMark());
624  $excel->setCell($row++, $col, $marks_obj->getComment());
625  }
626 
627 
628  //
629  // mark
630  //
631 
632  $excel->addSheet($this->lng->txt("exc_mark"));
633 
634  // header row
635  $row = $cnt = 1;
636  $excel->setCell($row, 0, $this->lng->txt("name"));
637  foreach ($ass_data as $ass) {
638  $excel->setCell($row, $cnt++, $cnt-1);
639  }
640  $excel->setCell($row++, $cnt++, $this->lng->txt("exc_total_exc"));
641  $excel->setBold("A1:" . $excel->getColumnCoord($cnt) . "1");
642 
643  // data rows
644  reset($mems);
645  foreach ($mems as $user_id => $d) {
646  $col = 0;
647 
648  // name
649  $d = ilObjUser::_lookupName($user_id);
650  $excel->setCell($row, $col++, $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]");
651 
652  reset($ass_data);
653  foreach ($ass_data as $ass) {
654  $excel->setCell($row, $col++, $ass->getMemberStatus($user_id)->getMark());
655  }
656 
657  // total mark
658  $excel->setCell($row++, $col, ilLPMarks::_lookupMark($user_id, $this->getId()));
659  }
660 
661  $exc_name = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->getTitle()));
662  $excel->sendToClient($exc_name);
663  }
664 
668  public function sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback = false)
669  {
670  $user_ids = $a_user_id;
671  if (!is_array($user_ids)) {
672  $user_ids = array($user_ids);
673  }
674 
675  include_once("./Modules/Exercise/classes/class.ilExerciseMailNotification.php");
676 
677  $type = (bool) $a_is_text_feedback
680 
681  $not = new ilExerciseMailNotification();
682  $not->setType($type);
683  $not->setAssignmentId($a_ass_id);
684  $not->setObjId($this->getId());
685  if ($this->getRefId() > 0) {
686  $not->setRefId($this->getRefId());
687  }
688  $not->setRecipients($user_ids);
689  $not->send();
690  }
691 
701  {
703  }
704 
714  public function setCompletionBySubmission($bool)
715  {
716  $this->completion_by_submission = (bool) $bool;
717 
718  return $this;
719  }
720 
721  public function processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, $a_has_submitted, array $a_valid_submissions = null)
722  {
723  $a_has_submitted = (bool) $a_has_submitted;
724 
725  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
726  foreach ($a_user_ids as $user_id) {
727  $member_status = $a_ass->getMemberStatus($user_id);
728  $member_status->setReturned($a_has_submitted);
729  $member_status->update();
730 
731  ilExerciseMembers::_writeReturned($this->getId(), $user_id, $a_has_submitted);
732  }
733 
734  // re-evaluate exercise status
735  if ($this->isCompletionBySubmissionEnabled()) {
736  foreach ($a_user_ids as $user_id) {
737  $status = 'notgraded';
738  if ($a_has_submitted) {
739  if (!is_array($a_valid_submissions) ||
740  $a_valid_submissions[$user_id]) {
741  $status = 'passed';
742  }
743  }
744 
745  $member_status = $a_ass->getMemberStatus($user_id);
746  $member_status->setStatus($status);
747  $member_status->update();
748  }
749  }
750  }
751 
758  public static function _lookupFinishedUserExercises($a_user_id)
759  {
760  global $DIC;
761 
762  $ilDB = $DIC->database();
763 
764  $set = $ilDB->query("SELECT obj_id, status FROM exc_members" .
765  " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
766  " AND (status = " . $ilDB->quote("passed", "text") .
767  " OR status = " . $ilDB->quote("failed", "text") . ")");
768 
769  $all = array();
770  while ($row = $ilDB->fetchAssoc($set)) {
771  $all[$row["obj_id"]] = ($row["status"] == "passed");
772  }
773  return $all;
774  }
775 
776 
783  public function getCertificateVisibility()
784  {
785  return (strlen($this->certificate_visibility)) ? $this->certificate_visibility : 0;
786  }
787 
794  public function setCertificateVisibility($a_value)
795  {
796  $this->certificate_visibility = $a_value;
797  }
798 
805  public function saveCertificateVisibility($a_value)
806  {
807  $ilDB = $this->db;
808 
809  $affectedRows = $ilDB->manipulateF(
810  "UPDATE exc_data SET certificate_visibility = %s WHERE obj_id = %s",
811  array('integer', 'integer'),
812  array($a_value, $this->getId())
813  );
814  }
815 
822  public function hasUserCertificate($a_user_id)
823  {
824  // show certificate?
825  include_once "Services/Certificate/classes/class.ilCertificate.php";
827  $certificate_visible = $this->getCertificateVisibility();
828  // if not never
829  if ($certificate_visible != 2) {
830  // if passed only
831  include_once 'Modules/Exercise/classes/class.ilExerciseMembers.php';
832  $status = ilExerciseMembers::_lookupStatus($this->getId(), $a_user_id);
833  if ($certificate_visible == 1 && $status == "passed") {
834  return true;
835  }
836  // always (excluding notgraded)
837  elseif ($certificate_visible == 0 && $status != "notgraded") {
838  return true;
839  }
840  }
841  }
842  return false;
843  }
844 
850  public function hasAddToDesktop()
851  {
852  $exc_set = new ilSetting("excs");
853  return (bool) $exc_set->get("add_to_pd", true);
854  }
855 }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _lookupName($a_user_id)
lookup user name
setCompletionBySubmission($bool)
Enabled/Disable completion by submission.
getMemberStatus($a_user_id=null)
determinStatusOfUser($a_user_id=0)
Determine status of user.
static removeForObject($type, $id)
Remove all notifications for given object.
Exercise assignment.
getPassMode()
Get pass mode (all | nr)
Class ilExerciseMembers.
getCertificateVisibility()
Returns the visibility settings of the certificate.
global $DIC
Definition: saml.php:7
This class handles all operations on files (attachments) in directory ilias_data/mail.
getId()
Get assignment id.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getDeadline()
Get deadline (timestamp)
setDate($a_hour, $a_minutes, $a_day, $a_month, $a_year)
const IL_CAL_UNIX
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
setInstruction($a_instruction)
static _writeStatus($a_obj_id, $a_user_id, $a_status)
Write user status.
user()
Definition: user.php:4
getShowSubmissions()
Get whether submissions of learners should be shown to other learners after deadline.
static _writeReturned($a_obj_id, $a_user_id, $a_status)
Write returned status.
setCertificateVisibility($a_value)
Sets the visibility settings of the certificate.
updateAllUsersStatus()
Update status of all users.
getExerciseId()
Get exercise id.
Class ilObjExercise.
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res
setPassMode($a_val)
Set pass mode (all | nr)
getId()
get object id public
setTimestamp($a_timestamp)
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
This class handles base functions for mail handling.
static _lookupStatus($a_obj_id, $a_user_id)
Lookup current status (notgraded|passed|failed)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static getInstancesByExercise($a_exc_id)
getTitle()
get object title public
Date and time handling
$ilUser
Definition: imgupload.php:18
$query
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
setTutorFeedback($a_value)
sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback=false)
Send feedback file notification to user.
hasAddToDesktop()
Add to desktop after hand-in.
static cloneAssignmentsOfExercise($a_old_exc_id, $a_new_exc_id, array $a_crit_cat_map)
Clone assignments of exercise.
update($pash, $contents, Config $config)
isCompletionBySubmissionEnabled()
Checks whether completion by submission is enabled or not.
static _lookupFinishedUserExercises($a_user_id)
Get all exercises for user.
static isObjectActive($a_obj_id)
updateUserStatus($a_user_id=0)
Update exercise status of user.
setShowSubmissions($a_val)
Set whether submissions of learners should be shown to other learners after deadline.
static getInstancesByParentId($a_parent_id)
getInstruction()
Get instruction.
sendAssignment(ilExAssignment $a_ass, $a_members)
send exercise per mail to members
saveCertificateVisibility($a_value)
Saves the visibility settings of the certificate.
global $ilDB
$ret
Definition: parser.php:6
getRefId()
get reference id public
exportGradesExcel()
Exports grades as excel.
Create PDF certificates.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getPassNr()
Get number of assignments that must be passed to pass the exercise.
static _lookupMark($a_usr_id, $a_obj_id)
hasUserCertificate($a_user_id)
Check if given user has certificate to show/download.
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, $a_has_submitted, array $a_valid_submissions=null)
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone exercise (no member data)
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
setPassNr($a_val)
Set number of assignments that must be passed to pass the exercise.