ILIAS  release_8 Revision v8.24
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.

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 }
setType(int $a_value)
Set type this will most probably become an non public function in the future (or become obsolete)
setFeedbackDate(int $a_value)
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28

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

+ 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.

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 }

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

1724 : bool
1725 {
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

References $ilUser.

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict ( bool  $a_include_personal = true)

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

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 }

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

1773 : bool
1774 {
1775 // no deadline === true
1776 return !$this->afterDeadlineStrict();
1777 }
afterDeadlineStrict(bool $a_include_personal=true)

◆ canParticipantReceiveFeedback()

ilExAssignment::canParticipantReceiveFeedback ( int  $part_id)

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

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)

References ILIAS\Survey\Mode\getId(), and ilExAssignmentTeam\getTeamId().

+ Here is the call graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

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

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

References $ilUser, ilFileUtils\delDir(), and ILIAS\Survey\Mode\getId().

+ Here is the call 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.

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();
1013 }
1014 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Exercise assignment.
ilExAssignmentTypeInterface $ass_type
static insertFileOrderNr(int $a_ass_id, string $a_filename, int $a_order_nr)
static getInstancesByExercise(int $a_exc_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
cloneSpecificProperties(ilExAssignment $source, ilExAssignment $target)

References $d, ilExAssignmentTypeInterface\cloneSpecificProperties(), ilExAssignmentReminder\FEEDBACK_REMINDER, ilExAssignmentReminder\GRADE_REMINDER, insertFileOrderNr(), ilFileUtils\rCopy(), and ilExAssignmentReminder\SUBMIT_REMINDER.

+ Here is the call graph for this function:

◆ count()

static ilExAssignment::count ( int  $a_ex_id)
static

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

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 }

References $DIC, and $ilDB.

◆ countMandatory()

static ilExAssignment::countMandatory ( int  $a_ex_id)
static

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

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 }

References $DIC, and $ilDB.

◆ createNewAssignmentRecords()

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

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

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...

◆ createNewUserRecords()

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

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

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 }
static getAssignmentDataOfExercise(int $a_exc_id)

Referenced by ilExerciseMembers\assignMember().

+ 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.

819 : void {
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
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 }
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
Exercise peer review.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjExercise.
updateAllUsersStatus()
Update status of all users.

References $ilDB, ILIAS\Survey\Mode\getId(), and ilObjExercise\updateAllUsersStatus().

+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

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

1795 : void
1796 {
1798 }

References ilFileUtils\delDir().

+ Here is the call graph for this function:

◆ fileAddOrder()

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

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

2123 : array {
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 }

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

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)) {
2117 }
2118 }
2119 }
static instructionFileInsertOrder(string $a_filename, int $a_ass_id, int $a_order_nr=0)
quote($value, string $type)
manipulate(string $query)
Run a (write) Query on the database.
query(string $query)
Run a (read-only) Query on the database.
fetchAssoc(ilDBStatement $statement)

References Vendor\Package\$f, ilDBInterface\fetchAssoc(), ILIAS\Survey\Mode\getId(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise ( int  $a_exc_id)
static

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

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 }

References $data, $DIC, and $ilDB.

Referenced by ilExerciseXMLParser\__construct(), ilObjExercise\delete(), and ilExerciseXMLWriter\start().

+ Here is the caller graph for this function:

◆ getAssignmentType()

ilExAssignment::getAssignmentType ( )

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

392 {
393 return $this->ass_type;
394 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilExSubmission\__construct().

+ 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.

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.

References $type, ILIAS\Survey\Mode\getId(), and ilExcIndividualDeadline\getStartingTimestamps().

+ Here is the call graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

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

231 : ?int
232 {
233 return $this->deadline;
234 }

◆ getDeadlineMode()

ilExAssignment::getDeadlineMode ( )

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

245 : int
246 {
248 }

◆ getExerciseId()

ilExAssignment::getExerciseId ( )

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

211 : int
212 {
213 return $this->exc_id;
214 }

◆ 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.

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 }

References $ilDB.

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

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

314 : ?int
315 {
316 return $this->deadline2;
317 }

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

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

589 : int
590 {
592 }

◆ getFeedbackDateCustom()

ilExAssignment::getFeedbackDateCustom ( )

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

603 : int
604 {
606 }

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

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

565 : ?string
566 {
568 }

◆ getFiles()

ilExAssignment::getFiles ( )

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

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 }

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

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

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

References $path.

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

1789 : string
1790 {
1791 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1792 return $storage->getGlobalFeedbackPath();
1793 }

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getId()

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

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

References $ilDB, and $res.

Referenced by ilAssignmentsPerParticipantTableGUI\parseData().

+ 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.

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 }

References $data, $DIC, and $ilDB.

Referenced by ilExGradesTableGUI\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), ilExerciseMembers\deassignMember(), ilObjExercise\exportGradesExcel(), ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\getAssignmentSelection(), ilExcCriteriaCatalogueTableGUI\getItems(), ILIAS\Exercise\Assignment\Mandatory\RandomAssignmentsManager\getTotalNumberOfAssignments(), ilExerciseManagementGUI\membersObject(), and ilAssignmentsPerParticipantTableGUI\parseData().

+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

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

324 : string
325 {
326 return $this->instruction;
327 }

◆ getInstructionFilesOrder()

ilExAssignment::getInstructionFilesOrder ( )

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

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 }

References $data, and $ilDB.

◆ getInstructionPresentation()

ilExAssignment::getInstructionPresentation ( )

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

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 }

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )

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

298 : int
299 {
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 }

References $ilDB.

◆ getMandatory()

ilExAssignment::getMandatory ( )

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

358 : bool
359 {
360 return $this->mandatory;
361 }

◆ getMaxCharLimit()

ilExAssignment::getMaxCharLimit ( )

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

2173 : int
2174 {
2175 return $this->max_char_limit;
2176 }

Referenced by ilExAssTypeTextGUI\getFormValuesArray().

+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

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

625 : ?int
626 {
627 return $this->max_file;
628 }

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

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

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
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
if($format !==null) $name
Definition: metadata.php:247

References $ilDB, $name, ilObject\_exists(), ilObjUser\_lookupName(), and ILIAS\Survey\Mode\getId().

+ 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.

1825 {
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...

References $ilUser, and ILIAS\Survey\Mode\getId().

Referenced by ilExAssignmentGUI\getOverviewHeader(), ilAssignmentsPerParticipantTableGUI\parseData(), and ilObjExercise\processExerciseStatus().

+ 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.

2162 : int
2163 {
2164 return $this->min_char_limit;
2165 }

Referenced by ilExAssTypeTextGUI\getFormValuesArray().

+ 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.

1451 : array
1452 {
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 }
static count(int $a_ex_id)
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
$i
Definition: metadata.php:41

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

+ Here is the call graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

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

368 : int
369 {
370 return $this->order_nr;
371 }

Referenced by ilAssignmentsPerParticipantTableGUI\parseData().

+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

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

416 : bool
417 {
418 return $this->peer;
419 }

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

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

517 : ?int
518 {
519 return $this->peer_char;
520 }

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

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

527 : ?int
528 {
529 return $this->crit_cat;
530 }

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

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

449 : int
450 {
451 return $this->peer_dl;
452 }

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

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

426 : int
427 {
428 return $this->peer_min;
429 }

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

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

436 : bool
437 {
438 return $this->peer_unlock;
439 }

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

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

464 : int
465 {
466 return $this->peer_valid;
467 }

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

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 }

References $DIC, $ilDB, and $res.

Referenced by ilExcCronFeedbackNotification\run().

+ Here is the caller graph for this function:

◆ getPersonalDeadline()

ilExAssignment::getPersonalDeadline ( int  $a_user_id)

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

272 : int
273 {
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 }

References $ilDB, ILIAS\Survey\Mode\getId(), and ilExAssignmentTeam\getTeamId().

+ Here is the call graph for this function:

◆ getPortfolioTemplateId()

ilExAssignment::getPortfolioTemplateId ( )

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

636 : int
637 {
639 }

Referenced by ilExAssTypePortfolioGUI\getFormValuesArray().

+ Here is the caller graph for this function:

◆ getRelativeDeadline()

ilExAssignment::getRelativeDeadline ( )

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

255 : int
256 {
258 }

◆ getRelDeadlineLastSubmission()

ilExAssignment::getRelDeadlineLastSubmission ( )

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

265 : int
266 {
268 }

◆ getStartTime()

ilExAssignment::getStartTime ( )

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

221 : ?int
222 {
223 return $this->start_time;
224 }

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

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

614 : bool
615 {
616 return $this->team_tutor;
617 }

◆ 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.

401 : int
402 {
403 return $this->type;
404 }

References $type.

◆ 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.

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
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 }
const IL_CAL_UNIX
Apointment templates are used for automatic generated apointments.
@classDescription Date and time handling
ilAppEventHandler $app_event_handler
$app
Definition: cli.php:39

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)
Exceptions
ilException

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

1803 : bool
1804 {
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)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file

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

+ Here is the call graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

1920 : bool
1921 {
1922 return (bool) $this->getDeadline() || (bool) $this->getRelativeDeadline();
1923 }

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

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

578 : bool
579 {
581 }

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

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

494 : bool
495 {
496 return $this->peer_file;
497 }

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

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

504 : bool
505 {
507 }

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

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

474 : bool
475 {
476 return $this->peer_rating;
477 }

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

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

484 : bool
485 {
486 return $this->peer_text;
487 }

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

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 }

◆ hasTeam()

ilExAssignment::hasTeam ( )

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

191 : bool
192 {
193 return $this->ass_type->usesTeams();
194 }

Referenced by ilExSubmission\__construct(), and ilAssignmentsPerParticipantTableGUI\parseData().

+ 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.

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 }
setTeamTutor(bool $a_value)
setRelativeDeadline(int $a_val)
setPeerReviewMin(int $a_value)
setDeadline(?int $a_val)
setExtendedDeadline(?int $a_val)
setPeerReviewText(bool $a_val)
setPeerReviewCriteriaCatalogue(?int $a_value)
setPeerReview(bool $a_value)
setStartTime(?int $a_val)
setDeadlineMode(int $a_val)
Set deadline mode.
setFeedbackCron(bool $a_value)
Toggle (global) feedback file cron.
setPeerReviewValid(int $a_value)
Set peer review validation.
setPeerReviewPersonalized(bool $a_val)
setInstruction(string $a_val)
setPortfolioTemplateId(int $a_val)
setTitle(string $a_val)
setRelDeadlineLastSubmission(int $a_val)
setPeerReviewSimpleUnlock(bool $a_value)
setPeerReviewChars(?int $a_value)
setPeerReviewRating(bool $a_val)
setPeerReviewDeadline(int $a_val)
setFeedbackDateCustom(int $a_value)
Set (global) feedback file availability using a custom date.
setMaxFile(?int $a_value)
setMandatory(bool $a_val)
setPeerReviewFileUpload(bool $a_val)

◆ 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.

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)
nextId(string $table_name)

Referenced by cloneAssignmentsOfExercise().

+ 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.

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 }

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

Referenced by ilExAssignmentFileSystemGUI\deleteFile().

+ 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.

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)

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

+ 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.

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 }
setLimit(int $limit, int $offset=0)

References ILIAS\Repository\int().

+ 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.

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
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 }
$filename
Definition: buildRTE.php:78
static instructionFileOrderGetMax(int $a_ass_id)
static getSafeFilename(string $a_initial_filename)

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

Referenced by ilExAssignmentFileSystemGUI\uploadFile().

+ 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.

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 }
queryF(string $query, array $types, array $values)

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

+ 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.

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 }

References $DIC, and $ilDB.

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

+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType ( int  $a_value)

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

406 : bool
407 {
408 return $this->types->isValidId($a_value);
409 }

◆ lookup()

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

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

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 }

References $DIC, and $ilDB.

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline ( int  $a_ass_id)
static

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

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 }
$query

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

◆ lookupExerciseId()

static ilExAssignment::lookupExerciseId ( int  $a_ass_id)
static

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

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 }

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

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

+ 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.

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 }

References $DIC, and $ilDB.

◆ lookupTitle()

◆ lookupType()

static ilExAssignment::lookupType ( int  $a_id)
static

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

1105 : string
1106 {
1107 return self::lookup($a_id, "type");
1108 }

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

+ 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.

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 }

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

644 : void
645 {
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.

References $ilDB.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )
Exceptions
ilDateTimeException

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

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
static getAllAssignmentFiles(int $a_exc_id, int $a_ass_id)

References $id, $ilDB, ilExSubmission\getAllAssignmentFiles(), ILIAS\Survey\Mode\getId(), IL_CAL_DATETIME, and IL_CAL_UNIX.

+ 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.

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 }

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

Referenced by ilExAssignmentFileSystemGUI\renameFile().

+ 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.

705 : void
706 {
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)
static createNewAssignmentRecords(int $a_ass_id, ilObjExercise $a_exc)

References $ilDB.

◆ saveAssOrderOfExercise()

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

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

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 }

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

+ 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.

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 }

Referenced by ilExAssignmentFileSystemGUI\saveFilesOrder().

+ 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.

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
1573 }
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getMemberStatus(?int $a_user_id=null)
getMultiFeedbackFiles(int $a_user_id=0)
Get multi feedback files (of uploader)
static rename(string $a_source, string $a_target)
sendFeedbackFileNotification(string $a_feedback_file, array $user_ids, int $a_ass_id, bool $a_is_text_feedback=false)

◆ 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.

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 }
static _getMembers(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ 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.

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) {
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 }
ilAccessHandler $access
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)
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 ...
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)

References $exercise, $name, ilObjUser\_lookupName(), ilFileDelivery\deliverFileLegacy(), ilOrgUnitPositionAndRBACAccessHandler\filterUserIdsByRbacOrPositionOfCurrentUser(), ilFileUtils\getASCIIFilename(), ILIAS\Survey\Mode\getId(), ilFileUtils\ilTempnam(), ilFileUtils\makeDir(), and ilFileUtils\zip().

+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline ( ?int  $a_val)

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

226 : void
227 {
228 $this->deadline = $a_val;
229 }

◆ 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.

240 : void
241 {
242 $this->deadline_mode = $a_val;
243 }

◆ setExerciseId()

ilExAssignment::setExerciseId ( int  $a_val)

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

206 : void
207 {
208 $this->exc_id = $a_val;
209 }

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline ( ?int  $a_val)

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

309 : void
310 {
311 $this->deadline2 = $a_val;
312 }

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron ( bool  $a_value)

Toggle (global) feedback file cron.

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

573 : void
574 {
575 $this->feedback_cron = $a_value;
576 }

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate ( int  $a_value)

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

584 : void
585 {
586 $this->feedback_date = $a_value;
587 }

Referenced by __construct().

+ 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.

598 : void
599 {
600 $this->feedback_date_custom = $a_value;
601 }

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile ( ?string  $a_value)

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

560 : void
561 {
562 $this->feedback_file = $a_value;
563 }

◆ setId()

ilExAssignment::setId ( int  $a_val)

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

196 : void
197 {
198 $this->id = $a_val;
199 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setIndividualDeadline()

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

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

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
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)

References $id.

◆ setInstruction()

ilExAssignment::setInstruction ( string  $a_val)

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

319 : void
320 {
321 $this->instruction = $a_val;
322 }

◆ setMandatory()

ilExAssignment::setMandatory ( bool  $a_val)

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

353 : void
354 {
355 $this->mandatory = $a_val;
356 }

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

+ Here is the caller graph for this function:

◆ setMaxCharLimit()

ilExAssignment::setMaxCharLimit ( int  $a_val)

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

2168 : void
2169 {
2170 $this->max_char_limit = $a_val;
2171 }

Referenced by ilExAssTypeTextGUI\importFormToAssignment().

+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile ( ?int  $a_value)

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

620 : void
621 {
622 $this->max_file = $a_value;
623 }

◆ setMinCharLimit()

ilExAssignment::setMinCharLimit ( int  $a_val)

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

2157 : void
2158 {
2159 $this->min_char_limit = $a_val;
2160 }

Referenced by ilExAssTypeTextGUI\importFormToAssignment().

+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr ( int  $a_val)

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

363 : void
364 {
365 $this->order_nr = $a_val;
366 }

◆ setPeerReview()

ilExAssignment::setPeerReview ( bool  $a_value)

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

411 : void
412 {
413 $this->peer = $a_value;
414 }

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars ( ?int  $a_value)

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

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 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue ( ?int  $a_value)

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

522 : void
523 {
524 $this->crit_cat = $a_value;
525 }

◆ setPeerReviewDeadline()

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

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

444 : void
445 {
446 $this->peer_dl = $a_val;
447 }

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload ( bool  $a_val)

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

489 : void
490 {
491 $this->peer_file = $a_val;
492 }

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin ( int  $a_value)

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

421 : void
422 {
423 $this->peer_min = $a_value;
424 }

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized ( bool  $a_val)

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

499 : void
500 {
501 $this->peer_personal = $a_val;
502 }

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating ( bool  $a_val)

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

469 : void
470 {
471 $this->peer_rating = $a_val;
472 }

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock ( bool  $a_value)

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

432 {
433 $this->peer_unlock = $a_value;
434 }

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText ( bool  $a_val)

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

479 : void
480 {
481 $this->peer_text = $a_val;
482 }

◆ 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.

459 : void
460 {
461 $this->peer_valid = $a_value;
462 }

◆ setPortfolioTemplateId()

ilExAssignment::setPortfolioTemplateId ( int  $a_val)

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

631 : void
632 {
633 $this->portfolio_template = $a_val;
634 }

Referenced by ilExAssTypePortfolioGUI\importFormToAssignment().

+ Here is the caller graph for this function:

◆ setRelativeDeadline()

ilExAssignment::setRelativeDeadline ( int  $a_val)

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

250 : void
251 {
252 $this->relative_deadline = $a_val;
253 }

◆ setRelDeadlineLastSubmission()

ilExAssignment::setRelDeadlineLastSubmission ( int  $a_val)

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

260 : void
261 {
262 $this->rel_deadline_last_subm = $a_val;
263 }

◆ setStartTime()

ilExAssignment::setStartTime ( ?int  $a_val)

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

216 : void
217 {
218 $this->start_time = $a_val;
219 }

◆ setTeamTutor()

ilExAssignment::setTeamTutor ( bool  $a_value)

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

609 : void
610 {
611 $this->team_tutor = $a_value;
612 }

◆ setTitle()

ilExAssignment::setTitle ( string  $a_val)

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

343 : void
344 {
345 $this->title = $a_val;
346 }

◆ 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.

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)

Referenced by __construct().

+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )
Exceptions
ilDateTimeException

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

763 : void
764 {
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 }

References $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call 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.

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 }

References ILIAS\Survey\Mode\getId(), and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

◆ uploadMultiFeedbackFile()

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

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

1418 : void
1419 {
1420 $lng = $this->lng;
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
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...

References $ilUser, $lng, ilFileUtils\delDir(), ilFileUtils\getDir(), ILIAS\Survey\Mode\getId(), ilFileUtils\moveUploadedFile(), and ilFileUtils\unzip().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExAssignment::$access
protected

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

◆ $app_event_handler

ilAppEventHandler ilExAssignment::$app_event_handler
protected

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

◆ $ass_type

ilExAssignmentTypeInterface ilExAssignment::$ass_type
protected

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

◆ $crit_cat

int ilExAssignment::$crit_cat = 0
protected

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

◆ $db

ilDBInterface ilExAssignment::$db
protected

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

◆ $deadline

int ilExAssignment::$deadline = null
protected

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

◆ $deadline2

int ilExAssignment::$deadline2 = null
protected

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

◆ $deadline_mode

int ilExAssignment::$deadline_mode = 0
protected

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

◆ $exc_id

int ilExAssignment::$exc_id = 0
protected

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

◆ $feedback_cron

bool ilExAssignment::$feedback_cron = false
protected

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

◆ $feedback_date

int ilExAssignment::$feedback_date = 0
protected

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

◆ $feedback_date_custom

int ilExAssignment::$feedback_date_custom = 0
protected

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

◆ $feedback_file

string ilExAssignment::$feedback_file = null
protected

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

◆ $id

int ilExAssignment::$id = 0
protected

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

◆ $instruction

string ilExAssignment::$instruction = ""
protected

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

◆ $lng

ilLanguage ilExAssignment::$lng
protected

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

◆ $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.

◆ $max_char_limit

int ilExAssignment::$max_char_limit = 0
protected

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

◆ $max_file

int ilExAssignment::$max_file = null
protected

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

◆ $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.

◆ $order_nr

int ilExAssignment::$order_nr = 0
protected

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

◆ $peer

bool ilExAssignment::$peer = false
protected

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

◆ $peer_char

int ilExAssignment::$peer_char = null
protected

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

◆ $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.

◆ $peer_file

bool ilExAssignment::$peer_file = false
protected

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

◆ $peer_min

int ilExAssignment::$peer_min = 0
protected

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

◆ $peer_personal

bool ilExAssignment::$peer_personal = false
protected

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

◆ $peer_rating

bool ilExAssignment::$peer_rating = false
protected

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

◆ $peer_text

bool ilExAssignment::$peer_text = false
protected

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

◆ $peer_unlock

bool ilExAssignment::$peer_unlock = false
protected

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

◆ $peer_valid

int ilExAssignment::$peer_valid
protected

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

◆ $portfolio_template

int ilExAssignment::$portfolio_template = 0
protected

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

◆ $rel_deadline_last_subm

int ilExAssignment::$rel_deadline_last_subm = 0
protected

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

◆ $relative_deadline

int ilExAssignment::$relative_deadline = 0
protected

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

◆ $start_time

int ilExAssignment::$start_time = null
protected

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

◆ $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.

◆ $title

string ilExAssignment::$title = ""
protected

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

◆ $type

int ilExAssignment::$type = 0
protected

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

◆ $types

ilExAssignmentTypes ilExAssignment::$types
protected

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

◆ $user

ilObjUser ilExAssignment::$user
protected

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

◆ DEADLINE_ABSOLUTE

◆ DEADLINE_RELATIVE

◆ FEEDBACK_DATE_CUSTOM

const ilExAssignment::FEEDBACK_DATE_CUSTOM = 3

◆ FEEDBACK_DATE_DEADLINE

const ilExAssignment::FEEDBACK_DATE_DEADLINE = 1

◆ FEEDBACK_DATE_SUBMISSION

const ilExAssignment::FEEDBACK_DATE_SUBMISSION = 2

◆ PEER_REVIEW_VALID_ALL

const ilExAssignment::PEER_REVIEW_VALID_ALL = 3

◆ PEER_REVIEW_VALID_NONE

const ilExAssignment::PEER_REVIEW_VALID_NONE = 1

◆ 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.

◆ TEAMS_FORMED_BY_RANDOM

const ilExAssignment::TEAMS_FORMED_BY_RANDOM = 2

◆ TEAMS_FORMED_BY_TUTOR

const ilExAssignment::TEAMS_FORMED_BY_TUTOR = 1

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

Referenced by ilExAssignmentEditorGUI\processForm().

◆ 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: