ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 hasTeam ()
 
 setId (int $a_val)
 
 getId ()
 
 setExerciseId (int $a_val)
 
 getExerciseId ()
 
 setStartTime (?int $a_val)
 
 getStartTime ()
 
 setDeadline (?int $a_val)
 
 getDeadline ()
 
 setDeadlineMode (int $a_val)
 Set deadline mode. More...
 
 getDeadlineMode ()
 
 setRelativeDeadline (int $a_val)
 
 getRelativeDeadline ()
 
 setRelDeadlineLastSubmission (int $a_val)
 
 getRelDeadlineLastSubmission ()
 
 getPersonalDeadline (int $a_user_id)
 
 getLastPersonalDeadline ()
 
 setExtendedDeadline (?int $a_val)
 
 getExtendedDeadline ()
 
 setInstruction (string $a_val)
 
 getInstruction ()
 
 getInstructionPresentation ()
 
 setTitle (string $a_val)
 
 getTitle ()
 
 setMandatory (bool $a_val)
 
 getMandatory ()
 
 setOrderNr (int $a_val)
 
 getOrderNr ()
 
 setType (int $a_value)
 Set type this will most probably become an non public function in the future (or become obsolete) More...
 
 getAssignmentType ()
 
 getType ()
 Get type this will most probably become an non public function in the future (or become obsolete) More...
 
 isValidType (int $a_value)
 
 setPeerReview (bool $a_value)
 
 getPeerReview ()
 
 setPeerReviewMin (int $a_value)
 
 getPeerReviewMin ()
 
 setPeerReviewSimpleUnlock (bool $a_value)
 
 getPeerReviewSimpleUnlock ()
 
 setPeerReviewDeadline (int $a_val)
 
 getPeerReviewDeadline ()
 
 setPeerReviewValid (int $a_value)
 Set peer review validation. More...
 
 getPeerReviewValid ()
 
 setPeerReviewRating (bool $a_val)
 
 hasPeerReviewRating ()
 
 setPeerReviewText (bool $a_val)
 
 hasPeerReviewText ()
 
 setPeerReviewFileUpload (bool $a_val)
 
 hasPeerReviewFileUpload ()
 
 setPeerReviewPersonalized (bool $a_val)
 
 hasPeerReviewPersonalized ()
 
 setPeerReviewChars (?int $a_value)
 
 getPeerReviewChars ()
 
 setPeerReviewCriteriaCatalogue (?int $a_value)
 
 getPeerReviewCriteriaCatalogue ()
 
 setFeedbackFile (?string $a_value)
 
 getFeedbackFile ()
 
 setFeedbackCron (bool $a_value)
 Toggle (global) feedback file cron. More...
 
 hasFeedbackCron ()
 
 setFeedbackDate (int $a_value)
 
 getFeedbackDate ()
 
 setFeedbackDateCustom (int $a_value)
 Set (global) feedback file availability using a custom date. More...
 
 getFeedbackDateCustom ()
 
 setTeamTutor (bool $a_value)
 
 getTeamTutor ()
 
 setMaxFile (?int $a_value)
 
 getMaxFile ()
 
 setPortfolioTemplateId (int $a_val)
 
 getPortfolioTemplateId ()
 
 read ()
 
 save ()
 
 update ()
 
 delete (ilObjExercise $exc, bool $update_status=true)
 
 getFiles ()
 
 getInstructionFilesOrder ()
 
 getMemberListData ()
 
 getExerciseMemberAssignmentData (int $a_user_id, string $a_grade="")
 Get submission data for an specific user,exercise and assignment. More...
 
 uploadAssignmentFiles (array $a_files)
 Upload assignment files (from creation form) More...
 
 sendMultiFeedbackStructureFile (ilObjExercise $exercise)
 Create member status record for a new assignment for all participants. More...
 
 uploadMultiFeedbackFile (array $a_file)
 
 getMultiFeedbackFiles (int $a_user_id=0)
 Get multi feedback files (of uploader) More...
 
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory. More...
 
 saveMultiFeedbackFiles (array $a_files, ilObjExercise $a_exc)
 
 afterDeadline ()
 
 afterDeadlineStrict (bool $a_include_personal=true)
 
 afterCustomDate ()
 
 beforeDeadline ()
 
 notStartedYet ()
 
 getGlobalFeedbackFileStoragePath ()
 
 deleteGlobalFeedbackFile ()
 
 handleGlobalFeedbackFileUpload (array $a_file)
 
 getGlobalFeedbackFilePath ()
 
 getMemberStatus (?int $a_user_id=null)
 
 recalculateLateSubmissions ()
 
 setIndividualDeadline (string $id, ilDateTime $date)
 
 getIndividualDeadlines ()
 
 hasActiveIDl ()
 
 hasReadOnlyIDl ()
 
 fixInstructionFileOrdering ()
 
 fileAddOrder (array $a_entries=array())
 
 setMinCharLimit (int $a_val)
 
 getMinCharLimit ()
 
 setMaxCharLimit (int $a_val)
 
 getMaxCharLimit ()
 
 getCalculatedDeadlines ()
 Get calculated deadlines for user/team members. More...
 
 canParticipantReceiveFeedback (int $part_id)
 

Static Public Member Functions

static getInstancesByExercise (int $a_exc_id)
 
static instructionFileGetFileOrderData (array $a_file_data, int $a_ass_id)
 
static getAssignmentDataOfExercise (int $a_exc_id)
 
static cloneAssignmentsOfExercise (int $a_old_exc_id, int $a_new_exc_id, array $a_crit_cat_map)
 Clone assignments of exercise. More...
 
static lookupMaxOrderNrForEx (int $a_exc_id)
 
static lookupAssignmentOnline (int $a_ass_id)
 
static lookupExerciseId (int $a_ass_id)
 
static lookupTitle (int $a_id)
 
static lookupType (int $a_id)
 
static saveAssOrderOfExercise (int $a_ex_id, array $a_order)
 
static orderAssByDeadline (int $a_ex_id)
 
static countMandatory (int $a_ex_id)
 
static count (int $a_ex_id)
 
static isInExercise (int $a_ass_id, int $a_ex_id)
 
static createNewUserRecords (int $a_user_id, int $a_exc_id)
 
static createNewAssignmentRecords (int $a_ass_id, ilObjExercise $a_exc)
 
static getPendingFeedbackNotifications ()
 
static sendFeedbackNotifications (int $a_ass_id, int $a_user_id=null)
 
static saveInstructionFilesOrderOfAssignment (int $a_ass_id, array $a_order)
 
static insertFileOrderNr (int $a_ass_id, string $a_filename, int $a_order_nr)
 
static instructionFileInsertOrder (string $a_filename, int $a_ass_id, int $a_order_nr=0)
 
static instructionFileDeleteOrder (int $a_ass_id, array $a_file)
 
static renameInstructionFile (string $a_old_name, string $a_new_name, int $a_ass_id)
 
static instructionFileExistsInDb (string $a_filename, int $a_ass_id)
 
static instructionFileOrderGetMax (int $a_ass_id)
 

Data Fields

const TYPE_UPLOAD = 1
 direct checks against const should be avoided, use type objects instead More...
 
const TYPE_BLOG = 2
 
const TYPE_PORTFOLIO = 3
 
const TYPE_UPLOAD_TEAM = 4
 
const TYPE_TEXT = 5
 
const TYPE_WIKI_TEAM = 6
 
const FEEDBACK_DATE_DEADLINE = 1
 
const FEEDBACK_DATE_SUBMISSION = 2
 
const FEEDBACK_DATE_CUSTOM = 3
 
const PEER_REVIEW_VALID_NONE = 1
 
const PEER_REVIEW_VALID_ONE = 2
 
const PEER_REVIEW_VALID_ALL = 3
 
const TEAMS_FORMED_BY_PARTICIPANTS = 0
 
const TEAMS_FORMED_BY_TUTOR = 1
 
const TEAMS_FORMED_BY_RANDOM = 2
 
const TEAMS_FORMED_BY_ASSIGNMENT = 3
 
const DEADLINE_ABSOLUTE = 0
 
const DEADLINE_RELATIVE = 1
 

Protected Member Functions

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

Protected Attributes

ILIAS Refinery String Group $string_transform
 
ilDBInterface $db
 
ilLanguage $lng
 
ilObjUser $user
 
ilAppEventHandler $app_event_handler
 
ilAccessHandler $access
 
int $id = 0
 
int $exc_id = 0
 
int $type = 0
 
int $start_time = null
 
int $deadline = null
 
int $deadline2 = null
 
string $instruction = ""
 
string $title = ""
 
bool $mandatory = false
 
int $order_nr = 0
 
bool $peer = false
 
int $peer_min = 0
 
bool $peer_unlock = false
 
int $peer_dl = 0
 
int $peer_valid
 
bool $peer_file = false
 
bool $peer_personal = false
 
int $peer_char = null
 
bool $peer_text = false
 
bool $peer_rating = false
 
int $peer_crit_cat = 0
 
string $feedback_file = null
 
bool $feedback_cron = false
 
int $feedback_date = 0
 
int $feedback_date_custom = 0
 
bool $team_tutor = false
 
int $max_file = null
 
int $portfolio_template = 0
 
int $min_char_limit = 0
 
int $max_char_limit = 0
 
ilExAssignmentTypes $types
 
ilExAssignmentTypeInterface $ass_type
 
int $deadline_mode = 0
 
int $relative_deadline = 0
 
int $rel_deadline_last_subm = 0
 
array $member_status = []
 
ilLogger $log
 
int $crit_cat = 0
 

Static Private Member Functions

static lookup (int $a_id, string $a_field)
 

Detailed Description

Exercise assignment.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

Exceptions
ilExcUnknownAssignmentTypeException

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

References $DIC, ILIAS\Repository\access(), ilExAssignmentTypes\getInstance(), ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), read(), setFeedbackDate(), setId(), setType(), and ILIAS\Repository\user().

107  {
108  global $DIC;
109 
110  $this->db = $DIC->database();
111  $this->lng = $DIC->language();
112  $this->user = $DIC->user();
113  $this->app_event_handler = $DIC["ilAppEventHandler"];
114  $this->types = ilExAssignmentTypes::getInstance();
115  $this->access = $DIC->access();
116 
117  $this->setType(self::TYPE_UPLOAD);
118  $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
119 
120  $this->log = ilLoggerFactory::getLogger("exc");
121 
122  if ($a_id > 0) {
123  $this->setId($a_id);
124  $this->read();
125  }
126  $this->string_transform = $DIC->refinery()
127  ->string();
128  }
static getLogger(string $a_component_id)
Get component logger.
setType(int $a_value)
Set type this will most probably become an non public function in the future (or become obsolete) ...
global $DIC
Definition: feed.php:28
setFeedbackDate(int $a_value)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterCustomDate()

ilExAssignment::afterCustomDate ( )
Returns
bool return if sample solution is available using a custom date.

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

References getFeedbackDateCustom().

Referenced by ilExAssignmentGUI\addSubmission().

1762  : bool
1763  {
1764  $date_custom = $this->getFeedbackDateCustom();
1765  //if the solution will be displayed only after reach all the deadlines.
1766  //$final_deadline = $this->afterDeadlineStrict();
1767  //$dl = max($final_deadline, time());
1768  //return ($date_custom - $dl <= 0);
1769  return ($date_custom - time() <= 0);
1770  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

References $ilUser, $user, and getPersonalDeadline().

Referenced by afterDeadlineStrict().

1724  : bool
1725  {
1726  $ilUser = $this->user;
1727 
1728  // :TODO: always current user?
1729  $idl = $this->getPersonalDeadline($ilUser->getId()); // official deadline
1730 
1731  // no deadline === true
1732  $deadline = max($this->deadline, $this->deadline2, $idl); // includes grace period
1733  return ($deadline - time() <= 0);
1734  }
getPersonalDeadline(int $a_user_id)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict ( bool  $a_include_personal = true)

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

References afterDeadline(), and getLastPersonalDeadline().

Referenced by beforeDeadline(), ilObjWikiGUI\getAssignmentButtons(), and ilExerciseSubmissionTableGUI\parseColumns().

1736  : bool
1737  {
1738  // :TODO: this means that peer feedback, global feedback is available
1739  // after LAST personal deadline
1740  // team management is currently ignoring personal deadlines
1741  $idl = $a_include_personal
1742  ? $this->getLastPersonalDeadline()
1743  : null;
1744 
1745  // no deadline === false
1746  $deadline = max($this->deadline, $this->deadline2, $idl);
1747 
1748  // #18271 - afterDeadline() does not handle last personal deadline
1749  // after effective deadline of all users
1750  if ($idl && $deadline == $idl) {
1751  return ($deadline - time() <= 0);
1752  }
1753 
1754  // like: after effective deadline (for single user), except: no deadline false
1755  return ($deadline > 0 &&
1756  $this->afterDeadline());
1757  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

References afterDeadlineStrict().

1773  : bool
1774  {
1775  // no deadline === true
1776  return !$this->afterDeadlineStrict();
1777  }
afterDeadlineStrict(bool $a_include_personal=true)
+ Here is the call graph for this function:

◆ canParticipantReceiveFeedback()

ilExAssignment::canParticipantReceiveFeedback ( int  $part_id)

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

References getId(), ilExAssignmentTeam\getTeamId(), and hasTeam().

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

2208  : bool
2209  {
2210  if ($this->hasTeam()) {
2211  if (!ilExAssignmentTeam::getTeamId($this->getId(), $part_id)) {
2212  return false;
2213  }
2214  }
2215  return true;
2216  }
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

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

References $ilUser, $user, ilFileUtils\delDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

1511  : void
1512  {
1513  $ilUser = $this->user;
1514 
1515  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1516  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1517  ilFileUtils::delDir($mfu);
1518  }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

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

Clone assignments of exercise.

Exceptions
DirectoryNotFoundException
FileNotFoundException
IOException
ilExcUnknownAssignmentTypeException|ilDateTimeException

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

References $d, ilExAssignmentTypeInterface\cloneSpecificProperties(), ilFSStorageExercise\create(), ilFileSystemAbstractionStorage\create(), ilExAssignmentReminder\FEEDBACK_REMINDER, ilFileSystemAbstractionStorage\getAbsolutePath(), ilFSStorageExercise\getGlobalFeedbackPath(), ilExAssignmentReminder\GRADE_REMINDER, insertFileOrderNr(), ilFileUtils\rCopy(), ilExAssignmentReminder\setReminderStatus(), and ilExAssignmentReminder\SUBMIT_REMINDER.

Referenced by ilObjExercise\saveData().

926  : void {
927  $ass_data = self::getInstancesByExercise($a_old_exc_id);
928  foreach ($ass_data as $d) {
929  // clone assignment
930  $new_ass = new ilExAssignment();
931  $new_ass->setExerciseId($a_new_exc_id);
932  $new_ass->setTitle($d->getTitle());
933  $new_ass->setDeadline($d->getDeadline());
934  $new_ass->setExtendedDeadline($d->getExtendedDeadline());
935  $new_ass->setInstruction($d->getInstruction());
936  $new_ass->setMandatory($d->getMandatory());
937  $new_ass->setOrderNr($d->getOrderNr());
938  $new_ass->setStartTime($d->getStartTime());
939  $new_ass->setType($d->getType());
940  $new_ass->setPeerReview($d->getPeerReview());
941  $new_ass->setPeerReviewMin($d->getPeerReviewMin());
942  $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
943  $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
944  $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
945  $new_ass->setPeerReviewValid($d->getPeerReviewValid());
946  $new_ass->setPeerReviewChars($d->getPeerReviewChars());
947  $new_ass->setPeerReviewText($d->hasPeerReviewText());
948  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
949  $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
950  $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
951  $new_ass->setFeedbackFile($d->getFeedbackFile());
952  $new_ass->setFeedbackDate($d->getFeedbackDate());
953  $new_ass->setFeedbackDateCustom($d->getFeedbackDateCustom());
954  $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
955  $new_ass->setTeamTutor($d->getTeamTutor());
956  $new_ass->setMaxFile($d->getMaxFile());
957  $new_ass->setMinCharLimit($d->getMinCharLimit());
958  $new_ass->setMaxCharLimit($d->getMaxCharLimit());
959  $new_ass->setPortfolioTemplateId($d->getPortfolioTemplateId());
960  $new_ass->setDeadlineMode($d->getDeadlineMode());
961  $new_ass->setRelativeDeadline($d->getRelativeDeadline());
962  $new_ass->setRelDeadlineLastSubmission($d->getRelDeadlineLastSubmission());
963 
964  // criteria catalogue(s)
965  if ($d->getPeerReviewCriteriaCatalogue() &&
966  array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map)) {
967  $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
968  }
969 
970  $new_ass->save();
971 
972 
973  // clone assignment files
974  $old_web_storage = new ilFSWebStorageExercise($a_old_exc_id, $d->getId());
975  $new_web_storage = new ilFSWebStorageExercise($a_new_exc_id, $new_ass->getId());
976  $new_web_storage->create();
977  if (is_dir($old_web_storage->getAbsolutePath())) {
978  ilFileUtils::rCopy($old_web_storage->getAbsolutePath(), $new_web_storage->getAbsolutePath());
979  }
980  $order = $d->getInstructionFilesOrder();
981  foreach ($order as $file) {
982  ilExAssignment::insertFileOrderNr($new_ass->getId(), $file["filename"], $file["order_nr"]);
983  }
984 
985  // clone global feedback file
986  $old_storage = new ilFSStorageExercise($a_old_exc_id, $d->getId());
987  $new_storage = new ilFSStorageExercise($a_new_exc_id, $new_ass->getId());
988  $new_storage->create();
989  if (is_dir($old_storage->getGlobalFeedbackPath())) {
990  ilFileUtils::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
991  }
992 
993  // clone reminders
997  $rmd_sub = new ilExAssignmentReminder($a_old_exc_id, $d->getId(), $rem_type);
998  if ($rmd_sub->getReminderStatus()) {
999  $new_rmd_sub = new ilExAssignmentReminder($a_new_exc_id, $new_ass->getId(), $rem_type);
1000  $new_rmd_sub->setReminderStatus($rmd_sub->getReminderStatus());
1001  $new_rmd_sub->setReminderStart($rmd_sub->getReminderStart());
1002  $new_rmd_sub->setReminderEnd($rmd_sub->getReminderEnd());
1003  $new_rmd_sub->setReminderFrequency($rmd_sub->getReminderFrequency());
1004  $new_rmd_sub->setReminderMailTemplate($rmd_sub->getReminderMailTemplate());
1005  $new_rmd_sub->save();
1006  }
1007  }
1008 
1009 
1010  // type specific properties
1011  $ass_type = $d->getAssignmentType();
1012  $ass_type->cloneSpecificProperties($d, $new_ass);
1013  }
1014  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Exercise assignment.
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
cloneSpecificProperties(ilExAssignment $source, ilExAssignment $target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAbsolutePath()
Calculates the full path on the filesystem.
static insertFileOrderNr(int $a_ass_id, string $a_filename, int $a_order_nr)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilExAssignmentTypeInterface $ass_type
setReminderStatus(?bool $a_status)
Set reminder for users without submission.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ count()

static ilExAssignment::count ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by getMultiFeedbackFiles(), and ilObjExerciseGUI\listAssignmentsObject().

1170  : int
1171  {
1172  global $DIC;
1173 
1174  $ilDB = $DIC->database();
1175 
1176  $set = $ilDB->query(
1177  "SELECT count(*) cntm FROM exc_assignment " .
1178  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer")
1179  );
1180  $rec = $ilDB->fetchAssoc($set);
1181  return $rec["cntm"];
1182  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ countMandatory()

static ilExAssignment::countMandatory ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by ilObjExerciseGUI\listAssignmentsObject().

1154  : int
1155  {
1156  global $DIC;
1157 
1158  $ilDB = $DIC->database();
1159 
1160  $set = $ilDB->query(
1161  "SELECT count(*) cntm FROM exc_assignment " .
1162  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1163  " AND mandatory = " . $ilDB->quote(1, "integer")
1164  );
1165  $rec = $ilDB->fetchAssoc($set);
1166  return (int) $rec["cntm"];
1167  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

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

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

References $DIC, and $ilDB.

1330  : void {
1331  global $DIC;
1332 
1333  $ilDB = $DIC->database();
1334 
1335  $exmem = new ilExerciseMembers($a_exc);
1336  $mems = $exmem->getMembers();
1337 
1338  foreach ($mems as $mem) {
1339  $ilDB->replace("exc_mem_ass_status", array(
1340  "ass_id" => array("integer", $a_ass_id),
1341  "usr_id" => array("integer", $mem)
1342  ), array(
1343  "status" => array("text", "notgraded")
1344  ));
1345  }
1346  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

◆ createNewUserRecords()

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

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

References $DIC, and $ilDB.

Referenced by ilExerciseMembers\assignMember().

1309  : void {
1310  global $DIC;
1311 
1312  $ilDB = $DIC->database();
1313 
1314  $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1315  foreach ($ass_data as $ass) {
1316  //echo "-".$ass["id"]."-".$a_user_id."-";
1317  $ilDB->replace("exc_mem_ass_status", array(
1318  "ass_id" => array("integer", $ass["id"]),
1319  "usr_id" => array("integer", $a_user_id)
1320  ), array(
1321  "status" => array("text", "notgraded")
1322  ));
1323  }
1324  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ delete()

ilExAssignment::delete ( ilObjExercise  $exc,
bool  $update_status = true 
)
Exceptions
ilDateTimeException

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

References $db, $ilDB, deleteGlobalFeedbackFile(), getExerciseId(), getId(), getPeerReview(), handleCalendarEntries(), and ilObjExercise\updateAllUsersStatus().

819  : void {
820  $ilDB = $this->db;
821 
822  // delete submissions
823  $exc_members = new ilExerciseMembers($exc);
824  foreach ($exc_members->getMembers() as $mem) {
825  $submission = new ilExSubmission($this, $mem);
826  $submission->deleteAllFiles();
827  }
828 
829  $ilDB->manipulateF(
830  "DELETE FROM exc_usr_tutor " .
831  "WHERE ass_id = %s",
832  array("integer"),
833  array($this->getId())
834  );
835 
836  $this->deleteGlobalFeedbackFile();
837 
838  // remove peer review data
839  if ($this->getPeerReview()) {
840  $peer_review = new ilExPeerReview($this);
841  $peer_review->resetPeerReviews();
842  }
843 
844  $ilDB->manipulate(
845  "DELETE FROM exc_ass_file_order" .
846  " WHERE assignment_id = " . $ilDB->quote($this->getId(), 'integer')
847  );
848 
849  $ilDB->manipulate(
850  "DELETE FROM exc_mem_ass_status" .
851  " WHERE ass_id = " . $ilDB->quote($this->getId(), 'integer')
852  );
853 
854  $ilDB->manipulate(
855  "DELETE FROM exc_assignment WHERE " .
856  " id = " . $ilDB->quote($this->getId(), "integer")
857  );
858 
859  if ($update_status) {
860  $exc = new ilObjExercise($this->getExerciseId(), false);
861  $exc->updateAllUsersStatus();
862  }
863 
864  $this->handleCalendarEntries("delete", $exc);
865 
866  $reminder = new ilExAssignmentReminder();
867  $reminder->deleteReminders($this->getId());
868  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateAllUsersStatus()
Update status of all users.
Exercise peer review.
Class ilObjExercise.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

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

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

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

1795  : void
1796  {
1798  }
static delDir(string $a_dir, bool $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:

◆ fileAddOrder()

ilExAssignment::fileAddOrder ( array  $a_entries = array())

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

References Vendor\Package\$e, fixInstructionFileOrdering(), and getInstructionFilesOrder().

2123  : array {
2124  $this->fixInstructionFileOrdering();
2125 
2126  $order = $this->getInstructionFilesOrder();
2127  foreach ($a_entries as $k => $e) {
2128  $a_entries[$k]["order_val"] = $order[$e["file"]]["order_nr"] ?? 0;
2129  $a_entries[$k]["order_id"] = $order[$e["file"]]["id"] ?? "";
2130  }
2131 
2132  return $a_entries;
2133  }
+ Here is the call graph for this function:

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

References $db, Vendor\Package\$f, ilDBInterface\fetchAssoc(), getFiles(), getId(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by fileAddOrder().

2082  : void
2083  {
2084  $db = $this->db;
2085 
2086  $files = array_map(function ($v) {
2087  return $v["name"];
2088  }, $this->getFiles());
2089 
2090  $set = $db->query("SELECT * FROM exc_ass_file_order " .
2091  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2092  " ORDER BY order_nr");
2093  $order_nr = 10;
2094  $numbered_files = array();
2095  while ($rec = $db->fetchAssoc($set)) {
2096  // file exists, set correct order nr
2097  if (in_array($rec["filename"], $files)) {
2098  $db->manipulate(
2099  "UPDATE exc_ass_file_order SET " .
2100  " order_nr = " . $db->quote($order_nr, "integer") .
2101  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2102  " AND id = " . $db->quote($rec["id"], "integer")
2103  );
2104  $order_nr += 10;
2105  $numbered_files[] = $rec["filename"];
2106  } else { // file does not exist, delete entry
2107  $db->manipulate(
2108  "DELETE FROM exc_ass_file_order " .
2109  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2110  " AND id = " . $db->quote($rec["id"], "integer")
2111  );
2112  }
2113  }
2114  foreach ($files as $f) {
2115  if (!in_array($f, $numbered_files)) {
2116  self::instructionFileInsertOrder($f, $this->getId());
2117  }
2118  }
2119  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise ( int  $a_exc_id)
static

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

References $data, $DIC, and $ilDB.

Referenced by ilExerciseXMLParser\__construct(), ilObjExercise\delete(), ilExAssignmentTeam\getAdoptableTeamAssignments(), ilObjExerciseGUI\getService(), and ilExerciseXMLWriter\start().

872  : array
873  {
874  global $DIC;
875 
876  $ilDB = $DIC->database();
877 
878  // should be changed to self::getInstancesByExerciseId()
879 
880  $set = $ilDB->query("SELECT * FROM exc_assignment " .
881  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
882  " ORDER BY order_nr");
883  $data = array();
884 
885  $order_val = 10;
886  while ($rec = $ilDB->fetchAssoc($set)) {
887  $data[] = array(
888  "id" => (int) $rec["id"],
889  "exc_id" => (int) $rec["exc_id"],
890  "deadline" => (int) $rec["time_stamp"],
891  "deadline2" => (int) $rec["deadline2"],
892  "instruction" => (string) $rec["instruction"],
893  "title" => (string) $rec["title"],
894  "start_time" => (int) $rec["start_time"],
895  "order_val" => $order_val,
896  "mandatory" => (bool) $rec["mandatory"],
897  "type" => (int) $rec["type"],
898  "peer" => (bool) $rec["peer"],
899  "peer_min" => (int) $rec["peer_min"],
900  "peer_dl" => (int) $rec["peer_dl"],
901  "peer_file" => (bool) $rec["peer_file"],
902  "peer_prsl" => (bool) $rec["peer_prsl"],
903  "fb_file" => (string) $rec["fb_file"],
904  "fb_date" => (int) $rec["fb_date"],
905  "fb_cron" => (bool) $rec["fb_cron"],
906  "deadline_mode" => (int) $rec["deadline_mode"],
907  "relative_deadline" => (int) $rec["relative_deadline"],
908  "rel_deadline_last_subm" => (int) $rec["rel_deadline_last_subm"]
909  );
910  $order_val += 10;
911  }
912  return $data;
913  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getAssignmentType()

ilExAssignment::getAssignmentType ( )

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

References $ass_type.

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

392  {
393  return $this->ass_type;
394  }
ilExAssignmentTypeInterface $ass_type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getCalculatedDeadlines()

ilExAssignment::getCalculatedDeadlines ( )

Get calculated deadlines for user/team members.

These arrays will contain no entries, if team or user has not started the assignment yet.

Returns
array[array] contains two arrays one with key "user", second with key "team", each one has member id as keys and calculated deadline as value

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

References $type, getDeadlineMode(), getId(), getRelativeDeadline(), and ilExcIndividualDeadline\getStartingTimestamps().

2186  : array
2187  {
2188  $calculated_deadlines = array(
2189  "user" => array(),
2190  "team" => array()
2191  );
2192 
2193  if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
2194  foreach (ilExcIndividualDeadline::getStartingTimestamps($this->getId()) as $ts) {
2195  $type = $ts["is_team"]
2196  ? "team"
2197  : "user";
2198 
2199  $calculated_deadlines[$type][$ts["member_id"]] = array(
2200  "calculated_deadline" => $ts["starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
2201  );
2202  }
2203  }
2204  return $calculated_deadlines;
2205  }
static getStartingTimestamps(int $a_ass_id)
Get starting timestamp data for an assignment.
+ Here is the call graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

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

References $deadline.

Referenced by getPersonalDeadline(), handleCalendarEntries(), hasActiveIDl(), ilExerciseSubmissionTableGUI\parseColumns(), save(), ilObjExercise\update(), and update().

231  : ?int
232  {
233  return $this->deadline;
234  }
+ Here is the caller graph for this function:

◆ getDeadlineMode()

ilExAssignment::getDeadlineMode ( )

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

References $deadline_mode.

Referenced by getCalculatedDeadlines(), handleCalendarEntries(), save(), and update().

245  : int
246  {
247  return $this->deadline_mode;
248  }
+ Here is the caller graph for this function:

◆ getExerciseId()

◆ getExerciseMemberAssignmentData()

ilExAssignment::getExerciseMemberAssignmentData ( int  $a_user_id,
string  $a_grade = "" 
)

Get submission data for an specific user,exercise and assignment.

todo we can refactor a bit the method getMemberListData to use this and remove duplicate code.

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

References $data, $DIC, $ilDB, and getId().

1272  : ?array {
1273  global $DIC;
1274  $ilDB = $DIC->database();
1275 
1276  $and_grade = "";
1277  if (in_array($a_grade, array("notgraded", "passed", "failed"))) {
1278  $and_grade = " AND status = " . $ilDB->quote($a_grade, "text");
1279  }
1280 
1281  $q = "SELECT * FROM exc_mem_ass_status " .
1282  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1283  " AND usr_id = " . $ilDB->quote($a_user_id, "integer") .
1284  $and_grade;
1285 
1286  $set = $ilDB->query($q);
1287 
1288  $data = null;
1289  while ($rec = $ilDB->fetchAssoc($set)) {
1290  $sub = new ilExSubmission($this, $a_user_id);
1291 
1292  $data["sent_time"] = $rec["sent_time"];
1293  $data["submission"] = $sub->getLastSubmission();
1294  $data["status_time"] = $rec["status_time"];
1295  $data["feedback_time"] = $rec["feedback_time"];
1296  $data["notice"] = $rec["notice"];
1297  $data["status"] = $rec["status"];
1298  $data["mark"] = $rec["mark"];
1299  $data["comment"] = $rec["u_comment"];
1300  }
1301 
1302  return $data;
1303  }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

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

References $deadline2.

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

314  : ?int
315  {
316  return $this->deadline2;
317  }
+ Here is the caller graph for this function:

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

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

References $feedback_date.

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

589  : int
590  {
591  return $this->feedback_date;
592  }
+ Here is the caller graph for this function:

◆ getFeedbackDateCustom()

ilExAssignment::getFeedbackDateCustom ( )

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

References $feedback_date_custom.

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

603  : int
604  {
606  }
+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

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

References $feedback_file.

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

565  : ?string
566  {
567  return $this->feedback_file;
568  }
+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

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

References getExerciseId(), and getId().

Referenced by ilExAssignmentGUI\addFiles(), and fixInstructionFileOrdering().

1016  : array
1017  {
1018  $this->log->debug("getting files from class.ilExAssignment using ilFSWebStorageExercise");
1019  $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1020  return $storage->getFiles();
1021  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

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

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

1814  : string
1815  {
1816  $file = $this->getFeedbackFile();
1817  if ($file) {
1819  return $path . "/" . $file;
1820  }
1821  return "";
1822  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

References getExerciseId(), and getId().

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

1789  : string
1790  {
1791  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1792  return $storage->getGlobalFeedbackPath();
1793  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilExAssignment::getId ( )

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

References $id.

Referenced by ilExPeerReview\__construct(), ilExSubmission\__construct(), ilExcAssMemberState\__construct(), ilExAssignmentGUI\addFiles(), ilExAssignmentGUI\addInstructions(), ilExAssignmentGUI\addPublicSubmissions(), ilExAssignmentGUI\addSchedule(), ilExAssignmentGUI\addSubmission(), ilExAssignmentGUI\addSubmissionFeedback(), canParticipantReceiveFeedback(), clearMultiFeedbackDirectory(), ilExAssTypeWikiTeam\cloneSpecificProperties(), delete(), ilExSubmission\downloadAllAssignmentFiles(), fixInstructionFileOrdering(), ilExAssignmentEditorGUI\generateTeams(), getCalculatedDeadlines(), getExerciseMemberAssignmentData(), getFiles(), ilExAssTypeWikiTeamGUI\getFormValuesArray(), getGlobalFeedbackFileStoragePath(), getMemberListData(), getMemberStatus(), getMultiFeedbackFiles(), ilExAssignmentGUI\getOverviewBody(), ilExAssignmentGUI\getOverviewHeader(), getPersonalDeadline(), handleCalendarEntries(), ilExAssTypeWikiTeam\handleNewUpload(), ilExAssTypeWikiTeamGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importFormToAssignment(), ilExAssignmentEditorGUI\importPeerReviewFormToAssignment(), ilExerciseSubmissionTableGUI\parseColumns(), recalculateLateSubmissions(), saveMultiFeedbackFiles(), sendMultiFeedbackStructureFile(), setIndividualDeadline(), ilObjExercise\update(), update(), uploadAssignmentFiles(), and uploadMultiFeedbackFile().

201  : int
202  {
203  return $this->id;
204  }
+ Here is the caller graph for this function:

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

References $db, $ilDB, and $res.

Referenced by getMemberListData().

1901  : array
1902  {
1903  $ilDB = $this->db;
1904 
1905  $res = array();
1906 
1907  $set = $ilDB->query("SELECT * FROM exc_idl" .
1908  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
1909  while ($row = $ilDB->fetchAssoc($set)) {
1910  if ($row["is_team"]) {
1911  $row["member_id"] = "t" . $row["member_id"];
1912  }
1913 
1914  $res[$row["member_id"]] = $row["tstamp"];
1915  }
1916 
1917  return $res;
1918  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ getInstancesByExercise()

static ilExAssignment::getInstancesByExercise ( int  $a_exc_id)
static
Parameters
int$a_exc_id
Returns
ilExAssignment[]
Exceptions
ilExcUnknownAssignmentTypeException

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

References $data, $DIC, and $ilDB.

Referenced by ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\__construct(), ilExGradesTableGUI\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), ilObjExerciseGUI\addLocatorItems(), ilExerciseMembers\deassignMember(), ilExSubmission\deleteUser(), ilObjExercise\exportGradesExcel(), ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\getAssignmentSelection(), ilExcCriteriaCatalogueTableGUI\getItems(), ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\getNumberOfMandatoryAssignments(), ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\getTotalNumberOfAssignments(), ilExerciseManagementGUI\membersObject(), ilAssignmentsPerParticipantTableGUI\parseData(), ilExerciseManagementCollectFilesJob\run(), and ilObjExercise\update().

135  : array
136  {
137  global $DIC;
138 
139  $ilDB = $DIC->database();
140 
141  $set = $ilDB->query("SELECT * FROM exc_assignment " .
142  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
143  " ORDER BY order_nr");
144  $data = array();
145 
146  $order_val = 10;
147  while ($rec = $ilDB->fetchAssoc($set)) {
148  // ???
149  $rec["order_val"] = $order_val;
150 
151  $ass = new self();
152  $ass->initFromDB($rec);
153  $data[] = $ass;
154 
155  $order_val += 10;
156  }
157 
158  return $data;
159  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

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

References $instruction.

Referenced by getInstructionPresentation(), save(), ilObjExercise\update(), and update().

324  : string
325  {
326  return $this->instruction;
327  }
+ Here is the caller graph for this function:

◆ getInstructionFilesOrder()

ilExAssignment::getInstructionFilesOrder ( )

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

References $data, $db, and $ilDB.

Referenced by fileAddOrder().

1023  : array
1024  {
1025  $ilDB = $this->db;
1026 
1027  $set = $ilDB->query(
1028  "SELECT filename, order_nr, id FROM exc_ass_file_order " .
1029  " WHERE assignment_id = " . $ilDB->quote($this->getId(), "integer")
1030  );
1031 
1032  $data = array();
1033  while ($rec = $ilDB->fetchAssoc($set)) {
1034  $data[$rec['filename']] = $rec;
1035  }
1036 
1037  return $data;
1038  }
+ Here is the caller graph for this function:

◆ getInstructionPresentation()

ilExAssignment::getInstructionPresentation ( )

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

References getInstruction().

329  : string
330  {
331  $inst = $this->getInstruction();
332  if (trim($inst)) {
333  $is_html = (strlen($inst) != strlen(strip_tags($inst)));
334  if (!$is_html) {
335  $inst = nl2br(
336  $this->string_transform->makeClickable()->transform($inst)
337  );
338  }
339  }
340  return $inst;
341  }
+ Here is the call graph for this function:

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )

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

References $db, and $ilDB.

Referenced by afterDeadlineStrict().

298  : int
299  {
300  $ilDB = $this->db;
301 
302  $set = $ilDB->query("SELECT MAX(tstamp) FROM exc_idl" .
303  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
304  $row = $ilDB->fetchAssoc($set);
305  return $row["tstamp"] ?? 0;
306  }
+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

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

References $mandatory.

Referenced by save(), and update().

358  : bool
359  {
360  return $this->mandatory;
361  }
+ Here is the caller graph for this function:

◆ getMaxCharLimit()

ilExAssignment::getMaxCharLimit ( )

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

References $max_char_limit.

Referenced by ilExAssTypeTextGUI\getFormValuesArray(), save(), and update().

2173  : int
2174  {
2175  return $this->max_char_limit;
2176  }
+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

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

References $max_file.

Referenced by save(), and update().

625  : ?int
626  {
627  return $this->max_file;
628  }
+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

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

References $db, $ilDB, $name, ilObject\_exists(), ilObjUser\_lookupName(), getId(), and getIndividualDeadlines().

1202  : array
1203  {
1204  $ilDB = $this->db;
1205 
1206  $mem = array();
1207 
1208  // first get list of members from member table
1209  $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login" .
1210  " FROM exc_members excm" .
1211  " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)" .
1212  " WHERE excm.obj_id = " . $ilDB->quote($this->getExerciseId(), "integer"));
1213  while ($rec = $ilDB->fetchAssoc($set)) {
1214  $mem[$rec["usr_id"]] =
1215  array(
1216  "name" => $rec["lastname"] . ", " . $rec["firstname"],
1217  "login" => $rec["login"],
1218  "usr_id" => $rec["usr_id"],
1219  "lastname" => $rec["lastname"],
1220  "firstname" => $rec["firstname"]
1221  );
1222  }
1223 
1224  // users in idl may already exist before occuring in the members db table
1225  // if user starts an assignment with relative deadline
1226  $idl = $this->getIndividualDeadlines();
1227  if (!$this->ass_type->usesTeams()) {
1228  foreach ($idl as $user_id => $v) {
1229  if (!isset($mem[$user_id])) {
1230  if (ilObjUser::_exists((int) $user_id)) {
1231  $name = ilObjUser::_lookupName($user_id);
1232  $mem[$user_id] =
1233  array(
1234  "name" => $name["lastname"] . ", " . $name["firstname"],
1235  "login" => $name["login"],
1236  "usr_id" => $user_id,
1237  "lastname" => $name["lastname"],
1238  "firstname" => $name["firstname"]
1239  );
1240  }
1241  }
1242  }
1243  }
1244 
1245  $q = "SELECT * FROM exc_mem_ass_status " .
1246  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer");
1247  $set = $ilDB->query($q);
1248  while ($rec = $ilDB->fetchAssoc($set)) {
1249  if (isset($mem[$rec["usr_id"]])) {
1250  $sub = new ilExSubmission($this, $rec["usr_id"]);
1251 
1252  $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1253  $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1254  $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1255  $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1256  $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1257  $mem[$rec["usr_id"]]["status"] = $rec["status"];
1258  $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1259  $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1260  }
1261  }
1262  return $mem;
1263  }
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getMemberStatus()

ilExAssignment::getMemberStatus ( ?int  $a_user_id = null)

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

References $ilUser, $user, and getId().

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

1825  {
1826  $ilUser = $this->user;
1827 
1828  if (!$a_user_id) {
1829  $a_user_id = $ilUser->getId();
1830  }
1831  if (!array_key_exists($a_user_id, $this->member_status)) {
1832  $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
1833  }
1834  return $this->member_status[$a_user_id];
1835  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinCharLimit()

ilExAssignment::getMinCharLimit ( )

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

References $min_char_limit.

Referenced by ilExAssTypeTextGUI\getFormValuesArray(), save(), and update().

2162  : int
2163  {
2164  return $this->min_char_limit;
2165  }
+ Here is the caller graph for this function:

◆ getMultiFeedbackFiles()

ilExAssignment::getMultiFeedbackFiles ( int  $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 1451 of file class.ilExAssignment.php.

References Vendor\Package\$f, $i, $ilUser, $name, $parts, $user, ilObjUser\_lookupName(), count(), ilFileUtils\getDir(), getExerciseId(), getId(), and ILIAS\Repository\int().

Referenced by saveMultiFeedbackFiles().

1451  : array
1452  {
1453  $ilUser = $this->user;
1454 
1455  if ($a_user_id == 0) {
1456  $a_user_id = $ilUser->getId();
1457  }
1458 
1459  $mf_files = array();
1460 
1461  // get members
1462  $exc = new ilObjExercise($this->getExerciseId(), false);
1463  $exmem = new ilExerciseMembers($exc);
1464  $mems = $exmem->getMembers();
1465 
1466  // read mf directory
1467  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1468  $mfu = $storage->getMultiFeedbackUploadPath($a_user_id);
1469 
1470  // get subdir that starts with multi_feedback
1471  $subdirs = ilFileUtils::getDir($mfu);
1472  $subdir = "notfound";
1473  foreach ($subdirs as $s => $j) {
1474  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1475  $subdir = $s;
1476  }
1477  }
1478 
1479  $items = ilFileUtils::getDir($mfu . "/" . $subdir);
1480  foreach ($items as $k => $i) {
1481  // check directory
1482  if ($i["type"] == "dir" && !in_array($k, array(".", ".."))) {
1483  // check if valid member id is given
1484  $parts = explode("_", $i["entry"]);
1485  $user_id = (int) $parts[count($parts) - 1];
1486  if (in_array($user_id, $mems)) {
1487  // read dir of user
1488  $name = ilObjUser::_lookupName($user_id);
1489  $files = ilFileUtils::getDir($mfu . "/" . $subdir . "/" . $k);
1490  foreach ($files as $k2 => $f) {
1491  // append files to array
1492  if ($f["type"] == "file" && substr($k2, 0, 1) != ".") {
1493  $mf_files[] = array(
1494  "lastname" => $name["lastname"],
1495  "firstname" => $name["firstname"],
1496  "login" => $name["login"],
1497  "user_id" => $name["user_id"],
1498  "full_path" => $mfu . "/" . $subdir . "/" . $k . "/" . $k2,
1499  "file" => $k2);
1500  }
1501  }
1502  }
1503  }
1504  }
1505  return $mf_files;
1506  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
static count(int $a_ex_id)
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
Class ilObjExercise.
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

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

References $order_nr.

Referenced by save(), and update().

368  : int
369  {
370  return $this->order_nr;
371  }
+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

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

References $peer.

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

416  : bool
417  {
418  return $this->peer;
419  }
+ Here is the caller graph for this function:

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

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

References $peer_char.

Referenced by save(), and update().

517  : ?int
518  {
519  return $this->peer_char;
520  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

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

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

Referenced by save(), and update().

527  : ?int
528  {
529  return $this->crit_cat;
530  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

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

References $peer_dl.

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

449  : int
450  {
451  return $this->peer_dl;
452  }
+ Here is the caller graph for this function:

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

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

References $peer_min.

Referenced by save(), and update().

426  : int
427  {
428  return $this->peer_min;
429  }
+ Here is the caller graph for this function:

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

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

References $peer_unlock.

Referenced by save(), and update().

436  : bool
437  {
438  return $this->peer_unlock;
439  }
+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

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

References $peer_valid.

Referenced by save(), and update().

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

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

References $DIC, $ilDB, and $res.

Referenced by ilExcCronFeedbackNotification\run().

1630  : array
1631  {
1632  global $DIC;
1633 
1634  $ilDB = $DIC->database();
1635 
1636  $res = array();
1637 
1638  $set = $ilDB->query("SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
1639  " WHERE fb_cron = " . $ilDB->quote(1, "integer") .
1640  " AND (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer") .
1641  " AND time_stamp IS NOT NULL" .
1642  " AND time_stamp > " . $ilDB->quote(0, "integer") .
1643  " AND time_stamp < " . $ilDB->quote(time(), "integer") .
1644  " AND fb_cron_done = " . $ilDB->quote(0, "integer") .
1645  ") OR (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_CUSTOM, "integer") .
1646  " AND fb_date_custom IS NOT NULL" .
1647  " AND fb_date_custom > " . $ilDB->quote(0, "integer") .
1648  " AND fb_date_custom < " . $ilDB->quote(time(), "integer") .
1649  " AND fb_cron_done = " . $ilDB->quote(0, "integer") . ")");
1650 
1651 
1652 
1653  while ($row = $ilDB->fetchAssoc($set)) {
1654  if ($row['fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
1655  $max = max($row['time_stamp'], $row['deadline2']);
1656  if (trim($row["fb_file"]) && $max <= time()) {
1657  $res[] = $row["id"];
1658  }
1659  } elseif ($row['fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
1660  if (trim($row["fb_file"] ?? "") && ($row['fb_date_custom'] ?? 0) <= time()) {
1661  $res[] = $row["id"];
1662  }
1663  }
1664  }
1665 
1666  return $res;
1667  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getPersonalDeadline()

ilExAssignment::getPersonalDeadline ( int  $a_user_id)

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

References $db, $ilDB, getDeadline(), getId(), and ilExAssignmentTeam\getTeamId().

Referenced by afterDeadline(), and recalculateLateSubmissions().

272  : int
273  {
274  $ilDB = $this->db;
275 
276  $is_team = false;
277  if ($this->ass_type->usesTeams()) {
278  $team_id = ilExAssignmentTeam::getTeamId($this->getId(), $a_user_id);
279  if (!$team_id) {
280  // #0021043
281  return $this->getDeadline();
282  }
283  $a_user_id = $team_id;
284  $is_team = true;
285  }
286 
287  $set = $ilDB->query("SELECT tstamp FROM exc_idl" .
288  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
289  " AND member_id = " . $ilDB->quote($a_user_id, "integer") .
290  " AND is_team = " . $ilDB->quote($is_team, "integer"));
291  $row = $ilDB->fetchAssoc($set);
292 
293  // use assignment deadline if no direct personal
294  return max(($row["tstamp"] ?? 0), $this->getDeadline());
295  }
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPortfolioTemplateId()

ilExAssignment::getPortfolioTemplateId ( )

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

References $portfolio_template.

Referenced by ilExAssTypePortfolioGUI\getFormValuesArray(), save(), and update().

636  : int
637  {
639  }
+ Here is the caller graph for this function:

◆ getRelativeDeadline()

ilExAssignment::getRelativeDeadline ( )

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

References $relative_deadline.

Referenced by getCalculatedDeadlines(), hasActiveIDl(), save(), and update().

255  : int
256  {
258  }
+ Here is the caller graph for this function:

◆ getRelDeadlineLastSubmission()

ilExAssignment::getRelDeadlineLastSubmission ( )

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

References $rel_deadline_last_subm.

Referenced by save(), and update().

265  : int
266  {
268  }
+ Here is the caller graph for this function:

◆ getStartTime()

ilExAssignment::getStartTime ( )

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

References $start_time.

Referenced by save(), and update().

221  : ?int
222  {
223  return $this->start_time;
224  }
+ Here is the caller graph for this function:

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

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

References $team_tutor.

Referenced by save(), and update().

614  : bool
615  {
616  return $this->team_tutor;
617  }
+ Here is the caller graph for this function:

◆ getTitle()

ilExAssignment::getTitle ( )

◆ getType()

ilExAssignment::getType ( )

Get type this will most probably become an non public function in the future (or become obsolete)

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

References $type.

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

401  : int
402  {
403  return $this->type;
404  }
+ Here is the caller graph for this function:

◆ handleCalendarEntries()

ilExAssignment::handleCalendarEntries ( string  $a_event,
ilObjExercise  $exc 
)
protected

Handle calendar entries for deadline(s)

Exceptions
ilDateTimeException

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

References $app, $app_event_handler, DEADLINE_RELATIVE, getDeadline(), getDeadlineMode(), getId(), ilObject\getId(), getPeerReview(), getPeerReviewDeadline(), getTitle(), IL_CAL_UNIX, and ilCalendarEntry\TRANSLATION_SYSTEM.

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

1582  : void {
1583  $ilAppEventHandler = $this->app_event_handler;
1584 
1585  $dl_id = $this->getId() . "0";
1586  $fbdl_id = $this->getId() . "1";
1587 
1588  $context_ids = array($dl_id, $fbdl_id);
1589  $apps = array();
1590 
1591  if ($a_event != "delete") {
1592  // deadline or relative deadline given
1593  if ($this->getDeadline() || $this->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
1594  $app = new ilCalendarAppointmentTemplate($dl_id);
1595  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1596  $app->setSubtitle("cal_exc_deadline");
1597  $app->setTitle($this->getTitle());
1598  $app->setFullday(false);
1599  // note: in the case of a relative deadline this will be set to 0 / 1970...)
1600  // see ilCalendarScheduleFilterExercise for appointment modification
1601  $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1602 
1603  $apps[] = $app;
1604  }
1605 
1606  if ($this->getPeerReview() &&
1607  $this->getPeerReviewDeadline()) {
1608  $app = new ilCalendarAppointmentTemplate($fbdl_id);
1609  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1610  $app->setSubtitle("cal_exc_peer_review_deadline");
1611  $app->setTitle($this->getTitle());
1612  $app->setFullday(false);
1613  $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1614 
1615  $apps[] = $app;
1616  }
1617  }
1618 
1619  $ilAppEventHandler->raise(
1620  'Modules/Exercise',
1621  $a_event . 'Assignment',
1622  array(
1623  'object' => $exc,
1624  'obj_id' => $exc->getId(),
1625  'context_ids' => $context_ids,
1626  'appointments' => $apps)
1627  );
1628  }
$app
Definition: cli.php:39
ilAppEventHandler $app_event_handler
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)
Exceptions
ilException

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1803  : bool
1804  {
1806  ilFileUtils::delDir($path, true);
1807  if (ilFileUtils::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path . "/" . $a_file["name"])) {
1808  $this->setFeedbackFile($a_file["name"]);
1809  return true;
1810  }
1811  return false;
1812  }
setFeedbackFile(?string $a_value)
$path
Definition: ltiservices.php:32
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

References getDeadline(), and getRelativeDeadline().

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

1920  : bool
1921  {
1922  return (bool) $this->getDeadline() || (bool) $this->getRelativeDeadline();
1923  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

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

References $feedback_cron.

Referenced by save(), and update().

578  : bool
579  {
580  return $this->feedback_cron;
581  }
+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

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

References $peer_file.

Referenced by save(), and update().

494  : bool
495  {
496  return $this->peer_file;
497  }
+ Here is the caller graph for this function:

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

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

References $peer_personal.

Referenced by save(), and update().

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

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

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

References $peer_rating.

Referenced by save(), and update().

474  : bool
475  {
476  return $this->peer_rating;
477  }
+ Here is the caller graph for this function:

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

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

References $peer_text.

Referenced by save(), and update().

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

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

References getPeerReview().

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

1925  : bool
1926  {
1927  if (!$this->ass_type->usesTeams() &&
1928  $this->getPeerReview()) {
1929  // all deadlines are read-only if we have peer feedback
1930  $peer_review = new ilExPeerReview($this);
1931  if ($peer_review->hasPeerReviewGroups()) {
1932  return true;
1933  }
1934  }
1935 
1936  return false;
1937  }
Exercise peer review.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTeam()

ilExAssignment::hasTeam ( )

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

Referenced by ilExSubmission\__construct(), canParticipantReceiveFeedback(), ilExSubmission\downloadAllAssignmentFiles(), and ilExerciseSubmissionTableGUI\parseColumns().

191  : bool
192  {
193  return $this->ass_type->usesTeams();
194  }
+ Here is the caller graph for this function:

◆ initFromDB()

ilExAssignment::initFromDB ( array  $a_set)
protected

Import DB record.

Parameters
array$a_set
Exceptions
ilExcUnknownAssignmentTypeException

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

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

Referenced by read().

665  : void
666  {
667  $this->setId((int) $a_set["id"]);
668  $this->setExerciseId((int) $a_set["exc_id"]);
669  $this->setDeadline((int) $a_set["time_stamp"]);
670  $this->setExtendedDeadline((int) $a_set["deadline2"]);
671  $this->setInstruction((string) $a_set["instruction"]);
672  $this->setTitle((string) $a_set["title"]);
673  $this->setStartTime((int) $a_set["start_time"]);
674  $this->setOrderNr((int) $a_set["order_nr"]);
675  $this->setMandatory((bool) $a_set["mandatory"]);
676  $this->setType((int) $a_set["type"]);
677  $this->setPeerReview((bool) $a_set["peer"]);
678  $this->setPeerReviewMin((int) $a_set["peer_min"]);
679  $this->setPeerReviewSimpleUnlock((bool) $a_set["peer_unlock"]);
680  $this->setPeerReviewDeadline((int) $a_set["peer_dl"]);
681  $this->setPeerReviewValid((int) $a_set["peer_valid"]);
682  $this->setPeerReviewFileUpload((bool) $a_set["peer_file"]);
683  $this->setPeerReviewPersonalized((bool) $a_set["peer_prsl"]);
684  $this->setPeerReviewChars((int) $a_set["peer_char"]);
685  $this->setPeerReviewText((bool) $a_set["peer_text"]);
686  $this->setPeerReviewRating((bool) $a_set["peer_rating"]);
687  $this->setPeerReviewCriteriaCatalogue((int) $a_set["peer_crit_cat"]);
688  $this->setFeedbackFile((string) $a_set["fb_file"]);
689  $this->setFeedbackDate((int) $a_set["fb_date"]);
690  $this->setFeedbackDateCustom((int) $a_set["fb_date_custom"]);
691  $this->setFeedbackCron((bool) $a_set["fb_cron"]);
692  $this->setTeamTutor((bool) $a_set["team_tutor"]);
693  $this->setMaxFile((int) $a_set["max_file"]);
694  $this->setPortfolioTemplateId((int) $a_set["portfolio_template"]);
695  $this->setMinCharLimit((int) $a_set["min_char_limit"]);
696  $this->setMaxCharLimit((int) $a_set["max_char_limit"]);
697  $this->setDeadlineMode((int) $a_set["deadline_mode"]);
698  $this->setRelativeDeadline((int) $a_set["relative_deadline"]);
699  $this->setRelDeadlineLastSubmission((int) $a_set["rel_deadline_last_subm"]);
700  }
setStartTime(?int $a_val)
setRelativeDeadline(int $a_val)
setFeedbackFile(?string $a_value)
setPeerReviewValid(int $a_value)
Set peer review validation.
setType(int $a_value)
Set type this will most probably become an non public function in the future (or become obsolete) ...
setFeedbackDateCustom(int $a_value)
Set (global) feedback file availability using a custom date.
setPeerReviewMin(int $a_value)
setPeerReviewFileUpload(bool $a_val)
setPeerReviewSimpleUnlock(bool $a_value)
setDeadlineMode(int $a_val)
Set deadline mode.
setFeedbackCron(bool $a_value)
Toggle (global) feedback file cron.
setInstruction(string $a_val)
setTeamTutor(bool $a_value)
setPeerReviewRating(bool $a_val)
setExtendedDeadline(?int $a_val)
setMandatory(bool $a_val)
setFeedbackDate(int $a_value)
setPortfolioTemplateId(int $a_val)
setPeerReviewDeadline(int $a_val)
setRelDeadlineLastSubmission(int $a_val)
setPeerReviewPersonalized(bool $a_val)
setPeerReviewChars(?int $a_value)
setPeerReviewText(bool $a_val)
setMaxFile(?int $a_value)
setTitle(string $a_val)
setPeerReview(bool $a_value)
setPeerReviewCriteriaCatalogue(?int $a_value)
setDeadline(?int $a_val)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFileOrderNr()

static ilExAssignment::insertFileOrderNr ( int  $a_ass_id,
string  $a_filename,
int  $a_order_nr 
)
static

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

References $DIC, ilDBInterface\insert(), and ilDBInterface\nextId().

Referenced by cloneAssignmentsOfExercise().

1966  : void {
1967  global $DIC;
1968  $db = $DIC->database();
1969  $id = $db->nextId("exc_ass_file_order");
1970  $db->insert(
1971  "exc_ass_file_order",
1972  [
1973  "id" => ["integer", $id],
1974  "order_nr" => ["integer", $a_order_nr],
1975  "assignment_id" => ["integer", $a_ass_id],
1976  "filename" => ["text", $a_filename]
1977  ]
1978  );
1979  }
insert(string $table_name, array $values)
global $DIC
Definition: feed.php:28
nextId(string $table_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileDeleteOrder()

static ilExAssignment::instructionFileDeleteOrder ( int  $a_ass_id,
array  $a_file 
)
static
Parameters
list<string>$a_file

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

References $DIC, ilDBInterface\manipulate(), and ilDBInterface\quote().

Referenced by ilExAssignmentFileSystemGUI\deleteFile().

2021  : void {
2022  global $DIC;
2023 
2024  $db = $DIC->database();
2025 
2026  //now its done by filename. We need to figure how to get the order id in the confirmdelete method
2027  foreach ($a_file as $v) {
2028  $db->manipulate(
2029  "DELETE FROM exc_ass_file_order " .
2030  "WHERE filename = " . $db->quote($v, 'text') .
2031  " AND assignment_id = " . $db->quote($a_ass_id, 'integer')
2032  );
2033  }
2034  }
quote($value, string $type)
global $DIC
Definition: feed.php:28
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileExistsInDb()

static ilExAssignment::instructionFileExistsInDb ( string  $a_filename,
int  $a_ass_id 
)
static

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

References $DIC, ilDBInterface\numRows(), ilDBInterface\query(), and ilDBInterface\quote().

2064  : int {
2065  global $DIC;
2066 
2067  $db = $DIC->database();
2068 
2069  if ($a_ass_id) {
2070  $result = $db->query(
2071  "SELECT id FROM exc_ass_file_order" .
2072  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
2073  " AND filename = " . $db->quote($a_filename, 'text')
2074  );
2075 
2076  return $db->numRows($result);
2077  }
2078 
2079  return 0;
2080  }
numRows(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ instructionFileGetFileOrderData()

static ilExAssignment::instructionFileGetFileOrderData ( array  $a_file_data,
int  $a_ass_id 
)
static
Parameters
array$a_file_data
int$a_ass_idassignment id
Returns
int[]

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

References $DIC, ilDBInterface\fetchAssoc(), ILIAS\Repository\int(), ilDBInterface\query(), and ilDBInterface\setLimit().

169  : array {
170  global $DIC;
171 
172  $db = $DIC->database();
173  $db->setLimit(1, 0);
174 
175  $result_order_val = $db->query("
176  SELECT id, order_nr
177  FROM exc_ass_file_order
178  WHERE assignment_id = {$db->quote($a_ass_id, 'integer')}
179  AND filename = {$db->quote($a_file_data['entry'], 'text')}
180  ");
181 
182  $order_val = 0;
183  $order_id = 0;
184  while ($row = $db->fetchAssoc($result_order_val)) {
185  $order_val = (int) $row['order_nr'];
186  $order_id = (int) $row['id'];
187  }
188  return array($order_val, $order_id);
189  }
fetchAssoc(ilDBStatement $statement)
setLimit(int $limit, int $offset=0)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ instructionFileInsertOrder()

static ilExAssignment::instructionFileInsertOrder ( string  $a_filename,
int  $a_ass_id,
int  $a_order_nr = 0 
)
static

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

References $DIC, $filename, ilFileUtils\getSafeFilename(), ilDBInterface\manipulate(), and ilDBInterface\quote().

Referenced by ilExerciseDataSet\importRecord(), and ilExAssignmentFileSystemGUI\uploadFile().

1986  : void {
1987  global $DIC;
1988 
1989  $db = $DIC->database();
1990 
1991  if ($a_ass_id) {
1992  //first of all check the suffix and change if necessary
1993  $filename = ilFileUtils::getSafeFilename($a_filename);
1994 
1995  if (self::instructionFileExistsInDb($filename, $a_ass_id) == 0) {
1996  if ($a_order_nr == 0) {
1997  $order_val = self::instructionFileOrderGetMax($a_ass_id);
1998  $order = $order_val + 10;
1999  } else {
2000  $order = $a_order_nr;
2001  }
2002 
2003  $id = $db->nextID('exc_ass_file_order');
2004  $db->manipulate("INSERT INTO exc_ass_file_order " .
2005  "(id, assignment_id, filename, order_nr) VALUES (" .
2006  $db->quote($id, "integer") . "," .
2007  $db->quote($a_ass_id, "integer") . "," .
2008  $db->quote($filename, "text") . "," .
2009  $db->quote($order, "integer") .
2010  ")");
2011  }
2012  }
2013  }
quote($value, string $type)
static getSafeFilename(string $a_initial_filename)
global $DIC
Definition: feed.php:28
$filename
Definition: buildRTE.php:78
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileOrderGetMax()

static ilExAssignment::instructionFileOrderGetMax ( int  $a_ass_id)
static

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

References $DIC, ilDBInterface\fetchAssoc(), ILIAS\Repository\int(), ilDBInterface\queryF(), and ilDBInterface\quote().

2135  : int
2136  {
2137  global $DIC;
2138 
2139  $db = $DIC->database();
2140 
2141  //get max order number
2142  $result = $db->queryF(
2143  "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
2144  array('integer'),
2145  array($db->quote($a_ass_id, 'integer'))
2146  );
2147 
2148  $order_val = 0;
2149  while ($row = $db->fetchAssoc($result)) {
2150  $order_val = (int) $row['max_order'];
2151  }
2152  return $order_val;
2153  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:

◆ isInExercise()

static ilExAssignment::isInExercise ( int  $a_ass_id,
int  $a_ex_id 
)
static

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

References $DIC, and $ilDB.

Referenced by ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsDBRepository\getAssignmentsOfUser(), and ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsDBRepository\saveAssignmentsOfUser().

1185  : bool
1186  {
1187  global $DIC;
1188 
1189  $ilDB = $DIC->database();
1190 
1191  $set = $ilDB->query(
1192  "SELECT * FROM exc_assignment " .
1193  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1194  " AND id = " . $ilDB->quote($a_ass_id, "integer")
1195  );
1196  if ($ilDB->fetchAssoc($set)) {
1197  return true;
1198  }
1199  return false;
1200  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType ( int  $a_value)

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

Referenced by setType().

406  : bool
407  {
408  return $this->types->isValidId($a_value);
409  }
+ Here is the caller graph for this function:

◆ lookup()

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

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

References $DIC, and $ilDB.

1084  : string
1085  {
1086  global $DIC;
1087 
1088  $ilDB = $DIC->database();
1089 
1090  $set = $ilDB->query(
1091  "SELECT " . $a_field . " FROM exc_assignment " .
1092  " WHERE id = " . $ilDB->quote($a_id, "integer")
1093  );
1094 
1095  $rec = $ilDB->fetchAssoc($set);
1096 
1097  return $rec[$a_field] ?? "";
1098  }
global $DIC
Definition: feed.php:28

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline ( int  $a_ass_id)
static

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

1057  : bool
1058  {
1059  global $DIC;
1060 
1061  $ilDB = $DIC->database();
1062 
1063  $query = "SELECT id FROM exc_assignment " .
1064  "WHERE start_time <= " . $ilDB->quote(time(), 'integer') . ' ' .
1065  "AND time_stamp >= " . $ilDB->quote(time(), 'integer') . ' ' .
1066  "AND id = " . $ilDB->quote($a_ass_id, 'integer');
1067  $res = $ilDB->query($query);
1068 
1069  return (bool) $res->numRows();
1070  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupExerciseId()

static ilExAssignment::lookupExerciseId ( int  $a_ass_id)
static

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjExerciseGUI\__construct(), and ilExerciseGSToolProvider\getAssignmentInfo().

1072  : int
1073  {
1074  global $DIC;
1075 
1076  $ilDB = $DIC->database();
1077  $query = "SELECT exc_id FROM exc_assignment " .
1078  "WHERE id = " . $ilDB->quote($a_ass_id, 'integer');
1079  $res = $ilDB->fetchAssoc($ilDB->query($query));
1080 
1081  return (int) ($res["exc_id"] ?? 0);
1082  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupMaxOrderNrForEx()

static ilExAssignment::lookupMaxOrderNrForEx ( int  $a_exc_id)
static

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

References $DIC, and $ilDB.

1041  : int
1042  {
1043  global $DIC;
1044 
1045  $ilDB = $DIC->database();
1046 
1047  $set = $ilDB->query(
1048  "SELECT MAX(order_nr) mnr FROM exc_assignment " .
1049  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer")
1050  );
1051  if ($rec = $ilDB->fetchAssoc($set)) {
1052  return (int) $rec["mnr"];
1053  }
1054  return 0;
1055  }
global $DIC
Definition: feed.php:28

◆ lookupTitle()

◆ lookupType()

static ilExAssignment::lookupType ( int  $a_id)
static

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

Referenced by ilParticipantsPerAssignmentTableGUI\__construct(), ilExSubmission\getAllAssignmentFiles(), ilExSubmission\getAssignmentFilesByUsers(), and ilExerciseMailNotification\send().

1105  : string
1106  {
1107  return self::lookup($a_id, "type");
1108  }
+ Here is the caller graph for this function:

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

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

1779  : bool
1780  {
1781  return (time() - $this->start_time <= 0);
1782  }

◆ orderAssByDeadline()

static ilExAssignment::orderAssByDeadline ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

1132  : void
1133  {
1134  global $DIC;
1135  $ilDB = $DIC->database();
1136 
1137  $set = $ilDB->query(
1138  "SELECT id FROM exc_assignment " .
1139  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1140  " ORDER BY time_stamp"
1141  );
1142  $nr = 10;
1143  while ($rec = $ilDB->fetchAssoc($set)) {
1144  $ilDB->manipulate(
1145  "UPDATE exc_assignment SET " .
1146  " order_nr = " . $ilDB->quote($nr, "integer") .
1147  " WHERE id = " . $ilDB->quote($rec["id"], "integer")
1148  );
1149  $nr += 10;
1150  }
1151  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

References $db, $ilDB, and initFromDB().

Referenced by __construct().

644  : void
645  {
646  $ilDB = $this->db;
647 
648  $set = $ilDB->query(
649  "SELECT * FROM exc_assignment " .
650  " WHERE id = " . $ilDB->quote($this->getId(), "integer")
651  );
652  $rec = $ilDB->fetchAssoc($set);
653 
654  // #16172 - might be deleted
655  if (is_array($rec)) {
656  $this->initFromDB($rec);
657  }
658  }
initFromDB(array $a_set)
Import DB record.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )
Exceptions
ilDateTimeException

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

References $db, $ilDB, ilExSubmission\getAllAssignmentFiles(), getExtendedDeadline(), getId(), getPersonalDeadline(), IL_CAL_DATETIME, and IL_CAL_UNIX.

1840  : void
1841  {
1842  $ilDB = $this->db;
1843 
1844  // see JF, 2015-05-11
1845 
1846  $ext_deadline = $this->getExtendedDeadline();
1847 
1848  foreach (ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file) {
1849  $id = $file["returned_id"];
1850  $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
1851  $uploaded = $uploaded->get(IL_CAL_UNIX);
1852 
1853  $deadline = $this->getPersonalDeadline($file["user_id"]);
1854  $last_deadline = max($deadline, $this->getExtendedDeadline());
1855 
1856  $late = null;
1857 
1858  // upload is not late anymore
1859  if ($file["late"] &&
1860  (!$last_deadline ||
1861  !$ext_deadline ||
1862  $uploaded < $deadline)) {
1863  $late = false;
1864  }
1865  // upload is now late
1866  elseif (!$file["late"] &&
1867  $ext_deadline &&
1868  $deadline &&
1869  $uploaded > $deadline) {
1870  $late = true;
1871  }
1872 
1873  if ($late !== null) {
1874  $ilDB->manipulate("UPDATE exc_returned" .
1875  " SET late = " . $ilDB->quote($late, "integer") .
1876  " WHERE returned_id = " . $ilDB->quote($id, "integer"));
1877  }
1878  }
1879  }
const IL_CAL_DATETIME
const IL_CAL_UNIX
getPersonalDeadline(int $a_user_id)
static getAllAssignmentFiles(int $a_exc_id, int $a_ass_id)
+ Here is the call graph for this function:

◆ renameInstructionFile()

static ilExAssignment::renameInstructionFile ( string  $a_old_name,
string  $a_new_name,
int  $a_ass_id 
)
static

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

References $DIC, ilDBInterface\manipulate(), and ilDBInterface\quote().

Referenced by ilExAssignmentFileSystemGUI\renameFile().

2040  : void {
2041  global $DIC;
2042 
2043  $db = $DIC->database();
2044 
2045  if ($a_ass_id) {
2046  $db->manipulate(
2047  "DELETE FROM exc_ass_file_order" .
2048  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
2049  " AND filename = " . $db->quote($a_new_name, 'text')
2050  );
2051 
2052  $db->manipulate(
2053  "UPDATE exc_ass_file_order SET" .
2054  " filename = " . $db->quote($a_new_name, 'text') .
2055  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
2056  " AND filename = " . $db->quote($a_old_name, 'text')
2057  );
2058  }
2059  }
quote($value, string $type)
global $DIC
Definition: feed.php:28
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilExAssignment::save ( )
Exceptions
ilDateTimeException

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

705  : void
706  {
707  $ilDB = $this->db;
708 
709  if ($this->getOrderNr() == 0) {
710  $this->setOrderNr(
711  self::lookupMaxOrderNrForEx($this->getExerciseId())
712  + 10
713  );
714  }
715 
716  $next_id = $ilDB->nextId("exc_assignment");
717  $ilDB->insert("exc_assignment", array(
718  "id" => array("integer", $next_id),
719  "exc_id" => array("integer", $this->getExerciseId()),
720  "time_stamp" => array("integer", $this->getDeadline()),
721  "deadline2" => array("integer", $this->getExtendedDeadline()),
722  "instruction" => array("clob", $this->getInstruction()),
723  "title" => array("text", $this->getTitle()),
724  "start_time" => array("integer", $this->getStartTime()),
725  "order_nr" => array("integer", $this->getOrderNr()),
726  "mandatory" => array("integer", $this->getMandatory()),
727  "type" => array("integer", $this->getType()),
728  "peer" => array("integer", $this->getPeerReview()),
729  "peer_min" => array("integer", $this->getPeerReviewMin()),
730  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
731  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
732  "peer_valid" => array("integer", $this->getPeerReviewValid()),
733  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
734  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
735  "peer_char" => array("integer", $this->getPeerReviewChars()),
736  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
737  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
738  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
739  "fb_file" => array("text", $this->getFeedbackFile()),
740  "fb_date" => array("integer", $this->getFeedbackDate()),
741  "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
742  "fb_cron" => array("integer", $this->hasFeedbackCron()),
743  "team_tutor" => array("integer", $this->getTeamTutor()),
744  "max_file" => array("integer", $this->getMaxFile()),
745  "portfolio_template" => array("integer", $this->getPortfolioTemplateId()),
746  "min_char_limit" => array("integer", $this->getMinCharLimit()),
747  "max_char_limit" => array("integer", $this->getMaxCharLimit()),
748  "relative_deadline" => array("integer", $this->getRelativeDeadline()),
749  "rel_deadline_last_subm" => array("integer", $this->getRelDeadlineLastSubmission()),
750  "deadline_mode" => array("integer", $this->getDeadlineMode())
751  ));
752  $this->setId($next_id);
753  $exc = new ilObjExercise($this->getExerciseId(), false);
754  $exc->updateAllUsersStatus();
755  self::createNewAssignmentRecords($next_id, $exc);
756 
757  $this->handleCalendarEntries("create", $exc);
758  }
getType()
Get type this will most probably become an non public function in the future (or become obsolete) ...
Class ilObjExercise.
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssOrderOfExercise()

static ilExAssignment::saveAssOrderOfExercise ( int  $a_ex_id,
array  $a_order 
)
static

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

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

1111  : void
1112  {
1113  global $DIC;
1114 
1115  $ilDB = $DIC->database();
1116 
1117  asort($a_order);
1118  $nr = 10;
1119  foreach ($a_order as $k => $v) {
1120  // the check for exc_id is for security reasons. ass ids are unique.
1121  $ilDB->manipulate(
1122  "UPDATE exc_assignment SET " .
1123  " order_nr = " . $ilDB->quote($nr, "integer") .
1124  " WHERE id = " . $ilDB->quote((int) $k, "integer") .
1125  " AND exc_id = " . $ilDB->quote($a_ex_id, "integer")
1126  );
1127  $nr += 10;
1128  }
1129  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ saveInstructionFilesOrderOfAssignment()

static ilExAssignment::saveInstructionFilesOrderOfAssignment ( int  $a_ass_id,
array  $a_order 
)
static

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

References $DIC, ilDBInterface\manipulate(), and ilDBInterface\quote().

Referenced by ilExAssignmentFileSystemGUI\saveFilesOrder().

1942  : void {
1943  global $DIC;
1944 
1945  $db = $DIC->database();
1946 
1947  asort($a_order, SORT_NUMERIC);
1948 
1949  $nr = 10;
1950  foreach (array_keys($a_order) as $k) {
1951  // the check for exc_id is for security reasons. ass ids are unique.
1952  $db->manipulate(
1953  "UPDATE exc_ass_file_order SET " .
1954  " order_nr = " . $db->quote($nr, "integer") .
1955  " WHERE id = " . $db->quote((int) $k, "integer") .
1956  " AND assignment_id = " . $db->quote($a_ass_id, "integer")
1957  );
1958  $nr += 10;
1959  }
1960  }
quote($value, string $type)
global $DIC
Definition: feed.php:28
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveMultiFeedbackFiles()

ilExAssignment::saveMultiFeedbackFiles ( array  $a_files,
ilObjExercise  $a_exc 
)
Parameters
array<int,list<string>>$a_files

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

References Vendor\Package\$f, clearMultiFeedbackDirectory(), getExerciseId(), getId(), ilObject\getId(), getMemberStatus(), getMultiFeedbackFiles(), ilFileUtils\rename(), and ilObjExercise\sendFeedbackFileNotification().

1526  : void {
1527  if ($this->getExerciseId() != $a_exc->getId()) {
1528  return;
1529  }
1530 
1531  $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1532  $fstorage->create();
1533 
1534  $mf_files = $this->getMultiFeedbackFiles();
1535  foreach ($mf_files as $f) {
1536  $user_id = $f["user_id"];
1537  $file_path = $f["full_path"];
1538  $file_name = $f["file"];
1539 
1540  // if checked in confirmation gui
1541  if (is_array($a_files[$user_id] ?? false) && in_array(md5($file_name), $a_files[$user_id])) {
1542  $submission = new ilExSubmission($this, $user_id);
1543  $feedback_id = $submission->getFeedbackId();
1544  $noti_rec_ids = $submission->getUserIds();
1545 
1546  if ($feedback_id) {
1547  $fb_path = $fstorage->getFeedbackPath($feedback_id);
1548  $target = $fb_path . "/" . $file_name;
1549  if (is_file($target)) {
1550  unlink($target);
1551  }
1552  // rename file
1553  ilFileUtils::rename($file_path, $target);
1554 
1555  if ($noti_rec_ids) {
1556  foreach ($noti_rec_ids as $user_id) {
1557  $member_status = $this->getMemberStatus($user_id);
1558  $member_status->setFeedback(true);
1559  $member_status->update();
1560  }
1561 
1563  $file_name,
1564  $noti_rec_ids,
1565  $this->getId()
1566  );
1567  }
1568  }
1569  }
1570  }
1571 
1572  $this->clearMultiFeedbackDirectory();
1573  }
getMemberStatus(?int $a_user_id=null)
sendFeedbackFileNotification(string $a_feedback_file, array $user_ids, int $a_ass_id, bool $a_is_text_feedback=false)
getMultiFeedbackFiles(int $a_user_id=0)
Get multi feedback files (of uploader)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
clearMultiFeedbackDirectory()
Clear multi feedback directory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rename(string $a_source, string $a_target)
+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

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

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

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

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

1675  : bool {
1676  global $DIC;
1677 
1678  $ilDB = $DIC->database();
1679 
1680  $ass = new self($a_ass_id);
1681 
1682  // valid assignment?
1683  if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
1684  return false;
1685  }
1686 
1687  if (!$a_user_id) {
1688  // already done?
1689  $set = $ilDB->query("SELECT fb_cron_done" .
1690  " FROM exc_assignment" .
1691  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
1692  $row = $ilDB->fetchAssoc($set);
1693  if ($row["fb_cron_done"]) {
1694  return false;
1695  }
1696  }
1697 
1698  $ntf = new ilSystemNotification();
1699  $ntf->setLangModules(array("exc"));
1700  $ntf->setObjId($ass->getExerciseId());
1701  $ntf->setSubjectLangId("exc_feedback_notification_subject");
1702  $ntf->setIntroductionLangId("exc_feedback_notification_body");
1703  $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
1704  $ntf->setGotoLangId("exc_feedback_notification_link");
1705  $ntf->setReasonLangId("exc_feedback_notification_reason");
1706 
1707  if (!$a_user_id) {
1708  $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
1709 
1710  $ilDB->manipulate("UPDATE exc_assignment" .
1711  " SET fb_cron_done = " . $ilDB->quote(1, "integer") .
1712  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
1713  } else {
1714  $ntf->sendMail(array($a_user_id));
1715  }
1716 
1717  return true;
1718  }
global $DIC
Definition: feed.php:28
static _getMembers(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMultiFeedbackStructureFile()

ilExAssignment::sendMultiFeedbackStructureFile ( ilObjExercise  $exercise)

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

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

References $access, $name, ilObjUser\_lookupName(), ilFileDelivery\deliverFileLegacy(), ilOrgUnitPositionAndRBACAccessHandler\filterUserIdsByRbacOrPositionOfCurrentUser(), ilFileUtils\getASCIIFilename(), getExerciseId(), getId(), ilObject\getRefId(), getTitle(), ilFileUtils\ilTempnam(), ilFileUtils\makeDir(), and ilFileUtils\zip().

1368  : void
1369  {
1371 
1372  // send and delete the zip file
1373  $deliverFilename = trim(str_replace(" ", "_", $this->getTitle() . "_" . $this->getId()));
1374  $deliverFilename = ilFileUtils::getASCIIFilename($deliverFilename);
1375  $deliverFilename = "multi_feedback_" . $deliverFilename;
1376 
1377  $exc = new ilObjExercise($this->getExerciseId(), false);
1378 
1379  $cdir = getcwd();
1380 
1381  // create temporary directoy
1382  $tmpdir = ilFileUtils::ilTempnam();
1383  ilFileUtils::makeDir($tmpdir);
1384  $mfdir = $tmpdir . "/" . $deliverFilename;
1385  ilFileUtils::makeDir($mfdir);
1386 
1387  // create subfolders <lastname>_<firstname>_<id> for each participant
1388  $exmem = new ilExerciseMembers($exc);
1389  $mems = $exmem->getMembers();
1390 
1392  'edit_submissions_grades',
1393  'edit_submissions_grades',
1394  $exercise->getRefId(),
1395  $mems
1396  );
1397  foreach ($mems as $mem) {
1398  $name = ilObjUser::_lookupName($mem);
1399  $subdir = $name["lastname"] . "_" . $name["firstname"] . "_" . $name["login"] . "_" . $name["user_id"];
1400  $subdir = ilFileUtils::getASCIIFilename($subdir);
1401  ilFileUtils::makeDir($mfdir . "/" . $subdir);
1402  }
1403 
1404  // create the zip file
1405  chdir($tmpdir);
1406  $tmpzipfile = $tmpdir . "/multi_feedback.zip";
1407  ilFileUtils::zip($tmpdir, $tmpzipfile, true);
1408  chdir($cdir);
1409 
1410 
1411  ilFileDelivery::deliverFileLegacy($tmpzipfile, $deliverFilename . ".zip", "", false, true);
1412  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupName(int $a_user_id)
lookup user name
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static getASCIIFilename(string $a_filename)
if($format !==null) $name
Definition: metadata.php:247
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)
Class ilObjExercise.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
ilAccessHandler $access
static zip(string $a_dir, string $a_file, bool $compress_content=false)
zips given directory/file into given zip.file
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline ( ?int  $a_val)

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

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

226  : void
227  {
228  $this->deadline = $a_val;
229  }
+ Here is the caller graph for this function:

◆ setDeadlineMode()

ilExAssignment::setDeadlineMode ( int  $a_val)

Set deadline mode.

Parameters
int$a_valdeadline mode (self::DEADLINE_ABSOLUTE | self::DEADLINE_ABSOLUTE)

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

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

240  : void
241  {
242  $this->deadline_mode = $a_val;
243  }
+ Here is the caller graph for this function:

◆ setExerciseId()

ilExAssignment::setExerciseId ( int  $a_val)

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

Referenced by initFromDB().

206  : void
207  {
208  $this->exc_id = $a_val;
209  }
+ Here is the caller graph for this function:

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline ( ?int  $a_val)

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

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

309  : void
310  {
311  $this->deadline2 = $a_val;
312  }
+ Here is the caller graph for this function:

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron ( bool  $a_value)

Toggle (global) feedback file cron.

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

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

573  : void
574  {
575  $this->feedback_cron = $a_value;
576  }
+ Here is the caller graph for this function:

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate ( int  $a_value)

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

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

584  : void
585  {
586  $this->feedback_date = $a_value;
587  }
+ Here is the caller graph for this function:

◆ setFeedbackDateCustom()

ilExAssignment::setFeedbackDateCustom ( int  $a_value)

Set (global) feedback file availability using a custom date.

Parameters
int$a_valuetimestamp

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

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

598  : void
599  {
600  $this->feedback_date_custom = $a_value;
601  }
+ Here is the caller graph for this function:

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile ( ?string  $a_value)

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

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

560  : void
561  {
562  $this->feedback_file = $a_value;
563  }
+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId ( int  $a_val)

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

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

196  : void
197  {
198  $this->id = $a_val;
199  }
+ Here is the caller graph for this function:

◆ setIndividualDeadline()

ilExAssignment::setIndividualDeadline ( string  $id,
ilDateTime  $date 
)

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

References ilDateTime\get(), getId(), ilExcIndividualDeadline\getInstance(), and IL_CAL_UNIX.

1889  : void {
1890  $is_team = false;
1891  if (!is_numeric($id)) {
1892  $id = substr($id, 1);
1893  $is_team = true;
1894  }
1895 
1896  $idl = ilExcIndividualDeadline::getInstance($this->getId(), (int) $id, $is_team);
1897  $idl->setIndividualDeadline($date->get(IL_CAL_UNIX));
1898  $idl->save();
1899  }
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
const IL_CAL_UNIX
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
+ Here is the call graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction ( string  $a_val)

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

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

319  : void
320  {
321  $this->instruction = $a_val;
322  }
+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory ( bool  $a_val)

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

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

353  : void
354  {
355  $this->mandatory = $a_val;
356  }
+ Here is the caller graph for this function:

◆ setMaxCharLimit()

ilExAssignment::setMaxCharLimit ( int  $a_val)

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

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

2168  : void
2169  {
2170  $this->max_char_limit = $a_val;
2171  }
+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile ( ?int  $a_value)

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

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

620  : void
621  {
622  $this->max_file = $a_value;
623  }
+ Here is the caller graph for this function:

◆ setMinCharLimit()

ilExAssignment::setMinCharLimit ( int  $a_val)

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

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

2157  : void
2158  {
2159  $this->min_char_limit = $a_val;
2160  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr ( int  $a_val)

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

Referenced by initFromDB(), and save().

363  : void
364  {
365  $this->order_nr = $a_val;
366  }
+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview ( bool  $a_value)

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

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

411  : void
412  {
413  $this->peer = $a_value;
414  }
+ Here is the caller graph for this function:

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars ( ?int  $a_value)

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

References ILIAS\Repository\int().

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

509  : void
510  {
511  $a_value = (is_numeric($a_value) && (int) $a_value > 0)
512  ? (int) $a_value
513  : null;
514  $this->peer_char = $a_value;
515  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue ( ?int  $a_value)

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

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

522  : void
523  {
524  $this->crit_cat = $a_value;
525  }
+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

ilExAssignment::setPeerReviewDeadline ( int  $a_val)
Parameters
intdeadline (timestamp)

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

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

444  : void
445  {
446  $this->peer_dl = $a_val;
447  }
+ Here is the caller graph for this function:

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload ( bool  $a_val)

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

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

489  : void
490  {
491  $this->peer_file = $a_val;
492  }
+ Here is the caller graph for this function:

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin ( int  $a_value)

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

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

421  : void
422  {
423  $this->peer_min = $a_value;
424  }
+ Here is the caller graph for this function:

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized ( bool  $a_val)

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

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

499  : void
500  {
501  $this->peer_personal = $a_val;
502  }
+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating ( bool  $a_val)

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

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

469  : void
470  {
471  $this->peer_rating = $a_val;
472  }
+ Here is the caller graph for this function:

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock ( bool  $a_value)

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

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

432  {
433  $this->peer_unlock = $a_value;
434  }
+ Here is the caller graph for this function:

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText ( bool  $a_val)

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

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

479  : void
480  {
481  $this->peer_text = $a_val;
482  }
+ Here is the caller graph for this function:

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid ( int  $a_value)

Set peer review validation.

Parameters
int$a_value(self::PEER_REVIEW_VALID_NONE, self::PEER_REVIEW_VALID_ONE, self::PEER_REVIEW_VALID_ALL)

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

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

459  : void
460  {
461  $this->peer_valid = $a_value;
462  }
+ Here is the caller graph for this function:

◆ setPortfolioTemplateId()

ilExAssignment::setPortfolioTemplateId ( int  $a_val)

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

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

631  : void
632  {
633  $this->portfolio_template = $a_val;
634  }
+ Here is the caller graph for this function:

◆ setRelativeDeadline()

ilExAssignment::setRelativeDeadline ( int  $a_val)

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

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

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

◆ setRelDeadlineLastSubmission()

ilExAssignment::setRelDeadlineLastSubmission ( int  $a_val)

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

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

260  : void
261  {
262  $this->rel_deadline_last_subm = $a_val;
263  }
+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime ( ?int  $a_val)

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

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

216  : void
217  {
218  $this->start_time = $a_val;
219  }
+ Here is the caller graph for this function:

◆ setTeamTutor()

ilExAssignment::setTeamTutor ( bool  $a_value)

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

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

609  : void
610  {
611  $this->team_tutor = $a_value;
612  }
+ Here is the caller graph for this function:

◆ setTitle()

ilExAssignment::setTitle ( string  $a_val)

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

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

343  : void
344  {
345  $this->title = $a_val;
346  }
+ Here is the caller graph for this function:

◆ setType()

ilExAssignment::setType ( int  $a_value)

Set type this will most probably become an non public function in the future (or become obsolete)

Exceptions
ilExcUnknownAssignmentTypeException

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

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

378  : void
379  {
380  if ($this->isValidType($a_value)) {
381  $this->type = $a_value;
382 
383  $this->ass_type = $this->types->getById($a_value);
384 
385  if ($this->ass_type->usesTeams()) {
386  $this->setPeerReview(false);
387  }
388  }
389  }
isValidType(int $a_value)
setPeerReview(bool $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )
Exceptions
ilDateTimeException

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

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

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

763  : void
764  {
765  $ilDB = $this->db;
766 
767  $ilDB->update(
768  "exc_assignment",
769  array(
770  "exc_id" => array("integer", $this->getExerciseId()),
771  "time_stamp" => array("integer", $this->getDeadline()),
772  "deadline2" => array("integer", $this->getExtendedDeadline()),
773  "instruction" => array("clob", $this->getInstruction()),
774  "title" => array("text", $this->getTitle()),
775  "start_time" => array("integer", $this->getStartTime()),
776  "order_nr" => array("integer", $this->getOrderNr()),
777  "mandatory" => array("integer", $this->getMandatory()),
778  "type" => array("integer", $this->getType()),
779  "peer" => array("integer", $this->getPeerReview()),
780  "peer_min" => array("integer", $this->getPeerReviewMin()),
781  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
782  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
783  "peer_valid" => array("integer", $this->getPeerReviewValid()),
784  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
785  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
786  "peer_char" => array("integer", $this->getPeerReviewChars()),
787  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
788  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
789  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
790  "fb_file" => array("text", $this->getFeedbackFile()),
791  "fb_date" => array("integer", $this->getFeedbackDate()),
792  "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
793  "fb_cron" => array("integer", $this->hasFeedbackCron()),
794  "team_tutor" => array("integer", $this->getTeamTutor()),
795  "max_file" => array("integer", $this->getMaxFile()),
796  "portfolio_template" => array("integer", $this->getPortfolioTemplateId()),
797  "min_char_limit" => array("integer", $this->getMinCharLimit()),
798  "max_char_limit" => array("integer", $this->getMaxCharLimit()),
799  "deadline_mode" => array("integer", $this->getDeadlineMode()),
800  "relative_deadline" => array("integer", $this->getRelativeDeadline()),
801  "rel_deadline_last_subm" => array("integer", $this->getRelDeadlineLastSubmission())
802  ),
803  array(
804  "id" => array("integer", $this->getId()),
805  )
806  );
807  $exc = new ilObjExercise($this->getExerciseId(), false);
808  $exc->updateAllUsersStatus();
809 
810  $this->handleCalendarEntries("update", $exc);
811  }
getType()
Get type this will most probably become an non public function in the future (or become obsolete) ...
Class ilObjExercise.
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadAssignmentFiles()

ilExAssignment::uploadAssignmentFiles ( array  $a_files)

Upload assignment files (from creation form)

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

References getExerciseId(), getId(), and ilLoggerFactory\getLogger().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1352  : void
1353  {
1354  ilLoggerFactory::getLogger("exc")->debug("upload assignment files files = ", $a_files);
1355  $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1356  $storage->create();
1357  $storage->uploadAssignmentFiles($a_files);
1358  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadMultiFeedbackFile()

ilExAssignment::uploadMultiFeedbackFile ( array  $a_file)
Exceptions
ilException
ilExerciseException

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

References $ilUser, $lng, $user, ilFileUtils\delDir(), ilFileUtils\getDir(), getExerciseId(), getId(), ilFileUtils\moveUploadedFile(), ilLanguage\txt(), and ilFileUtils\unzip().

1418  : void
1419  {
1420  $lng = $this->lng;
1421  $ilUser = $this->user;
1422 
1423  if (!is_file($a_file["tmp_name"])) {
1424  throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1425  }
1426 
1427  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1428  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1429  ilFileUtils::delDir($mfu, true);
1430  ilFileUtils::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu . "/" . "multi_feedback.zip");
1431  ilFileUtils::unzip($mfu . "/multi_feedback.zip", true);
1432  $subdirs = ilFileUtils::getDir($mfu);
1433  $subdir = "notfound";
1434  foreach ($subdirs as $s => $j) {
1435  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1436  $subdir = $s;
1437  }
1438  }
1439 
1440  if (!is_dir($mfu . "/" . $subdir)) {
1441  throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1442  }
1443  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExAssignment::$access
protected

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

Referenced by sendMultiFeedbackStructureFile().

◆ $app_event_handler

ilAppEventHandler ilExAssignment::$app_event_handler
protected

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

Referenced by handleCalendarEntries().

◆ $ass_type

ilExAssignmentTypeInterface ilExAssignment::$ass_type
protected

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

Referenced by getAssignmentType().

◆ $crit_cat

int ilExAssignment::$crit_cat = 0
protected

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

Referenced by getPeerReviewCriteriaCatalogue().

◆ $db

◆ $deadline

int ilExAssignment::$deadline = null
protected

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

Referenced by getDeadline().

◆ $deadline2

int ilExAssignment::$deadline2 = null
protected

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

Referenced by getExtendedDeadline().

◆ $deadline_mode

int ilExAssignment::$deadline_mode = 0
protected

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

Referenced by getDeadlineMode().

◆ $exc_id

int ilExAssignment::$exc_id = 0
protected

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

Referenced by getExerciseId().

◆ $feedback_cron

bool ilExAssignment::$feedback_cron = false
protected

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

Referenced by hasFeedbackCron().

◆ $feedback_date

int ilExAssignment::$feedback_date = 0
protected

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

Referenced by getFeedbackDate().

◆ $feedback_date_custom

int ilExAssignment::$feedback_date_custom = 0
protected

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

Referenced by getFeedbackDateCustom().

◆ $feedback_file

string ilExAssignment::$feedback_file = null
protected

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

Referenced by getFeedbackFile().

◆ $id

int ilExAssignment::$id = 0
protected

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

Referenced by getId().

◆ $instruction

string ilExAssignment::$instruction = ""
protected

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

Referenced by getInstruction().

◆ $lng

ilLanguage ilExAssignment::$lng
protected

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

Referenced by uploadMultiFeedbackFile().

◆ $log

ilLogger ilExAssignment::$log
protected

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

◆ $mandatory

bool ilExAssignment::$mandatory = false
protected

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

Referenced by getMandatory().

◆ $max_char_limit

int ilExAssignment::$max_char_limit = 0
protected

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

Referenced by getMaxCharLimit().

◆ $max_file

int ilExAssignment::$max_file = null
protected

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

Referenced by getMaxFile().

◆ $member_status

array ilExAssignment::$member_status = []
protected

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

◆ $min_char_limit

int ilExAssignment::$min_char_limit = 0
protected

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

Referenced by getMinCharLimit().

◆ $order_nr

int ilExAssignment::$order_nr = 0
protected

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

Referenced by getOrderNr().

◆ $peer

bool ilExAssignment::$peer = false
protected

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

Referenced by getPeerReview().

◆ $peer_char

int ilExAssignment::$peer_char = null
protected

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

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

int ilExAssignment::$peer_crit_cat = 0
protected

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

◆ $peer_dl

int ilExAssignment::$peer_dl = 0
protected

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

Referenced by getPeerReviewDeadline().

◆ $peer_file

bool ilExAssignment::$peer_file = false
protected

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

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

int ilExAssignment::$peer_min = 0
protected

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

Referenced by getPeerReviewMin().

◆ $peer_personal

bool ilExAssignment::$peer_personal = false
protected

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

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

bool ilExAssignment::$peer_rating = false
protected

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

Referenced by hasPeerReviewRating().

◆ $peer_text

bool ilExAssignment::$peer_text = false
protected

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

Referenced by hasPeerReviewText().

◆ $peer_unlock

bool ilExAssignment::$peer_unlock = false
protected

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

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

int ilExAssignment::$peer_valid
protected

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

Referenced by getPeerReviewValid().

◆ $portfolio_template

int ilExAssignment::$portfolio_template = 0
protected

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

Referenced by getPortfolioTemplateId().

◆ $rel_deadline_last_subm

int ilExAssignment::$rel_deadline_last_subm = 0
protected

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

Referenced by getRelDeadlineLastSubmission().

◆ $relative_deadline

int ilExAssignment::$relative_deadline = 0
protected

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

Referenced by getRelativeDeadline().

◆ $start_time

int ilExAssignment::$start_time = null
protected

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

Referenced by getStartTime().

◆ $string_transform

ILIAS Refinery String Group ilExAssignment::$string_transform
protected

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

◆ $team_tutor

bool ilExAssignment::$team_tutor = false
protected

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

Referenced by getTeamTutor().

◆ $title

string ilExAssignment::$title = ""
protected

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

Referenced by getTitle().

◆ $type

int ilExAssignment::$type = 0
protected

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

Referenced by getCalculatedDeadlines(), and getType().

◆ $types

ilExAssignmentTypes ilExAssignment::$types
protected

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

◆ $user

◆ DEADLINE_ABSOLUTE

◆ DEADLINE_RELATIVE

◆ FEEDBACK_DATE_CUSTOM

◆ 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

◆ TEAMS_FORMED_BY_ASSIGNMENT

const ilExAssignment::TEAMS_FORMED_BY_ASSIGNMENT = 3

◆ TEAMS_FORMED_BY_PARTICIPANTS

const ilExAssignment::TEAMS_FORMED_BY_PARTICIPANTS = 0

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

Referenced by ilExAssignmentEditorGUI\initAssignmentForm().

◆ TEAMS_FORMED_BY_RANDOM

const ilExAssignment::TEAMS_FORMED_BY_RANDOM = 2

◆ TEAMS_FORMED_BY_TUTOR

const ilExAssignment::TEAMS_FORMED_BY_TUTOR = 1

◆ TYPE_BLOG

◆ TYPE_PORTFOLIO

◆ TYPE_TEXT

◆ TYPE_UPLOAD

◆ TYPE_UPLOAD_TEAM

◆ TYPE_WIKI_TEAM


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