ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 canParticipantReceiveFeedback ($part_id)
 

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.
global $DIC
Definition: goto.php:24

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

2142 {
2143 $date_custom = $this->getFeedbackDateCustom();
2144 //if the solution will be displayed only after reach all the deadlines.
2145 //$final_deadline = $this->afterDeadlineStrict();
2146 //$dl = max($final_deadline, time());
2147 //return ($date_custom - $dl <= 0);
2148 return ($date_custom - time() <= 0);
2149 }
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 2105 of file class.ilExAssignment.php.

2106 {
2108
2109 // :TODO: always current user?
2110 $idl = $this->getPersonalDeadline($ilUser->getId()); // official deadline
2111
2112 // no deadline === true
2113 $deadline = max($this->deadline, $this->deadline2, $idl); // includes grace period
2114 return ($deadline - time() <= 0);
2115 }
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 2117 of file class.ilExAssignment.php.

2118 {
2119 // :TODO: this means that peer feedback, global feedback is available
2120 // after LAST personal deadline
2121 // team management is currently ignoring personal deadlines
2122 $idl = (bool) $a_include_personal
2123 ? $this->getLastPersonalDeadline()
2124 : null;
2125
2126 // no deadline === false
2127 $deadline = max($this->deadline, $this->deadline2, $idl);
2128
2129 // #18271 - afterDeadline() does not handle last personal deadline
2130 if ($idl && $deadline == $idl) { // after effective deadline of all users
2131 return ($deadline - time() <= 0);
2132 }
2133
2134 return ($deadline > 0 && // like: after effective deadline (for single user), except: no deadline false
2135 $this->afterDeadline());
2136 }
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 2151 of file class.ilExAssignment.php.

2152 {
2153 // no deadline === true
2154 return !$this->afterDeadlineStrict();
2155 }
afterDeadlineStrict($a_include_personal=true)

References afterDeadlineStrict().

+ Here is the call graph for this function:

◆ canParticipantReceiveFeedback()

ilExAssignment::canParticipantReceiveFeedback (   $part_id)

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

2624 : bool
2625 {
2626 if ($this->hasTeam()) {
2627 if (!ilExAssignmentTeam::getTeamId($this->getId(), $part_id)) {
2628 return false;
2629 }
2630 }
2631 return true;
2632 }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
getId()
Get assignment id.

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

Referenced by ilExerciseSubmissionTableGUI\parseRow().

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

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

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

1890 {
1891 $lng = $this->lng;
1893
1894 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1895 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1896 ilUtil::delDir($mfu);
1897 }
getExerciseId()
Get exercise 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 1699 of file class.ilExAssignment.php.

1700 {
1701 global $DIC;
1702
1703 $ilDB = $DIC->database();
1704
1705 $exmem = new ilExerciseMembers($a_exc);
1706 $mems = $exmem->getMembers();
1707
1708 foreach ($mems as $mem) {
1709 $ilDB->replace("exc_mem_ass_status", array(
1710 "ass_id" => array("integer", $a_ass_id),
1711 "usr_id" => array("integer", $mem)
1712 ), array(
1713 "status" => array("text", "notgraded")
1714 ));
1715 }
1716 }
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 1678 of file class.ilExAssignment.php.

1679 {
1680 global $DIC;
1681
1682 $ilDB = $DIC->database();
1683
1684 $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1685 foreach ($ass_data as $ass) {
1686 //echo "-".$ass["id"]."-".$a_user_id."-";
1687 $ilDB->replace("exc_mem_ass_status", array(
1688 "ass_id" => array("integer", $ass["id"]),
1689 "usr_id" => array("integer", $a_user_id)
1690 ), array(
1691 "status" => array("text", "notgraded")
1692 ));
1693 }
1694 }
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 2173 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 2520 of file class.ilExAssignment.php.

2521 {
2523
2524 $order = $this->getInstructionFilesOrder();
2525 foreach ($a_entries as $k => $e) {
2526 $a_entries[$k]["order_val"] = $order[$e["file"]]["order_nr"];
2527 $a_entries[$k]["order_id"] = $order[$e["file"]]["id"];
2528 }
2529
2530 return $a_entries;
2531 }

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

+ Here is the call graph for this function:

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

2475 {
2476 global $DIC;
2477
2478 $db = $DIC->database();
2479
2480 $files = array_map(function ($v) {
2481 return $v["name"];
2482 }, $this->getFiles());
2483
2484 $set = $db->query("SELECT * FROM exc_ass_file_order " .
2485 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2486 " ORDER BY order_nr");
2487 $order_nr = 10;
2488 $numbered_files = array();
2489 while ($rec = $db->fetchAssoc($set)) {
2490 // file exists, set correct order nr
2491 if (in_array($rec["filename"], $files)) {
2492 $db->manipulate(
2493 "UPDATE exc_ass_file_order SET " .
2494 " order_nr = " . $db->quote($order_nr, "integer") .
2495 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2496 " AND id = " . $db->quote($rec["id"], "integer")
2497 );
2498 $order_nr += 10;
2499 $numbered_files[] = $rec["filename"];
2500 } else { // file does not exist, delete entry
2501 $db->manipulate(
2502 "DELETE FROM exc_ass_file_order " .
2503 " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2504 " AND id = " . $db->quote($rec["id"], "integer")
2505 );
2506 }
2507 }
2508 foreach ($files as $f) {
2509 if (!in_array($f, $numbered_files)) {
2511 }
2512 }
2513 }
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 2602 of file class.ilExAssignment.php.

2603 {
2604 $calculated_deadlines = array(
2605 "user" => array(),
2606 "team" => array()
2607 );
2608
2609 if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
2610 foreach (ilExcIndividualDeadline::getStartingTimestamps($this->getId()) as $ts) {
2611 $type = $ts["is_team"]
2612 ? "team"
2613 : "user";
2614
2615 $calculated_deadlines[$type][$ts["member_id"]] = array(
2616 "calculated_deadline" => $ts["starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
2617 );
2618 }
2619 }
2620 return $calculated_deadlines;
2621 }
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(), ilExerciseSubmissionTableGUI\parseRow(), 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 1643 of file class.ilExAssignment.php.

1644 {
1645 global $DIC;
1646 $ilDB = $DIC->database();
1647
1648 if (in_array($a_grade, array("notgraded", "passed", "failed"))) {
1649 $and_grade = " AND status = " . $ilDB->quote($a_grade, "text");
1650 }
1651
1652 $q = "SELECT * FROM exc_mem_ass_status " .
1653 "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1654 " AND usr_id = " . $ilDB->quote($a_user_id, "integer") .
1655 $and_grade;
1656
1657 $set = $ilDB->query($q);
1658
1659 while ($rec = $ilDB->fetchAssoc($set)) {
1660 $sub = new ilExSubmission($this, $a_user_id);
1661
1662 $data["sent_time"] = $rec["sent_time"];
1663 $data["submission"] = $sub->getLastSubmission();
1664 $data["status_time"] = $rec["status_time"];
1665 $data["feedback_time"] = $rec["feedback_time"];
1666 $data["notice"] = $rec["notice"];
1667 $data["status"] = $rec["status"];
1668 $data["mark"] = $rec["mark"];
1669 $data["comment"] = $rec["u_comment"];
1670 }
1671
1672 return $data;
1673 }
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 2189 of file class.ilExAssignment.php.

2190 {
2191 $file = $this->getFeedbackFile();
2192 if ($file) {
2193 $path = $this->getGlobalFeedbackFileStoragePath();
2194 return $path . "/" . $file;
2195 }
2196 }
getFeedbackFile()
Get (global) feedback file.

References getFeedbackFile(), and getGlobalFeedbackFileStoragePath().

+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

2168 {
2169 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
2170 return $storage->getGlobalFeedbackPath();
2171 }

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(), canParticipantReceiveFeedback(), clearMultiFeedbackDirectory(), ilExAssTypeWikiTeam\cloneSpecificProperties(), delete(), ilExSubmission\downloadAllAssignmentFiles(), fixInstructionFileOrdering(), ilExAssignmentEditorGUI\generateTeams(), getCalculatedDeadlines(), getExerciseMemberAssignmentData(), getFiles(), ilExAssTypeWikiTeamGUI\getFormValuesArray(), getGlobalFeedbackFileStoragePath(), getMemberListData(), getMemberStatus(), getMultiFeedbackFiles(), ilExAssignmentGUI\getOverviewBody(), ilExAssignmentGUI\getOverviewHeader(), getPersonalDeadline(), handleCalendarEntries(), ilExAssTypeWikiTeam\handleNewUpload(), 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 2290 of file class.ilExAssignment.php.

2291 {
2292 $ilDB = $this->db;
2293
2294 $res = array();
2295
2296 $set = $ilDB->query("SELECT * FROM exc_idl" .
2297 " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
2298 while ($row = $ilDB->fetchAssoc($set)) {
2299 if ($row["is_team"]) {
2300 $row["member_id"] = "t" . $row["member_id"];
2301 }
2302
2303 $res[$row["member_id"]] = $row["tstamp"];
2304 }
2305
2306 return $res;
2307 }
foreach($_POST as $key=> $value) $res

References $db, $ilDB, and $res.

Referenced by getMemberListData().

+ Here is the caller graph for this function:

◆ 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(), ilExerciseMembers\deassignMember(), 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 2590 of file class.ilExAssignment.php.

2591 {
2592 return $this->max_char_limit;
2593 }

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 // users in idl may already exist before occuring in the members db table
1597 // if user starts an assignment with relative deadline
1598 $idl = $this->getIndividualDeadlines();
1599 foreach ($idl as $user_id => $v) {
1600 if (!isset($mem[$user_id])) {
1601 if (ilObjUser::_exists($user_id)) {
1602 $name = ilObjUser::_lookupName($user_id);
1603 $mem[$user_id] =
1604 array(
1605 "name" => $name["lastname"] . ", " . $name["firstname"],
1606 "login" => $name["login"],
1607 "usr_id" => $user_id,
1608 "lastname" => $name["lastname"],
1609 "firstname" => $name["firstname"]
1610 );
1611 }
1612 }
1613 }
1614
1615
1616 $q = "SELECT * FROM exc_mem_ass_status " .
1617 "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer");
1618 $set = $ilDB->query($q);
1619 while ($rec = $ilDB->fetchAssoc($set)) {
1620 if (isset($mem[$rec["usr_id"]])) {
1621 $sub = new ilExSubmission($this, $rec["usr_id"]);
1622
1623 $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1624 $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1625 $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1626 $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1627 $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1628 $mem[$rec["usr_id"]]["status"] = $rec["status"];
1629 $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1630 $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1631 }
1632 }
1633 return $mem;
1634 }
static _lookupName($a_user_id)
lookup user name
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
if($format !==null) $name
Definition: metadata.php:230

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

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

2203 {
2205
2206 if (!$a_user_id) {
2207 $a_user_id = $ilUser->getId();
2208 }
2209 if (!array_key_exists($a_user_id, $this->member_status)) {
2210 $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
2211 }
2212 return $this->member_status[$a_user_id];
2213 }
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 2572 of file class.ilExAssignment.php.

2573 {
2574 return $this->min_char_limit;
2575 }

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

1827 {
1829
1830 if ($a_user_id == 0) {
1831 $a_user_id = $ilUser->getId();
1832 }
1833
1834 $mf_files = array();
1835
1836 // get members
1837 $exc = new ilObjExercise($this->getExerciseId(), false);
1838 $exmem = new ilExerciseMembers($exc);
1839 $mems = $exmem->getMembers();
1840
1841 // read mf directory
1842 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1843 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1844
1845 // get subdir that starts with multi_feedback
1846 $subdirs = ilUtil::getDir($mfu);
1847 $subdir = "notfound";
1848 foreach ($subdirs as $s => $j) {
1849 if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1850 $subdir = $s;
1851 }
1852 }
1853
1854 $items = ilUtil::getDir($mfu . "/" . $subdir);
1855 foreach ($items as $k => $i) {
1856 // check directory
1857 if ($i["type"] == "dir" && !in_array($k, array(".", ".."))) {
1858 // check if valid member id is given
1859 $parts = explode("_", $i["entry"]);
1860 $user_id = (int) $parts[count($parts) - 1];
1861 if (in_array($user_id, $mems)) {
1862 // read dir of user
1863 $name = ilObjUser::_lookupName($user_id);
1864 $files = ilUtil::getDir($mfu . "/" . $subdir . "/" . $k);
1865 foreach ($files as $k2 => $f) {
1866 // append files to array
1867 if ($f["type"] == "file" && substr($k2, 0, 1) != ".") {
1868 $mf_files[] = array(
1869 "lastname" => $name["lastname"],
1870 "firstname" => $name["firstname"],
1871 "login" => $name["login"],
1872 "user_id" => $name["user_id"],
1873 "full_path" => $mfu . "/" . $subdir . "/" . $k . "/" . $k2,
1874 "file" => $k2);
1875 }
1876 }
1877 }
1878 }
1879 }
1880 return $mf_files;
1881 }
static count($a_ex_id)
Order assignments by deadline date.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
$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 2017 of file class.ilExAssignment.php.

2018 {
2019 global $DIC;
2020
2021 $ilDB = $DIC->database();
2022
2023 $res = array();
2024
2025 $set = $ilDB->query("SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
2026 " WHERE fb_cron = " . $ilDB->quote(1, "integer") .
2027 " AND (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer") .
2028 " AND time_stamp IS NOT NULL" .
2029 " AND time_stamp > " . $ilDB->quote(0, "integer") .
2030 " AND time_stamp < " . $ilDB->quote(time(), "integer") .
2031 " AND fb_cron_done = " . $ilDB->quote(0, "integer") .
2032 ") OR (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_CUSTOM, "integer") .
2033 " AND fb_date_custom IS NOT NULL" .
2034 " AND fb_date_custom > " . $ilDB->quote(0, "integer") .
2035 " AND fb_date_custom < " . $ilDB->quote(time(), "integer") .
2036 " AND fb_cron_done = " . $ilDB->quote(0, "integer") . ")");
2037
2038
2039
2040 while ($row = $ilDB->fetchAssoc($set)) {
2041 if ($row['fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
2042 $max = max($row['time_stamp'], $row['deadline2']);
2043 if (trim($row["fb_file"]) && $max <= time()) {
2044 $res[] = $row["id"];
2045 }
2046 } elseif ($row['fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
2047 if (trim($row["fb_file"]) && $row['fb_date_custom'] <= time()) {
2048 $res[] = $row["id"];
2049 }
2050 }
2051 }
2052
2053 return $res;
2054 }

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 }
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(), hasActiveIDl(), 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 1965 of file class.ilExAssignment.php.

1966 {
1967 $ilAppEventHandler = $this->app_event_handler;
1968
1969 $dl_id = $this->getId() . "0";
1970 $fbdl_id = $this->getId() . "1";
1971
1972 $context_ids = array($dl_id, $fbdl_id);
1973 $apps = array();
1974
1975 if ($a_event != "delete") {
1976 // deadline or relative deadline given
1978 $app = new ilCalendarAppointmentTemplate($dl_id);
1979 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1980 $app->setSubtitle("cal_exc_deadline");
1981 $app->setTitle($this->getTitle());
1982 $app->setFullday(false);
1983 // note: in the case of a relative deadline this will be set to 0 / 1970...)
1984 // see ilCalendarScheduleFilterExercise for appointment modification
1985 $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1986
1987 $apps[] = $app;
1988 }
1989
1990 if ($this->getPeerReview() &&
1991 $this->getPeerReviewDeadline()) {
1992 $app = new ilCalendarAppointmentTemplate($fbdl_id);
1993 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1994 $app->setSubtitle("cal_exc_peer_review_deadline");
1995 $app->setTitle($this->getTitle());
1996 $app->setFullday(false);
1997 $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1998
1999 $apps[] = $app;
2000 }
2001 }
2002
2003 $exc = new ilObjExercise($this->getExerciseId(), false);
2004
2005 $ilAppEventHandler->raise(
2006 'Modules/Exercise',
2007 $a_event . 'Assignment',
2008 array(
2009 'object' => $exc,
2010 'obj_id' => $exc->getId(),
2011 'context_ids' => $context_ids,
2012 'appointments' => $apps)
2013 );
2014 }
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 2178 of file class.ilExAssignment.php.

2179 {
2180 $path = $this->getGlobalFeedbackFileStoragePath();
2181 ilUtil::delDir($path, true);
2182 if (ilUtil::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path . "/" . $a_file["name"])) {
2183 $this->setFeedbackFile($a_file["name"]);
2184 return true;
2185 }
2186 return false;
2187 }
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 2309 of file class.ilExAssignment.php.

2310 {
2311 return (bool) $this->getDeadline() || (bool) $this->getRelativeDeadline();
2312 }

References getDeadline(), and getRelativeDeadline().

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

2315 {
2316 if (!$this->ass_type->usesTeams() &&
2317 $this->getPeerReview()) {
2318 // all deadlines are read-only if we have peer feedback
2319 $peer_review = new ilExPeerReview($this);
2320 if ($peer_review->hasPeerReviewGroups()) {
2321 return true;
2322 }
2323 }
2324
2325 return false;
2326 }
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(), canParticipantReceiveFeedback(), 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 2354 of file class.ilExAssignment.php.

2355 {
2356 global $DIC;
2357 $db = $DIC->database();
2358 $id = $db->nextId("exc_ass_file_order");
2359 $db->insert(
2360 "exc_ass_file_order",
2361 [
2362 "id" => ["integer", $id],
2363 "order_nr" => ["integer", $a_order_nr],
2364 "assignment_id" => ["integer", $a_ass_id],
2365 "filename" => ["text", $a_filename]
2366 ]
2367 );
2368 }

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

2409 {
2410 global $DIC;
2411
2412 $db = $DIC->database();
2413
2414 //now its done by filename. We need to figure how to get the order id in the confirmdelete method
2415 foreach ($a_file as $k => $v) {
2416 $db->manipulate(
2417 "DELETE FROM exc_ass_file_order " .
2418 //"WHERE id = " . $ilDB->quote((int)$k, "integer") .
2419 "WHERE filename = " . $db->quote($v, "string") .
2420 " AND assignment_id = " . $db->quote($a_ass_id, 'integer')
2421 );
2422 }
2423 }

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

2458 {
2459 global $DIC;
2460
2461 $db = $DIC->database();
2462
2463 if ($a_ass_id) {
2464 $result = $db->query(
2465 "SELECT id FROM exc_ass_file_order" .
2466 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2467 " AND filename = " . $db->quote($a_filename, 'string')
2468 );
2469
2470 return $db->numRows($result);
2471 }
2472 }
$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 2375 of file class.ilExAssignment.php.

2376 {
2377 global $DIC;
2378
2379 $db = $DIC->database();
2380
2381 $order = 0;
2382 $order_val = 0;
2383
2384 if ($a_ass_id) {
2385 //first of all check the suffix and change if necessary
2386 $filename = ilUtil::getSafeFilename($a_filename);
2387
2388 if (!self::instructionFileExistsInDb($filename, $a_ass_id)) {
2389 if ($a_order_nr == 0) {
2390 $order_val = self::instructionFileOrderGetMax($a_ass_id);
2391 $order = $order_val + 10;
2392 } else {
2393 $order = $a_order_nr;
2394 }
2395
2396 $id = $db->nextID('exc_ass_file_order');
2397 $db->manipulate("INSERT INTO exc_ass_file_order " .
2398 "(id, assignment_id, filename, order_nr) VALUES (" .
2399 $db->quote($id, "integer") . "," .
2400 $db->quote($a_ass_id, "integer") . "," .
2401 $db->quote($filename, "text") . "," .
2402 $db->quote($order, "integer") .
2403 ")");
2404 }
2405 }
2406 }
$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 2537 of file class.ilExAssignment.php.

2538 {
2539 global $DIC;
2540
2541 $db = $DIC->database();
2542
2543 //get max order number
2544 $result = $db->queryF(
2545 "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
2546 array('integer'),
2547 array($db->quote($a_ass_id, 'integer'))
2548 );
2549
2550 while ($row = $db->fetchAssoc($result)) {
2551 $order_val = (int) $row['max_order'];
2552 }
2553 return $order_val;
2554 }

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 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
$query

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

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

2158 {
2159 return (time() - $this->start_time <= 0);
2160 }

◆ 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 2215 of file class.ilExAssignment.php.

2216 {
2217 $ilDB = $this->db;
2218
2219 // see JF, 2015-05-11
2220
2221 $ext_deadline = $this->getExtendedDeadline();
2222
2223 foreach (ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file) {
2224 $id = $file["returned_id"];
2225 $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
2226 $uploaded = $uploaded->get(IL_CAL_UNIX);
2227
2228 $deadline = $this->getPersonalDeadline($file["user_id"]);
2229 $last_deadline = max($deadline, $this->getExtendedDeadline());
2230
2231 $late = null;
2232
2233 // upload is not late anymore
2234 if ($file["late"] &&
2235 (!$last_deadline ||
2236 !$ext_deadline ||
2237 $uploaded < $deadline)) {
2238 $late = false;
2239 }
2240 // upload is now late
2241 elseif (!$file["late"] &&
2242 $ext_deadline &&
2243 $deadline &&
2244 $uploaded > $deadline) {
2245 $late = true;
2246 } elseif ($last_deadline && $uploaded > $last_deadline) {
2247 // do nothing, we do not remove submissions?
2248 }
2249
2250 if ($late !== null) {
2251 $ilDB->manipulate("UPDATE exc_returned" .
2252 " SET late = " . $ilDB->quote($late, "integer") .
2253 " WHERE returned_id = " . $ilDB->quote($id, "integer"));
2254 }
2255 }
2256 }
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 2430 of file class.ilExAssignment.php.

2431 {
2432 global $DIC;
2433
2434 $db = $DIC->database();
2435
2436 if ($a_ass_id) {
2437 $db->manipulate(
2438 "DELETE FROM exc_ass_file_order" .
2439 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2440 " AND filename = " . $db->quote($a_new_name, 'string')
2441 );
2442
2443 $db->manipulate(
2444 "UPDATE exc_ass_file_order SET" .
2445 " filename = " . $db->quote($a_new_name, 'string') .
2446 " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2447 " AND filename = " . $db->quote($a_old_name, 'string')
2448 );
2449 }
2450 }

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

2334 {
2335 global $DIC;
2336
2337 $db = $DIC->database();
2338
2339 asort($a_order, SORT_NUMERIC);
2340
2341 $nr = 10;
2342 foreach ($a_order as $k => $v) {
2343 // the check for exc_id is for security reasons. ass ids are unique.
2344 $db->manipulate(
2345 $t = "UPDATE exc_ass_file_order SET " .
2346 " order_nr = " . $db->quote($nr, "integer") .
2347 " WHERE id = " . $db->quote((int) $k, "integer") .
2348 " AND assignment_id = " . $db->quote((int) $a_ass_id, "integer")
2349 );
2350 $nr += 10;
2351 }
2352 }

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

1906 {
1907 if ($this->getExerciseId() != $a_exc->getId()) {
1908 return;
1909 }
1910
1911 $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1912 $fstorage->create();
1913
1914 $team_map = array();
1915
1916 $mf_files = $this->getMultiFeedbackFiles();
1917 foreach ($mf_files as $f) {
1918 $user_id = $f["user_id"];
1919 $file_path = $f["full_path"];
1920 $file_name = $f["file"];
1921
1922 // if checked in confirmation gui
1923 if ($a_files[$user_id][md5($file_name)] != "") {
1924 $submission = new ilExSubmission($this, $user_id);
1925 $feedback_id = $submission->getFeedbackId();
1926 $noti_rec_ids = $submission->getUserIds();
1927
1928 if ($feedback_id) {
1929 $fb_path = $fstorage->getFeedbackPath($feedback_id);
1930 $target = $fb_path . "/" . $file_name;
1931 if (is_file($target)) {
1932 unlink($target);
1933 }
1934 // rename file
1935 rename($file_path, $target);
1936
1937 if ($noti_rec_ids) {
1938 foreach ($noti_rec_ids as $user_id) {
1939 $member_status = $this->getMemberStatus($user_id);
1940 $member_status->setFeedback(true);
1941 $member_status->update();
1942 }
1943
1945 $file_name,
1946 $noti_rec_ids,
1947 (int) $this->getId()
1948 );
1949 }
1950 }
1951 }
1952 }
1953
1955 }
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 2056 of file class.ilExAssignment.php.

2057 {
2058 global $DIC;
2059
2060 $ilDB = $DIC->database();
2061
2062 $ass = new self($a_ass_id);
2063
2064 // valid assignment?
2065 if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
2066 return false;
2067 }
2068
2069 if (!$a_user_id) {
2070 // already done?
2071 $set = $ilDB->query("SELECT fb_cron_done" .
2072 " FROM exc_assignment" .
2073 " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
2074 $row = $ilDB->fetchAssoc($set);
2075 if ($row["fb_cron_done"]) {
2076 return false;
2077 }
2078 }
2079
2080 $ntf = new ilSystemNotification();
2081 $ntf->setLangModules(array("exc"));
2082 $ntf->setObjId($ass->getExerciseId());
2083 $ntf->setSubjectLangId("exc_feedback_notification_subject");
2084 $ntf->setIntroductionLangId("exc_feedback_notification_body");
2085 $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
2086 $ntf->setGotoLangId("exc_feedback_notification_link");
2087 $ntf->setReasonLangId("exc_feedback_notification_reason");
2088
2089 if (!$a_user_id) {
2090 $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
2091
2092 $ilDB->manipulate("UPDATE exc_assignment" .
2093 " SET fb_cron_done = " . $ilDB->quote(1, "integer") .
2094 " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
2095 } else {
2096 $ntf->sendMail(array($a_user_id));
2097 }
2098
2099 return true;
2100 }
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 1738 of file class.ilExAssignment.php.

1739 {
1740 global $DIC;
1741
1742
1743 // send and delete the zip file
1744 $deliverFilename = trim(str_replace(" ", "_", $this->getTitle() . "_" . $this->getId()));
1745 $deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
1746 $deliverFilename = "multi_feedback_" . $deliverFilename;
1747
1748 $exc = new ilObjExercise($this->getExerciseId(), false);
1749
1750 $cdir = getcwd();
1751
1752 // create temporary directoy
1753 $tmpdir = ilUtil::ilTempnam();
1754 ilUtil::makeDir($tmpdir);
1755 $mfdir = $tmpdir . "/" . $deliverFilename;
1756 ilUtil::makeDir($mfdir);
1757
1758 // create subfolders <lastname>_<firstname>_<id> for each participant
1759 $exmem = new ilExerciseMembers($exc);
1760 $mems = $exmem->getMembers();
1761
1762 $mems = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1763 'edit_submissions_grades',
1764 'edit_submissions_grades',
1765 $exercise->getRefId(),
1766 $mems
1767 );
1768 foreach ($mems as $mem) {
1770 $subdir = $name["lastname"] . "_" . $name["firstname"] . "_" . $name["login"] . "_" . $name["user_id"];
1771 $subdir = ilUtil::getASCIIFilename($subdir);
1772 ilUtil::makeDir($mfdir . "/" . $subdir);
1773 }
1774
1775 // create the zip file
1776 chdir($tmpdir);
1777 $tmpzipfile = $tmpdir . "/multi_feedback.zip";
1778 ilUtil::zip($tmpdir, $tmpzipfile, true);
1779 chdir($cdir);
1780
1781
1782 ilUtil::deliverFile($tmpzipfile, $deliverFilename . ".zip", "", false, true);
1783 }
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 2263 of file class.ilExAssignment.php.

2264 {
2265 $ilDB = $this->db;
2266
2267 $is_team = false;
2268 if (!is_numeric($id)) {
2269 $id = substr($id, 1);
2270 $is_team = true;
2271 }
2272
2273 $idl = ilExcIndividualDeadline::getInstance($this->getId(), $id, $is_team);
2274 $idl->setIndividualDeadline($date->get(IL_CAL_UNIX));
2275 $idl->save();
2276
2277 /*
2278 $ilDB->replace("exc_idl",
2279 array(
2280 "ass_id" => array("integer", $this->getId()),
2281 "member_id" => array("integer", $id),
2282 "is_team" => array("integer", $is_team)
2283 ),
2284 array(
2285 "tstamp" => array("integer", $date->get(IL_CAL_UNIX))
2286 )
2287 );*/
2288 }
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 2581 of file class.ilExAssignment.php.

2582 {
2583 $this->max_char_limit = $a_val;
2584 }

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

2563 {
2564 $this->min_char_limit = $a_val;
2565 }

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

1723 {
1724 ilLoggerFactory::getLogger("exc")->debug("upload assignment files files = ", $a_files);
1725 $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1726 $storage->create();
1727 $storage->uploadAssignmentFiles($a_files);
1728 }

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

1792 {
1793 $lng = $this->lng;
1795
1796 if (!is_file($a_file["tmp_name"])) {
1797 throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1798 }
1799
1800 $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1801 $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1802 ilUtil::delDir($mfu, true);
1803 ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu . "/" . "multi_feedback.zip");
1804 ilUtil::unzip($mfu . "/multi_feedback.zip", true);
1805 $subdirs = ilUtil::getDir($mfu);
1806 $subdir = "notfound";
1807 foreach ($subdirs as $s => $j) {
1808 if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1809 $subdir = $s;
1810 }
1811 }
1812
1813 if (!is_dir($mfu . "/" . $subdir)) {
1814 throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1815 }
1816
1817 return true;
1818 }
Exercise exceptions class.
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)

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: