ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 hasTeam ()
 
 setId ($a_val)
 Set assignment id. More...
 
 getId ()
 Get assignment id. More...
 
 setExerciseId ($a_val)
 Set exercise id. More...
 
 getExerciseId ()
 Get exercise id. More...
 
 setStartTime ($a_val)
 Set start time (timestamp) More...
 
 getStartTime ()
 Get start time (timestamp) More...
 
 setDeadline ($a_val)
 Set deadline (timestamp) More...
 
 getDeadline ()
 Get deadline (timestamp) More...
 
 setDeadlineMode ($a_val)
 Set deadline mode. More...
 
 getDeadlineMode ()
 Get deadline mode. More...
 
 setRelativeDeadline ($a_val)
 Set relative deadline. More...
 
 getRelativeDeadline ()
 Get relative deadline. More...
 
 setRelDeadlineLastSubmission ($a_val)
 Set relative deadline last submission. More...
 
 getRelDeadlineLastSubmission ()
 Get relative deadline last submission. More...
 
 getPersonalDeadline ($a_user_id)
 Get individual deadline (max of common or idl (team) deadline = Official Deadline) More...
 
 getLastPersonalDeadline ()
 Get last/final personal deadline (of assignment) More...
 
 setExtendedDeadline ($a_val)
 Set extended deadline (timestamp) More...
 
 getExtendedDeadline ()
 Get extended deadline (timestamp) More...
 
 setInstruction ($a_val)
 Set instruction. More...
 
 getInstruction ()
 Get instruction. More...
 
 getInstructionPresentation ()
 Get instruction presentation. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setMandatory ($a_val)
 Set mandatory. More...
 
 getMandatory ()
 Get mandatory. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setType ($a_value)
 Set type. More...
 
 getAssignmentType ()
 Get assignment type. More...
 
 getType ()
 Get type. More...
 
 isValidType ($a_value)
 Is given type valid? More...
 
 setPeerReview ($a_value)
 Toggle peer review. More...
 
 getPeerReview ()
 Get peer review status. More...
 
 setPeerReviewMin ($a_value)
 Set peer review minimum. More...
 
 getPeerReviewMin ()
 Get peer review minimum. More...
 
 setPeerReviewSimpleUnlock ($a_value)
 Set peer review simple unlock. More...
 
 getPeerReviewSimpleUnlock ()
 Get peer review simple unlock. More...
 
 setPeerReviewDeadline ($a_val)
 Set peer review deadline (timestamp) More...
 
 getPeerReviewDeadline ()
 Get peer review deadline (timestamp) More...
 
 setPeerReviewValid ($a_value)
 Set peer review validation. More...
 
 getPeerReviewValid ()
 Get peer review validatiob. More...
 
 setPeerReviewRating ($a_val)
 Set peer review rating. More...
 
 hasPeerReviewRating ()
 Get peer review rating status. More...
 
 setPeerReviewText ($a_val)
 Set peer review text. More...
 
 hasPeerReviewText ()
 Get peer review text status. More...
 
 setPeerReviewFileUpload ($a_val)
 Set peer review file upload. More...
 
 hasPeerReviewFileUpload ()
 Get peer review file upload status. More...
 
 setPeerReviewPersonalized ($a_val)
 Set peer review personalized. More...
 
 hasPeerReviewPersonalized ()
 Get peer review personalized status. More...
 
 setPeerReviewChars ($a_value)
 Set peer review minimum characters. More...
 
 getPeerReviewChars ()
 Get peer review minimum characters. More...
 
 setPeerReviewCriteriaCatalogue ($a_value)
 Set peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogue ()
 Get peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogueItems ()
 
 setFeedbackFile ($a_value)
 Set (global) feedback file. More...
 
 getFeedbackFile ()
 Get (global) feedback file. More...
 
 setFeedbackCron ($a_value)
 Toggle (global) feedback file cron. More...
 
 hasFeedbackCron ()
 Get (global) feedback file cron status. More...
 
 setFeedbackDate ($a_value)
 Set (global) feedback file availability date. More...
 
 getFeedbackDate ()
 Get (global) feedback file availability date. More...
 
 setFeedbackDateCustom ($a_value)
 Set (global) feedback file availability using a custom date. More...
 
 getFeedbackDateCustom ()
 Get feedback file availability using custom date. More...
 
 setTeamTutor ($a_value)
 Set team management by tutor. More...
 
 getTeamTutor ()
 Get team management by tutor. More...
 
 setMaxFile ($a_value)
 Set max number of uploads. More...
 
 getMaxFile ()
 Get max number of uploads. More...
 
 setPortfolioTemplateId ($a_val)
 Set portfolio template id. More...
 
 getPortfolioTemplateId ()
 Get portfolio template id. More...
 
 read ()
 Read from db. More...
 
 save ()
 Save assignment. More...
 
 update ()
 Update. More...
 
 delete ()
 Delete assignment. More...
 
 getFiles ()
 Get files. More...
 
 getInstructionFilesOrder ()
 
 getMemberListData ()
 get member list data More...
 
 getExerciseMemberAssignmentData ($a_user_id, $a_grade="")
 Get submission data for an specific user,exercise and assignment. More...
 
 uploadAssignmentFiles ($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 ($a_file)
 Upload multi feedback file. More...
 
 getMultiFeedbackFiles ($a_user_id=0)
 Get multi feedback files (of uploader) More...
 
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory. More...
 
 saveMultiFeedbackFiles ($a_files, ilObjExercise $a_exc)
 Save multi feedback files. More...
 
 afterDeadline ()
 
 afterDeadlineStrict ($a_include_personal=true)
 
 afterCustomDate ()
 
 beforeDeadline ()
 
 notStartedYet ()
 
 getGlobalFeedbackFileStoragePath ()
 
 deleteGlobalFeedbackFile ()
 
 handleGlobalFeedbackFileUpload (array $a_file)
 
 getGlobalFeedbackFilePath ()
 
 getMemberStatus ($a_user_id=null)
 
 recalculateLateSubmissions ()
 
 setIndividualDeadline ($id, ilDateTime $date)
 
 getIndividualDeadlines ()
 
 hasActiveIDl ()
 
 hasReadOnlyIDl ()
 
 fixInstructionFileOrdering ()
 
 fileAddOrder ($a_entries=array())
 
 setMinCharLimit ($a_val)
 Set limit minimum characters. More...
 
 getMinCharLimit ()
 Get limit minimum characters. More...
 
 setMaxCharLimit ($a_val)
 Set limit maximum characters. More...
 
 getMaxCharLimit ()
 get limit maximum characters return int max limit More...
 
 getCalculatedDeadlines ()
 Get calculated deadlines for user/team members. More...
 

Static Public Member Functions

static getInstancesByExercise ($a_exc_id)
 
static instructionFileGetFileOrderData ($a_file_data, $a_ass_id)
 
static getAssignmentDataOfExercise ($a_exc_id)
 Get assignments data of an exercise in an array. More...
 
static cloneAssignmentsOfExercise ($a_old_exc_id, $a_new_exc_id, array $a_crit_cat_map)
 Clone assignments of exercise. More...
 
static lookupMaxOrderNrForEx ($a_exc_id)
 Select the maximum order nr for an exercise. More...
 
static lookupAssignmentOnline ($a_ass_id)
 Check if assignment is online. More...
 
static lookupExerciseId ($a_ass_id)
 Lookup excercise id for assignment id. More...
 
static lookupTitle ($a_id)
 Lookup title. More...
 
static lookupType ($a_id)
 Lookup type. More...
 
static saveAssOrderOfExercise ($a_ex_id, $a_order)
 Save ordering of all assignments of an exercise. More...
 
static orderAssByDeadline ($a_ex_id)
 Order assignments by deadline date. More...
 
static countMandatory ($a_ex_id)
 Count the number of mandatory assignments. More...
 
static count ($a_ex_id)
 Order assignments by deadline date. More...
 
static isInExercise ($a_ass_id, $a_ex_id)
 Is assignment in exercise? More...
 
static lookupUpdatedSubmission ($ass_id, $member_id)
 Check whether student has upload new files after tutor has set the exercise to another than notgraded. More...
 
static createNewUserRecords ($a_user_id, $a_exc_id)
 Create member status record for a new participant for all assignments. More...
 
static createNewAssignmentRecords ($a_ass_id, $a_exc)
 Create member status record for a new assignment for all participants. More...
 
static getPendingFeedbackNotifications ()
 
static sendFeedbackNotifications ($a_ass_id, $a_user_id=null)
 
static saveInstructionFilesOrderOfAssignment ($a_ass_id, $a_order)
 Save ordering of instruction files for an assignment. More...
 
static insertFileOrderNr (int $a_ass_id, string $a_filename, int $a_order_nr)
 
static instructionFileInsertOrder ($a_filename, $a_ass_id, $a_order_nr=0)
 Store the file order in the database. More...
 
static instructionFileDeleteOrder ($a_ass_id, $a_file)
 
static renameInstructionFile ($a_old_name, $a_new_name, $a_ass_id)
 
static instructionFileExistsInDb ($a_filename, $a_ass_id)
 
static instructionFileOrderGetMax ($a_ass_id)
 

Data Fields

const TYPE_UPLOAD = 1
 
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 ($a_event)
 Handle calendar entries for deadline(s) More...
 

Protected Attributes

 $db
 
 $lng
 
 $user
 
 $app_event_handler
 
 $id
 
 $exc_id
 
 $type
 
 $start_time
 
 $deadline
 
 $deadline2
 
 $instruction
 
 $title
 
 $mandatory
 
 $order_nr
 
 $peer
 
 $peer_min
 
 $peer_unlock
 
 $peer_dl
 
 $peer_valid
 
 $peer_file
 
 $peer_personal
 
 $peer_char
 
 $peer_text
 
 $peer_rating
 
 $peer_crit_cat
 
 $feedback_file
 
 $feedback_cron
 
 $feedback_date
 
 $feedback_date_custom
 
 $team_tutor = false
 
 $max_file
 
 $portfolio_template
 
 $min_char_limit
 
 $max_char_limit
 
 $types = null
 
 $ass_type
 
 $deadline_mode = 0
 
 $relative_deadline = 0
 
 $starting_timestamp = null
 
 $rel_deadline_last_subm
 
 $member_status = array()
 
 $log
 

Static Private Member Functions

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

Detailed Description

Exercise assignment.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

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

130 {
131 global $DIC;
132
133 $this->db = $DIC->database();
134 $this->lng = $DIC->language();
135 $this->user = $DIC->user();
136 $this->app_event_handler = $DIC["ilAppEventHandler"];
137 $this->types = ilExAssignmentTypes::getInstance();
138
139 $this->setType(self::TYPE_UPLOAD);
140 $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
141
142 $this->log = ilLoggerFactory::getLogger("exc");
143
144 if ($a_id > 0) {
145 $this->setId($a_id);
146 $this->read();
147 }
148 }
user()
Definition: user.php:4
static getInstance()
Get instance.
setId($a_val)
Set assignment id.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setType($a_value)
Set type.
static getLogger($a_component_id)
Get component logger.
$DIC
Definition: xapitoken.php:46

References $DIC, ilExAssignmentTypes\getInstance(), ilLoggerFactory\getLogger(), read(), setFeedbackDate(), setId(), setType(), and 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 2121 of file class.ilExAssignment.php.

2122 {
2123 $date_custom = $this->getFeedbackDateCustom();
2124 //if the solution will be displayed only after reach all the deadlines.
2125 //$final_deadline = $this->afterDeadlineStrict();
2126 //$dl = max($final_deadline, time());
2127 //return ($date_custom - $dl <= 0);
2128 return ($date_custom - time() <= 0);
2129 }
getFeedbackDateCustom()
Get feedback file availability using custom date.

References getFeedbackDateCustom().

Referenced by ilExAssignmentGUI\addSubmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

2086 {
2088
2089 // :TODO: always current user?
2090 $idl = $this->getPersonalDeadline($ilUser->getId()); // official deadline
2091
2092 // no deadline === true
2093 $deadline = max($this->deadline, $this->deadline2, $idl); // includes grace period
2094 return ($deadline - time() <= 0);
2095 }
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline)
$ilUser
Definition: imgupload.php:18

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

Referenced by afterDeadlineStrict().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict (   $a_include_personal = true)

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

2098 {
2099 // :TODO: this means that peer feedback, global feedback is available
2100 // after LAST personal deadline
2101 // team management is currently ignoring personal deadlines
2102 $idl = (bool) $a_include_personal
2103 ? $this->getLastPersonalDeadline()
2104 : null;
2105
2106 // no deadline === false
2107 $deadline = max($this->deadline, $this->deadline2, $idl);
2108
2109 // #18271 - afterDeadline() does not handle last personal deadline
2110 if ($idl && $deadline == $idl) { // after effective deadline of all users
2111 return ($deadline - time() <= 0);
2112 }
2113
2114 return ($deadline > 0 && // like: after effective deadline (for single user), except: no deadline false
2115 $this->afterDeadline());
2116 }
getLastPersonalDeadline()
Get last/final personal deadline (of assignment)

References $deadline, afterDeadline(), and getLastPersonalDeadline().

Referenced by beforeDeadline(), and ilExerciseSubmissionTableGUI\parseRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

2132 {
2133 // no deadline === true
2134 return !$this->afterDeadlineStrict();
2135 }
afterDeadlineStrict($a_include_personal=true)

References afterDeadlineStrict().

+ Here is the call graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

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

1870 {
1871 $lng = $this->lng;
1873
1874 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1875 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1876 ilUtil::delDir($mfu);
1877 }
getExerciseId()
Get exercise id.
getId()
Get assignment id.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

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

Referenced by saveMultiFeedbackFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

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

Clone assignments of exercise.

Parameters

return

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

1216 {
1217 $ass_data = self::getInstancesByExercise($a_old_exc_id);
1218 foreach ($ass_data as $d) {
1219 // clone assignment
1220 $new_ass = new ilExAssignment();
1221 $new_ass->setExerciseId($a_new_exc_id);
1222 $new_ass->setTitle($d->getTitle());
1223 $new_ass->setDeadline($d->getDeadline());
1224 $new_ass->setExtendedDeadline($d->getExtendedDeadline());
1225 $new_ass->setInstruction($d->getInstruction());
1226 $new_ass->setMandatory($d->getMandatory());
1227 $new_ass->setOrderNr($d->getOrderNr());
1228 $new_ass->setStartTime($d->getStartTime());
1229 $new_ass->setType($d->getType());
1230 $new_ass->setPeerReview($d->getPeerReview());
1231 $new_ass->setPeerReviewMin($d->getPeerReviewMin());
1232 $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
1233 $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
1234 $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
1235 $new_ass->setPeerReviewValid($d->getPeerReviewValid());
1236 $new_ass->setPeerReviewChars($d->getPeerReviewChars());
1237 $new_ass->setPeerReviewText($d->hasPeerReviewText());
1238 $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
1239 $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
1240 $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
1241 $new_ass->setFeedbackFile($d->getFeedbackFile());
1242 $new_ass->setFeedbackDate($d->getFeedbackDate());
1243 $new_ass->setFeedbackDateCustom($d->getFeedbackDateCustom());
1244 $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
1245 $new_ass->setTeamTutor($d->getTeamTutor());
1246 $new_ass->setMaxFile($d->getMaxFile());
1247 $new_ass->setMinCharLimit($d->getMinCharLimit());
1248 $new_ass->setMaxCharLimit($d->getMaxCharLimit());
1249 $new_ass->setPortfolioTemplateId($d->getPortfolioTemplateId());
1250 $new_ass->setDeadlineMode($d->getDeadlineMode());
1251 $new_ass->setRelativeDeadline($d->getRelativeDeadline());
1252 $new_ass->setRelDeadlineLastSubmission($d->getRelDeadlineLastSubmission());
1253
1254 // criteria catalogue(s)
1255 if ($d->getPeerReviewCriteriaCatalogue() &&
1256 array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map)) {
1257 $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
1258 }
1259
1260 $new_ass->save();
1261
1262
1263 // clone assignment files
1264 $old_web_storage = new ilFSWebStorageExercise($a_old_exc_id, (int) $d->getId());
1265 $new_web_storage = new ilFSWebStorageExercise($a_new_exc_id, (int) $new_ass->getId());
1266 $new_web_storage->create();
1267 if (is_dir($old_web_storage->getPath())) {
1268 ilUtil::rCopy($old_web_storage->getPath(), $new_web_storage->getPath());
1269 }
1270 $order = $d->getInstructionFilesOrder();
1271 foreach ($order as $file) {
1272 ilExAssignment::insertFileOrderNr($new_ass->getId(), $file["filename"], $file["order_nr"]);
1273 }
1274
1275 // clone global feedback file
1276 $old_storage = new ilFSStorageExercise($a_old_exc_id, (int) $d->getId());
1277 $new_storage = new ilFSStorageExercise($a_new_exc_id, (int) $new_ass->getId());
1278 $new_storage->create();
1279 if (is_dir($old_storage->getGlobalFeedbackPath())) {
1280 ilUtil::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
1281 }
1282
1283 // clone reminders
1287 $rmd_sub = new ilExAssignmentReminder($a_old_exc_id, $d->getId(), $rem_type);
1288 if ($rmd_sub->getReminderStatus()) {
1289 $new_rmd_sub = new ilExAssignmentReminder($a_new_exc_id, $new_ass->getId(), $rem_type);
1290 $new_rmd_sub->setReminderStatus($rmd_sub->getReminderStatus());
1291 $new_rmd_sub->setReminderStart($rmd_sub->getReminderStart());
1292 $new_rmd_sub->setReminderEnd($rmd_sub->getReminderEnd());
1293 $new_rmd_sub->setReminderFrequency($rmd_sub->getReminderFrequency());
1294 $new_rmd_sub->setReminderMailTemplate($rmd_sub->getReminderMailTemplate());
1295 $new_rmd_sub->save();
1296 }
1297 }
1298
1299
1300 // type specific properties
1301 $ass_type = $d->getAssignmentType();
1302 $ass_type->cloneSpecificProperties($d, $new_ass);
1303 }
1304 }
TODO: import/export reminder data with the exercise/assignment.
Exercise assignment.
static getInstancesByExercise($a_exc_id)
static insertFileOrderNr(int $a_ass_id, string $a_filename, int $a_order_nr)
static rCopy($a_sdir, $a_tdir, $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

References $ass_type, $d, ilExAssignmentReminder\FEEDBACK_REMINDER, getInstancesByExercise(), ilExAssignmentReminder\GRADE_REMINDER, insertFileOrderNr(), ilUtil\rCopy(), and ilExAssignmentReminder\SUBMIT_REMINDER.

Referenced by ilObjExercise\cloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ count()

static ilExAssignment::count (   $a_ex_id)
static

Order assignments by deadline date.

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

1500 {
1501 global $DIC;
1502
1503 $ilDB = $DIC->database();
1504
1505 $set = $ilDB->query(
1506 "SELECT count(*) cntm FROM exc_assignment " .
1507 " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer")
1508 );
1509 $rec = $ilDB->fetchAssoc($set);
1510 return $rec["cntm"];
1511 }
global $ilDB

References $DIC, and $ilDB.

Referenced by getMultiFeedbackFiles(), ilObjExerciseGUI\initEditCustomForm(), and lookupUpdatedSubmission().

+ Here is the caller graph for this function:

◆ countMandatory()

static ilExAssignment::countMandatory (   $a_ex_id)
static

Count the number of mandatory assignments.

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

1482 {
1483 global $DIC;
1484
1485 $ilDB = $DIC->database();
1486
1487 $set = $ilDB->query(
1488 "SELECT count(*) cntm FROM exc_assignment " .
1489 " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1490 " AND mandatory = " . $ilDB->quote(1, "integer")
1491 );
1492 $rec = $ilDB->fetchAssoc($set);
1493 return $rec["cntm"];
1494 }

References $DIC, and $ilDB.

Referenced by ilObjExerciseGUI\initEditCustomForm().

+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

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

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

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

1680 {
1681 global $DIC;
1682
1683 $ilDB = $DIC->database();
1684
1685 $exmem = new ilExerciseMembers($a_exc);
1686 $mems = $exmem->getMembers();
1687
1688 foreach ($mems as $mem) {
1689 $ilDB->replace("exc_mem_ass_status", array(
1690 "ass_id" => array("integer", $a_ass_id),
1691 "usr_id" => array("integer", $mem)
1692 ), array(
1693 "status" => array("text", "notgraded")
1694 ));
1695 }
1696 }
Class ilExerciseMembers.

References $DIC, and $ilDB.

Referenced by save().

+ Here is the caller graph for this function:

◆ createNewUserRecords()

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

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

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

1659 {
1660 global $DIC;
1661
1662 $ilDB = $DIC->database();
1663
1664 $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1665 foreach ($ass_data as $ass) {
1666 //echo "-".$ass["id"]."-".$a_user_id."-";
1667 $ilDB->replace("exc_mem_ass_status", array(
1668 "ass_id" => array("integer", $ass["id"]),
1669 "usr_id" => array("integer", $a_user_id)
1670 ), array(
1671 "status" => array("text", "notgraded")
1672 ));
1673 }
1674 }
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.

References $DIC, $ilDB, and getAssignmentDataOfExercise().

Referenced by ilExerciseMembers\assignMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilExAssignment::delete ( )

Delete assignment.

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

1145 {
1146 $ilDB = $this->db;
1147
1148 $this->deleteGlobalFeedbackFile();
1149
1150 $ilDB->manipulate(
1151 "DELETE FROM exc_assignment WHERE " .
1152 " id = " . $ilDB->quote($this->getId(), "integer")
1153 );
1154 $exc = new ilObjExercise($this->getExerciseId(), false);
1155 $exc->updateAllUsersStatus();
1156
1157 $this->handleCalendarEntries("delete");
1158
1159 $reminder = new ilExAssignmentReminder();
1160 $reminder->deleteReminders($this->getId());
1161 }
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
Class ilObjExercise.

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

+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

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

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fileAddOrder()

ilExAssignment::fileAddOrder (   $a_entries = array())
Parameters
array$a_entries
integer$a_ass_idassignment id
Returns
array data items

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

2499 {
2501
2502 $order = $this->getInstructionFilesOrder();
2503 foreach ($a_entries as $k => $e) {
2504 $a_entries[$k]["order_val"] = $order[$e["file"]]["order_nr"];
2505 $a_entries[$k]["order_id"] = $order[$e["file"]]["id"];
2506 }
2507
2508 return $a_entries;
2509 }

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

+ Here is the call graph for this function:

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

2453 {
2454 global $DIC;
2455
2456 $db = $DIC->database();
2457
2458 $files = array_map(function ($v) {
2459 return $v["name"];
2460 }, $this->getFiles());
2461
2462 $set = $db->query("SELECT * FROM exc_ass_file_order " .
2463 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2464 " ORDER BY order_nr");
2465 $order_nr = 10;
2466 $numbered_files = array();
2467 while ($rec = $db->fetchAssoc($set)) {
2468 // file exists, set correct order nr
2469 if (in_array($rec["filename"], $files)) {
2470 $db->manipulate(
2471 "UPDATE exc_ass_file_order SET " .
2472 " order_nr = " . $db->quote($order_nr, "integer") .
2473 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2474 " AND id = " . $db->quote($rec["id"], "integer")
2475 );
2476 $order_nr += 10;
2477 $numbered_files[] = $rec["filename"];
2478 } else { // file does not exist, delete entry
2479 $db->manipulate(
2480 "DELETE FROM exc_ass_file_order " .
2481 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2482 " AND id = " . $db->quote($rec["id"], "integer")
2483 );
2484 }
2485 }
2486 foreach ($files as $f) {
2487 if (!in_array($f, $numbered_files)) {
2489 }
2490 }
2491 }
static instructionFileInsertOrder($a_filename, $a_ass_id, $a_order_nr=0)
Store the file order in the database.

References $db, $DIC, Vendor\Package\$f, $order_nr, getFiles(), getId(), and instructionFileInsertOrder().

Referenced by fileAddOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise (   $a_exc_id)
static

Get assignments data of an exercise in an array.

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

1168 {
1169 global $DIC;
1170
1171 $ilDB = $DIC->database();
1172
1173 // should be changed to self::getInstancesByExerciseId()
1174
1175 $set = $ilDB->query("SELECT * FROM exc_assignment " .
1176 " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
1177 " ORDER BY order_nr ASC");
1178 $data = array();
1179
1180 $order_val = 10;
1181 while ($rec = $ilDB->fetchAssoc($set)) {
1182 $data[] = array(
1183 "id" => $rec["id"],
1184 "exc_id" => $rec["exc_id"],
1185 "deadline" => $rec["time_stamp"],
1186 "deadline2" => $rec["deadline2"],
1187 "instruction" => $rec["instruction"],
1188 "title" => $rec["title"],
1189 "start_time" => $rec["start_time"],
1190 "order_val" => $order_val,
1191 "mandatory" => $rec["mandatory"],
1192 "type" => $rec["type"],
1193 "peer" => $rec["peer"],
1194 "peer_min" => $rec["peer_min"],
1195 "peer_dl" => $rec["peer_dl"],
1196 "peer_file" => $rec["peer_file"],
1197 "peer_prsl" => $rec["peer_prsl"],
1198 "fb_file" => $rec["fb_file"],
1199 "fb_date" => $rec["fb_date"],
1200 "fb_cron" => $rec["fb_cron"],
1201 "deadline_mode" => $rec["deadline_mode"],
1202 "relative_deadline" => $rec["relative_deadline"],
1203 "rel_deadline_last_subm" => $rec["rel_deadline_last_subm"]
1204 );
1205 $order_val += 10;
1206 }
1207 return $data;
1208 }
$data
Definition: storeScorm.php:23

References $data, $DIC, and $ilDB.

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

+ Here is the caller graph for this function:

◆ getAssignmentType()

ilExAssignment::getAssignmentType ( )

Get assignment type.

Parameters

return null|ilExAssignmentTypeInterface

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

546 {
547 return $this->ass_type;
548 }

References $ass_type.

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

+ 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 2580 of file class.ilExAssignment.php.

2581 {
2582 $calculated_deadlines = array(
2583 "user" => array(),
2584 "team" => array()
2585 );
2586
2587 if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
2588 foreach (ilExcIndividualDeadline::getStartingTimestamps($this->getId()) as $ts) {
2589 $type = $ts["is_team"]
2590 ? "team"
2591 : "user";
2592
2593 $calculated_deadlines[$type][$ts["member_id"]] = array(
2594 "calculated_deadline" => $ts["starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
2595 );
2596 }
2597 }
2598 return $calculated_deadlines;
2599 }
getRelativeDeadline()
Get relative deadline.
getDeadlineMode()
Get deadline mode.
static getStartingTimestamps($a_ass_id)
Get starting timestamp data for an assignment.

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

+ Here is the call graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

Get deadline (timestamp)

Returns
int deadline (timestamp)

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

289 {
290 return $this->deadline;
291 }

References $deadline.

Referenced by ilExAssignmentGUI\getOverviewHeader(), getPersonalDeadline(), handleCalendarEntries(), hasActiveIDl(), save(), ilObjExercise\sendAssignment(), and update().

+ Here is the caller graph for this function:

◆ getDeadlineMode()

ilExAssignment::getDeadlineMode ( )

Get deadline mode.

Returns
int deadline mode

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

309 {
311 }

References $deadline_mode.

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

+ Here is the caller graph for this function:

◆ getExerciseId()

◆ getExerciseMemberAssignmentData()

ilExAssignment::getExerciseMemberAssignmentData (   $a_user_id,
  $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.

Parameters
$a_user_id
$a_grade
Returns
array

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

1624 {
1625 global $DIC;
1626 $ilDB = $DIC->database();
1627
1628 if (in_array($a_grade, array("notgraded", "passed", "failed"))) {
1629 $and_grade = " AND status = " . $ilDB->quote($a_grade, "text");
1630 }
1631
1632 $q = "SELECT * FROM exc_mem_ass_status " .
1633 "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1634 " AND usr_id = " . $ilDB->quote($a_user_id, "integer") .
1635 $and_grade;
1636
1637 $set = $ilDB->query($q);
1638
1639 while ($rec = $ilDB->fetchAssoc($set)) {
1640 $sub = new ilExSubmission($this, $a_user_id);
1641
1642 $data["sent_time"] = $rec["sent_time"];
1643 $data["submission"] = $sub->getLastSubmission();
1644 $data["status_time"] = $rec["status_time"];
1645 $data["feedback_time"] = $rec["feedback_time"];
1646 $data["notice"] = $rec["notice"];
1647 $data["status"] = $rec["status"];
1648 $data["mark"] = $rec["mark"];
1649 $data["comment"] = $rec["u_comment"];
1650 }
1651
1652 return $data;
1653 }
Exercise submission //TODO: This class has to much static methods related to delivered "files".

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

+ Here is the call graph for this function:

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

Get extended deadline (timestamp)

Returns
int

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

418 {
419 return $this->deadline2;
420 }

References $deadline2.

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

+ Here is the caller graph for this function:

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

Get (global) feedback file availability date.

Returns
int

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

882 {
883 return (int) $this->feedback_date;
884 }

References $feedback_date.

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

+ Here is the caller graph for this function:

◆ getFeedbackDateCustom()

ilExAssignment::getFeedbackDateCustom ( )

Get feedback file availability using custom date.

Returns
string timestamp

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

900 {
902 }

References $feedback_date_custom.

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

+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

Get (global) feedback file.

Returns
int

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

842 {
843 return (string) $this->feedback_file;
844 }

References $feedback_file.

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

+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

Get files.

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

1310 {
1311 $this->log->debug("getting files from class.ilExAssignment using ilFSWebStorageExercise");
1312 $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1313 return $storage->getFiles();
1314 }

References getExerciseId(), and getId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

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

2170 {
2171 $file = $this->getFeedbackFile();
2172 if ($file) {
2173 $path = $this->getGlobalFeedbackFileStoragePath();
2174 return $path . "/" . $file;
2175 }
2176 }
getFeedbackFile()
Get (global) feedback file.

References getFeedbackFile(), and getGlobalFeedbackFileStoragePath().

+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

2148 {
2149 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
2150 return $storage->getGlobalFeedbackPath();
2151 }

References getExerciseId(), and getId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilExAssignment::getId ( )

Get assignment id.

Returns
int assignment id

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

229 {
230 return $this->id;
231 }

References $id.

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

+ Here is the caller graph for this function:

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

2271 {
2272 $ilDB = $this->db;
2273
2274 $res = array();
2275
2276 $set = $ilDB->query("SELECT * FROM exc_idl" .
2277 " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
2278 while ($row = $ilDB->fetchAssoc($set)) {
2279 if ($row["is_team"]) {
2280 $row["member_id"] = "t" . $row["member_id"];
2281 }
2282
2283 $res[$row["member_id"]] = $row["tstamp"];
2284 }
2285
2286 return $res;
2287 }
foreach($_POST as $key=> $value) $res

References $db, $ilDB, and $res.

◆ getInstancesByExercise()

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

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

155 {
156 global $DIC;
157
158 $ilDB = $DIC->database();
159
160 $set = $ilDB->query("SELECT * FROM exc_assignment " .
161 " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
162 " ORDER BY order_nr ASC");
163 $data = array();
164
165 $order_val = 10;
166 while ($rec = $ilDB->fetchAssoc($set)) {
167 // ???
168 $rec["order_val"] = $order_val;
169
170 $ass = new self();
171 $ass->initFromDB($rec);
172 $data[] = $ass;
173
174 $order_val += 10;
175 }
176
177 return $data;
178 }

References $data, $DIC, and $ilDB.

Referenced by ilExGradesTableGUI\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), cloneAssignmentsOfExercise(), ilExSubmission\deleteUser(), ilObjExercise\exportGradesExcel(), ilExcRandomAssignmentManager\getAssignmentSelection(), ilExcCriteriaCatalogueTableGUI\getItems(), ilExcRandomAssignmentManager\getTotalNumberOfAssignments(), ilExerciseManagementGUI\membersObject(), ilExerciseManagementCollectFilesJob\run(), and ilObjExerciseGUI\showOverviewObject().

+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

Get instruction.

Returns
string instruction

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

438 {
439 return $this->instruction;
440 }

References $instruction.

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

+ Here is the caller graph for this function:

◆ getInstructionFilesOrder()

ilExAssignment::getInstructionFilesOrder ( )
Parameters
$a_ass_id
Returns
array

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

1321 {
1322 $ilDB = $this->db;
1323
1324 $set = $ilDB->query(
1325 "SELECT filename, order_nr, id FROM exc_ass_file_order " .
1326 " WHERE assignment_id = " . $ilDB->quote($this->getId(), "integer")
1327 );
1328
1329 $data = array();
1330 while ($rec = $ilDB->fetchAssoc($set)) {
1331 $data[$rec['filename']] = $rec;
1332 }
1333
1334 return $data;
1335 }

References $data, $db, and $ilDB.

Referenced by fileAddOrder().

+ Here is the caller graph for this function:

◆ getInstructionPresentation()

ilExAssignment::getInstructionPresentation ( )

Get instruction presentation.

Returns
string

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

448 {
449 $inst = $this->getInstruction();
450 if (trim($inst)) {
451 $is_html = (strlen($inst) != strlen(strip_tags($inst)));
452 if (!$is_html) {
453 $inst = nl2br(ilUtil::makeClickable($inst, true));
454 }
455 }
456 return $inst;
457 }
getInstruction()
Get instruction.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen

References getInstruction(), and ilUtil\makeClickable().

+ Here is the call graph for this function:

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )

Get last/final personal deadline (of assignment)

Returns
int

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

390 {
392
393 $set = $ilDB->query("SELECT MAX(tstamp) FROM exc_idl" .
394 " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
395 $row = $ilDB->fetchAssoc($set);
396 return $row["tstamp"];
397 }

References $db, and $ilDB.

Referenced by afterDeadlineStrict().

+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

Get mandatory.

Returns
int mandatory

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

496 {
497 return $this->mandatory;
498 }

References $mandatory.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getMaxCharLimit()

ilExAssignment::getMaxCharLimit ( )

get limit maximum characters return int max limit

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

2569 {
2570 return $this->max_char_limit;
2571 }

References $max_char_limit.

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

+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

Get max number of uploads.

Returns
bool

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

943 {
944 return $this->max_file;
945 }

References $max_file.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

get member list data

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

1575 {
1576 $ilDB = $this->db;
1577
1578 $mem = array();
1579
1580 // first get list of members from member table
1581 $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login" .
1582 " FROM exc_members excm" .
1583 " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)" .
1584 " WHERE excm.obj_id = " . $ilDB->quote($this->getExerciseId(), "integer"));
1585 while ($rec = $ilDB->fetchAssoc($set)) {
1586 $mem[$rec["usr_id"]] =
1587 array(
1588 "name" => $rec["lastname"] . ", " . $rec["firstname"],
1589 "login" => $rec["login"],
1590 "usr_id" => $rec["usr_id"],
1591 "lastname" => $rec["lastname"],
1592 "firstname" => $rec["firstname"]
1593 );
1594 }
1595
1596 $q = "SELECT * FROM exc_mem_ass_status " .
1597 "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer");
1598 $set = $ilDB->query($q);
1599 while ($rec = $ilDB->fetchAssoc($set)) {
1600 if (isset($mem[$rec["usr_id"]])) {
1601 $sub = new ilExSubmission($this, $rec["usr_id"]);
1602
1603 $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1604 $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1605 $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1606 $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1607 $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1608 $mem[$rec["usr_id"]]["status"] = $rec["status"];
1609 $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1610 $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1611 }
1612 }
1613 return $mem;
1614 }

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

+ Here is the call graph for this function:

◆ getMemberStatus()

ilExAssignment::getMemberStatus (   $a_user_id = null)
Parameters
int | null$a_user_id
Returns
\ilExAssignmentMemberStatus

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

2183 {
2185
2186 if (!$a_user_id) {
2187 $a_user_id = $ilUser->getId();
2188 }
2189 if (!array_key_exists($a_user_id, $this->member_status)) {
2190 $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
2191 }
2192 return $this->member_status[$a_user_id];
2193 }
Exercise assignment member status.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinCharLimit()

ilExAssignment::getMinCharLimit ( )

Get limit minimum characters.

Returns
int minimum limit

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

2551 {
2552 return $this->min_char_limit;
2553 }

References $min_char_limit.

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

+ Here is the caller graph for this function:

◆ getMultiFeedbackFiles()

ilExAssignment::getMultiFeedbackFiles (   $a_user_id = 0)

Get multi feedback files (of uploader)

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

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

1807 {
1809
1810 if ($a_user_id == 0) {
1811 $a_user_id = $ilUser->getId();
1812 }
1813
1814 $mf_files = array();
1815
1816 // get members
1817 $exc = new ilObjExercise($this->getExerciseId(), false);
1818 $exmem = new ilExerciseMembers($exc);
1819 $mems = $exmem->getMembers();
1820
1821 // read mf directory
1822 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1823 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1824
1825 // get subdir that starts with multi_feedback
1826 $subdirs = ilUtil::getDir($mfu);
1827 $subdir = "notfound";
1828 foreach ($subdirs as $s => $j) {
1829 if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1830 $subdir = $s;
1831 }
1832 }
1833
1834 $items = ilUtil::getDir($mfu . "/" . $subdir);
1835 foreach ($items as $k => $i) {
1836 // check directory
1837 if ($i["type"] == "dir" && !in_array($k, array(".", ".."))) {
1838 // check if valid member id is given
1839 $parts = explode("_", $i["entry"]);
1840 $user_id = (int) $parts[count($parts) - 1];
1841 if (in_array($user_id, $mems)) {
1842 // read dir of user
1843 $name = ilObjUser::_lookupName($user_id);
1844 $files = ilUtil::getDir($mfu . "/" . $subdir . "/" . $k);
1845 foreach ($files as $k2 => $f) {
1846 // append files to array
1847 if ($f["type"] == "file" && substr($k2, 0, 1) != ".") {
1848 $mf_files[] = array(
1849 "lastname" => $name["lastname"],
1850 "firstname" => $name["firstname"],
1851 "login" => $name["login"],
1852 "user_id" => $name["user_id"],
1853 "full_path" => $mfu . "/" . $subdir . "/" . $k . "/" . $k2,
1854 "file" => $k2);
1855 }
1856 }
1857 }
1858 }
1859 }
1860 return $mf_files;
1861 }
static count($a_ex_id)
Order assignments by deadline date.
static _lookupName($a_user_id)
lookup user name
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
if($format !==null) $name
Definition: metadata.php:230
$i
Definition: metadata.php:24

References Vendor\Package\$f, $i, $ilUser, $name, $user, ilObjUser\_lookupName(), count(), ilUtil\getDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

Get order nr.

Returns
int order nr

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

516 {
517 return $this->order_nr;
518 }

References $order_nr.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

Get peer review status.

Returns
bool

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

589 {
590 return (bool) $this->peer;
591 }

References $peer.

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

+ Here is the caller graph for this function:

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

Get peer review minimum characters.

Returns
int

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

772 {
773 return $this->peer_char;
774 }

References $peer_char.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

Get peer review criteria catalogue id.

Returns
int

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

795 {
796 return $this->crit_cat;
797 }

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogueItems()

ilExAssignment::getPeerReviewCriteriaCatalogueItems ( )

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

800 {
801 if ($this->crit_cat) {
802 return ilExcCriteria::getInstancesByParentId($this->crit_cat);
803 } else {
804 $res = array();
805
806 if ($this->peer_rating) {
808 }
809
810 if ($this->peer_text) {
811 $crit = ilExcCriteria::getInstanceByType("text");
812 if ($this->peer_char) {
813 $crit->setMinChars($this->peer_char);
814 }
815 $res[] = $crit;
816 }
817
818 if ($this->peer_file) {
820 }
821
822 return $res;
823 }
824 }
static getInstancesByParentId($a_parent_id)
static getInstanceByType($a_type)

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

+ Here is the call graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

Get peer review deadline (timestamp)

Returns
int deadline (timestamp)

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

649 {
650 return $this->peer_dl;
651 }

References $peer_dl.

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

+ Here is the caller graph for this function:

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

Get peer review minimum.

Returns
int

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

609 {
610 return (int) $this->peer_min;
611 }

References $peer_min.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

Get peer review simple unlock.

Returns
bool

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

629 {
630 return (bool) $this->peer_unlock;
631 }

References $peer_unlock.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

Get peer review validatiob.

Returns
int

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

669 {
670 return (int) $this->peer_valid;
671 }

References $peer_valid.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

1998 {
1999 global $DIC;
2000
2001 $ilDB = $DIC->database();
2002
2003 $res = array();
2004
2005 $set = $ilDB->query("SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
2006 " WHERE fb_cron = " . $ilDB->quote(1, "integer") .
2007 " AND (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer") .
2008 " AND time_stamp IS NOT NULL" .
2009 " AND time_stamp > " . $ilDB->quote(0, "integer") .
2010 " AND time_stamp < " . $ilDB->quote(time(), "integer") .
2011 " AND fb_cron_done = " . $ilDB->quote(0, "integer") .
2012 ") OR (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_CUSTOM, "integer") .
2013 " AND fb_date_custom IS NOT NULL" .
2014 " AND fb_date_custom > " . $ilDB->quote(0, "integer") .
2015 " AND fb_date_custom < " . $ilDB->quote(time(), "integer") .
2016 " AND fb_cron_done = " . $ilDB->quote(0, "integer") . ")");
2017
2018
2019
2020 while ($row = $ilDB->fetchAssoc($set)) {
2021 if ($row['fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
2022 $max = max($row['time_stamp'], $row['deadline2']);
2023 if (trim($row["fb_file"]) && $max <= time()) {
2024 $res[] = $row["id"];
2025 }
2026 } elseif ($row['fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
2027 if (trim($row["fb_file"]) && $row['fb_date_custom'] <= time()) {
2028 $res[] = $row["id"];
2029 }
2030 }
2031 }
2032
2033 return $res;
2034 }

References $DIC, $ilDB, and $res.

Referenced by ilExcCronFeedbackNotification\run().

+ Here is the caller graph for this function:

◆ getPersonalDeadline()

ilExAssignment::getPersonalDeadline (   $a_user_id)

Get individual deadline (max of common or idl (team) deadline = Official Deadline)

Parameters
int$a_user_id
Returns
int

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

360 {
362
363 $is_team = false;
364 if ($this->ass_type->usesTeams()) {
365 $team_id = ilExAssignmentTeam::getTeamId($this->getId(), $a_user_id);
366 if (!$team_id) {
367 // #0021043
368 return $this->getDeadline();
369 }
370 $a_user_id = $team_id;
371 $is_team = true;
372 }
373
374 $set = $ilDB->query("SELECT tstamp FROM exc_idl" .
375 " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
376 " AND member_id = " . $ilDB->quote($a_user_id, "integer") .
377 " AND is_team = " . $ilDB->quote($is_team, "integer"));
378 $row = $ilDB->fetchAssoc($set);
379
380 // use assignment deadline if no direct personal
381 return max($row["tstamp"], $this->getDeadline());
382 }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
getDeadline()
Get deadline (timestamp)

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

Referenced by afterDeadline(), ilExAssignmentGUI\getOverviewHeader(), and recalculateLateSubmissions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPortfolioTemplateId()

ilExAssignment::getPortfolioTemplateId ( )

Get portfolio template id.

Returns
int portfolio template id

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

963 {
965 }

References $portfolio_template.

Referenced by ilExAssTypePortfolioGUI\getFormValuesArray().

+ Here is the caller graph for this function:

◆ getRelativeDeadline()

ilExAssignment::getRelativeDeadline ( )

Get relative deadline.

Returns
int relative deadline

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

329 {
331 }

References $relative_deadline.

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

+ Here is the caller graph for this function:

◆ getRelDeadlineLastSubmission()

ilExAssignment::getRelDeadlineLastSubmission ( )

Get relative deadline last submission.

Returns
int

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

References $rel_deadline_last_subm.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getStartTime()

ilExAssignment::getStartTime ( )

Get start time (timestamp)

Returns
int start time (timestamp)

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

269 {
270 return $this->start_time;
271 }

References $start_time.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

Get team management by tutor.

Returns
bool

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

920 {
921 return $this->team_tutor;
922 }

References $team_tutor.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getTitle()

ilExAssignment::getTitle ( )

◆ getType()

ilExAssignment::getType ( )

Get type.

Returns
int
Deprecated:
this will most probably become an non public function in the future (or become obsolete)

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

558 {
559 return $this->type;
560 }

References $type.

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

+ Here is the caller graph for this function:

◆ handleCalendarEntries()

ilExAssignment::handleCalendarEntries (   $a_event)
protected

Handle calendar entries for deadline(s)

Parameters
string$a_event

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

1946 {
1947 $ilAppEventHandler = $this->app_event_handler;
1948
1949 $dl_id = $this->getId() . "0";
1950 $fbdl_id = $this->getId() . "1";
1951
1952 $context_ids = array($dl_id, $fbdl_id);
1953 $apps = array();
1954
1955 if ($a_event != "delete") {
1956 // deadline or relative deadline given
1958 $app = new ilCalendarAppointmentTemplate($dl_id);
1959 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1960 $app->setSubtitle("cal_exc_deadline");
1961 $app->setTitle($this->getTitle());
1962 $app->setFullday(false);
1963 // note: in the case of a relative deadline this will be set to 0 / 1970...)
1964 // see ilCalendarScheduleFilterExercise for appointment modification
1965 $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1966
1967 $apps[] = $app;
1968 }
1969
1970 if ($this->getPeerReview() &&
1971 $this->getPeerReviewDeadline()) {
1972 $app = new ilCalendarAppointmentTemplate($fbdl_id);
1973 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1974 $app->setSubtitle("cal_exc_peer_review_deadline");
1975 $app->setTitle($this->getTitle());
1976 $app->setFullday(false);
1977 $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1978
1979 $apps[] = $app;
1980 }
1981 }
1982
1983 $exc = new ilObjExercise($this->getExerciseId(), false);
1984
1985 $ilAppEventHandler->raise(
1986 'Modules/Exercise',
1987 $a_event . 'Assignment',
1988 array(
1989 'object' => $exc,
1990 'obj_id' => $exc->getId(),
1991 'context_ids' => $context_ids,
1992 'appointments' => $apps)
1993 );
1994 }
const IL_CAL_TRANSLATION_SYSTEM
const IL_CAL_UNIX
Apointment templates are used for automatic generated apointments.
@classDescription Date and time handling
getPeerReview()
Get peer review status.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
$app
Definition: cli.php:38

References $app, $app_event_handler, DEADLINE_RELATIVE, getDeadline(), getDeadlineMode(), getExerciseId(), getId(), getPeerReview(), getPeerReviewDeadline(), getTitle(), IL_CAL_TRANSLATION_SYSTEM, and IL_CAL_UNIX.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)

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

2159 {
2160 $path = $this->getGlobalFeedbackFileStoragePath();
2161 ilUtil::delDir($path, true);
2162 if (ilUtil::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path . "/" . $a_file["name"])) {
2163 $this->setFeedbackFile($a_file["name"]);
2164 return true;
2165 }
2166 return false;
2167 }
setFeedbackFile($a_value)
Set (global) feedback file.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

2290 {
2291 return (bool) $this->getDeadline();
2292 }

References getDeadline().

Referenced by ilExerciseSubmissionTableGUI\parseRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

Get (global) feedback file cron status.

Returns
int

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

862 {
863 return (bool) $this->feedback_cron;
864 }

References $feedback_cron.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

Get peer review file upload status.

Returns
bool

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

729 {
730 return $this->peer_file;
731 }

References $peer_file.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

Get peer review personalized status.

Returns
bool

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

749 {
751 }

References $peer_personal.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

Get peer review rating status.

Returns
bool

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

689 {
690 return $this->peer_rating;
691 }

References $peer_rating.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

Get peer review text status.

Returns
bool

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

709 {
710 return $this->peer_text;
711 }

References $peer_text.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

2295 {
2296 if (!$this->ass_type->usesTeams() &&
2297 $this->getPeerReview()) {
2298 // all deadlines are read-only if we have peer feedback
2299 $peer_review = new ilExPeerReview($this);
2300 if ($peer_review->hasPeerReviewGroups()) {
2301 return true;
2302 }
2303 }
2304
2305 return false;
2306 }
Exercise peer review.

Referenced by ilExerciseSubmissionTableGUI\parseRow().

+ Here is the caller graph for this function:

◆ hasTeam()

ilExAssignment::hasTeam ( )

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

209 {
210 return $this->ass_type->usesTeams();
211 }

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

+ Here is the caller graph for this function:

◆ initFromDB()

ilExAssignment::initFromDB ( array  $a_set)
protected

Import DB record.

See also
getInstancesByExercise()
Parameters
array$a_set

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

994 {
995 $this->setId($a_set["id"]);
996 $this->setExerciseId($a_set["exc_id"]);
997 $this->setDeadline($a_set["time_stamp"]);
998 $this->setExtendedDeadline($a_set["deadline2"]);
999 $this->setInstruction($a_set["instruction"]);
1000 $this->setTitle($a_set["title"]);
1001 $this->setStartTime($a_set["start_time"]);
1002 $this->setOrderNr($a_set["order_nr"]);
1003 $this->setMandatory($a_set["mandatory"]);
1004 $this->setType($a_set["type"]);
1005 $this->setPeerReview($a_set["peer"]);
1006 $this->setPeerReviewMin($a_set["peer_min"]);
1007 $this->setPeerReviewSimpleUnlock($a_set["peer_unlock"]);
1008 $this->setPeerReviewDeadline($a_set["peer_dl"]);
1009 $this->setPeerReviewValid($a_set["peer_valid"]);
1010 $this->setPeerReviewFileUpload($a_set["peer_file"]);
1011 $this->setPeerReviewPersonalized($a_set["peer_prsl"]);
1012 $this->setPeerReviewChars($a_set["peer_char"]);
1013 $this->setPeerReviewText($a_set["peer_text"]);
1014 $this->setPeerReviewRating($a_set["peer_rating"]);
1015 $this->setPeerReviewCriteriaCatalogue($a_set["peer_crit_cat"]);
1016 $this->setFeedbackFile($a_set["fb_file"]);
1017 $this->setFeedbackDate($a_set["fb_date"]);
1018 $this->setFeedbackDateCustom($a_set["fb_date_custom"]);
1019 $this->setFeedbackCron($a_set["fb_cron"]);
1020 $this->setTeamTutor($a_set["team_tutor"]);
1021 $this->setMaxFile($a_set["max_file"]);
1022 $this->setPortfolioTemplateId($a_set["portfolio_template"]);
1023 $this->setMinCharLimit($a_set["min_char_limit"]);
1024 $this->setMaxCharLimit($a_set["max_char_limit"]);
1025 $this->setDeadlineMode($a_set["deadline_mode"]);
1026 $this->setRelativeDeadline($a_set["relative_deadline"]);
1027 $this->setRelDeadlineLastSubmission($a_set["rel_deadline_last_subm"]);
1028 }
setDeadline($a_val)
Set deadline (timestamp)
setOrderNr($a_val)
Set order nr.
setPeerReviewRating($a_val)
Set peer review rating.
setPeerReview($a_value)
Toggle peer review.
setPortfolioTemplateId($a_val)
Set portfolio template id.
setTeamTutor($a_value)
Set team management by tutor.
setFeedbackCron($a_value)
Toggle (global) feedback file cron.
setTitle($a_val)
Set title.
setFeedbackDateCustom($a_value)
Set (global) feedback file availability using a custom date.
setPeerReviewPersonalized($a_val)
Set peer review personalized.
setRelativeDeadline($a_val)
Set relative deadline.
setPeerReviewValid($a_value)
Set peer review validation.
setPeerReviewText($a_val)
Set peer review text.
setPeerReviewSimpleUnlock($a_value)
Set peer review simple unlock.
setExtendedDeadline($a_val)
Set extended deadline (timestamp)
setPeerReviewMin($a_value)
Set peer review minimum.
setInstruction($a_val)
Set instruction.
setDeadlineMode($a_val)
Set deadline mode.
setPeerReviewChars($a_value)
Set peer review minimum characters.
setMaxCharLimit($a_val)
Set limit maximum characters.
setMaxFile($a_value)
Set max number of uploads.
setStartTime($a_val)
Set start time (timestamp)
setMinCharLimit($a_val)
Set limit minimum characters.
setPeerReviewCriteriaCatalogue($a_value)
Set peer review criteria catalogue id.
setPeerReviewDeadline($a_val)
Set peer review deadline (timestamp)
setPeerReviewFileUpload($a_val)
Set peer review file upload.
setRelDeadlineLastSubmission($a_val)
Set relative deadline last submission.
setExerciseId($a_val)
Set exercise id.
setMandatory($a_val)
Set mandatory.

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

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFileOrderNr()

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

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

2335 {
2336 global $DIC;
2337 $db = $DIC->database();
2338 $id = $db->nextId("exc_ass_file_order");
2339 $db->insert("exc_ass_file_order", [
2340 "id" => ["integer", $id],
2341 "order_nr" => ["integer", $a_order_nr],
2342 "assignment_id" => ["integer", $a_ass_id],
2343 "filename" => ["text", $a_filename]
2344 ]
2345 );
2346 }

References $db, $DIC, and $id.

Referenced by cloneAssignmentsOfExercise().

+ Here is the caller graph for this function:

◆ instructionFileDeleteOrder()

static ilExAssignment::instructionFileDeleteOrder (   $a_ass_id,
  $a_file 
)
static

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

2387 {
2388 global $DIC;
2389
2390 $db = $DIC->database();
2391
2392 //now its done by filename. We need to figure how to get the order id in the confirmdelete method
2393 foreach ($a_file as $k => $v) {
2394 $db->manipulate(
2395 "DELETE FROM exc_ass_file_order " .
2396 //"WHERE id = " . $ilDB->quote((int)$k, "integer") .
2397 "WHERE filename = " . $db->quote($v, "string") .
2398 " AND assignment_id = " . $db->quote($a_ass_id, 'integer')
2399 );
2400 }
2401 }

References $db, and $DIC.

Referenced by ilExAssignmentFileSystemGUI\deleteFile().

+ Here is the caller graph for this function:

◆ instructionFileExistsInDb()

static ilExAssignment::instructionFileExistsInDb (   $a_filename,
  $a_ass_id 
)
static
Parameters
$a_filename
$a_ass_idassignment id
Returns
int if the file exists or not in the DB

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

2436 {
2437 global $DIC;
2438
2439 $db = $DIC->database();
2440
2441 if ($a_ass_id) {
2442 $result = $db->query(
2443 "SELECT id FROM exc_ass_file_order" .
2444 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2445 " AND filename = " . $db->quote($a_filename, 'string')
2446 );
2447
2448 return $db->numRows($result);
2449 }
2450 }
$result

References $db, $DIC, and $result.

◆ instructionFileGetFileOrderData()

static ilExAssignment::instructionFileGetFileOrderData (   $a_file_data,
  $a_ass_id 
)
static
Parameters
array$a_file_data
integer$a_ass_idassignment id.
Returns
array

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

186 {
187 global $DIC;
188
189 $db = $DIC->database();
190 $db->setLimit(1, 0);
191
192 $result_order_val = $db->query("
193 SELECT id, order_nr
194 FROM exc_ass_file_order
195 WHERE assignment_id = {$db->quote($a_ass_id, 'integer')}
196 AND filename = {$db->quote($a_file_data['entry'], 'string')}
197 ");
198
199 $order_val = 0;
200 $order_id = 0;
201 while ($row = $db->fetchAssoc($result_order_val)) {
202 $order_val = (int) $row['order_nr'];
203 $order_id = (int) $row['id'];
204 }
205 return array($order_val, $order_id);
206 }

References $db, and $DIC.

◆ instructionFileInsertOrder()

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

Store the file order in the database.

Parameters
string$a_filenamepreviously sanitized.
int$a_ass_idassignment id.

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

2354 {
2355 global $DIC;
2356
2357 $db = $DIC->database();
2358
2359 $order = 0;
2360 $order_val = 0;
2361
2362 if ($a_ass_id) {
2363 //first of all check the suffix and change if necessary
2364 $filename = ilUtil::getSafeFilename($a_filename);
2365
2366 if (!self::instructionFileExistsInDb($filename, $a_ass_id)) {
2367 if ($a_order_nr == 0) {
2368 $order_val = self::instructionFileOrderGetMax($a_ass_id);
2369 $order = $order_val + 10;
2370 } else {
2371 $order = $a_order_nr;
2372 }
2373
2374 $id = $db->nextID('exc_ass_file_order');
2375 $db->manipulate("INSERT INTO exc_ass_file_order " .
2376 "(id, assignment_id, filename, order_nr) VALUES (" .
2377 $db->quote($id, "integer") . "," .
2378 $db->quote($a_ass_id, "integer") . "," .
2379 $db->quote($filename, "text") . "," .
2380 $db->quote($order, "integer") .
2381 ")");
2382 }
2383 }
2384 }
$filename
Definition: buildRTE.php:89
static instructionFileOrderGetMax($a_ass_id)
static getSafeFilename($a_initial_filename)

References $db, $DIC, $filename, $id, ilUtil\getSafeFilename(), and instructionFileOrderGetMax().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileOrderGetMax()

static ilExAssignment::instructionFileOrderGetMax (   $a_ass_id)
static
Parameters
int$a_ass_idassignment id
Returns
int

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

2516 {
2517 global $DIC;
2518
2519 $db = $DIC->database();
2520
2521 //get max order number
2522 $result = $db->queryF(
2523 "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
2524 array('integer'),
2525 array($db->quote($a_ass_id, 'integer'))
2526 );
2527
2528 while ($row = $db->fetchAssoc($result)) {
2529 $order_val = (int) $row['max_order'];
2530 }
2531 return $order_val;
2532 }

References $db, $DIC, and $result.

Referenced by instructionFileInsertOrder().

+ Here is the caller graph for this function:

◆ isInExercise()

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

Is assignment in exercise?

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

1517 {
1518 global $DIC;
1519
1520 $ilDB = $DIC->database();
1521
1522 $set = $ilDB->query(
1523 "SELECT * FROM exc_assignment " .
1524 " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1525 " AND id = " . $ilDB->quote($a_ass_id, "integer")
1526 );
1527 if ($rec = $ilDB->fetchAssoc($set)) {
1528 return true;
1529 }
1530 return false;
1531 }

References $DIC, and $ilDB.

Referenced by ilExcRandomAssignmentDBRepository\getAssignmentsOfUser(), and ilExcRandomAssignmentDBRepository\saveAssignmentsOfUser().

+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType (   $a_value)

Is given type valid?

Parameters
int$a_value
Returns
bool

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

569 {
570 return $this->types->isValidId($a_value);
571 }

Referenced by setType().

+ Here is the caller graph for this function:

◆ lookup()

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

Private lookup.

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

1399 {
1400 global $DIC;
1401
1402 $ilDB = $DIC->database();
1403
1404 $set = $ilDB->query(
1405 "SELECT " . $a_field . " FROM exc_assignment " .
1406 " WHERE id = " . $ilDB->quote($a_id, "integer")
1407 );
1408
1409 $rec = $ilDB->fetchAssoc($set);
1410
1411 return $rec[$a_field];
1412 }

References $DIC, and $ilDB.

Referenced by lookupTitle(), and lookupType().

+ Here is the caller graph for this function:

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline (   $a_ass_id)
static

Check if assignment is online.

Parameters
int$a_ass_id
Returns
bool

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

1362 {
1363 global $DIC;
1364
1365 $ilDB = $DIC->database();
1366
1367 $query = "SELECT id FROM exc_assignment " .
1368 "WHERE start_time <= " . $ilDB->quote(time(), 'integer') . ' ' .
1369 "AND time_stamp >= " . $ilDB->quote(time(), 'integer') . ' ' .
1370 "AND id = " . $ilDB->quote($a_ass_id, 'integer');
1371 $res = $ilDB->query($query);
1372
1373 return $res->numRows() ? true : false;
1374 }
$query

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

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

+ Here is the caller graph for this function:

◆ lookupExerciseId()

static ilExAssignment::lookupExerciseId (   $a_ass_id)
static

Lookup excercise id for assignment id.

Parameters
int$a_ass_id
Returns
int

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

1383 {
1384 global $DIC;
1385
1386 $ilDB = $DIC->database();
1387
1388 $query = "SELECT exc_id FROM exc_assignment " .
1389 "WHERE id = " . $ilDB->quote($a_ass_id, 'integer');
1390 $res = $ilDB->fetchAssoc($ilDB->query($query));
1391
1392 return (int) $res["exc_id"];
1393 }

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

Select the maximum order nr for an exercise.

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

1341 {
1342 global $DIC;
1343
1344 $ilDB = $DIC->database();
1345
1346 $set = $ilDB->query(
1347 "SELECT MAX(order_nr) mnr FROM exc_assignment " .
1348 " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer")
1349 );
1350 while ($rec = $ilDB->fetchAssoc($set)) {
1351 return (int) $rec["mnr"];
1352 }
1353 return 0;
1354 }

References $DIC, and $ilDB.

◆ lookupTitle()

◆ lookupType()

static ilExAssignment::lookupType (   $a_id)
static

Lookup type.

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

1426 {
1427 return self::lookup($a_id, "type");
1428 }

References lookup().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupUpdatedSubmission()

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

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

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

1539 {
1540 global $DIC;
1541
1542 $ilDB = $DIC->database();
1543 $lng = $DIC->language();
1544
1545 // team upload?
1546 $user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
1547 if (!$user_ids) {
1548 $user_ids = array($member_id);
1549 }
1550
1551 $q = "SELECT exc_mem_ass_status.status_time, exc_returned.ts " .
1552 "FROM exc_mem_ass_status, exc_returned " .
1553 "WHERE exc_mem_ass_status.status_time < exc_returned.ts " .
1554 "AND NOT exc_mem_ass_status.status_time IS NULL " .
1555 "AND exc_returned.ass_id = exc_mem_ass_status.ass_id " .
1556 "AND exc_returned.user_id = exc_mem_ass_status.usr_id " .
1557 "AND exc_returned.ass_id=" . $ilDB->quote($ass_id, "integer") .
1558 " AND " . $ilDB->in("exc_returned.user_id", $user_ids, "", "integer");
1559
1560 $usr_set = $ilDB->query($q);
1561
1562 $array = $ilDB->fetchAssoc($usr_set);
1563
1564 if (count($array) == 0) {
1565 return 0;
1566 } else {
1567 return 1;
1568 }
1569 }

References $DIC, $ilDB, $lng, and count().

+ Here is the call graph for this function:

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

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

2138 {
2139 return (time() - $this->start_time <= 0);
2140 }

◆ orderAssByDeadline()

static ilExAssignment::orderAssByDeadline (   $a_ex_id)
static

Order assignments by deadline date.

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

1458 {
1459 global $DIC;
1460 $ilDB = $DIC->database();
1461
1462 $set = $ilDB->query(
1463 "SELECT id FROM exc_assignment " .
1464 " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1465 " ORDER BY time_stamp ASC"
1466 );
1467 $nr = 10;
1468 while ($rec = $ilDB->fetchAssoc($set)) {
1469 $ilDB->manipulate(
1470 "UPDATE exc_assignment SET " .
1471 " order_nr = " . $ilDB->quote($nr, "integer") .
1472 " WHERE id = " . $ilDB->quote($rec["id"], "integer")
1473 );
1474 $nr += 10;
1475 }
1476 }

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )

Read from db.

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

972 {
974
975 $set = $ilDB->query(
976 "SELECT * FROM exc_assignment " .
977 " WHERE id = " . $ilDB->quote($this->getId(), "integer")
978 );
979 $rec = $ilDB->fetchAssoc($set);
980
981 // #16172 - might be deleted
982 if (is_array($rec)) {
983 $this->initFromDB($rec);
984 }
985 }
initFromDB(array $a_set)
Import DB record.

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )

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

2196 {
2197 $ilDB = $this->db;
2198
2199 // see JF, 2015-05-11
2200
2201 $ext_deadline = $this->getExtendedDeadline();
2202
2203 foreach (ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file) {
2204 $id = $file["returned_id"];
2205 $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
2206 $uploaded = $uploaded->get(IL_CAL_UNIX);
2207
2208 $deadline = $this->getPersonalDeadline($file["user_id"]);
2209 $last_deadline = max($deadline, $this->getExtendedDeadline());
2210
2211 $late = null;
2212
2213 // upload is not late anymore
2214 if ($file["late"] &&
2215 (!$last_deadline ||
2216 !$ext_deadline ||
2217 $uploaded < $deadline)) {
2218 $late = false;
2219 }
2220 // upload is now late
2221 elseif (!$file["late"] &&
2222 $ext_deadline &&
2223 $deadline &&
2224 $uploaded > $deadline) {
2225 $late = true;
2226 } elseif ($last_deadline && $uploaded > $last_deadline) {
2227 // do nothing, we do not remove submissions?
2228 }
2229
2230 if ($late !== null) {
2231 $ilDB->manipulate("UPDATE exc_returned" .
2232 " SET late = " . $ilDB->quote($late, "integer") .
2233 " WHERE returned_id = " . $ilDB->quote($id, "integer"));
2234 }
2235 }
2236 }
const IL_CAL_DATETIME
getExtendedDeadline()
Get extended deadline (timestamp)
static getAllAssignmentFiles($a_exc_id, $a_ass_id)

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

+ Here is the call graph for this function:

◆ renameInstructionFile()

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

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

2409 {
2410 global $DIC;
2411
2412 $db = $DIC->database();
2413
2414 if ($a_ass_id) {
2415 $db->manipulate(
2416 "DELETE FROM exc_ass_file_order" .
2417 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2418 " AND filename = " . $db->quote($a_new_name, 'string')
2419 );
2420
2421 $db->manipulate(
2422 "UPDATE exc_ass_file_order SET" .
2423 " filename = " . $db->quote($a_new_name, 'string') .
2424 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2425 " AND filename = " . $db->quote($a_old_name, 'string')
2426 );
2427 }
2428 }

References $db, and $DIC.

Referenced by ilExAssignmentFileSystemGUI\renameFile().

+ Here is the caller graph for this function:

◆ save()

ilExAssignment::save ( )

Save assignment.

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

1034 {
1035 $ilDB = $this->db;
1036
1037 if ($this->getOrderNr() == 0) {
1038 $this->setOrderNr(
1039 self::lookupMaxOrderNrForEx($this->getExerciseId())
1040 + 10
1041 );
1042 }
1043
1044 $next_id = $ilDB->nextId("exc_assignment");
1045 $ilDB->insert("exc_assignment", array(
1046 "id" => array("integer", $next_id),
1047 "exc_id" => array("integer", $this->getExerciseId()),
1048 "time_stamp" => array("integer", $this->getDeadline()),
1049 "deadline2" => array("integer", $this->getExtendedDeadline()),
1050 "instruction" => array("clob", $this->getInstruction()),
1051 "title" => array("text", $this->getTitle()),
1052 "start_time" => array("integer", $this->getStartTime()),
1053 "order_nr" => array("integer", $this->getOrderNr()),
1054 "mandatory" => array("integer", $this->getMandatory()),
1055 "type" => array("integer", $this->getType()),
1056 "peer" => array("integer", $this->getPeerReview()),
1057 "peer_min" => array("integer", $this->getPeerReviewMin()),
1058 "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
1059 "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
1060 "peer_valid" => array("integer", $this->getPeerReviewValid()),
1061 "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
1062 "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
1063 "peer_char" => array("integer", $this->getPeerReviewChars()),
1064 "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
1065 "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
1066 "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
1067 "fb_file" => array("text", $this->getFeedbackFile()),
1068 "fb_date" => array("integer", $this->getFeedbackDate()),
1069 "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
1070 "fb_cron" => array("integer", $this->hasFeedbackCron()),
1071 "team_tutor" => array("integer", $this->getTeamTutor()),
1072 "max_file" => array("integer", $this->getMaxFile()),
1073 "portfolio_template" => array("integer", $this->getPortFolioTemplateId()),
1074 "min_char_limit" => array("integer", $this->getMinCharLimit()),
1075 "max_char_limit" => array("integer", $this->getMaxCharLimit()),
1076 "relative_deadline" => array("integer", $this->getRelativeDeadline()),
1077 "rel_deadline_last_subm" => array("integer", (int) $this->getRelDeadlineLastSubmission()),
1078 "deadline_mode" => array("integer", $this->getDeadlineMode())
1079 ));
1080 $this->setId($next_id);
1081 $exc = new ilObjExercise($this->getExerciseId(), false);
1082 $exc->updateAllUsersStatus();
1083 self::createNewAssignmentRecords($next_id, $exc);
1084
1085 $this->handleCalendarEntries("create");
1086 }
getMinCharLimit()
Get limit minimum characters.
hasPeerReviewText()
Get peer review text status.
getPeerReviewChars()
Get peer review minimum characters.
hasPeerReviewPersonalized()
Get peer review personalized status.
getFeedbackDate()
Get (global) feedback file availability date.
getPeerReviewValid()
Get peer review validatiob.
getTeamTutor()
Get team management by tutor.
getPeerReviewMin()
Get peer review minimum.
getMaxFile()
Get max number of uploads.
getRelDeadlineLastSubmission()
Get relative deadline last submission.
static createNewAssignmentRecords($a_ass_id, $a_exc)
Create member status record for a new assignment for all participants.
hasPeerReviewFileUpload()
Get peer review file upload status.
hasFeedbackCron()
Get (global) feedback file cron status.
getStartTime()
Get start time (timestamp)
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
getMaxCharLimit()
get limit maximum characters return int max limit
getOrderNr()
Get order nr.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getMandatory()
Get mandatory.
hasPeerReviewRating()
Get peer review rating status.

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssOrderOfExercise()

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

Save ordering of all assignments of an exercise.

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

1434 {
1435 global $DIC;
1436
1437 $ilDB = $DIC->database();
1438
1439 $result_order = array();
1440 asort($a_order);
1441 $nr = 10;
1442 foreach ($a_order as $k => $v) {
1443 // the check for exc_id is for security reasons. ass ids are unique.
1444 $ilDB->manipulate(
1445 $t = "UPDATE exc_assignment SET " .
1446 " order_nr = " . $ilDB->quote($nr, "integer") .
1447 " WHERE id = " . $ilDB->quote((int) $k, "integer") .
1448 " AND exc_id = " . $ilDB->quote((int) $a_ex_id, "integer")
1449 );
1450 $nr += 10;
1451 }
1452 }

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

+ Here is the caller graph for this function:

◆ saveInstructionFilesOrderOfAssignment()

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

Save ordering of instruction files for an assignment.

Parameters
int$a_ass_idassignment id
int$a_orderorder

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

2314 {
2315 global $DIC;
2316
2317 $db = $DIC->database();
2318
2319 asort($a_order, SORT_NUMERIC);
2320
2321 $nr = 10;
2322 foreach ($a_order as $k => $v) {
2323 // the check for exc_id is for security reasons. ass ids are unique.
2324 $db->manipulate(
2325 $t = "UPDATE exc_ass_file_order SET " .
2326 " order_nr = " . $db->quote($nr, "integer") .
2327 " WHERE id = " . $db->quote((int) $k, "integer") .
2328 " AND assignment_id = " . $db->quote((int) $a_ass_id, "integer")
2329 );
2330 $nr += 10;
2331 }
2332 }

References $db, and $DIC.

Referenced by ilExAssignmentFileSystemGUI\saveFilesOrder().

+ Here is the caller graph for this function:

◆ saveMultiFeedbackFiles()

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

Save multi feedback files.

Parameters

return

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

1886 {
1887 if ($this->getExerciseId() != $a_exc->getId()) {
1888 return;
1889 }
1890
1891 $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1892 $fstorage->create();
1893
1894 $team_map = array();
1895
1896 $mf_files = $this->getMultiFeedbackFiles();
1897 foreach ($mf_files as $f) {
1898 $user_id = $f["user_id"];
1899 $file_path = $f["full_path"];
1900 $file_name = $f["file"];
1901
1902 // if checked in confirmation gui
1903 if ($a_files[$user_id][md5($file_name)] != "") {
1904 $submission = new ilExSubmission($this, $user_id);
1905 $feedback_id = $submission->getFeedbackId();
1906 $noti_rec_ids = $submission->getUserIds();
1907
1908 if ($feedback_id) {
1909 $fb_path = $fstorage->getFeedbackPath($feedback_id);
1910 $target = $fb_path . "/" . $file_name;
1911 if (is_file($target)) {
1912 unlink($target);
1913 }
1914 // rename file
1915 rename($file_path, $target);
1916
1917 if ($noti_rec_ids) {
1918 foreach ($noti_rec_ids as $user_id) {
1919 $member_status = $this->getMemberStatus($user_id);
1920 $member_status->setFeedback(true);
1921 $member_status->update();
1922 }
1923
1925 $file_name,
1926 $noti_rec_ids,
1927 (int) $this->getId()
1928 );
1929 }
1930 }
1931 }
1932 }
1933
1935 }
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getMultiFeedbackFiles($a_user_id=0)
Get multi feedback files (of uploader)
getMemberStatus($a_user_id=null)
sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback=false)
Send feedback file notification to user.
getId()
get object id @access public

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

+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

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

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

2037 {
2038 global $DIC;
2039
2040 $ilDB = $DIC->database();
2041
2042 $ass = new self($a_ass_id);
2043
2044 // valid assignment?
2045 if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
2046 return false;
2047 }
2048
2049 if (!$a_user_id) {
2050 // already done?
2051 $set = $ilDB->query("SELECT fb_cron_done" .
2052 " FROM exc_assignment" .
2053 " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
2054 $row = $ilDB->fetchAssoc($set);
2055 if ($row["fb_cron_done"]) {
2056 return false;
2057 }
2058 }
2059
2060 $ntf = new ilSystemNotification();
2061 $ntf->setLangModules(array("exc"));
2062 $ntf->setObjId($ass->getExerciseId());
2063 $ntf->setSubjectLangId("exc_feedback_notification_subject");
2064 $ntf->setIntroductionLangId("exc_feedback_notification_body");
2065 $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
2066 $ntf->setGotoLangId("exc_feedback_notification_link");
2067 $ntf->setReasonLangId("exc_feedback_notification_reason");
2068
2069 if (!$a_user_id) {
2070 $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
2071
2072 $ilDB->manipulate("UPDATE exc_assignment" .
2073 " SET fb_cron_done = " . $ilDB->quote(1, "integer") .
2074 " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
2075 } else {
2076 $ntf->sendMail(array($a_user_id));
2077 }
2078
2079 return true;
2080 }
static _getMembers($a_obj_id)
Wrapper classes for system notifications.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMultiFeedbackStructureFile()

ilExAssignment::sendMultiFeedbackStructureFile ( ilObjExercise  $exercise)

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

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

1719 {
1720 global $DIC;
1721
1722
1723 // send and delete the zip file
1724 $deliverFilename = trim(str_replace(" ", "_", $this->getTitle() . "_" . $this->getId()));
1725 $deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
1726 $deliverFilename = "multi_feedback_" . $deliverFilename;
1727
1728 $exc = new ilObjExercise($this->getExerciseId(), false);
1729
1730 $cdir = getcwd();
1731
1732 // create temporary directoy
1733 $tmpdir = ilUtil::ilTempnam();
1734 ilUtil::makeDir($tmpdir);
1735 $mfdir = $tmpdir . "/" . $deliverFilename;
1736 ilUtil::makeDir($mfdir);
1737
1738 // create subfolders <lastname>_<firstname>_<id> for each participant
1739 $exmem = new ilExerciseMembers($exc);
1740 $mems = $exmem->getMembers();
1741
1742 $mems = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1743 'edit_submissions_grades',
1744 'edit_submissions_grades',
1745 $exercise->getRefId(),
1746 $mems
1747 );
1748 foreach ($mems as $mem) {
1750 $subdir = $name["lastname"] . "_" . $name["firstname"] . "_" . $name["login"] . "_" . $name["user_id"];
1751 $subdir = ilUtil::getASCIIFilename($subdir);
1752 ilUtil::makeDir($mfdir . "/" . $subdir);
1753 }
1754
1755 // create the zip file
1756 chdir($tmpdir);
1757 $tmpzipfile = $tmpdir . "/multi_feedback.zip";
1758 ilUtil::zip($tmpdir, $tmpzipfile, true);
1759 chdir($cdir);
1760
1761
1762 ilUtil::deliverFile($tmpzipfile, $deliverFilename . ".zip", "", false, true);
1763 }
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

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

+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline (   $a_val)

Set deadline (timestamp)

Parameters
intdeadline (timestamp)

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

279 {
280 $this->deadline = $a_val;
281 }

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

+ Here is the caller graph for this function:

◆ setDeadlineMode()

ilExAssignment::setDeadlineMode (   $a_val)

Set deadline mode.

Parameters
int$a_valdeadline mode

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

299 {
300 $this->deadline_mode = $a_val;
301 }

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

+ Here is the caller graph for this function:

◆ setExerciseId()

ilExAssignment::setExerciseId (   $a_val)

Set exercise id.

Parameters
intexercise id

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

239 {
240 $this->exc_id = $a_val;
241 }

Referenced by initFromDB().

+ Here is the caller graph for this function:

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline (   $a_val)

Set extended deadline (timestamp)

Parameters
int

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

405 {
406 if ($a_val !== null) {
407 $a_val = (int) $a_val;
408 }
409 $this->deadline2 = $a_val;
410 }

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

+ Here is the caller graph for this function:

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron (   $a_value)

Toggle (global) feedback file cron.

Parameters
bool$a_value

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

852 {
853 $this->feedback_cron = (string) $a_value;
854 }

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

+ Here is the caller graph for this function:

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate (   $a_value)

Set (global) feedback file availability date.

Parameters
int$a_value

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

872 {
873 $this->feedback_date = (int) $a_value;
874 }

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

+ Here is the caller graph for this function:

◆ setFeedbackDateCustom()

ilExAssignment::setFeedbackDateCustom (   $a_value)

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

Parameters
int$a_valuetimestamp

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

891 {
892 $this->feedback_date_custom = $a_value;
893 }

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

+ Here is the caller graph for this function:

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile (   $a_value)

Set (global) feedback file.

Parameters
string$a_value

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

832 {
833 $this->feedback_file = (string) $a_value;
834 }

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

+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

219 {
220 $this->id = $a_val;
221 }

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

+ Here is the caller graph for this function:

◆ setIndividualDeadline()

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

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

2244 {
2245 $ilDB = $this->db;
2246
2247 $is_team = false;
2248 if (!is_numeric($id)) {
2249 $id = substr($id, 1);
2250 $is_team = true;
2251 }
2252
2253 $idl = ilExcIndividualDeadline::getInstance($this->getId(), $id, $is_team);
2254 $idl->setIndividualDeadline($date->get(IL_CAL_UNIX));
2255 $idl->save();
2256
2257 /*
2258 $ilDB->replace("exc_idl",
2259 array(
2260 "ass_id" => array("integer", $this->getId()),
2261 "member_id" => array("integer", $id),
2262 "is_team" => array("integer", $is_team)
2263 ),
2264 array(
2265 "tstamp" => array("integer", $date->get(IL_CAL_UNIX))
2266 )
2267 );*/
2268 }
get($a_format, $a_format_str='', $a_tz='')
get formatted date
static getInstance($a_ass_id, $a_participant_id, $a_is_team=false)
Get instance.

References $db, $id, $ilDB, ilDateTime\get(), getId(), ilExcIndividualDeadline\getInstance(), and IL_CAL_UNIX.

+ Here is the call graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction (   $a_val)

Set instruction.

Parameters
stringinstruction

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

428 {
429 $this->instruction = $a_val;
430 }

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

+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory (   $a_val)

Set mandatory.

Parameters
intmandatory

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

486 {
487 $this->mandatory = $a_val;
488 }

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

+ Here is the caller graph for this function:

◆ setMaxCharLimit()

ilExAssignment::setMaxCharLimit (   $a_val)

Set limit maximum characters.

Parameters
intmax limit

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

2560 {
2561 $this->max_char_limit = $a_val;
2562 }

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

+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile (   $a_value)

Set max number of uploads.

Parameters
int$a_value

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

930 {
931 if ($a_value !== null) {
932 $a_value = (int) $a_value;
933 }
934 $this->max_file = $a_value;
935 }

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

+ Here is the caller graph for this function:

◆ setMinCharLimit()

ilExAssignment::setMinCharLimit (   $a_val)

Set limit minimum characters.

Parameters
intminim limit

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

2541 {
2542 $this->min_char_limit = $a_val;
2543 }

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

+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

506 {
507 $this->order_nr = $a_val;
508 }

Referenced by initFromDB(), and save().

+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview (   $a_value)

Toggle peer review.

Parameters
bool$a_value

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

579 {
580 $this->peer = (bool) $a_value;
581 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars (   $a_value)

Set peer review minimum characters.

Parameters
int$a_value

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

759 {
760 $a_value = (is_numeric($a_value) && (int) $a_value > 0)
761 ? (int) $a_value
762 : null;
763 $this->peer_char = $a_value;
764 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue (   $a_value)

Set peer review criteria catalogue id.

Parameters
int$a_value

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

782 {
783 $a_value = is_numeric($a_value)
784 ? (int) $a_value
785 : null;
786 $this->crit_cat = $a_value;
787 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

ilExAssignment::setPeerReviewDeadline (   $a_val)

Set peer review deadline (timestamp)

Parameters
intdeadline (timestamp)

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

639 {
640 $this->peer_dl = $a_val;
641 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload (   $a_val)

Set peer review file upload.

Parameters
bool

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

719 {
720 $this->peer_file = (bool) $a_val;
721 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin (   $a_value)

Set peer review minimum.

Parameters
int$a_value

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

599 {
600 $this->peer_min = (int) $a_value;
601 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized (   $a_val)

Set peer review personalized.

Parameters
bool

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

739 {
740 $this->peer_personal = (bool) $a_val;
741 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating (   $a_val)

Set peer review rating.

Parameters
bool

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

679 {
680 $this->peer_rating = (bool) $a_val;
681 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock (   $a_value)

Set peer review simple unlock.

Parameters
bool$a_value

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

619 {
620 $this->peer_unlock = (bool) $a_value;
621 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText (   $a_val)

Set peer review text.

Parameters
bool

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

699 {
700 $this->peer_text = (bool) $a_val;
701 }

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

+ Here is the caller graph for this function:

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid (   $a_value)

Set peer review validation.

Parameters
int$a_value

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

659 {
660 $this->peer_valid = (int) $a_value;
661 }

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

+ Here is the caller graph for this function:

◆ setPortfolioTemplateId()

ilExAssignment::setPortfolioTemplateId (   $a_val)

Set portfolio template id.

Parameters
int$a_val

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

953 {
954 $this->portfolio_template = $a_val;
955 }

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

+ Here is the caller graph for this function:

◆ setRelativeDeadline()

ilExAssignment::setRelativeDeadline (   $a_val)

Set relative deadline.

Parameters
int$a_valrelative deadline

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

319 {
320 $this->relative_deadline = $a_val;
321 }

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

+ Here is the caller graph for this function:

◆ setRelDeadlineLastSubmission()

ilExAssignment::setRelDeadlineLastSubmission (   $a_val)

Set relative deadline last submission.

Parameters
int$a_val

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

339 {
340 $this->rel_deadline_last_subm = $a_val;
341 }

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

+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime (   $a_val)

Set start time (timestamp)

Parameters
intstart time (timestamp)

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

259 {
260 $this->start_time = $a_val;
261 }

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

+ Here is the caller graph for this function:

◆ setTeamTutor()

ilExAssignment::setTeamTutor (   $a_value)

Set team management by tutor.

Parameters
bool$a_value

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

910 {
911 $this->team_tutor = (bool) $a_value;
912 }

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

+ Here is the caller graph for this function:

◆ setTitle()

ilExAssignment::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

466 {
467 $this->title = $a_val;
468 }

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

+ Here is the caller graph for this function:

◆ setType()

ilExAssignment::setType (   $a_value)

Set type.

Parameters
int$a_value
Deprecated:
this will most probably become an non public function in the future (or become obsolete)

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

527 {
528 if ($this->isValidType($a_value)) {
529 $this->type = (int) $a_value;
530
531 $this->ass_type = $this->types->getById($a_value);
532
533 if ($this->ass_type->usesTeams()) {
534 $this->setPeerReview(false);
535 }
536 }
537 }
isValidType($a_value)
Is given type valid?

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )

Update.

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

1092 {
1093 $ilDB = $this->db;
1094
1095 $ilDB->update(
1096 "exc_assignment",
1097 array(
1098 "exc_id" => array("integer", $this->getExerciseId()),
1099 "time_stamp" => array("integer", $this->getDeadline()),
1100 "deadline2" => array("integer", $this->getExtendedDeadline()),
1101 "instruction" => array("clob", $this->getInstruction()),
1102 "title" => array("text", $this->getTitle()),
1103 "start_time" => array("integer", $this->getStartTime()),
1104 "order_nr" => array("integer", $this->getOrderNr()),
1105 "mandatory" => array("integer", $this->getMandatory()),
1106 "type" => array("integer", $this->getType()),
1107 "peer" => array("integer", $this->getPeerReview()),
1108 "peer_min" => array("integer", $this->getPeerReviewMin()),
1109 "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
1110 "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
1111 "peer_valid" => array("integer", $this->getPeerReviewValid()),
1112 "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
1113 "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
1114 "peer_char" => array("integer", $this->getPeerReviewChars()),
1115 "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
1116 "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
1117 "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
1118 "fb_file" => array("text", $this->getFeedbackFile()),
1119 "fb_date" => array("integer", $this->getFeedbackDate()),
1120 "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
1121 "fb_cron" => array("integer", $this->hasFeedbackCron()),
1122 "team_tutor" => array("integer", $this->getTeamTutor()),
1123 "max_file" => array("integer", $this->getMaxFile()),
1124 "portfolio_template" => array("integer", $this->getPortFolioTemplateId()),
1125 "min_char_limit" => array("integer", $this->getMinCharLimit()),
1126 "max_char_limit" => array("integer", $this->getMaxCharLimit()),
1127 "deadline_mode" => array("integer", $this->getDeadlineMode()),
1128 "relative_deadline" => array("integer", $this->getRelativeDeadline()),
1129 "rel_deadline_last_subm" => array("integer", (int) $this->getRelDeadlineLastSubmission())
1130 ),
1131 array(
1132 "id" => array("integer", $this->getId()),
1133 )
1134 );
1135 $exc = new ilObjExercise($this->getExerciseId(), false);
1136 $exc->updateAllUsersStatus();
1137
1138 $this->handleCalendarEntries("update");
1139 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadAssignmentFiles()

ilExAssignment::uploadAssignmentFiles (   $a_files)

Upload assignment files (from creation form)

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

1703 {
1704 ilLoggerFactory::getLogger("exc")->debug("upload assignment files files = ", $a_files);
1705 $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1706 $storage->create();
1707 $storage->uploadAssignmentFiles($a_files);
1708 }

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadMultiFeedbackFile()

ilExAssignment::uploadMultiFeedbackFile (   $a_file)

Upload multi feedback file.

Parameters
array
Returns

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

1772 {
1773 $lng = $this->lng;
1775
1776 if (!is_file($a_file["tmp_name"])) {
1777 throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1778 }
1779
1780 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1781 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1782 ilUtil::delDir($mfu, true);
1783 ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu . "/" . "multi_feedback.zip");
1784 ilUtil::unzip($mfu . "/multi_feedback.zip", true);
1785 $subdirs = ilUtil::getDir($mfu);
1786 $subdir = "notfound";
1787 foreach ($subdirs as $s => $j) {
1788 if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1789 $subdir = $s;
1790 }
1791 }
1792
1793 if (!is_dir($mfu . "/" . $subdir)) {
1794 throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1795 }
1796
1797 return true;
1798 }
Exercise exceptions class.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file

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

+ Here is the call graph for this function:

Field Documentation

◆ $app_event_handler

ilExAssignment::$app_event_handler
protected

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

Referenced by handleCalendarEntries().

◆ $ass_type

ilExAssignment::$ass_type
protected

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

Referenced by cloneAssignmentsOfExercise(), and getAssignmentType().

◆ $db

◆ $deadline

ilExAssignment::$deadline
protected

◆ $deadline2

ilExAssignment::$deadline2
protected

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

Referenced by getExtendedDeadline().

◆ $deadline_mode

ilExAssignment::$deadline_mode = 0
protected

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

Referenced by getDeadlineMode().

◆ $exc_id

ilExAssignment::$exc_id
protected

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

Referenced by getExerciseId().

◆ $feedback_cron

ilExAssignment::$feedback_cron
protected

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

Referenced by hasFeedbackCron().

◆ $feedback_date

ilExAssignment::$feedback_date
protected

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

Referenced by getFeedbackDate().

◆ $feedback_date_custom

ilExAssignment::$feedback_date_custom
protected

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

Referenced by getFeedbackDateCustom().

◆ $feedback_file

ilExAssignment::$feedback_file
protected

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

Referenced by getFeedbackFile().

◆ $id

ilExAssignment::$id
protected

◆ $instruction

ilExAssignment::$instruction
protected

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

Referenced by getInstruction().

◆ $lng

ilExAssignment::$lng
protected

◆ $log

ilExAssignment::$log
protected

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

◆ $mandatory

ilExAssignment::$mandatory
protected

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

Referenced by getMandatory().

◆ $max_char_limit

ilExAssignment::$max_char_limit
protected

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

Referenced by getMaxCharLimit().

◆ $max_file

ilExAssignment::$max_file
protected

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

Referenced by getMaxFile().

◆ $member_status

ilExAssignment::$member_status = array()
protected

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

Referenced by saveMultiFeedbackFiles().

◆ $min_char_limit

ilExAssignment::$min_char_limit
protected

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

Referenced by getMinCharLimit().

◆ $order_nr

ilExAssignment::$order_nr
protected

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

Referenced by fixInstructionFileOrdering(), and getOrderNr().

◆ $peer

ilExAssignment::$peer
protected

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

Referenced by getPeerReview().

◆ $peer_char

ilExAssignment::$peer_char
protected

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

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

ilExAssignment::$peer_crit_cat
protected

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

◆ $peer_dl

ilExAssignment::$peer_dl
protected

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

Referenced by getPeerReviewDeadline().

◆ $peer_file

ilExAssignment::$peer_file
protected

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

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

ilExAssignment::$peer_min
protected

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

Referenced by getPeerReviewMin().

◆ $peer_personal

ilExAssignment::$peer_personal
protected

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

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

ilExAssignment::$peer_rating
protected

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

Referenced by hasPeerReviewRating().

◆ $peer_text

ilExAssignment::$peer_text
protected

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

Referenced by hasPeerReviewText().

◆ $peer_unlock

ilExAssignment::$peer_unlock
protected

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

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

ilExAssignment::$peer_valid
protected

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

Referenced by getPeerReviewValid().

◆ $portfolio_template

ilExAssignment::$portfolio_template
protected

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

Referenced by getPortfolioTemplateId().

◆ $rel_deadline_last_subm

ilExAssignment::$rel_deadline_last_subm
protected

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

Referenced by getRelDeadlineLastSubmission().

◆ $relative_deadline

ilExAssignment::$relative_deadline = 0
protected

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

Referenced by getRelativeDeadline().

◆ $start_time

ilExAssignment::$start_time
protected

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

Referenced by getStartTime().

◆ $starting_timestamp

ilExAssignment::$starting_timestamp = null
protected

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

◆ $team_tutor

ilExAssignment::$team_tutor = false
protected

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

Referenced by getTeamTutor().

◆ $title

ilExAssignment::$title
protected

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

Referenced by getTitle().

◆ $type

ilExAssignment::$type
protected

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

Referenced by getCalculatedDeadlines(), and getType().

◆ $types

ilExAssignment::$types = null
protected

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

◆ $user

ilExAssignment::$user
protected

◆ DEADLINE_ABSOLUTE

◆ DEADLINE_RELATIVE

◆ FEEDBACK_DATE_CUSTOM

◆ FEEDBACK_DATE_DEADLINE

◆ FEEDBACK_DATE_SUBMISSION

const ilExAssignment::FEEDBACK_DATE_SUBMISSION = 2

◆ PEER_REVIEW_VALID_ALL

const ilExAssignment::PEER_REVIEW_VALID_ALL = 3

◆ PEER_REVIEW_VALID_NONE

◆ PEER_REVIEW_VALID_ONE

const ilExAssignment::PEER_REVIEW_VALID_ONE = 2

◆ TEAMS_FORMED_BY_ASSIGNMENT

const ilExAssignment::TEAMS_FORMED_BY_ASSIGNMENT = 3

◆ TEAMS_FORMED_BY_PARTICIPANTS

const ilExAssignment::TEAMS_FORMED_BY_PARTICIPANTS = 0

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

Referenced by ilExAssignmentEditorGUI\initAssignmentForm().

◆ TEAMS_FORMED_BY_RANDOM

const ilExAssignment::TEAMS_FORMED_BY_RANDOM = 2

◆ TEAMS_FORMED_BY_TUTOR

const ilExAssignment::TEAMS_FORMED_BY_TUTOR = 1

◆ TYPE_BLOG

◆ TYPE_PORTFOLIO

◆ TYPE_TEXT

◆ TYPE_UPLOAD

◆ TYPE_UPLOAD_TEAM

◆ TYPE_WIKI_TEAM


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