ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 hasTeam ()
 
 setId ($a_val)
 Set assignment id. More...
 
 getId ()
 Get assignment id. More...
 
 setExerciseId ($a_val)
 Set exercise id. More...
 
 getExerciseId ()
 Get exercise id. More...
 
 setStartTime ($a_val)
 Set start time (timestamp) More...
 
 getStartTime ()
 Get start time (timestamp) More...
 
 setDeadline ($a_val)
 Set deadline (timestamp) More...
 
 getDeadline ()
 Get deadline (timestamp) More...
 
 setExtendedDeadline ($a_val)
 Set extended deadline (timestamp) More...
 
 getExtendedDeadline ()
 Get extended deadline (timestamp) More...
 
 setInstruction ($a_val)
 Set instruction. More...
 
 getInstruction ()
 Get instruction. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setMandatory ($a_val)
 Set mandatory. More...
 
 getMandatory ()
 Get mandatory. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setType ($a_value)
 Set type. More...
 
 getType ()
 Get type. More...
 
 isValidType ($a_value)
 Is given type valid? More...
 
 setPeerReview ($a_value)
 Toggle peer review. More...
 
 getPeerReview ()
 Get peer review status. More...
 
 setPeerReviewMin ($a_value)
 Set peer review minimum. More...
 
 getPeerReviewMin ()
 Get peer review minimum. More...
 
 setPeerReviewSimpleUnlock ($a_value)
 Set peer review simple unlock. More...
 
 getPeerReviewSimpleUnlock ()
 Get peer review simple unlock. More...
 
 setPeerReviewDeadline ($a_val)
 Set peer review deadline (timestamp) More...
 
 getPeerReviewDeadline ()
 Get peer review deadline (timestamp) More...
 
 setPeerReviewValid ($a_value)
 Set peer review validation. More...
 
 getPeerReviewValid ()
 Get peer review validatiob. More...
 
 setPeerReviewRating ($a_val)
 Set peer review rating. More...
 
 hasPeerReviewRating ()
 Get peer review rating status. More...
 
 setPeerReviewText ($a_val)
 Set peer review text. More...
 
 hasPeerReviewText ()
 Get peer review text status. More...
 
 setPeerReviewFileUpload ($a_val)
 Set peer review file upload. More...
 
 hasPeerReviewFileUpload ()
 Get peer review file upload status. More...
 
 setPeerReviewPersonalized ($a_val)
 Set peer review personalized. More...
 
 hasPeerReviewPersonalized ()
 Get peer review personalized status. More...
 
 setPeerReviewChars ($a_value)
 Set peer review minimum characters. More...
 
 getPeerReviewChars ()
 Get peer review minimum characters. More...
 
 setPeerReviewCriteriaCatalogue ($a_value)
 Set peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogue ()
 Get peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogueItems ()
 
 setFeedbackFile ($a_value)
 Set (global) feedback file. More...
 
 getFeedbackFile ()
 Get (global) feedback file. More...
 
 setFeedbackCron ($a_value)
 Toggle (global) feedback file cron. More...
 
 hasFeedbackCron ()
 Get (global) feedback file cron status. More...
 
 setFeedbackDate ($a_value)
 Set (global) feedback file availability date. More...
 
 getFeedbackDate ()
 Get (global) feedback file availability date. More...
 
 setTeamTutor ($a_value)
 Set team management by tutor. More...
 
 getTeamTutor ()
 Get team management by tutor. More...
 
 setMaxFile ($a_value)
 Set max number of uploads. More...
 
 getMaxFile ()
 Get max number of uploads. More...
 
 read ()
 Read from db. More...
 
 save ()
 Save assignment. More...
 
 update ()
 Update. More...
 
 delete ()
 Delete assignment. More...
 
 cloneAssignmentsOfExercise ($a_old_exc_id, $a_new_exc_id, array $a_crit_cat_map)
 Clone assignments of exercise. More...
 
 getFiles ()
 Get files. More...
 
 saveAssOrderOfExercise ($a_ex_id, $a_order)
 Save ordering of all assignments of an exercise. More...
 
 orderAssByDeadline ($a_ex_id)
 Order assignments by deadline date. More...
 
 countMandatory ($a_ex_id)
 Order assignments by deadline date. More...
 
 getMemberListData ()
 get member list data More...
 
 uploadAssignmentFiles ($a_files)
 Upload assignment files (from creation form) More...
 
 sendMultiFeedbackStructureFile ()
 Create member status record for a new assignment for all participants. More...
 
 uploadMultiFeedbackFile ($a_file)
 Upload multi feedback file. More...
 
 getMultiFeedbackFiles ($a_user_id=0)
 Get multi feedback files (of uploader) More...
 
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory. More...
 
 saveMultiFeedbackFiles ($a_files, ilObjExercise $a_exc)
 Save multi feedback files. More...
 
 afterDeadline ()
 
 afterDeadlineStrict ()
 
 beforeDeadline ()
 
 notStartedYet ()
 
 getGlobalFeedbackFileStoragePath ()
 
 deleteGlobalFeedbackFile ()
 
 handleGlobalFeedbackFileUpload (array $a_file)
 
 getGlobalFeedbackFilePath ()
 
 getMemberStatus ($a_user_id=null)
 
 recalculateLateSubmissions ()
 

Static Public Member Functions

static getInstancesByExercise ($a_exc_id)
 
static getAssignmentDataOfExercise ($a_exc_id)
 Get assignments data of an exercise in an array. More...
 
static lookupMaxOrderNrForEx ($a_exc_id)
 Select the maximum order nr for an exercise. More...
 
static lookupAssignmentOnline ($a_ass_id)
 Check if assignment is online. More...
 
static lookupTitle ($a_id)
 Lookup title. More...
 
static lookupType ($a_id)
 Lookup type. More...
 
static lookupUpdatedSubmission ($ass_id, $member_id)
 Check whether student has upload new files after tutor has set the exercise to another than notgraded. More...
 
static createNewUserRecords ($a_user_id, $a_exc_id)
 Create member status record for a new participant for all assignments. More...
 
static createNewAssignmentRecords ($a_ass_id, $a_exc)
 Create member status record for a new assignment for all participants. More...
 
static getPendingFeedbackNotifications ()
 
static sendFeedbackNotifications ($a_ass_id, $a_user_id=null)
 

Data Fields

const TYPE_UPLOAD = 1
 
const TYPE_BLOG = 2
 
const TYPE_PORTFOLIO = 3
 
const TYPE_UPLOAD_TEAM = 4
 
const TYPE_TEXT = 5
 
const FEEDBACK_DATE_DEADLINE = 1
 
const FEEDBACK_DATE_SUBMISSION = 2
 
const PEER_REVIEW_VALID_NONE = 1
 
const PEER_REVIEW_VALID_ONE = 2
 
const PEER_REVIEW_VALID_ALL = 3
 

Protected Member Functions

 initFromDB (array $a_set)
 Import DB record. More...
 
 handleCalendarEntries ($a_event)
 Handle calendar entries for deadline(s) More...
 

Protected Attributes

 $id
 
 $exc_id
 
 $type
 
 $start_time
 
 $deadline
 
 $deadline2
 
 $instruction
 
 $title
 
 $mandatory
 
 $order_nr
 
 $peer
 
 $peer_min
 
 $peer_unlock
 
 $peer_dl
 
 $peer_valid
 
 $peer_file
 
 $peer_personal
 
 $peer_char
 
 $peer_text
 
 $peer_rating
 
 $peer_crit_cat
 
 $feedback_file
 
 $feedback_cron
 
 $feedback_date
 
 $team_tutor = false
 
 $max_file
 
 $member_status = array()
 

Static Private Member Functions

static lookup ($a_id, $a_field)
 Private lookup. More...
 

Detailed Description

Exercise assignment.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilExAssignment.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

Definition at line 58 of file class.ilExAssignment.php.

References read(), setFeedbackDate(), setId(), and setType().

59  {
60  $this->setType(self::TYPE_UPLOAD);
61  $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
62 
63  if ($a_id > 0)
64  {
65  $this->setId($a_id);
66  $this->read();
67  }
68  }
setType($a_value)
Set type.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setId($a_val)
Set assignment id.
read()
Read from db.
+ Here is the call graph for this function:

Member Function Documentation

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

Definition at line 1631 of file class.ilExAssignment.php.

References $deadline.

Referenced by ilExAssignmentGUI\addPublicSubmissions(), and afterDeadlineStrict().

1632  {
1633  // no deadline === true
1634  $deadline = max($this->deadline, $this->deadline2);
1635  return ($deadline - time() <= 0);
1636  }
+ Here is the caller graph for this function:

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict ( )

Definition at line 1638 of file class.ilExAssignment.php.

References $deadline, and afterDeadline().

Referenced by ilExAssignmentGUI\addSubmission(), and beforeDeadline().

1639  {
1640  // no deadline === false
1641  $deadline = max($this->deadline, $this->deadline2);
1642  return ($deadline > 0 &&
1643  $this->afterDeadline());
1644  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

Definition at line 1646 of file class.ilExAssignment.php.

References afterDeadlineStrict().

Referenced by ilExAssignmentGUI\addSchedule().

1647  {
1648  // no deadline === true
1649  return !$this->afterDeadlineStrict();
1650  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

Definition at line 1424 of file class.ilExAssignment.php.

References $ilUser, $lng, ilUtil\delDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

1425  {
1426  global $lng, $ilUser;
1427 
1428  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1429  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1430  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1431  ilUtil::delDir($mfu);
1432  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

ilExAssignment::cloneAssignmentsOfExercise (   $a_old_exc_id,
  $a_new_exc_id,
array  $a_crit_cat_map 
)

Clone assignments of exercise.

Parameters

Definition at line 912 of file class.ilExAssignment.php.

References $d, ilFSStorageExercise\create(), ilFSStorageExercise\getGlobalFeedbackPath(), ilFileSystemStorage\getPath(), and ilUtil\rCopy().

Referenced by ilObjExercise\cloneObject().

913  {
914  $ass_data = self::getInstancesByExercise($a_old_exc_id);
915  foreach ($ass_data as $d)
916  {
917  // clone assignment
918  $new_ass = new ilExAssignment();
919  $new_ass->setExerciseId($a_new_exc_id);
920  $new_ass->setTitle($d->getTitle());
921  $new_ass->setDeadline($d->getDeadline());
922  $new_ass->setExtendedDeadline($d->getExtendedDeadline());
923  $new_ass->setInstruction($d->getInstruction());
924  $new_ass->setMandatory($d->getMandatory());
925  $new_ass->setOrderNr($d->getOrderNr());
926  $new_ass->setStartTime($d->getStartTime());
927  $new_ass->setType($d->getType());
928  $new_ass->setPeerReview($d->getPeerReview());
929  $new_ass->setPeerReviewMin($d->getPeerReviewMin());
930  $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
931  $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
932  $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
933  $new_ass->setPeerReviewValid($d->getPeerReviewValid());
934  $new_ass->setPeerReviewChars($d->getPeerReviewChars());
935  $new_ass->setPeerReviewText($d->hasPeerReviewText());
936  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
937  $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
938  $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
939  $new_ass->setPeerReviewText($d->hasPeerReviewText());
940  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
941  $new_ass->setFeedbackFile($d->getFeedbackFile());
942  $new_ass->setFeedbackDate($d->getFeedbackDate());
943  $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
944  $new_ass->setTeamTutor($d->getTeamTutor());
945  $new_ass->setMaxFile($d->getMaxFile());
946 
947  // criteria catalogue(s)
948  if($d->getPeerReviewCriteriaCatalogue() &&
949  array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map))
950  {
951  $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
952  }
953 
954  $new_ass->save();
955 
956  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
957  $old_storage = new ilFSStorageExercise($a_old_exc_id, (int) $d->getId());
958  $new_storage = new ilFSStorageExercise($a_new_exc_id, (int) $new_ass->getId());
959  $new_storage->create();
960 
961  // clone assignment files
962  if (is_dir($old_storage->getPath()))
963  {
964  ilUtil::rCopy($old_storage->getPath(), $new_storage->getPath());
965  }
966 
967  // clone global feedback file
968  if (is_dir($old_storage->getGlobalFeedbackPath()))
969  {
970  ilUtil::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
971  }
972  }
973  }
Exercise assignment.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ countMandatory()

ilExAssignment::countMandatory (   $a_ex_id)

Order assignments by deadline date.

Definition at line 1100 of file class.ilExAssignment.php.

References $ilDB.

Referenced by ilObjExerciseGUI\initEditCustomForm().

1101  {
1102  global $ilDB;
1103 
1104  $set = $ilDB->query("SELECT count(*) cntm FROM exc_assignment ".
1105  " WHERE exc_id = ".$ilDB->quote($a_ex_id, "integer").
1106  " AND mandatory = ".$ilDB->quote(1, "integer")
1107  );
1108  $rec = $ilDB->fetchAssoc($set);
1109  return $rec["cntm"];
1110  }
global $ilDB
+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

static ilExAssignment::createNewAssignmentRecords (   $a_ass_id,
  $a_exc 
)
static

Create member status record for a new assignment for all participants.

Definition at line 1223 of file class.ilExAssignment.php.

References $ilDB.

1224  {
1225  global $ilDB;
1226 
1227  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1228  $exmem = new ilExerciseMembers($a_exc);
1229  $mems = $exmem->getMembers();
1230 
1231  foreach ($mems as $mem)
1232  {
1233  $ilDB->replace("exc_mem_ass_status", array(
1234  "ass_id" => array("integer", $a_ass_id),
1235  "usr_id" => array("integer", $mem)
1236  ), array(
1237  "status" => array("text", "notgraded")
1238  ));
1239  }
1240  }
Class ilExerciseMembers.
global $ilDB

◆ createNewUserRecords()

static ilExAssignment::createNewUserRecords (   $a_user_id,
  $a_exc_id 
)
static

Create member status record for a new participant for all assignments.

Definition at line 1203 of file class.ilExAssignment.php.

References $ilDB.

Referenced by ilExerciseMembers\assignMember().

1204  {
1205  global $ilDB;
1206 
1207  $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1208  foreach ($ass_data as $ass)
1209  {
1210 //echo "-".$ass["id"]."-".$a_user_id."-";
1211  $ilDB->replace("exc_mem_ass_status", array(
1212  "ass_id" => array("integer", $ass["id"]),
1213  "usr_id" => array("integer", $a_user_id)
1214  ), array(
1215  "status" => array("text", "notgraded")
1216  ));
1217  }
1218  }
global $ilDB
+ Here is the caller graph for this function:

◆ delete()

ilExAssignment::delete ( )

Delete assignment.

Definition at line 847 of file class.ilExAssignment.php.

References $ilDB, deleteGlobalFeedbackFile(), getExerciseId(), and handleCalendarEntries().

848  {
849  global $ilDB;
850 
851  $this->deleteGlobalFeedbackFile();
852 
853  $ilDB->manipulate("DELETE FROM exc_assignment WHERE ".
854  " id = ".$ilDB->quote($this->getId(), "integer")
855  );
856  $exc = new ilObjExercise($this->getExerciseId(), false);
857  $exc->updateAllUsersStatus();
858 
859  $this->handleCalendarEntries("delete");
860  }
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getExerciseId()
Get exercise id.
Class ilObjExercise.
global $ilDB
+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

Definition at line 1669 of file class.ilExAssignment.php.

References ilUtil\delDir(), and getGlobalFeedbackFileStoragePath().

Referenced by delete(), and ilExAssignmentEditorGUI\importFormToAssignment().

1670  {
1672  }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise (   $a_exc_id)
static

Get assignments data of an exercise in an array.

Definition at line 866 of file class.ilExAssignment.php.

References $data, and $ilDB.

Referenced by ilAssignmentsTableGUI\__construct(), ilExParticipantTableGUI\__construct(), ilExAssignmentTeam\getAdoptableTeamAssignments(), ilExerciseXMLParser\ilExerciseXMLParser(), ilObjExerciseGUI\infoScreen(), ilExerciseManagementGUI\showParticipantObject(), and ilExerciseXMLWriter\start().

867  {
868  global $ilDB;
869 
870  // should be changed to self::getInstancesByExerciseId()
871 
872  $set = $ilDB->query("SELECT * FROM exc_assignment ".
873  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer").
874  " ORDER BY order_nr ASC");
875  $data = array();
876 
877  $order_val = 10;
878  while ($rec = $ilDB->fetchAssoc($set))
879  {
880 
881  $data[] = array(
882  "id" => $rec["id"],
883  "exc_id" => $rec["exc_id"],
884  "deadline" => $rec["time_stamp"],
885  "deadline2" => $rec["deadline2"],
886  "instruction" => $rec["instruction"],
887  "title" => $rec["title"],
888  "start_time" => $rec["start_time"],
889  "order_val" => $order_val,
890  "mandatory" => $rec["mandatory"],
891  "type" => $rec["type"],
892  "peer" => $rec["peer"],
893  "peer_min" => $rec["peer_min"],
894  "peer_dl" => $rec["peer_dl"],
895  "peer_file" => $rec["peer_file"],
896  "peer_prsl" => $rec["peer_prsl"],
897  "fb_file" => $rec["fb_file"],
898  "fb_date" => $rec["fb_date"],
899  "fb_cron" => $rec["fb_cron"],
900  );
901  $order_val += 10;
902  }
903  return $data;
904  }
$data
global $ilDB
+ Here is the caller graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

Get deadline (timestamp)

Returns
int deadline (timestamp)

Definition at line 175 of file class.ilExAssignment.php.

References $deadline.

Referenced by ilExAssignmentGUI\addSchedule(), ilExAssignmentGUI\getOverviewHeader(), handleCalendarEntries(), recalculateLateSubmissions(), save(), ilObjExercise\sendAssignment(), and update().

176  {
177  return $this->deadline;
178  }
+ Here is the caller graph for this function:

◆ getExerciseId()

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

Get extended deadline (timestamp)

Returns
int

Definition at line 199 of file class.ilExAssignment.php.

References $deadline2.

Referenced by recalculateLateSubmissions(), save(), and update().

200  {
201  return $this->deadline2;
202  }
+ Here is the caller graph for this function:

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

Get (global) feedback file availability date.

Returns
int

Definition at line 645 of file class.ilExAssignment.php.

References $feedback_date.

Referenced by ilExAssignmentGUI\addSubmission(), save(), and update().

646  {
647  return (int)$this->feedback_date;
648  }
+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

Get (global) feedback file.

Returns
int

Definition at line 605 of file class.ilExAssignment.php.

References $feedback_file.

Referenced by ilExAssignmentGUI\addSubmission(), ilExAssignmentGUI\addSubmissionFeedback(), getGlobalFeedbackFilePath(), save(), and update().

606  {
607  return (string)$this->feedback_file;
608  }
+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

Get files.

Definition at line 978 of file class.ilExAssignment.php.

References getExerciseId(), and getId().

Referenced by ilExAssignmentGUI\addFiles().

979  {
980  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
981  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
982  return $storage->getFiles();
983  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

Definition at line 1686 of file class.ilExAssignment.php.

References $file, $path, getFeedbackFile(), and getGlobalFeedbackFileStoragePath().

1687  {
1688  $file = $this->getFeedbackFile();
1689  if($file)
1690  {
1692  return $path."/".$file;
1693  }
1694  }
print $file
getFeedbackFile()
Get (global) feedback file.
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

Definition at line 1662 of file class.ilExAssignment.php.

References getExerciseId(), and getId().

Referenced by deleteGlobalFeedbackFile(), getGlobalFeedbackFilePath(), and handleGlobalFeedbackFileUpload().

1663  {
1664  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1665  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1666  return $storage->getGlobalFeedbackPath();
1667  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

◆ getInstancesByExercise()

static ilExAssignment::getInstancesByExercise (   $a_exc_id)
static

Definition at line 70 of file class.ilExAssignment.php.

References $data, and $ilDB.

Referenced by ilExGradesTableGUI\__construct(), ilExSubmission\deleteUser(), ilObjExercise\determinStatusOfUser(), ilObjExercise\exportGradesExcel(), ilExcCriteriaCatalogueTableGUI\getItems(), ilExerciseManagementGUI\membersObject(), and ilObjExerciseGUI\showOverviewObject().

71  {
72  global $ilDB;
73 
74  $set = $ilDB->query("SELECT * FROM exc_assignment ".
75  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer").
76  " ORDER BY order_nr ASC");
77  $data = array();
78 
79  $order_val = 10;
80  while ($rec = $ilDB->fetchAssoc($set))
81  {
82  // ???
83  $rec["order_val"] = $order_val;
84 
85  $ass = new self();
86  $ass->initFromDB($rec);
87  $data[] = $ass;
88 
89  $order_val += 10;
90  }
91 
92  return $data;
93  }
$data
global $ilDB
+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

Get instruction.

Returns
string instruction

Definition at line 219 of file class.ilExAssignment.php.

References $instruction.

Referenced by ilExAssignmentGUI\addInstructions(), save(), ilObjExercise\sendAssignment(), and update().

220  {
221  return $this->instruction;
222  }
+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

Get mandatory.

Returns
int mandatory

Definition at line 259 of file class.ilExAssignment.php.

References $mandatory.

Referenced by ilExAssignmentGUI\getOverviewHeader(), save(), and update().

260  {
261  return $this->mandatory;
262  }
+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

Get max number of uploads.

Returns
bool

Definition at line 689 of file class.ilExAssignment.php.

References $max_file.

Referenced by save(), and update().

690  {
691  return $this->max_file;
692  }
+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

get member list data

Definition at line 1155 of file class.ilExAssignment.php.

References $ilDB, and getId().

1156  {
1157  global $ilDB;
1158 
1159  $mem = array();
1160 
1161  // first get list of members from member table
1162  $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login".
1163  " FROM exc_members excm".
1164  " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)".
1165  " WHERE excm.obj_id = ".$ilDB->quote($this->getExerciseId(), "integer"));
1166  while($rec = $ilDB->fetchAssoc($set))
1167  {
1168  $mem[$rec["usr_id"]] =
1169  array(
1170  "name" => $rec["lastname"].", ".$rec["firstname"],
1171  "login" => $rec["login"],
1172  "usr_id" => $rec["usr_id"],
1173  "lastname" => $rec["lastname"],
1174  "firstname" => $rec["firstname"]
1175  );
1176  }
1177 
1178  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1179 
1180  $q = "SELECT * FROM exc_mem_ass_status ".
1181  "WHERE ass_id = ".$ilDB->quote($this->getId(), "integer");
1182  $set = $ilDB->query($q);
1183  while($rec = $ilDB->fetchAssoc($set))
1184  {
1185  if (isset($mem[$rec["usr_id"]]))
1186  {
1187  $sub = new ilExSubmission($this, $rec["usr_id"]);
1188 
1189  $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1190  $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1191  $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1192  $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1193  $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1194  $mem[$rec["usr_id"]]["status"] = $rec["status"];
1195  }
1196  }
1197  return $mem;
1198  }
getId()
Get assignment id.
global $ilDB
Exercise submission.
+ Here is the call graph for this function:

◆ getMemberStatus()

ilExAssignment::getMemberStatus (   $a_user_id = null)

Definition at line 1696 of file class.ilExAssignment.php.

References $ilUser, and getId().

Referenced by ilExAssignmentGUI\addSubmissionFeedback(), ilExAssignmentGUI\getOverviewHeader(), ilObjExercise\processExerciseStatus(), and ilObjExercise\sendAssignment().

1697  {
1698  global $ilUser;
1699 
1700  if(!$a_user_id)
1701  {
1702  $a_user_id = $ilUser->getId();
1703  }
1704  if(!array_key_exists($a_user_id, $this->member_status))
1705  {
1706  include_once "Modules/Exercise/classes/class.ilExAssignmentMemberStatus.php";
1707  $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
1708  }
1709  return $this->member_status[$a_user_id];
1710  }
Exercise assignment member status.
getId()
Get assignment id.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiFeedbackFiles()

ilExAssignment::getMultiFeedbackFiles (   $a_user_id = 0)

Get multi feedback files (of uploader)

Parameters
int$a_user_iduser id of uploader
Returns
array array of user files (keys: lastname, firstname, user_id, login, file)

Definition at line 1351 of file class.ilExAssignment.php.

References $ilUser, ilObjUser\_lookupName(), ilUtil\getDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

1352  {
1353  global $ilUser;
1354 
1355  if ($a_user_id == 0)
1356  {
1357  $a_user_id = $ilUser->getId();
1358  }
1359 
1360  $mf_files = array();
1361 
1362  // get members
1363  $exc = new ilObjExercise($this->getExerciseId(), false);
1364  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1365  $exmem = new ilExerciseMembers($exc);
1366  $mems = $exmem->getMembers();
1367 
1368  // read mf directory
1369  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1370  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1371  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1372 
1373  // get subdir that starts with multi_feedback
1374  $subdirs = ilUtil::getDir($mfu);
1375  $subdir = "notfound";
1376  foreach ($subdirs as $s => $j)
1377  {
1378  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
1379  {
1380  $subdir = $s;
1381  }
1382  }
1383 
1384  $items = ilUtil::getDir($mfu."/".$subdir);
1385  foreach ($items as $k => $i)
1386  {
1387  // check directory
1388  if ($i["type"] == "dir" && !in_array($k, array(".", "..")))
1389  {
1390  // check if valid member id is given
1391  $parts = explode("_", $i["entry"]);
1392  $user_id = (int) $parts[count($parts) - 1];
1393  if (in_array($user_id, $mems))
1394  {
1395  // read dir of user
1396  $name = ilObjUser::_lookupName($user_id);
1397  $files = ilUtil::getDir($mfu."/".$subdir."/".$k);
1398  foreach ($files as $k2 => $f)
1399  {
1400  // append files to array
1401  if ($f["type"] == "file" && substr($k2, 0, 1) != ".")
1402  {
1403  $mf_files[] = array(
1404  "lastname" => $name["lastname"],
1405  "firstname" => $name["firstname"],
1406  "login" => $name["login"],
1407  "user_id" => $name["user_id"],
1408  "full_path" => $mfu."/".$subdir."/".$k."/".$k2,
1409  "file" => $k2);
1410  }
1411  }
1412  }
1413  }
1414  }
1415  return $mf_files;
1416  }
static _lookupName($a_user_id)
lookup user name
Class ilExerciseMembers.
getId()
Get assignment id.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
getExerciseId()
Get exercise id.
Class ilObjExercise.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

Get order nr.

Returns
int order nr

Definition at line 279 of file class.ilExAssignment.php.

References $order_nr.

Referenced by save(), and update().

280  {
281  return $this->order_nr;
282  }
+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

Get peer review status.

Returns
bool

Definition at line 343 of file class.ilExAssignment.php.

References $peer.

Referenced by ilExAssignmentGUI\getOverviewHeader(), handleCalendarEntries(), save(), and update().

344  {
345  return (bool)$this->peer;
346  }
+ Here is the caller graph for this function:

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

Get peer review minimum characters.

Returns
int

Definition at line 526 of file class.ilExAssignment.php.

References $peer_char.

Referenced by save(), and update().

527  {
528  return $this->peer_char;
529  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

Get peer review criteria catalogue id.

Returns
int

Definition at line 549 of file class.ilExAssignment.php.

Referenced by save(), and update().

550  {
551  return $this->crit_cat;
552  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogueItems()

ilExAssignment::getPeerReviewCriteriaCatalogueItems ( )

Definition at line 554 of file class.ilExAssignment.php.

References $res, ilExcCriteria\getInstanceByType(), and ilExcCriteria\getInstancesByParentId().

555  {
556  include_once "Modules/Exercise/classes/class.ilExcCriteria.php";
557 
558  if($this->crit_cat)
559  {
560  return ilExcCriteria::getInstancesByParentId($this->crit_cat);
561  }
562  else
563  {
564  $res = array();
565 
566  if($this->peer_rating)
567  {
569  }
570 
571  if($this->peer_text)
572  {
573  $crit = ilExcCriteria::getInstanceByType("text");
574  if($this->peer_char)
575  {
576  $crit->setMinChars($this->peer_char);
577  }
578  $res[] = $crit;
579  }
580 
581  if($this->peer_file)
582  {
584  }
585 
586  return $res;
587  }
588  }
static getInstanceByType($a_type)
static getInstancesByParentId($a_parent_id)
+ Here is the call graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

Get peer review deadline (timestamp)

Returns
int deadline (timestamp)

Definition at line 403 of file class.ilExAssignment.php.

References $peer_dl.

Referenced by ilExAssignmentGUI\getOverviewHeader(), handleCalendarEntries(), save(), and update().

404  {
405  return $this->peer_dl;
406  }
+ Here is the caller graph for this function:

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

Get peer review minimum.

Returns
int

Definition at line 363 of file class.ilExAssignment.php.

References $peer_min.

Referenced by save(), and update().

364  {
365  return (int)$this->peer_min;
366  }
+ Here is the caller graph for this function:

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

Get peer review simple unlock.

Returns
bool

Definition at line 383 of file class.ilExAssignment.php.

References $peer_unlock.

Referenced by save(), and update().

384  {
385  return (bool)$this->peer_unlock;
386  }
+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

Get peer review validatiob.

Returns
int

Definition at line 423 of file class.ilExAssignment.php.

References $peer_valid.

Referenced by save(), and update().

424  {
425  return (int)$this->peer_valid;
426  }
+ Here is the caller graph for this function:

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

Definition at line 1552 of file class.ilExAssignment.php.

References $ilDB, $res, and $row.

Referenced by ilExcCronFeedbackNotification\run().

1553  {
1554  global $ilDB;
1555 
1556  $res = array();
1557 
1558  $set = $ilDB->query("SELECT id,fb_file FROM exc_assignment".
1559  " WHERE fb_cron = ".$ilDB->quote(1, "integer").
1560  " AND fb_date = ".$ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer").
1561  " AND time_stamp IS NOT NULL".
1562  " AND time_stamp > ".$ilDB->quote(0, "integer").
1563  " AND time_stamp < ".$ilDB->quote(time(), "integer").
1564  " AND fb_cron_done = ".$ilDB->quote(0, "integer"));
1565  while($row = $ilDB->fetchAssoc($set))
1566  {
1567  if(trim($row["fb_file"]))
1568  {
1569  $res[] = $row["id"];
1570  }
1571  }
1572 
1573  return $res;
1574  }
global $ilDB
+ Here is the caller graph for this function:

◆ getStartTime()

ilExAssignment::getStartTime ( )

Get start time (timestamp)

Returns
int start time (timestamp)

Definition at line 155 of file class.ilExAssignment.php.

References $start_time.

Referenced by ilExAssignmentGUI\addSchedule(), ilExAssignmentGUI\getOverviewHeader(), save(), and update().

156  {
157  return $this->start_time;
158  }
+ Here is the caller graph for this function:

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

Get team management by tutor.

Returns
bool

Definition at line 665 of file class.ilExAssignment.php.

References $team_tutor.

Referenced by save(), and update().

666  {
667  return $this->team_tutor;
668  }
+ Here is the caller graph for this function:

◆ getTitle()

◆ getType()

ilExAssignment::getType ( )

Get type.

Returns
int

Definition at line 307 of file class.ilExAssignment.php.

References $type.

Referenced by ilExSubmission\downloadAllAssignmentFiles(), save(), and update().

308  {
309  return $this->type;
310  }
+ Here is the caller graph for this function:

◆ handleCalendarEntries()

ilExAssignment::handleCalendarEntries (   $a_event)
protected

Handle calendar entries for deadline(s)

Parameters
string$a_event

Definition at line 1498 of file class.ilExAssignment.php.

References getDeadline(), getExerciseId(), getId(), getPeerReview(), getPeerReviewDeadline(), getTitle(), IL_CAL_TRANSLATION_SYSTEM, and IL_CAL_UNIX.

Referenced by delete(), save(), and update().

1499  {
1500  global $ilAppEventHandler;
1501 
1502  $dl_id = $this->getId()."0";
1503  $fbdl_id = $this->getId()."1";
1504 
1505  $context_ids = array($dl_id, $fbdl_id);
1506  $apps = array();
1507 
1508  if($a_event != "delete")
1509  {
1510  include_once "Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php";
1511 
1512  if($this->getDeadline())
1513  {
1514  $app = new ilCalendarAppointmentTemplate($dl_id);
1515  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1516  $app->setSubtitle("cal_exc_deadline");
1517  $app->setTitle($this->getTitle());
1518  $app->setFullday(false);
1519  $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1520 
1521  $apps[] = $app;
1522  }
1523 
1524  if($this->getPeerReview() &&
1525  $this->getPeerReviewDeadline())
1526  {
1527  $app = new ilCalendarAppointmentTemplate($fbdl_id);
1528  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1529  $app->setSubtitle("cal_exc_peer_review_deadline");
1530  $app->setTitle($this->getTitle());
1531  $app->setFullday(false);
1532  $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1533 
1534  $apps[] = $app;
1535  }
1536 
1537  }
1538 
1539  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1540  $exc = new ilObjExercise($this->getExerciseId(), false);
1541 
1542  $ilAppEventHandler->raise('Modules/Exercise',
1543  $a_event.'Assignment',
1544  array(
1545  'object' => $exc,
1546  'obj_id' => $exc->getId(),
1547  'context_ids' => $context_ids,
1548  'appointments' => $apps));
1549  }
getPeerReview()
Get peer review status.
const IL_CAL_TRANSLATION_SYSTEM
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
getExerciseId()
Get exercise id.
Class ilObjExercise.
Date and time handling
getPeerReviewDeadline()
Get peer review deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)

Definition at line 1674 of file class.ilExAssignment.php.

References $path, ilUtil\delDir(), getGlobalFeedbackFileStoragePath(), ilUtil\moveUploadedFile(), and setFeedbackFile().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1675  {
1677  ilUtil::delDir($path, true);
1678  if (ilUtil::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path."/".$a_file["name"]))
1679  {
1680  $this->setFeedbackFile($a_file["name"]);
1681  return true;
1682  }
1683  return false;
1684  }
setFeedbackFile($a_value)
Set (global) feedback file.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
$path
Definition: index.php:22
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

Get (global) feedback file cron status.

Returns
int

Definition at line 625 of file class.ilExAssignment.php.

References $feedback_cron.

Referenced by save(), and update().

626  {
627  return (bool)$this->feedback_cron;
628  }
+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

Get peer review file upload status.

Returns
bool

Definition at line 483 of file class.ilExAssignment.php.

References $peer_file.

Referenced by save(), and update().

484  {
485  return $this->peer_file;
486  }
+ Here is the caller graph for this function:

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

Get peer review personalized status.

Returns
bool

Definition at line 503 of file class.ilExAssignment.php.

References $peer_personal.

Referenced by save(), and update().

504  {
505  return $this->peer_personal;
506  }
+ Here is the caller graph for this function:

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

Get peer review rating status.

Returns
bool

Definition at line 443 of file class.ilExAssignment.php.

References $peer_rating.

Referenced by save(), and update().

444  {
445  return $this->peer_rating;
446  }
+ Here is the caller graph for this function:

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

Get peer review text status.

Returns
bool

Definition at line 463 of file class.ilExAssignment.php.

References $peer_text.

Referenced by save(), and update().

464  {
465  return $this->peer_text;
466  }
+ Here is the caller graph for this function:

◆ hasTeam()

ilExAssignment::hasTeam ( )

Definition at line 95 of file class.ilExAssignment.php.

Referenced by ilExSubmission\__construct(), and ilExSubmission\downloadAllAssignmentFiles().

96  {
97  return $this->type == self::TYPE_UPLOAD_TEAM;
98  }
+ Here is the caller graph for this function:

◆ initFromDB()

ilExAssignment::initFromDB ( array  $a_set)
protected

Import DB record.

See also
getInstancesByExercise()
Parameters
array$a_set

Definition at line 719 of file class.ilExAssignment.php.

References setDeadline(), setExerciseId(), setExtendedDeadline(), setFeedbackCron(), setFeedbackDate(), setFeedbackFile(), setId(), setInstruction(), setMandatory(), setMaxFile(), setOrderNr(), setPeerReview(), setPeerReviewChars(), setPeerReviewCriteriaCatalogue(), setPeerReviewDeadline(), setPeerReviewFileUpload(), setPeerReviewMin(), setPeerReviewPersonalized(), setPeerReviewRating(), setPeerReviewSimpleUnlock(), setPeerReviewText(), setPeerReviewValid(), setStartTime(), setTeamTutor(), setTitle(), and setType().

Referenced by read().

720  {
721  $this->setId($a_set["id"]);
722  $this->setExerciseId($a_set["exc_id"]);
723  $this->setDeadline($a_set["time_stamp"]);
724  $this->setExtendedDeadline($a_set["deadline2"]);
725  $this->setInstruction($a_set["instruction"]);
726  $this->setTitle($a_set["title"]);
727  $this->setStartTime($a_set["start_time"]);
728  $this->setOrderNr($a_set["order_nr"]);
729  $this->setMandatory($a_set["mandatory"]);
730  $this->setType($a_set["type"]);
731  $this->setPeerReview($a_set["peer"]);
732  $this->setPeerReviewMin($a_set["peer_min"]);
733  $this->setPeerReviewSimpleUnlock($a_set["peer_unlock"]);
734  $this->setPeerReviewDeadline($a_set["peer_dl"]);
735  $this->setPeerReviewValid($a_set["peer_valid"]);
736  $this->setPeerReviewFileUpload($a_set["peer_file"]);
737  $this->setPeerReviewPersonalized($a_set["peer_prsl"]);
738  $this->setPeerReviewChars($a_set["peer_char"]);
739  $this->setPeerReviewText($a_set["peer_text"]);
740  $this->setPeerReviewRating($a_set["peer_rating"]);
741  $this->setPeerReviewCriteriaCatalogue($a_set["peer_crit_cat"]);
742  $this->setFeedbackFile($a_set["fb_file"]);
743  $this->setFeedbackDate($a_set["fb_date"]);
744  $this->setFeedbackCron($a_set["fb_cron"]);
745  $this->setTeamTutor($a_set["team_tutor"]);
746  $this->setMaxFile($a_set["max_file"]);
747  }
setMaxFile($a_value)
Set max number of uploads.
setFeedbackFile($a_value)
Set (global) feedback file.
setPeerReviewMin($a_value)
Set peer review minimum.
setTeamTutor($a_value)
Set team management by tutor.
setPeerReviewFileUpload($a_val)
Set peer review file upload.
setPeerReview($a_value)
Toggle peer review.
setPeerReviewDeadline($a_val)
Set peer review deadline (timestamp)
setPeerReviewValid($a_value)
Set peer review validation.
setType($a_value)
Set type.
setTitle($a_val)
Set title.
setOrderNr($a_val)
Set order nr.
setInstruction($a_val)
Set instruction.
setStartTime($a_val)
Set start time (timestamp)
setDeadline($a_val)
Set deadline (timestamp)
setPeerReviewCriteriaCatalogue($a_value)
Set peer review criteria catalogue id.
setPeerReviewPersonalized($a_val)
Set peer review personalized.
setPeerReviewRating($a_val)
Set peer review rating.
setPeerReviewSimpleUnlock($a_value)
Set peer review simple unlock.
setPeerReviewText($a_val)
Set peer review text.
setExerciseId($a_val)
Set exercise id.
setFeedbackCron($a_value)
Toggle (global) feedback file cron.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setPeerReviewChars($a_value)
Set peer review minimum characters.
setId($a_val)
Set assignment id.
setMandatory($a_val)
Set mandatory.
setExtendedDeadline($a_val)
Set extended deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType (   $a_value)

Is given type valid?

Parameters
int$a_value
Returns
bool

Definition at line 318 of file class.ilExAssignment.php.

Referenced by setType().

319  {
320  if(in_array((int)$a_value, array(self::TYPE_UPLOAD, self::TYPE_BLOG,
321  self::TYPE_PORTFOLIO, self::TYPE_UPLOAD_TEAM, self::TYPE_TEXT)))
322  {
323  return true;
324  }
325  return false;
326  }
+ Here is the caller graph for this function:

◆ lookup()

static ilExAssignment::lookup (   $a_id,
  $a_field 
)
staticprivate

Private lookup.

Definition at line 1024 of file class.ilExAssignment.php.

References $ilDB.

1025  {
1026  global $ilDB;
1027 
1028  $set = $ilDB->query("SELECT ".$a_field." FROM exc_assignment ".
1029  " WHERE id = ".$ilDB->quote($a_id, "integer")
1030  );
1031 
1032  $rec = $ilDB->fetchAssoc($set);
1033 
1034  return $rec[$a_field];
1035  }
global $ilDB

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline (   $a_ass_id)
static

Check if assignment is online.

Parameters
int$a_ass_id
Returns
bool

Definition at line 1007 of file class.ilExAssignment.php.

References $ilDB, $query, and $res.

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

1008  {
1009  global $ilDB;
1010 
1011  $query = "SELECT id FROM exc_assignment ".
1012  "WHERE start_time <= ".$ilDB->quote(time(),'integer').' '.
1013  "AND time_stamp >= ".$ilDB->quote(time(),'integer').' '.
1014  "AND id = ".$ilDB->quote($a_ass_id,'integer');
1015  $res = $ilDB->query($query);
1016 
1017  return $res->numRows() ? true : false;
1018  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupMaxOrderNrForEx()

static ilExAssignment::lookupMaxOrderNrForEx (   $a_exc_id)
static

Select the maximum order nr for an exercise.

Definition at line 988 of file class.ilExAssignment.php.

References $ilDB.

989  {
990  global $ilDB;
991 
992  $set = $ilDB->query("SELECT MAX(order_nr) mnr FROM exc_assignment ".
993  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer")
994  );
995  while ($rec = $ilDB->fetchAssoc($set))
996  {
997  return (int) $rec["mnr"];
998  }
999  return 0;
1000  }
global $ilDB

◆ lookupTitle()

static ilExAssignment::lookupTitle (   $a_id)
static

Lookup title.

Definition at line 1040 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\confirmAssignmentsDeletionObject(), ilExSubmission\downloadMultipleFiles(), ilObjExerciseSubItemListGUI\getHTML(), ilExerciseManagementGUI\initMultiFeedbackForm(), and ilExerciseMailNotification\send().

1041  {
1042  return self::lookup($a_id, "title");
1043  }
+ Here is the caller graph for this function:

◆ lookupType()

static ilExAssignment::lookupType (   $a_id)
static

Lookup type.

Definition at line 1048 of file class.ilExAssignment.php.

1049  {
1050  return self::lookup($a_id, "type");
1051  }

◆ lookupUpdatedSubmission()

static ilExAssignment::lookupUpdatedSubmission (   $ass_id,
  $member_id 
)
static

Check whether student has upload new files after tutor has set the exercise to another than notgraded.

Definition at line 1117 of file class.ilExAssignment.php.

References $ilDB, and $lng.

1118  {
1119  global $ilDB, $lng;
1120 
1121  // team upload?
1122  $user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
1123  if(!$user_ids)
1124  {
1125  $user_ids = array($member_id);
1126  }
1127 
1128  $q="SELECT exc_mem_ass_status.status_time, exc_returned.ts ".
1129  "FROM exc_mem_ass_status, exc_returned ".
1130  "WHERE exc_mem_ass_status.status_time < exc_returned.ts ".
1131  "AND NOT exc_mem_ass_status.status_time IS NULL ".
1132  "AND exc_returned.ass_id = exc_mem_ass_status.ass_id ".
1133  "AND exc_returned.user_id = exc_mem_ass_status.usr_id ".
1134  "AND exc_returned.ass_id=".$ilDB->quote($ass_id, "integer").
1135  " AND ".$ilDB->in("exc_returned.user_id", $user_ids, "", "integer");
1136 
1137  $usr_set = $ilDB->query($q);
1138 
1139  $array = $ilDB->fetchAssoc($usr_set);
1140 
1141  if (count($array)==0)
1142  {
1143  return 0;
1144  }
1145  else
1146  {
1147  return 1;
1148  }
1149 
1150  }
global $lng
Definition: privfeed.php:40
global $ilDB

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

Definition at line 1652 of file class.ilExAssignment.php.

Referenced by ilExAssignmentGUI\addInstructions(), ilExAssignmentGUI\addSchedule(), ilExAssignmentGUI\getOverviewBody(), and ilExAssignmentGUI\getOverviewHeader().

1653  {
1654  return (time() - $this->start_time <= 0);
1655  }
+ Here is the caller graph for this function:

◆ orderAssByDeadline()

ilExAssignment::orderAssByDeadline (   $a_ex_id)

Order assignments by deadline date.

Definition at line 1078 of file class.ilExAssignment.php.

References $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

1079  {
1080  global $ilDB;
1081 
1082  $set = $ilDB->query("SELECT id FROM exc_assignment ".
1083  " WHERE exc_id = ".$ilDB->quote($a_ex_id, "integer").
1084  " ORDER BY time_stamp ASC"
1085  );
1086  $nr = 10;
1087  while ($rec = $ilDB->fetchAssoc($set))
1088  {
1089  $ilDB->manipulate("UPDATE exc_assignment SET ".
1090  " order_nr = ".$ilDB->quote($nr, "integer").
1091  " WHERE id = ".$ilDB->quote($rec["id"], "integer")
1092  );
1093  $nr += 10;
1094  }
1095  }
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )

Read from db.

Definition at line 697 of file class.ilExAssignment.php.

References $ilDB, and initFromDB().

Referenced by __construct().

698  {
699  global $ilDB;
700 
701  $set = $ilDB->query("SELECT * FROM exc_assignment ".
702  " WHERE id = ".$ilDB->quote($this->getId(), "integer")
703  );
704  $rec = $ilDB->fetchAssoc($set);
705 
706  // #16172 - might be deleted
707  if(is_array($rec))
708  {
709  $this->initFromDB($rec);
710  }
711  }
initFromDB(array $a_set)
Import DB record.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )

Definition at line 1712 of file class.ilExAssignment.php.

References $deadline, $file, $id, $ilDB, ilExSubmission\getAllAssignmentFiles(), getDeadline(), getExtendedDeadline(), getId(), IL_CAL_DATETIME, and IL_CAL_UNIX.

1713  {
1714  global $ilDB;
1715 
1716  // see JF, 2015-05-11
1717 
1718  $deadline = $this->getDeadline();
1719  $ext_deadline = $this->getExtendedDeadline();
1720  $last_deadline = max($this->getDeadline(), $this->getExtendedDeadline());
1721 
1722  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1723  foreach(ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file)
1724  {
1725  $id = $file["returned_id"];
1726  $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
1727  $uploaded = $uploaded->get(IL_CAL_UNIX);
1728 
1729  $late = null;
1730 
1731  // upload is not late anymore
1732  if($file["late"] &&
1733  (!$last_deadline ||
1734  !$ext_deadline ||
1735  $uploaded < $deadline))
1736  {
1737  $late = false;
1738  }
1739  // upload is now late
1740  else if(!$file["late"] &&
1741  $ext_deadline &&
1742  $deadline &&
1743  $uploaded > $deadline)
1744  {
1745  $late = true;
1746  }
1747  else if($last_deadline && $uploaded > $last_deadline)
1748  {
1749  // do nothing, we do not remove submissions?
1750  }
1751 
1752  if($late !== null)
1753  {
1754  $ilDB->manipulate("UPDATE exc_returned".
1755  " SET late = ".$ilDB->quote($late, "integer").
1756  " WHERE returned_id = ".$ilDB->quote($id, "integer"));
1757  }
1758  }
1759  }
print $file
const IL_CAL_DATETIME
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
const IL_CAL_UNIX
Date and time handling
getExtendedDeadline()
Get extended deadline (timestamp)
global $ilDB
static getAllAssignmentFiles($a_exc_id, $a_ass_id)
+ Here is the call graph for this function:

◆ save()

ilExAssignment::save ( )

Save assignment.

Definition at line 752 of file class.ilExAssignment.php.

References $ilDB, getDeadline(), getExerciseId(), getExtendedDeadline(), getFeedbackDate(), getFeedbackFile(), getInstruction(), getMandatory(), getMaxFile(), getOrderNr(), getPeerReview(), getPeerReviewChars(), getPeerReviewCriteriaCatalogue(), getPeerReviewDeadline(), getPeerReviewMin(), getPeerReviewSimpleUnlock(), getPeerReviewValid(), getStartTime(), getTeamTutor(), getTitle(), getType(), handleCalendarEntries(), hasFeedbackCron(), hasPeerReviewFileUpload(), hasPeerReviewPersonalized(), hasPeerReviewRating(), hasPeerReviewText(), setId(), and setOrderNr().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

753  {
754  global $ilDB;
755 
756  if ($this->getOrderNr() == 0)
757  {
758  $this->setOrderNr(
759  self::lookupMaxOrderNrForEx($this->getExerciseId())
760  + 10);
761  }
762 
763  $next_id = $ilDB->nextId("exc_assignment");
764  $ilDB->insert("exc_assignment", array(
765  "id" => array("integer", $next_id),
766  "exc_id" => array("integer", $this->getExerciseId()),
767  "time_stamp" => array("integer", $this->getDeadline()),
768  "deadline2" => array("integer", $this->getExtendedDeadline()),
769  "instruction" => array("clob", $this->getInstruction()),
770  "title" => array("text", $this->getTitle()),
771  "start_time" => array("integer", $this->getStartTime()),
772  "order_nr" => array("integer", $this->getOrderNr()),
773  "mandatory" => array("integer", $this->getMandatory()),
774  "type" => array("integer", $this->getType()),
775  "peer" => array("integer", $this->getPeerReview()),
776  "peer_min" => array("integer", $this->getPeerReviewMin()),
777  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
778  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
779  "peer_valid" => array("integer", $this->getPeerReviewValid()),
780  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
781  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
782  "peer_char" => array("integer", $this->getPeerReviewChars()),
783  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
784  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
785  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
786  "fb_file" => array("text", $this->getFeedbackFile()),
787  "fb_date" => array("integer", $this->getFeedbackDate()),
788  "fb_cron" => array("integer", $this->hasFeedbackCron()),
789  "team_tutor" => array("integer", $this->getTeamTutor()),
790  "max_file" => array("integer", $this->getMaxFile())
791  ));
792  $this->setId($next_id);
793  $exc = new ilObjExercise($this->getExerciseId(), false);
794  $exc->updateAllUsersStatus();
795  self::createNewAssignmentRecords($next_id, $exc);
796 
797  $this->handleCalendarEntries("create");
798  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
setOrderNr($a_val)
Set order nr.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
setId($a_val)
Set assignment id.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssOrderOfExercise()

ilExAssignment::saveAssOrderOfExercise (   $a_ex_id,
  $a_order 
)

Save ordering of all assignments of an exercise.

Definition at line 1056 of file class.ilExAssignment.php.

References $ilDB, and $t.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

1057  {
1058  global $ilDB;
1059 
1060  $result_order = array();
1061  asort($a_order);
1062  $nr = 10;
1063  foreach ($a_order as $k => $v)
1064  {
1065  // the check for exc_id is for security reasons. ass ids are unique.
1066  $ilDB->manipulate($t = "UPDATE exc_assignment SET ".
1067  " order_nr = ".$ilDB->quote($nr, "integer").
1068  " WHERE id = ".$ilDB->quote((int) $k, "integer").
1069  " AND exc_id = ".$ilDB->quote((int) $a_ex_id, "integer")
1070  );
1071  $nr+=10;
1072  }
1073  }
global $ilDB
+ Here is the caller graph for this function:

◆ saveMultiFeedbackFiles()

ilExAssignment::saveMultiFeedbackFiles (   $a_files,
ilObjExercise  $a_exc 
)

Save multi feedback files.

Parameters

Definition at line 1440 of file class.ilExAssignment.php.

References clearMultiFeedbackDirectory(), getExerciseId(), getId(), ilObject\getId(), getMultiFeedbackFiles(), and ilObjExercise\sendFeedbackFileNotification().

1441  {
1442  if($this->getExerciseId() != $a_exc->getId())
1443  {
1444  return;
1445  }
1446 
1447  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1448  $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1449  $fstorage->create();
1450 
1451  $team_map = array();
1452 
1453  $mf_files = $this->getMultiFeedbackFiles();
1454  foreach ($mf_files as $f)
1455  {
1456  $user_id = $f["user_id"];
1457  $file_path = $f["full_path"];
1458  $file_name = $f["file"];
1459 
1460  // if checked in confirmation gui
1461  if ($a_files[$user_id][md5($file_name)] != "")
1462  {
1463  $submission = new ilExSubmission($this, $user_id);
1464  $feedback_id = $submission->getFeedbackId();
1465  $noti_rec_ids = $submission->getUserIds();
1466 
1467  if ($feedback_id)
1468  {
1469  $fb_path = $fstorage->getFeedbackPath($feedback_id);
1470  $target = $fb_path."/".$file_name;
1471  if (is_file($target))
1472  {
1473  unlink($target);
1474  }
1475  // rename file
1476  rename($file_path, $target);
1477 
1478  if ($noti_rec_ids)
1479  {
1480  $a_exc->sendFeedbackFileNotification($file_name, $noti_rec_ids,
1481  (int) $this->getId());
1482  }
1483  }
1484  }
1485  }
1486 
1487  $this->clearMultiFeedbackDirectory();
1488  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
getId()
get object id public
sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback=false)
Send feedback file notification to user.
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getMultiFeedbackFiles($a_user_id=0)
Get multi feedback files (of uploader)
Exercise submission.
+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

static ilExAssignment::sendFeedbackNotifications (   $a_ass_id,
  $a_user_id = null 
)
static

Definition at line 1576 of file class.ilExAssignment.php.

References $ilDB, $row, and ilExerciseMembers\_getMembers().

Referenced by ilExAssignmentMemberStatus\postUpdateReturned(), and ilExcCronFeedbackNotification\run().

1577  {
1578  global $ilDB;
1579 
1580  $ass = new self($a_ass_id);
1581 
1582  // valid assignment?
1583  if(!$ass->hasFeedbackCron() || !$ass->getFeedbackFile())
1584  {
1585  return false;
1586  }
1587 
1588  if(!$a_user_id)
1589  {
1590  // already done?
1591  $set = $ilDB->query("SELECT fb_cron_done".
1592  " FROM exc_assignment".
1593  " WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
1594  $row = $ilDB->fetchAssoc($set);
1595  if($row["fb_cron_done"])
1596  {
1597  return false;
1598  }
1599  }
1600 
1601  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1602  $ntf = new ilSystemNotification();
1603  $ntf->setLangModules(array("exc"));
1604  $ntf->setObjId($ass->getExerciseId());
1605  $ntf->setSubjectLangId("exc_feedback_notification_subject");
1606  $ntf->setIntroductionLangId("exc_feedback_notification_body");
1607  $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
1608  $ntf->setGotoLangId("exc_feedback_notification_link");
1609  $ntf->setReasonLangId("exc_feedback_notification_reason");
1610 
1611  if(!$a_user_id)
1612  {
1613  include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
1614  $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
1615 
1616  $ilDB->manipulate("UPDATE exc_assignment".
1617  " SET fb_cron_done = ".$ilDB->quote(1, "integer").
1618  " WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
1619  }
1620  else
1621  {
1622  $ntf->sendMail(array($a_user_id));
1623  }
1624 
1625  return true;
1626  }
global $ilDB
Wrapper classes for system notifications.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMultiFeedbackStructureFile()

ilExAssignment::sendMultiFeedbackStructureFile ( )

Create member status record for a new assignment for all participants.

Definition at line 1262 of file class.ilExAssignment.php.

References $ilDB, ilObjUser\_lookupName(), ilUtil\deliverFile(), ilUtil\getASCIIFilename(), getExerciseId(), getId(), getTitle(), ilUtil\ilTempnam(), ilUtil\makeDir(), and ilUtil\zip().

1263  {
1264  global $ilDB;
1265 
1266 
1267  // send and delete the zip file
1268  $deliverFilename = trim(str_replace(" ", "_", $this->getTitle()."_".$this->getId()));
1269  $deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
1270  $deliverFilename = "multi_feedback_".$deliverFilename;
1271 
1272  $exc = new ilObjExercise($this->getExerciseId(), false);
1273 
1274  $cdir = getcwd();
1275 
1276  // create temporary directoy
1277  $tmpdir = ilUtil::ilTempnam();
1278  ilUtil::makeDir($tmpdir);
1279  $mfdir = $tmpdir."/".$deliverFilename;
1280  ilUtil::makeDir($mfdir);
1281 
1282  // create subfolders <lastname>_<firstname>_<id> for each participant
1283  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1284  $exmem = new ilExerciseMembers($exc);
1285  $mems = $exmem->getMembers();
1286 
1287  foreach ($mems as $mem)
1288  {
1289  $name = ilObjUser::_lookupName($mem);
1290  $subdir = $name["lastname"]."_".$name["firstname"]."_".$name["login"]."_".$name["user_id"];
1291  $subdir = ilUtil::getASCIIFilename($subdir);
1292  ilUtil::makeDir($mfdir."/".$subdir);
1293  }
1294 
1295  // create the zip file
1296  chdir($tmpdir);
1297  $tmpzipfile = $tmpdir."/multi_feedback.zip";
1298  ilUtil::zip($tmpdir, $tmpzipfile, true);
1299  chdir($cdir);
1300 
1301 
1302  ilUtil::deliverFile($tmpzipfile, $deliverFilename.".zip", "", false, true);
1303  }
static _lookupName($a_user_id)
lookup user name
Class ilExerciseMembers.
getId()
Get assignment id.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
getExerciseId()
Get exercise id.
Class ilObjExercise.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
global $ilDB
+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline (   $a_val)

Set deadline (timestamp)

Parameters
intdeadline (timestamp)

Definition at line 165 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

166  {
167  $this->deadline = $a_val;
168  }
+ Here is the caller graph for this function:

◆ setExerciseId()

ilExAssignment::setExerciseId (   $a_val)

Set exercise id.

Parameters
intexercise id

Definition at line 125 of file class.ilExAssignment.php.

Referenced by initFromDB().

126  {
127  $this->exc_id = $a_val;
128  }
+ Here is the caller graph for this function:

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline (   $a_val)

Set extended deadline (timestamp)

Parameters
int

Definition at line 185 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

186  {
187  if($a_val !== null)
188  {
189  $a_val = (int)$a_val;
190  }
191  $this->deadline2 = $a_val;
192  }
+ Here is the caller graph for this function:

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron (   $a_value)

Toggle (global) feedback file cron.

Parameters
bool$a_value

Definition at line 615 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

616  {
617  $this->feedback_cron = (string)$a_value;
618  }
+ Here is the caller graph for this function:

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate (   $a_value)

Set (global) feedback file availability date.

Parameters
int$a_value

Definition at line 635 of file class.ilExAssignment.php.

Referenced by __construct(), ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

636  {
637  $this->feedback_date = (int)$a_value;
638  }
+ Here is the caller graph for this function:

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile (   $a_value)

Set (global) feedback file.

Parameters
string$a_value

Definition at line 595 of file class.ilExAssignment.php.

Referenced by handleGlobalFeedbackFileUpload(), ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

596  {
597  $this->feedback_file = (string)$a_value;
598  }
+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId (   $a_val)

Set assignment id.

Parameters
intassignment id

Definition at line 105 of file class.ilExAssignment.php.

Referenced by __construct(), initFromDB(), and save().

106  {
107  $this->id = $a_val;
108  }
+ Here is the caller graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction (   $a_val)

Set instruction.

Parameters
stringinstruction

Definition at line 209 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

210  {
211  $this->instruction = $a_val;
212  }
+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory (   $a_val)

Set mandatory.

Parameters
intmandatory

Definition at line 249 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

250  {
251  $this->mandatory = $a_val;
252  }
+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile (   $a_value)

Set max number of uploads.

Parameters
int$a_value

Definition at line 675 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

676  {
677  if($a_value !== null)
678  {
679  $a_value = (int)$a_value;
680  }
681  $this->max_file = $a_value;
682  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

Definition at line 269 of file class.ilExAssignment.php.

Referenced by initFromDB(), and save().

270  {
271  $this->order_nr = $a_val;
272  }
+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview (   $a_value)

Toggle peer review.

Parameters
bool$a_value

Definition at line 333 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), initFromDB(), and setType().

334  {
335  $this->peer = (bool)$a_value;
336  }
+ Here is the caller graph for this function:

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars (   $a_value)

Set peer review minimum characters.

Parameters
int$a_value

Definition at line 513 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

514  {
515  $a_value = (is_numeric($a_value) && (int)$a_value > 0)
516  ? (int)$a_value
517  : null;
518  $this->peer_char = $a_value;
519  }
+ Here is the caller graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue (   $a_value)

Set peer review criteria catalogue id.

Parameters
int$a_value

Definition at line 536 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

537  {
538  $a_value = is_numeric($a_value)
539  ? (int)$a_value
540  : null;
541  $this->crit_cat = $a_value;
542  }
+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

ilExAssignment::setPeerReviewDeadline (   $a_val)

Set peer review deadline (timestamp)

Parameters
intdeadline (timestamp)

Definition at line 393 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

394  {
395  $this->peer_dl = $a_val;
396  }
+ Here is the caller graph for this function:

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload (   $a_val)

Set peer review file upload.

Parameters
bool

Definition at line 473 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

474  {
475  $this->peer_file = (bool)$a_val;
476  }
+ Here is the caller graph for this function:

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin (   $a_value)

Set peer review minimum.

Parameters
int$a_value

Definition at line 353 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

354  {
355  $this->peer_min = (int)$a_value;
356  }
+ Here is the caller graph for this function:

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized (   $a_val)

Set peer review personalized.

Parameters
bool

Definition at line 493 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

494  {
495  $this->peer_personal = (bool)$a_val;
496  }
+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating (   $a_val)

Set peer review rating.

Parameters
bool

Definition at line 433 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

434  {
435  $this->peer_rating = (bool)$a_val;
436  }
+ Here is the caller graph for this function:

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock (   $a_value)

Set peer review simple unlock.

Parameters
bool$a_value

Definition at line 373 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

374  {
375  $this->peer_unlock = (bool)$a_value;
376  }
+ Here is the caller graph for this function:

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText (   $a_val)

Set peer review text.

Parameters
bool

Definition at line 453 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

454  {
455  $this->peer_text = (bool)$a_val;
456  }
+ Here is the caller graph for this function:

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid (   $a_value)

Set peer review validation.

Parameters
int$a_value

Definition at line 413 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), and initFromDB().

414  {
415  $this->peer_valid = (int)$a_value;
416  }
+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime (   $a_val)

Set start time (timestamp)

Parameters
intstart time (timestamp)

Definition at line 145 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

146  {
147  $this->start_time = $a_val;
148  }
+ Here is the caller graph for this function:

◆ setTeamTutor()

ilExAssignment::setTeamTutor (   $a_value)

Set team management by tutor.

Parameters
bool$a_value

Definition at line 655 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

656  {
657  $this->team_tutor = (bool)$a_value;
658  }
+ Here is the caller graph for this function:

◆ setTitle()

ilExAssignment::setTitle (   $a_val)

Set title.

Parameters
stringtitle

Definition at line 229 of file class.ilExAssignment.php.

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and initFromDB().

230  {
231  $this->title = $a_val;
232  }
+ Here is the caller graph for this function:

◆ setType()

ilExAssignment::setType (   $a_value)

Set type.

Parameters
int$a_value

Definition at line 289 of file class.ilExAssignment.php.

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

290  {
291  if($this->isValidType($a_value))
292  {
293  $this->type = (int)$a_value;
294 
295  if($this->type == self::TYPE_UPLOAD_TEAM)
296  {
297  $this->setPeerReview(false);
298  }
299  }
300  }
setPeerReview($a_value)
Toggle peer review.
isValidType($a_value)
Is given type valid?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )

Update.

Definition at line 803 of file class.ilExAssignment.php.

References $ilDB, getDeadline(), getExerciseId(), getExtendedDeadline(), getFeedbackDate(), getFeedbackFile(), getId(), getInstruction(), getMandatory(), getMaxFile(), getOrderNr(), getPeerReview(), getPeerReviewChars(), getPeerReviewCriteriaCatalogue(), getPeerReviewDeadline(), getPeerReviewMin(), getPeerReviewSimpleUnlock(), getPeerReviewValid(), getStartTime(), getTeamTutor(), getTitle(), getType(), handleCalendarEntries(), hasFeedbackCron(), hasPeerReviewFileUpload(), hasPeerReviewPersonalized(), hasPeerReviewRating(), and hasPeerReviewText().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment(), and ilExAssignmentEditorGUI\importPeerReviewFormToAssignment().

804  {
805  global $ilDB;
806 
807  $ilDB->update("exc_assignment",
808  array(
809  "exc_id" => array("integer", $this->getExerciseId()),
810  "time_stamp" => array("integer", $this->getDeadline()),
811  "deadline2" => array("integer", $this->getExtendedDeadline()),
812  "instruction" => array("clob", $this->getInstruction()),
813  "title" => array("text", $this->getTitle()),
814  "start_time" => array("integer", $this->getStartTime()),
815  "order_nr" => array("integer", $this->getOrderNr()),
816  "mandatory" => array("integer", $this->getMandatory()),
817  "type" => array("integer", $this->getType()),
818  "peer" => array("integer", $this->getPeerReview()),
819  "peer_min" => array("integer", $this->getPeerReviewMin()),
820  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
821  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
822  "peer_valid" => array("integer", $this->getPeerReviewValid()),
823  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
824  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
825  "peer_char" => array("integer", $this->getPeerReviewChars()),
826  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
827  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
828  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
829  "fb_file" => array("text", $this->getFeedbackFile()),
830  "fb_date" => array("integer", $this->getFeedbackDate()),
831  "fb_cron" => array("integer", $this->hasFeedbackCron()),
832  "team_tutor" => array("integer", $this->getTeamTutor()),
833  "max_file" => array("integer", $this->getMaxFile())
834  ),
835  array(
836  "id" => array("integer", $this->getId()),
837  ));
838  $exc = new ilObjExercise($this->getExerciseId(), false);
839  $exc->updateAllUsersStatus();
840 
841  $this->handleCalendarEntries("update");
842  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
getPeerReviewDeadline()
Get peer review deadline (timestamp)
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadAssignmentFiles()

ilExAssignment::uploadAssignmentFiles (   $a_files)

Upload assignment files (from creation form)

Definition at line 1246 of file class.ilExAssignment.php.

References getExerciseId(), and getId().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1247  {
1248  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1249  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1250  $storage->create();
1251  $storage->uploadAssignmentFiles($a_files);
1252  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadMultiFeedbackFile()

ilExAssignment::uploadMultiFeedbackFile (   $a_file)

Upload multi feedback file.

Parameters
array
Returns

Definition at line 1311 of file class.ilExAssignment.php.

References $ilUser, $lng, ilUtil\delDir(), ilUtil\getDir(), getExerciseId(), getId(), ilUtil\moveUploadedFile(), and ilUtil\unzip().

1312  {
1313  global $lng, $ilUser;
1314 
1315  include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
1316  if (!is_file($a_file["tmp_name"]))
1317  {
1318  throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1319  }
1320 
1321  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1322  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1323  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1324  ilUtil::delDir($mfu, true);
1325  ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu."/"."multi_feedback.zip");
1326  ilUtil::unzip($mfu."/multi_feedback.zip", true);
1327  $subdirs = ilUtil::getDir($mfu);
1328  $subdir = "notfound";
1329  foreach ($subdirs as $s => $j)
1330  {
1331  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
1332  {
1333  $subdir = $s;
1334  }
1335  }
1336 
1337  if (!is_dir($mfu."/".$subdir))
1338  {
1339  throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1340  }
1341 
1342  return true;
1343  }
getId()
Get assignment id.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
getExerciseId()
Get exercise id.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Class to report exception.
+ Here is the call graph for this function:

Field Documentation

◆ $deadline

ilExAssignment::$deadline
protected

◆ $deadline2

ilExAssignment::$deadline2
protected

Definition at line 31 of file class.ilExAssignment.php.

Referenced by getExtendedDeadline().

◆ $exc_id

ilExAssignment::$exc_id
protected

Definition at line 27 of file class.ilExAssignment.php.

Referenced by getExerciseId().

◆ $feedback_cron

ilExAssignment::$feedback_cron
protected

Definition at line 48 of file class.ilExAssignment.php.

Referenced by hasFeedbackCron().

◆ $feedback_date

ilExAssignment::$feedback_date
protected

Definition at line 49 of file class.ilExAssignment.php.

Referenced by getFeedbackDate().

◆ $feedback_file

ilExAssignment::$feedback_file
protected

Definition at line 47 of file class.ilExAssignment.php.

Referenced by getFeedbackFile().

◆ $id

ilExAssignment::$id
protected

Definition at line 26 of file class.ilExAssignment.php.

Referenced by getId(), and recalculateLateSubmissions().

◆ $instruction

ilExAssignment::$instruction
protected

Definition at line 32 of file class.ilExAssignment.php.

Referenced by getInstruction().

◆ $mandatory

ilExAssignment::$mandatory
protected

Definition at line 34 of file class.ilExAssignment.php.

Referenced by getMandatory().

◆ $max_file

ilExAssignment::$max_file
protected

Definition at line 51 of file class.ilExAssignment.php.

Referenced by getMaxFile().

◆ $member_status

ilExAssignment::$member_status = array()
protected

Definition at line 53 of file class.ilExAssignment.php.

◆ $order_nr

ilExAssignment::$order_nr
protected

Definition at line 35 of file class.ilExAssignment.php.

Referenced by getOrderNr().

◆ $peer

ilExAssignment::$peer
protected

Definition at line 36 of file class.ilExAssignment.php.

Referenced by getPeerReview().

◆ $peer_char

ilExAssignment::$peer_char
protected

Definition at line 43 of file class.ilExAssignment.php.

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

ilExAssignment::$peer_crit_cat
protected

Definition at line 46 of file class.ilExAssignment.php.

◆ $peer_dl

ilExAssignment::$peer_dl
protected

Definition at line 39 of file class.ilExAssignment.php.

Referenced by getPeerReviewDeadline().

◆ $peer_file

ilExAssignment::$peer_file
protected

Definition at line 41 of file class.ilExAssignment.php.

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

ilExAssignment::$peer_min
protected

Definition at line 37 of file class.ilExAssignment.php.

Referenced by getPeerReviewMin().

◆ $peer_personal

ilExAssignment::$peer_personal
protected

Definition at line 42 of file class.ilExAssignment.php.

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

ilExAssignment::$peer_rating
protected

Definition at line 45 of file class.ilExAssignment.php.

Referenced by hasPeerReviewRating().

◆ $peer_text

ilExAssignment::$peer_text
protected

Definition at line 44 of file class.ilExAssignment.php.

Referenced by hasPeerReviewText().

◆ $peer_unlock

ilExAssignment::$peer_unlock
protected

Definition at line 38 of file class.ilExAssignment.php.

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

ilExAssignment::$peer_valid
protected

Definition at line 40 of file class.ilExAssignment.php.

Referenced by getPeerReviewValid().

◆ $start_time

ilExAssignment::$start_time
protected

Definition at line 29 of file class.ilExAssignment.php.

Referenced by getStartTime().

◆ $team_tutor

ilExAssignment::$team_tutor = false
protected

Definition at line 50 of file class.ilExAssignment.php.

Referenced by getTeamTutor().

◆ $title

ilExAssignment::$title
protected

Definition at line 33 of file class.ilExAssignment.php.

Referenced by getTitle().

◆ $type

ilExAssignment::$type
protected

Definition at line 28 of file class.ilExAssignment.php.

Referenced by getType().

◆ FEEDBACK_DATE_DEADLINE

◆ FEEDBACK_DATE_SUBMISSION

const ilExAssignment::FEEDBACK_DATE_SUBMISSION = 2

◆ PEER_REVIEW_VALID_ALL

const ilExAssignment::PEER_REVIEW_VALID_ALL = 3

◆ PEER_REVIEW_VALID_NONE

◆ PEER_REVIEW_VALID_ONE

const ilExAssignment::PEER_REVIEW_VALID_ONE = 2

◆ TYPE_BLOG

◆ TYPE_PORTFOLIO

◆ TYPE_TEXT

◆ TYPE_UPLOAD

◆ TYPE_UPLOAD_TEAM


The documentation for this class was generated from the following file: