ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 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...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setMandatory ($a_val)
 Set mandatory. More...
 
 getMandatory ()
 Get mandatory. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setType ($a_value)
 Set type. More...
 
 getAssignmentType ()
 Get assignment type. More...
 
 getType ()
 Get type. More...
 
 isValidType ($a_value)
 Is given type valid? More...
 
 setPeerReview ($a_value)
 Toggle peer review. More...
 
 getPeerReview ()
 Get peer review status. More...
 
 setPeerReviewMin ($a_value)
 Set peer review minimum. More...
 
 getPeerReviewMin ()
 Get peer review minimum. More...
 
 setPeerReviewSimpleUnlock ($a_value)
 Set peer review simple unlock. More...
 
 getPeerReviewSimpleUnlock ()
 Get peer review simple unlock. More...
 
 setPeerReviewDeadline ($a_val)
 Set peer review deadline (timestamp) More...
 
 getPeerReviewDeadline ()
 Get peer review deadline (timestamp) More...
 
 setPeerReviewValid ($a_value)
 Set peer review validation. More...
 
 getPeerReviewValid ()
 Get peer review validatiob. More...
 
 setPeerReviewRating ($a_val)
 Set peer review rating. More...
 
 hasPeerReviewRating ()
 Get peer review rating status. More...
 
 setPeerReviewText ($a_val)
 Set peer review text. More...
 
 hasPeerReviewText ()
 Get peer review text status. More...
 
 setPeerReviewFileUpload ($a_val)
 Set peer review file upload. More...
 
 hasPeerReviewFileUpload ()
 Get peer review file upload status. More...
 
 setPeerReviewPersonalized ($a_val)
 Set peer review personalized. More...
 
 hasPeerReviewPersonalized ()
 Get peer review personalized status. More...
 
 setPeerReviewChars ($a_value)
 Set peer review minimum characters. More...
 
 getPeerReviewChars ()
 Get peer review minimum characters. More...
 
 setPeerReviewCriteriaCatalogue ($a_value)
 Set peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogue ()
 Get peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogueItems ()
 
 setFeedbackFile ($a_value)
 Set (global) feedback file. More...
 
 getFeedbackFile ()
 Get (global) feedback file. More...
 
 setFeedbackCron ($a_value)
 Toggle (global) feedback file cron. More...
 
 hasFeedbackCron ()
 Get (global) feedback file cron status. More...
 
 setFeedbackDate ($a_value)
 Set (global) feedback file availability date. More...
 
 getFeedbackDate ()
 Get (global) feedback file availability date. More...
 
 setFeedbackDateCustom ($a_value)
 Set (global) feedback file availability using a custom date. More...
 
 getFeedbackDateCustom ()
 Get feedback file availability using custom date. More...
 
 setTeamTutor ($a_value)
 Set team management by tutor. More...
 
 getTeamTutor ()
 Get team management by tutor. More...
 
 setMaxFile ($a_value)
 Set max number of uploads. More...
 
 getMaxFile ()
 Get max number of uploads. More...
 
 setPortfolioTemplateId ($a_val)
 Set portfolio template id. More...
 
 getPortfolioTemplateId ()
 Get portfolio template id. More...
 
 read ()
 Read from db. More...
 
 save ()
 Save assignment. More...
 
 update ()
 Update. More...
 
 delete ()
 Delete assignment. More...
 
 getFiles ()
 Get files. More...
 
 getInstructionFilesOrder ()
 
 getMemberListData ()
 get member list data More...
 
 getExerciseMemberAssignmentData ($a_user_id, $a_grade="")
 Get submission data for an specific user,exercise and assignment. More...
 
 uploadAssignmentFiles ($a_files)
 Upload assignment files (from creation form) More...
 
 sendMultiFeedbackStructureFile (ilObjExercise $exercise)
 Create member status record for a new assignment for all participants. More...
 
 uploadMultiFeedbackFile ($a_file)
 Upload multi feedback file. More...
 
 getMultiFeedbackFiles ($a_user_id=0)
 Get multi feedback files (of uploader) More...
 
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory. More...
 
 saveMultiFeedbackFiles ($a_files, ilObjExercise $a_exc)
 Save multi feedback files. More...
 
 afterDeadline ()
 
 afterDeadlineStrict ($a_include_personal=true)
 
 afterCustomDate ()
 
 beforeDeadline ()
 
 notStartedYet ()
 
 getGlobalFeedbackFileStoragePath ()
 
 deleteGlobalFeedbackFile ()
 
 handleGlobalFeedbackFileUpload (array $a_file)
 
 getGlobalFeedbackFilePath ()
 
 getMemberStatus ($a_user_id=null)
 
 recalculateLateSubmissions ()
 
 setIndividualDeadline ($id, ilDateTime $date)
 
 getIndividualDeadlines ()
 
 hasActiveIDl ()
 
 hasReadOnlyIDl ()
 
 fixInstructionFileOrdering ()
 
 fileAddOrder ($a_entries=array())
 
 setMinCharLimit ($a_val)
 Set limit minimum characters. More...
 
 getMinCharLimit ()
 Get limit minimum characters. More...
 
 setMaxCharLimit ($a_val)
 Set limit maximum characters. More...
 
 getMaxCharLimit ()
 get limit maximum characters return int max limit More...
 
 getCalculatedDeadlines ()
 Get calculated deadlines for user/team members. More...
 

Static Public Member Functions

static getInstancesByExercise ($a_exc_id)
 
static instructionFileGetFileOrderData ($a_file_data, $a_ass_id)
 
static getAssignmentDataOfExercise ($a_exc_id)
 Get assignments data of an exercise in an array. More...
 
static cloneAssignmentsOfExercise ($a_old_exc_id, $a_new_exc_id, array $a_crit_cat_map)
 Clone assignments of exercise. More...
 
static lookupMaxOrderNrForEx ($a_exc_id)
 Select the maximum order nr for an exercise. More...
 
static lookupAssignmentOnline ($a_ass_id)
 Check if assignment is online. More...
 
static lookupExerciseId ($a_ass_id)
 Lookup excercise id for assignment id. More...
 
static lookupTitle ($a_id)
 Lookup title. More...
 
static lookupType ($a_id)
 Lookup type. More...
 
static saveAssOrderOfExercise ($a_ex_id, $a_order)
 Save ordering of all assignments of an exercise. More...
 
static orderAssByDeadline ($a_ex_id)
 Order assignments by deadline date. More...
 
static countMandatory ($a_ex_id)
 Order assignments by deadline date. 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 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
 
 $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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

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

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

127  {
128  global $DIC;
129 
130  $this->db = $DIC->database();
131  $this->lng = $DIC->language();
132  $this->user = $DIC->user();
133  $this->app_event_handler = $DIC["ilAppEventHandler"];
134  include_once("./Modules/Exercise/AssignmentTypes/classes/class.ilExAssignmentTypes.php");
135  $this->types = ilExAssignmentTypes::getInstance();
136 
137  $this->setType(self::TYPE_UPLOAD);
138  $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
139 
140  $this->log = ilLoggerFactory::getLogger("exc");
141 
142  if ($a_id > 0) {
143  $this->setId($a_id);
144  $this->read();
145  }
146  }
global $DIC
Definition: saml.php:7
setType($a_value)
Set type.
user()
Definition: user.php:4
static getInstance()
Get instance.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setId($a_val)
Set assignment id.
static getLogger($a_component_id)
Get component logger.
read()
Read from db.
+ 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 2055 of file class.ilExAssignment.php.

References getFeedbackDateCustom().

Referenced by ilExAssignmentGUI\addSubmission().

2056  {
2057  $date_custom = $this->getFeedbackDateCustom();
2058  //if the solution will be displayed only after reach all the deadlines.
2059  //$final_deadline = $this->afterDeadlineStrict();
2060  //$dl = max($final_deadline, time());
2061  //return ($date_custom - $dl <= 0);
2062  return ($date_custom - time() <= 0);
2063  }
getFeedbackDateCustom()
Get feedback file availability using custom date.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

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

Referenced by afterDeadlineStrict().

2020  {
2021  $ilUser = $this->user;
2022 
2023  // :TODO: always current user?
2024  $idl = $this->getPersonalDeadline($ilUser->getId()); // official deadline
2025 
2026  // no deadline === true
2027  $deadline = max($this->deadline, $this->deadline2, $idl); // includes grace period
2028  return ($deadline - time() <= 0);
2029  }
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline) ...
$ilUser
Definition: imgupload.php:18
+ 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 2031 of file class.ilExAssignment.php.

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

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

2032  {
2033  // :TODO: this means that peer feedback, global feedback is available
2034  // after LAST personal deadline
2035  // team management is currently ignoring personal deadlines
2036  $idl = (bool) $a_include_personal
2037  ? $this->getLastPersonalDeadline()
2038  : null;
2039 
2040  // no deadline === false
2041  $deadline = max($this->deadline, $this->deadline2, $idl);
2042 
2043  // #18271 - afterDeadline() does not handle last personal deadline
2044  if ($idl && $deadline == $idl) { // after effective deadline of all users
2045  return ($deadline - time() <= 0);
2046  }
2047 
2048  return ($deadline > 0 && // like: after effective deadline (for single user), except: no deadline false
2049  $this->afterDeadline());
2050  }
getLastPersonalDeadline()
Get last/final personal deadline (of assignment)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

References afterDeadlineStrict().

2066  {
2067  // no deadline === true
2068  return !$this->afterDeadlineStrict();
2069  }
afterDeadlineStrict($a_include_personal=true)
+ Here is the call graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

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

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

Referenced by saveMultiFeedbackFiles().

1797  {
1798  $lng = $this->lng;
1799  $ilUser = $this->user;
1800 
1801  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1802  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1803  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1804  ilUtil::delDir($mfu);
1805  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
$ilUser
Definition: imgupload.php:18
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

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

Clone assignments of exercise.

Parameters

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

References $ass_type, $d, ilFSWebStorageExercise\create(), ilFSStorageExercise\create(), ilExAssignmentReminder\FEEDBACK_REMINDER, ilFSStorageExercise\getGlobalFeedbackPath(), ilFileSystemStorage\getPath(), ilExAssignmentReminder\GRADE_REMINDER, ilUtil\rCopy(), ilExAssignmentReminder\setReminderStatus(), and ilExAssignmentReminder\SUBMIT_REMINDER.

Referenced by ilObjExercise\cloneObject().

1170  {
1171  $ass_data = self::getInstancesByExercise($a_old_exc_id);
1172  foreach ($ass_data as $d) {
1173  // clone assignment
1174  $new_ass = new ilExAssignment();
1175  $new_ass->setExerciseId($a_new_exc_id);
1176  $new_ass->setTitle($d->getTitle());
1177  $new_ass->setDeadline($d->getDeadline());
1178  $new_ass->setExtendedDeadline($d->getExtendedDeadline());
1179  $new_ass->setInstruction($d->getInstruction());
1180  $new_ass->setMandatory($d->getMandatory());
1181  $new_ass->setOrderNr($d->getOrderNr());
1182  $new_ass->setStartTime($d->getStartTime());
1183  $new_ass->setType($d->getType());
1184  $new_ass->setPeerReview($d->getPeerReview());
1185  $new_ass->setPeerReviewMin($d->getPeerReviewMin());
1186  $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
1187  $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
1188  $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
1189  $new_ass->setPeerReviewValid($d->getPeerReviewValid());
1190  $new_ass->setPeerReviewChars($d->getPeerReviewChars());
1191  $new_ass->setPeerReviewText($d->hasPeerReviewText());
1192  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
1193  $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
1194  $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
1195  $new_ass->setFeedbackFile($d->getFeedbackFile());
1196  $new_ass->setFeedbackDate($d->getFeedbackDate());
1197  $new_ass->setFeedbackDateCustom($d->getFeedbackDateCustom());
1198  $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
1199  $new_ass->setTeamTutor($d->getTeamTutor());
1200  $new_ass->setMaxFile($d->getMaxFile());
1201  $new_ass->setMinCharLimit($d->getMinCharLimit());
1202  $new_ass->setMaxCharLimit($d->getMaxCharLimit());
1203  $new_ass->setPortfolioTemplateId($d->getPortfolioTemplateId());
1204  $new_ass->setDeadlineMode($d->getDeadlineMode());
1205  $new_ass->setRelativeDeadline($d->getRelativeDeadline());
1206 
1207  // criteria catalogue(s)
1208  if ($d->getPeerReviewCriteriaCatalogue() &&
1209  array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map)) {
1210  $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
1211  }
1212 
1213  $new_ass->save();
1214 
1215 
1216  // clone assignment files
1217  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
1218  $old_web_storage = new ilFSWebStorageExercise($a_old_exc_id, (int) $d->getId());
1219  $new_web_storage = new ilFSWebStorageExercise($a_new_exc_id, (int) $new_ass->getId());
1220  $new_web_storage->create();
1221  if (is_dir($old_web_storage->getPath())) {
1222  ilUtil::rCopy($old_web_storage->getPath(), $new_web_storage->getPath());
1223  }
1224 
1225  // clone global feedback file
1226  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1227  $old_storage = new ilFSStorageExercise($a_old_exc_id, (int) $d->getId());
1228  $new_storage = new ilFSStorageExercise($a_new_exc_id, (int) $new_ass->getId());
1229  $new_storage->create();
1230  if (is_dir($old_storage->getGlobalFeedbackPath())) {
1231  ilUtil::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
1232  }
1233 
1234  // clone reminders
1238  $rmd_sub = new ilExAssignmentReminder($a_old_exc_id, $d->getId(), $rem_type);
1239  if ($rmd_sub->getReminderStatus()) {
1240  $new_rmd_sub = new ilExAssignmentReminder($a_new_exc_id, $new_ass->getId(), $rem_type);
1241  $new_rmd_sub->setReminderStatus($rmd_sub->getReminderStatus());
1242  $new_rmd_sub->setReminderStart($rmd_sub->getReminderStart());
1243  $new_rmd_sub->setReminderEnd($rmd_sub->getReminderEnd());
1244  $new_rmd_sub->setReminderFrequency($rmd_sub->getReminderFrequency());
1245  $new_rmd_sub->setReminderMailTemplate($rmd_sub->getReminderMailTemplate());
1246  $new_rmd_sub->save();
1247  }
1248  }
1249 
1250 
1251  // type specific properties
1252  $ass_type = $d->getAssignmentType();
1253  $ass_type->cloneSpecificProperties($d, $new_ass);
1254  }
1255  }
setReminderStatus($a_status)
Set reminder for users without submission.
Exercise assignment.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
TODO: import/export reminder data with the exercise/assignment.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ countMandatory()

static ilExAssignment::countMandatory (   $a_ex_id)
static

Order assignments by deadline date.

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

References $DIC, and $ilDB.

Referenced by ilObjExerciseGUI\initEditCustomForm().

1435  {
1436  global $DIC;
1437 
1438  $ilDB = $DIC->database();
1439 
1440  $set = $ilDB->query(
1441  "SELECT count(*) cntm FROM exc_assignment " .
1442  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1443  " AND mandatory = " . $ilDB->quote(1, "integer")
1444  );
1445  $rec = $ilDB->fetchAssoc($set);
1446  return $rec["cntm"];
1447  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

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

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

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

References $DIC, and $ilDB.

1600  {
1601  global $DIC;
1602 
1603  $ilDB = $DIC->database();
1604 
1605  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1606  $exmem = new ilExerciseMembers($a_exc);
1607  $mems = $exmem->getMembers();
1608 
1609  foreach ($mems as $mem) {
1610  $ilDB->replace("exc_mem_ass_status", array(
1611  "ass_id" => array("integer", $a_ass_id),
1612  "usr_id" => array("integer", $mem)
1613  ), array(
1614  "status" => array("text", "notgraded")
1615  ));
1616  }
1617  }
Class ilExerciseMembers.
global $DIC
Definition: saml.php:7
global $ilDB

◆ createNewUserRecords()

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

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

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

References $DIC, and $ilDB.

Referenced by ilExerciseMembers\assignMember().

1579  {
1580  global $DIC;
1581 
1582  $ilDB = $DIC->database();
1583 
1584  $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1585  foreach ($ass_data as $ass) {
1586  //echo "-".$ass["id"]."-".$a_user_id."-";
1587  $ilDB->replace("exc_mem_ass_status", array(
1588  "ass_id" => array("integer", $ass["id"]),
1589  "usr_id" => array("integer", $a_user_id)
1590  ), array(
1591  "status" => array("text", "notgraded")
1592  ));
1593  }
1594  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ delete()

ilExAssignment::delete ( )

Delete assignment.

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

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

1100  {
1101  $ilDB = $this->db;
1102 
1103  $this->deleteGlobalFeedbackFile();
1104 
1105  $ilDB->manipulate(
1106  "DELETE FROM exc_assignment WHERE " .
1107  " id = " . $ilDB->quote($this->getId(), "integer")
1108  );
1109  $exc = new ilObjExercise($this->getExerciseId(), false);
1110  $exc->updateAllUsersStatus();
1111 
1112  $this->handleCalendarEntries("delete");
1113 
1114  $reminder = new ilExAssignmentReminder();
1115  $reminder->deleteReminders($this->getId());
1116  }
getId()
Get assignment id.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getExerciseId()
Get exercise id.
Class ilObjExercise.
TODO: import/export reminder data with the exercise/assignment.
global $ilDB
+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

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

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

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

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

◆ fileAddOrder()

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

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

References fixInstructionFileOrdering(), and getInstructionFilesOrder().

2424  {
2425  $this->fixInstructionFileOrdering();
2426 
2427  $order = $this->getInstructionFilesOrder();
2428  foreach ($a_entries as $k => $e) {
2429  $a_entries[$k]["order_val"] = $order[$e["file"]]["order_nr"];
2430  $a_entries[$k]["order_id"] = $order[$e["file"]]["id"];
2431  }
2432 
2433  return $a_entries;
2434  }
+ Here is the call graph for this function:

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

References $db, $DIC, $f, $files, $order_nr, getFiles(), and getId().

Referenced by fileAddOrder().

2378  {
2379  global $DIC;
2380 
2381  $db = $DIC->database();
2382 
2383  $files = array_map(function ($v) {
2384  return $v["name"];
2385  }, $this->getFiles());
2386 
2387  $set = $db->query("SELECT * FROM exc_ass_file_order " .
2388  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2389  " ORDER BY order_nr");
2390  $order_nr = 10;
2391  $numbered_files = array();
2392  while ($rec = $db->fetchAssoc($set)) {
2393  // file exists, set correct order nr
2394  if (in_array($rec["filename"], $files)) {
2395  $db->manipulate(
2396  "UPDATE exc_ass_file_order SET " .
2397  " order_nr = " . $db->quote($order_nr, "integer") .
2398  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2399  " AND id = " . $db->quote($rec["id"], "integer")
2400  );
2401  $order_nr += 10;
2402  $numbered_files[] = $rec["filename"];
2403  } else { // file does not exist, delete entry
2404  $db->manipulate(
2405  "DELETE FROM exc_ass_file_order " .
2406  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
2407  " AND id = " . $db->quote($rec["id"], "integer")
2408  );
2409  }
2410  }
2411  foreach ($files as $f) {
2412  if (!in_array($f, $numbered_files)) {
2413  self::instructionFileInsertOrder($f, $this->getId());
2414  }
2415  }
2416  }
$files
Definition: metarefresh.php:49
global $DIC
Definition: saml.php:7
getId()
Get assignment id.
+ 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 1122 of file class.ilExAssignment.php.

References $data, $DIC, and $ilDB.

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

1123  {
1124  global $DIC;
1125 
1126  $ilDB = $DIC->database();
1127 
1128  // should be changed to self::getInstancesByExerciseId()
1129 
1130  $set = $ilDB->query("SELECT * FROM exc_assignment " .
1131  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
1132  " ORDER BY order_nr ASC");
1133  $data = array();
1134 
1135  $order_val = 10;
1136  while ($rec = $ilDB->fetchAssoc($set)) {
1137  $data[] = array(
1138  "id" => $rec["id"],
1139  "exc_id" => $rec["exc_id"],
1140  "deadline" => $rec["time_stamp"],
1141  "deadline2" => $rec["deadline2"],
1142  "instruction" => $rec["instruction"],
1143  "title" => $rec["title"],
1144  "start_time" => $rec["start_time"],
1145  "order_val" => $order_val,
1146  "mandatory" => $rec["mandatory"],
1147  "type" => $rec["type"],
1148  "peer" => $rec["peer"],
1149  "peer_min" => $rec["peer_min"],
1150  "peer_dl" => $rec["peer_dl"],
1151  "peer_file" => $rec["peer_file"],
1152  "peer_prsl" => $rec["peer_prsl"],
1153  "fb_file" => $rec["fb_file"],
1154  "fb_date" => $rec["fb_date"],
1155  "fb_cron" => $rec["fb_cron"],
1156  "deadline_mode" => $rec["deadline_mode"],
1157  "relative_deadline" => $rec["relative_deadline"]
1158  );
1159  $order_val += 10;
1160  }
1161  return $data;
1162  }
global $DIC
Definition: saml.php:7
global $ilDB
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ getAssignmentType()

ilExAssignment::getAssignmentType ( )

Get assignment type.

Parameters

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

References $ass_type.

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

502  {
503  return $this->ass_type;
504  }
+ 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 2505 of file class.ilExAssignment.php.

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

2506  {
2507  $calculated_deadlines = array(
2508  "user" => array(),
2509  "team" => array()
2510  );
2511 
2512  if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
2513  include_once("./Modules/Exercise/classes/class.ilExcIndividualDeadline.php");
2514  foreach (ilExcIndividualDeadline::getStartingTimestamps($this->getId()) as $ts) {
2515  $type = $ts["is_team"]
2516  ? "team"
2517  : "user";
2518 
2519  $calculated_deadlines[$type][$ts["member_id"]] = array(
2520  "calculated_deadline" => $ts["starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
2521  );
2522  }
2523  }
2524  return $calculated_deadlines;
2525  }
getId()
Get assignment id.
getDeadlineMode()
Get deadline mode.
static getStartingTimestamps($a_ass_id)
Get starting timestamp data for an assignment.
getRelativeDeadline()
Get relative deadline.
+ Here is the call graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

Get deadline (timestamp)

Returns
int deadline (timestamp)

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

References $deadline.

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

283  {
284  return $this->deadline;
285  }
+ Here is the caller graph for this function:

◆ getDeadlineMode()

ilExAssignment::getDeadlineMode ( )

Get deadline mode.

Returns
int deadline mode

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

References $deadline_mode.

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

303  {
304  return $this->deadline_mode;
305  }
+ 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 1541 of file class.ilExAssignment.php.

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

1542  {
1543  global $DIC;
1544  $ilDB = $DIC->database();
1545 
1546  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1547 
1548  if (in_array($a_grade, array("notgraded", "passed", "failed"))) {
1549  $and_grade = " AND status = " . $ilDB->quote($a_grade, "text");
1550  }
1551 
1552  $q = "SELECT * FROM exc_mem_ass_status " .
1553  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1554  " AND usr_id = " . $ilDB->quote($a_user_id, "integer") .
1555  $and_grade;
1556 
1557  $set = $ilDB->query($q);
1558 
1559  while ($rec = $ilDB->fetchAssoc($set)) {
1560  $sub = new ilExSubmission($this, $a_user_id);
1561 
1562  $data["sent_time"] = $rec["sent_time"];
1563  $data["submission"] = $sub->getLastSubmission();
1564  $data["status_time"] = $rec["status_time"];
1565  $data["feedback_time"] = $rec["feedback_time"];
1566  $data["notice"] = $rec["notice"];
1567  $data["status"] = $rec["status"];
1568  $data["mark"] = $rec["mark"];
1569  $data["comment"] = $rec["u_comment"];
1570  }
1571 
1572  return $data;
1573  }
global $DIC
Definition: saml.php:7
getId()
Get assignment id.
global $ilDB
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

Get extended deadline (timestamp)

Returns
int

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

References $deadline2.

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

392  {
393  return $this->deadline2;
394  }
+ Here is the caller graph for this function:

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

Get (global) feedback file availability date.

Returns
int

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

References $feedback_date.

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

840  {
841  return (int) $this->feedback_date;
842  }
+ Here is the caller graph for this function:

◆ getFeedbackDateCustom()

ilExAssignment::getFeedbackDateCustom ( )

Get feedback file availability using custom date.

Returns
string timestamp

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

References $feedback_date_custom.

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

858  {
860  }
+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

Get (global) feedback file.

Returns
int

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

References $feedback_file.

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

800  {
801  return (string) $this->feedback_file;
802  }
+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

Get files.

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

References getExerciseId(), and getId().

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

1261  {
1262  $this->log->debug("getting files from class.ilExAssignment using ilFSWebStorageExercise");
1263  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
1264  $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1265  return $storage->getFiles();
1266  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

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

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

2105  {
2106  $file = $this->getFeedbackFile();
2107  if ($file) {
2109  return $path . "/" . $file;
2110  }
2111  }
$path
Definition: aliased.php:25
getFeedbackFile()
Get (global) feedback file.
+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

References getExerciseId(), and getId().

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

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

◆ getId()

ilExAssignment::getId ( )

Get assignment id.

Returns
int assignment id

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

References $id.

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

223  {
224  return $this->id;
225  }
+ Here is the caller graph for this function:

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

References $db, $ilDB, $res, and $row.

2209  {
2210  $ilDB = $this->db;
2211 
2212  $res = array();
2213 
2214  $set = $ilDB->query("SELECT * FROM exc_idl" .
2215  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
2216  while ($row = $ilDB->fetchAssoc($set)) {
2217  if ($row["is_team"]) {
2218  $row["member_id"] = "t" . $row["member_id"];
2219  }
2220 
2221  $res[$row["member_id"]] = $row["tstamp"];
2222  }
2223 
2224  return $res;
2225  }
foreach($_POST as $key=> $value) $res
$row
global $ilDB

◆ getInstancesByExercise()

static ilExAssignment::getInstancesByExercise (   $a_exc_id)
static

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

References $data, $DIC, and $ilDB.

Referenced by ilExGradesTableGUI\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), ilExSubmission\deleteUser(), ilObjExercise\determinStatusOfUser(), ilObjExercise\exportGradesExcel(), ilExcCriteriaCatalogueTableGUI\getItems(), ilExParticipantTableGUI\initMode(), ilExerciseManagementGUI\membersObject(), ilExerciseManagementCollectFilesJob\run(), and ilObjExerciseGUI\showOverviewObject().

149  {
150  global $DIC;
151 
152  $ilDB = $DIC->database();
153 
154  $set = $ilDB->query("SELECT * FROM exc_assignment " .
155  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
156  " ORDER BY order_nr ASC");
157  $data = array();
158 
159  $order_val = 10;
160  while ($rec = $ilDB->fetchAssoc($set)) {
161  // ???
162  $rec["order_val"] = $order_val;
163 
164  $ass = new self();
165  $ass->initFromDB($rec);
166  $data[] = $ass;
167 
168  $order_val += 10;
169  }
170 
171  return $data;
172  }
global $DIC
Definition: saml.php:7
global $ilDB
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

Get instruction.

Returns
string instruction

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

References $instruction.

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

412  {
413  return $this->instruction;
414  }
+ Here is the caller graph for this function:

◆ getInstructionFilesOrder()

ilExAssignment::getInstructionFilesOrder ( )
Parameters
$a_ass_id
Returns
array

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

References $data, $db, and $ilDB.

Referenced by fileAddOrder().

1273  {
1274  $ilDB = $this->db;
1275 
1276  $set = $ilDB->query(
1277  "SELECT filename, order_nr, id FROM exc_ass_file_order " .
1278  " WHERE assignment_id = " . $ilDB->quote($this->getId(), "integer")
1279  );
1280 
1281  $data = array();
1282  while ($rec = $ilDB->fetchAssoc($set)) {
1283  $data[$rec['filename']] = $rec;
1284  }
1285 
1286  return $data;
1287  }
global $ilDB
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )

Get last/final personal deadline (of assignment)

Returns
int

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

References $db, $ilDB, and $row.

Referenced by afterDeadlineStrict().

364  {
365  $ilDB = $this->db;
366 
367  $set = $ilDB->query("SELECT MAX(tstamp) FROM exc_idl" .
368  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
369  $row = $ilDB->fetchAssoc($set);
370  return $row["tstamp"];
371  }
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

Get mandatory.

Returns
int mandatory

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

References $mandatory.

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

452  {
453  return $this->mandatory;
454  }
+ Here is the caller graph for this function:

◆ getMaxCharLimit()

ilExAssignment::getMaxCharLimit ( )

get limit maximum characters return int max limit

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

References $max_char_limit.

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

2494  {
2495  return $this->max_char_limit;
2496  }
+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

Get max number of uploads.

Returns
bool

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

References $max_file.

Referenced by save(), and update().

901  {
902  return $this->max_file;
903  }
+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

get member list data

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

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

1491  {
1492  $ilDB = $this->db;
1493 
1494  $mem = array();
1495 
1496  // first get list of members from member table
1497  $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login" .
1498  " FROM exc_members excm" .
1499  " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)" .
1500  " WHERE excm.obj_id = " . $ilDB->quote($this->getExerciseId(), "integer"));
1501  while ($rec = $ilDB->fetchAssoc($set)) {
1502  $mem[$rec["usr_id"]] =
1503  array(
1504  "name" => $rec["lastname"] . ", " . $rec["firstname"],
1505  "login" => $rec["login"],
1506  "usr_id" => $rec["usr_id"],
1507  "lastname" => $rec["lastname"],
1508  "firstname" => $rec["firstname"]
1509  );
1510  }
1511 
1512  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1513 
1514  $q = "SELECT * FROM exc_mem_ass_status " .
1515  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer");
1516  $set = $ilDB->query($q);
1517  while ($rec = $ilDB->fetchAssoc($set)) {
1518  if (isset($mem[$rec["usr_id"]])) {
1519  $sub = new ilExSubmission($this, $rec["usr_id"]);
1520 
1521  $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1522  $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1523  $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1524  $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1525  $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1526  $mem[$rec["usr_id"]]["status"] = $rec["status"];
1527  $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1528  $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1529  }
1530  }
1531  return $mem;
1532  }
getId()
Get assignment id.
global $ilDB
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ getMemberStatus()

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

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

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

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

2118  {
2119  $ilUser = $this->user;
2120 
2121  if (!$a_user_id) {
2122  $a_user_id = $ilUser->getId();
2123  }
2124  if (!array_key_exists($a_user_id, $this->member_status)) {
2125  include_once "Modules/Exercise/classes/class.ilExAssignmentMemberStatus.php";
2126  $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
2127  }
2128  return $this->member_status[$a_user_id];
2129  }
Exercise assignment member status.
getId()
Get assignment id.
$ilUser
Definition: imgupload.php:18
+ 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 2475 of file class.ilExAssignment.php.

References $min_char_limit.

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

2476  {
2477  return $this->min_char_limit;
2478  }
+ 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 1731 of file class.ilExAssignment.php.

References $f, $files, $i, $ilUser, $name, $s, $user, ilObjUser\_lookupName(), ilUtil\getDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

1732  {
1733  $ilUser = $this->user;
1734 
1735  if ($a_user_id == 0) {
1736  $a_user_id = $ilUser->getId();
1737  }
1738 
1739  $mf_files = array();
1740 
1741  // get members
1742  $exc = new ilObjExercise($this->getExerciseId(), false);
1743  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1744  $exmem = new ilExerciseMembers($exc);
1745  $mems = $exmem->getMembers();
1746 
1747  // read mf directory
1748  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1749  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1750  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1751 
1752  // get subdir that starts with multi_feedback
1753  $subdirs = ilUtil::getDir($mfu);
1754  $subdir = "notfound";
1755  foreach ($subdirs as $s => $j) {
1756  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1757  $subdir = $s;
1758  }
1759  }
1760 
1761  $items = ilUtil::getDir($mfu . "/" . $subdir);
1762  foreach ($items as $k => $i) {
1763  // check directory
1764  if ($i["type"] == "dir" && !in_array($k, array(".", ".."))) {
1765  // check if valid member id is given
1766  $parts = explode("_", $i["entry"]);
1767  $user_id = (int) $parts[count($parts) - 1];
1768  if (in_array($user_id, $mems)) {
1769  // read dir of user
1770  $name = ilObjUser::_lookupName($user_id);
1771  $files = ilUtil::getDir($mfu . "/" . $subdir . "/" . $k);
1772  foreach ($files as $k2 => $f) {
1773  // append files to array
1774  if ($f["type"] == "file" && substr($k2, 0, 1) != ".") {
1775  $mf_files[] = array(
1776  "lastname" => $name["lastname"],
1777  "firstname" => $name["firstname"],
1778  "login" => $name["login"],
1779  "user_id" => $name["user_id"],
1780  "full_path" => $mfu . "/" . $subdir . "/" . $k . "/" . $k2,
1781  "file" => $k2);
1782  }
1783  }
1784  }
1785  }
1786  }
1787  return $mf_files;
1788  }
static _lookupName($a_user_id)
lookup user name
$files
Definition: metarefresh.php:49
Class ilExerciseMembers.
getId()
Get assignment id.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
$s
Definition: pwgen.php:45
getExerciseId()
Get exercise id.
Class ilObjExercise.
$ilUser
Definition: imgupload.php:18
$i
Definition: disco.tpl.php:19
+ 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 471 of file class.ilExAssignment.php.

References $order_nr.

Referenced by save(), and update().

472  {
473  return $this->order_nr;
474  }
+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

Get peer review status.

Returns
bool

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

References $peer.

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

545  {
546  return (bool) $this->peer;
547  }
+ Here is the caller graph for this function:

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

Get peer review minimum characters.

Returns
int

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

References $peer_char.

Referenced by save(), and update().

728  {
729  return $this->peer_char;
730  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

Get peer review criteria catalogue id.

Returns
int

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

Referenced by save(), and update().

751  {
752  return $this->crit_cat;
753  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogueItems()

ilExAssignment::getPeerReviewCriteriaCatalogueItems ( )

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

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

756  {
757  include_once "Modules/Exercise/classes/class.ilExcCriteria.php";
758 
759  if ($this->crit_cat) {
760  return ilExcCriteria::getInstancesByParentId($this->crit_cat);
761  } else {
762  $res = array();
763 
764  if ($this->peer_rating) {
766  }
767 
768  if ($this->peer_text) {
769  $crit = ilExcCriteria::getInstanceByType("text");
770  if ($this->peer_char) {
771  $crit->setMinChars($this->peer_char);
772  }
773  $res[] = $crit;
774  }
775 
776  if ($this->peer_file) {
778  }
779 
780  return $res;
781  }
782  }
static getInstanceByType($a_type)
foreach($_POST as $key=> $value) $res
static getInstancesByParentId($a_parent_id)
+ Here is the call graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

Get peer review deadline (timestamp)

Returns
int deadline (timestamp)

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

References $peer_dl.

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

605  {
606  return $this->peer_dl;
607  }
+ Here is the caller graph for this function:

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

Get peer review minimum.

Returns
int

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

References $peer_min.

Referenced by save(), and update().

565  {
566  return (int) $this->peer_min;
567  }
+ Here is the caller graph for this function:

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

Get peer review simple unlock.

Returns
bool

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

References $peer_unlock.

Referenced by save(), and update().

585  {
586  return (bool) $this->peer_unlock;
587  }
+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

Get peer review validatiob.

Returns
int

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

References $peer_valid.

Referenced by save(), and update().

625  {
626  return (int) $this->peer_valid;
627  }
+ Here is the caller graph for this function:

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

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

Referenced by ilExcCronFeedbackNotification\run().

1930  {
1931  global $DIC;
1932 
1933  $ilDB = $DIC->database();
1934 
1935  $res = array();
1936 
1937  $set = $ilDB->query("SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
1938  " WHERE fb_cron = " . $ilDB->quote(1, "integer") .
1939  " AND (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer") .
1940  " AND time_stamp IS NOT NULL" .
1941  " AND time_stamp > " . $ilDB->quote(0, "integer") .
1942  " AND time_stamp < " . $ilDB->quote(time(), "integer") .
1943  " AND fb_cron_done = " . $ilDB->quote(0, "integer") .
1944  ") OR (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_CUSTOM, "integer") .
1945  " AND fb_date_custom IS NOT NULL" .
1946  " AND fb_date_custom > " . $ilDB->quote(0, "integer") .
1947  " AND fb_date_custom < " . $ilDB->quote(time(), "integer") .
1948  " AND fb_cron_done = " . $ilDB->quote(0, "integer") . ")");
1949 
1950 
1951 
1952  while ($row = $ilDB->fetchAssoc($set)) {
1953  if ($row['fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
1954  $max = max($row['time_stamp'], $row['deadline2']);
1955  if (trim($row["fb_file"]) && $max <= time()) {
1956  $res[] = $row["id"];
1957  }
1958  } elseif ($row['fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
1959  if (trim($row["fb_file"]) && $row['fb_date_custom'] <= time()) {
1960  $res[] = $row["id"];
1961  }
1962  }
1963  }
1964 
1965  return $res;
1966  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
global $ilDB
+ 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 332 of file class.ilExAssignment.php.

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

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

333  {
334  $ilDB = $this->db;
335 
336  $is_team = false;
337  if ($this->ass_type->usesTeams()) {
338  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
339  $team_id = ilExAssignmentTeam::getTeamId($this->getId(), $a_user_id);
340  if (!$team_id) {
341  // #0021043
342  return $this->getDeadline();
343  }
344  $a_user_id = $team_id;
345  $is_team = true;
346  }
347 
348  $set = $ilDB->query("SELECT tstamp FROM exc_idl" .
349  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
350  " AND member_id = " . $ilDB->quote($a_user_id, "integer") .
351  " AND is_team = " . $ilDB->quote($is_team, "integer"));
352  $row = $ilDB->fetchAssoc($set);
353 
354  // use assignment deadline if no direct personal
355  return max($row["tstamp"], $this->getDeadline());
356  }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
$row
global $ilDB
+ 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 920 of file class.ilExAssignment.php.

References $portfolio_template.

Referenced by ilExAssTypePortfolioGUI\getFormValuesArray().

921  {
923  }
+ Here is the caller graph for this function:

◆ getRelativeDeadline()

ilExAssignment::getRelativeDeadline ( )

Get relative deadline.

Returns
int relative deadline

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

References $relative_deadline.

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

323  {
325  }
+ Here is the caller graph for this function:

◆ getStartTime()

ilExAssignment::getStartTime ( )

Get start time (timestamp)

Returns
int start time (timestamp)

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

References $start_time.

Referenced by save(), and update().

263  {
264  return $this->start_time;
265  }
+ Here is the caller graph for this function:

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

Get team management by tutor.

Returns
bool

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

References $team_tutor.

Referenced by save(), and update().

878  {
879  return $this->team_tutor;
880  }
+ 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 513 of file class.ilExAssignment.php.

References $type.

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

514  {
515  return $this->type;
516  }
+ 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 1874 of file class.ilExAssignment.php.

References $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().

1875  {
1876  $ilAppEventHandler = $this->app_event_handler;
1877 
1878  $dl_id = $this->getId() . "0";
1879  $fbdl_id = $this->getId() . "1";
1880 
1881  $context_ids = array($dl_id, $fbdl_id);
1882  $apps = array();
1883 
1884  if ($a_event != "delete") {
1885  include_once "Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php";
1886 
1887  // deadline or relative deadline given
1888  if ($this->getDeadline() || $this->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
1889  $app = new ilCalendarAppointmentTemplate($dl_id);
1890  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1891  $app->setSubtitle("cal_exc_deadline");
1892  $app->setTitle($this->getTitle());
1893  $app->setFullday(false);
1894  // note: in the case of a relative deadline this will be set to 0 / 1970...)
1895  // see ilCalendarScheduleFilterExercise for appointment modification
1896  $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1897 
1898  $apps[] = $app;
1899  }
1900 
1901  if ($this->getPeerReview() &&
1902  $this->getPeerReviewDeadline()) {
1903  $app = new ilCalendarAppointmentTemplate($fbdl_id);
1904  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1905  $app->setSubtitle("cal_exc_peer_review_deadline");
1906  $app->setTitle($this->getTitle());
1907  $app->setFullday(false);
1908  $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1909 
1910  $apps[] = $app;
1911  }
1912  }
1913 
1914  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1915  $exc = new ilObjExercise($this->getExerciseId(), false);
1916 
1917  $ilAppEventHandler->raise(
1918  'Modules/Exercise',
1919  $a_event . 'Assignment',
1920  array(
1921  'object' => $exc,
1922  'obj_id' => $exc->getId(),
1923  'context_ids' => $context_ids,
1924  'appointments' => $apps)
1925  );
1926  }
getPeerReview()
Get peer review status.
const IL_CAL_TRANSLATION_SYSTEM
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
getExerciseId()
Get exercise id.
Class ilObjExercise.
Date and time handling
getDeadlineMode()
Get deadline mode.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

2094  {
2096  ilUtil::delDir($path, true);
2097  if (ilUtil::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path . "/" . $a_file["name"])) {
2098  $this->setFeedbackFile($a_file["name"]);
2099  return true;
2100  }
2101  return false;
2102  }
$path
Definition: aliased.php:25
setFeedbackFile($a_value)
Set (global) feedback file.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

References getDeadline().

Referenced by ilExerciseSubmissionTableGUI\parseRow().

2228  {
2229  return (bool) $this->getDeadline();
2230  }
getDeadline()
Get deadline (timestamp)
+ 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 819 of file class.ilExAssignment.php.

References $feedback_cron.

Referenced by save(), and update().

820  {
821  return (bool) $this->feedback_cron;
822  }
+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

Get peer review file upload status.

Returns
bool

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

References $peer_file.

Referenced by save(), and update().

685  {
686  return $this->peer_file;
687  }
+ Here is the caller graph for this function:

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

Get peer review personalized status.

Returns
bool

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

References $peer_personal.

Referenced by save(), and update().

705  {
706  return $this->peer_personal;
707  }
+ Here is the caller graph for this function:

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

Get peer review rating status.

Returns
bool

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

References $peer_rating.

Referenced by save(), and update().

645  {
646  return $this->peer_rating;
647  }
+ Here is the caller graph for this function:

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

Get peer review text status.

Returns
bool

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

References $peer_text.

Referenced by save(), and update().

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

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

References getPeerReview().

Referenced by ilExerciseSubmissionTableGUI\parseRow().

2233  {
2234  if (!$this->ass_type->usesTeams() &&
2235  $this->getPeerReview()) {
2236  // all deadlines are read-only if we have peer feedback
2237  include_once "Modules/Exercise/classes/class.ilExPeerReview.php";
2238  $peer_review = new ilExPeerReview($this);
2239  if ($peer_review->hasPeerReviewGroups()) {
2240  return true;
2241  }
2242  }
2243 
2244  return false;
2245  }
getPeerReview()
Get peer review status.
Exercise peer review.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTeam()

ilExAssignment::hasTeam ( )

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

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

203  {
204  return $this->ass_type->usesTeams();
205  }
+ 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 951 of file class.ilExAssignment.php.

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

Referenced by read().

952  {
953  $this->setId($a_set["id"]);
954  $this->setExerciseId($a_set["exc_id"]);
955  $this->setDeadline($a_set["time_stamp"]);
956  $this->setExtendedDeadline($a_set["deadline2"]);
957  $this->setInstruction($a_set["instruction"]);
958  $this->setTitle($a_set["title"]);
959  $this->setStartTime($a_set["start_time"]);
960  $this->setOrderNr($a_set["order_nr"]);
961  $this->setMandatory($a_set["mandatory"]);
962  $this->setType($a_set["type"]);
963  $this->setPeerReview($a_set["peer"]);
964  $this->setPeerReviewMin($a_set["peer_min"]);
965  $this->setPeerReviewSimpleUnlock($a_set["peer_unlock"]);
966  $this->setPeerReviewDeadline($a_set["peer_dl"]);
967  $this->setPeerReviewValid($a_set["peer_valid"]);
968  $this->setPeerReviewFileUpload($a_set["peer_file"]);
969  $this->setPeerReviewPersonalized($a_set["peer_prsl"]);
970  $this->setPeerReviewChars($a_set["peer_char"]);
971  $this->setPeerReviewText($a_set["peer_text"]);
972  $this->setPeerReviewRating($a_set["peer_rating"]);
973  $this->setPeerReviewCriteriaCatalogue($a_set["peer_crit_cat"]);
974  $this->setFeedbackFile($a_set["fb_file"]);
975  $this->setFeedbackDate($a_set["fb_date"]);
976  $this->setFeedbackDateCustom($a_set["fb_date_custom"]);
977  $this->setFeedbackCron($a_set["fb_cron"]);
978  $this->setTeamTutor($a_set["team_tutor"]);
979  $this->setMaxFile($a_set["max_file"]);
980  $this->setPortfolioTemplateId($a_set["portfolio_template"]);
981  $this->setMinCharLimit($a_set["min_char_limit"]);
982  $this->setMaxCharLimit($a_set["max_char_limit"]);
983  $this->setDeadlineMode($a_set["deadline_mode"]);
984  $this->setRelativeDeadline($a_set["relative_deadline"]);
985  }
setMaxFile($a_value)
Set max number of uploads.
setFeedbackFile($a_value)
Set (global) feedback file.
setPeerReviewMin($a_value)
Set peer review minimum.
setMaxCharLimit($a_val)
Set limit maximum characters.
setTeamTutor($a_value)
Set team management by tutor.
setPortfolioTemplateId($a_val)
Set portfolio template id.
setPeerReviewFileUpload($a_val)
Set peer review file upload.
setMinCharLimit($a_val)
Set limit minimum characters.
setPeerReview($a_value)
Toggle peer review.
setPeerReviewDeadline($a_val)
Set peer review deadline (timestamp)
setPeerReviewValid($a_value)
Set peer review validation.
setType($a_value)
Set type.
setTitle($a_val)
Set title.
setOrderNr($a_val)
Set order nr.
setRelativeDeadline($a_val)
Set relative deadline.
setInstruction($a_val)
Set instruction.
setDeadlineMode($a_val)
Set deadline mode.
setStartTime($a_val)
Set start time (timestamp)
setDeadline($a_val)
Set deadline (timestamp)
setPeerReviewCriteriaCatalogue($a_value)
Set peer review criteria catalogue id.
setPeerReviewPersonalized($a_val)
Set peer review personalized.
setPeerReviewRating($a_val)
Set peer review rating.
setPeerReviewSimpleUnlock($a_value)
Set peer review simple unlock.
setPeerReviewText($a_val)
Set peer review text.
setExerciseId($a_val)
Set exercise id.
setFeedbackCron($a_value)
Toggle (global) feedback file cron.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setPeerReviewChars($a_value)
Set peer review minimum characters.
setId($a_val)
Set assignment id.
setFeedbackDateCustom($a_value)
Set (global) feedback file availability using a custom date.
setMandatory($a_val)
Set mandatory.
setExtendedDeadline($a_val)
Set extended deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileDeleteOrder()

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

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

References $db, and $DIC.

Referenced by ilExAssignmentFileSystemGUI\deleteFile().

2312  {
2313  global $DIC;
2314 
2315  $db = $DIC->database();
2316 
2317  //now its done by filename. We need to figure how to get the order id in the confirmdelete method
2318  foreach ($a_file as $k => $v) {
2319  $db->manipulate(
2320  "DELETE FROM exc_ass_file_order " .
2321  //"WHERE id = " . $ilDB->quote((int)$k, "integer") .
2322  "WHERE filename = " . $db->quote($v, "string") .
2323  " AND assignment_id = " . $db->quote($a_ass_id, 'integer')
2324  );
2325  }
2326  }
global $DIC
Definition: saml.php:7
+ 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 2360 of file class.ilExAssignment.php.

References $db, $DIC, and $result.

2361  {
2362  global $DIC;
2363 
2364  $db = $DIC->database();
2365 
2366  if ($a_ass_id) {
2367  $result = $db->query(
2368  "SELECT id FROM exc_ass_file_order" .
2369  " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2370  " AND filename = " . $db->quote($a_filename, 'string')
2371  );
2372 
2373  return $db->numRows($result);
2374  }
2375  }
$result
global $DIC
Definition: saml.php:7

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

References $db, $DIC, and $row.

180  {
181  global $DIC;
182 
183  $db = $DIC->database();
184  $db->setLimit(1, 0);
185 
186  $result_order_val = $db->query("
187  SELECT id, order_nr
188  FROM exc_ass_file_order
189  WHERE assignment_id = {$db->quote($a_ass_id, 'integer')}
190  AND filename = {$db->quote($a_file_data['entry'], 'string')}
191  ");
192 
193  $order_val = 0;
194  $order_id = 0;
195  while ($row = $db->fetchAssoc($result_order_val)) {
196  $order_val = (int) $row['order_nr'];
197  $order_id = (int) $row['id'];
198  }
199  return array($order_val, $order_id);
200  }
global $DIC
Definition: saml.php:7
$row

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

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

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

2279  {
2280  global $DIC;
2281 
2282  $db = $DIC->database();
2283 
2284  $order = 0;
2285  $order_val = 0;
2286 
2287  if ($a_ass_id) {
2288  //first of all check the suffix and change if necessary
2289  $filename = ilUtil::getSafeFilename($a_filename);
2290 
2291  if (!self::instructionFileExistsInDb($filename, $a_ass_id)) {
2292  if ($a_order_nr == 0) {
2293  $order_val = self::instructionFileOrderGetMax($a_ass_id);
2294  $order = $order_val + 10;
2295  } else {
2296  $order = $a_order_nr;
2297  }
2298 
2299  $id = $db->nextID('exc_ass_file_order');
2300  $db->manipulate("INSERT INTO exc_ass_file_order " .
2301  "(id, assignment_id, filename, order_nr) VALUES (" .
2302  $db->quote($id, "integer") . "," .
2303  $db->quote($a_ass_id, "integer") . "," .
2304  $db->quote($filename, "text") . "," .
2305  $db->quote($order, "integer") .
2306  ")");
2307  }
2308  }
2309  }
static getSafeFilename($a_initial_filename)
global $DIC
Definition: saml.php:7
$filename
Definition: buildRTE.php:89
+ 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 2440 of file class.ilExAssignment.php.

References $db, $DIC, $result, and $row.

2441  {
2442  global $DIC;
2443 
2444  $db = $DIC->database();
2445 
2446  //get max order number
2447  $result = $db->queryF(
2448  "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
2449  array('integer'),
2450  array($db->quote($a_ass_id, 'integer'))
2451  );
2452 
2453  while ($row = $db->fetchAssoc($result)) {
2454  $order_val = (int) $row['max_order'];
2455  }
2456  return $order_val;
2457  }
$result
global $DIC
Definition: saml.php:7
$row

◆ isValidType()

ilExAssignment::isValidType (   $a_value)

Is given type valid?

Parameters
int$a_value
Returns
bool

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

Referenced by setType().

525  {
526  return $this->types->isValidId($a_value);
527  }
+ Here is the caller graph for this function:

◆ lookup()

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

Private lookup.

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

References $DIC, and $ilDB.

1351  {
1352  global $DIC;
1353 
1354  $ilDB = $DIC->database();
1355 
1356  $set = $ilDB->query(
1357  "SELECT " . $a_field . " FROM exc_assignment " .
1358  " WHERE id = " . $ilDB->quote($a_id, "integer")
1359  );
1360 
1361  $rec = $ilDB->fetchAssoc($set);
1362 
1363  return $rec[$a_field];
1364  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline (   $a_ass_id)
static

Check if assignment is online.

Parameters
int$a_ass_id
Returns
bool

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

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

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

1314  {
1315  global $DIC;
1316 
1317  $ilDB = $DIC->database();
1318 
1319  $query = "SELECT id FROM exc_assignment " .
1320  "WHERE start_time <= " . $ilDB->quote(time(), 'integer') . ' ' .
1321  "AND time_stamp >= " . $ilDB->quote(time(), 'integer') . ' ' .
1322  "AND id = " . $ilDB->quote($a_ass_id, 'integer');
1323  $res = $ilDB->query($query);
1324 
1325  return $res->numRows() ? true : false;
1326  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ 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 1334 of file class.ilExAssignment.php.

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

Referenced by ilObjExerciseGUI\__construct().

1335  {
1336  global $DIC;
1337 
1338  $ilDB = $DIC->database();
1339 
1340  $query = "SELECT exc_id FROM exc_assignment " .
1341  "WHERE id = " . $ilDB->quote($a_ass_id, 'integer');
1342  $res = $ilDB->fetchAssoc($ilDB->query($query));
1343 
1344  return (int) $res["exc_id"];
1345  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ lookupMaxOrderNrForEx()

static ilExAssignment::lookupMaxOrderNrForEx (   $a_exc_id)
static

Select the maximum order nr for an exercise.

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

References $DIC, and $ilDB.

1293  {
1294  global $DIC;
1295 
1296  $ilDB = $DIC->database();
1297 
1298  $set = $ilDB->query(
1299  "SELECT MAX(order_nr) mnr FROM exc_assignment " .
1300  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer")
1301  );
1302  while ($rec = $ilDB->fetchAssoc($set)) {
1303  return (int) $rec["mnr"];
1304  }
1305  return 0;
1306  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupTitle()

◆ lookupType()

static ilExAssignment::lookupType (   $a_id)
static

Lookup type.

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

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

1378  {
1379  return self::lookup($a_id, "type");
1380  }
+ 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 1454 of file class.ilExAssignment.php.

References $DIC, $ilDB, and $lng.

1455  {
1456  global $DIC;
1457 
1458  $ilDB = $DIC->database();
1459  $lng = $DIC->language();
1460 
1461  // team upload?
1462  $user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
1463  if (!$user_ids) {
1464  $user_ids = array($member_id);
1465  }
1466 
1467  $q = "SELECT exc_mem_ass_status.status_time, exc_returned.ts " .
1468  "FROM exc_mem_ass_status, exc_returned " .
1469  "WHERE exc_mem_ass_status.status_time < exc_returned.ts " .
1470  "AND NOT exc_mem_ass_status.status_time IS NULL " .
1471  "AND exc_returned.ass_id = exc_mem_ass_status.ass_id " .
1472  "AND exc_returned.user_id = exc_mem_ass_status.usr_id " .
1473  "AND exc_returned.ass_id=" . $ilDB->quote($ass_id, "integer") .
1474  " AND " . $ilDB->in("exc_returned.user_id", $user_ids, "", "integer");
1475 
1476  $usr_set = $ilDB->query($q);
1477 
1478  $array = $ilDB->fetchAssoc($usr_set);
1479 
1480  if (count($array) == 0) {
1481  return 0;
1482  } else {
1483  return 1;
1484  }
1485  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

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

2072  {
2073  return (time() - $this->start_time <= 0);
2074  }

◆ orderAssByDeadline()

static ilExAssignment::orderAssByDeadline (   $a_ex_id)
static

Order assignments by deadline date.

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

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

1410  {
1411  global $DIC;
1412 
1413  $ilDB = $DIC->database();
1414 
1415  $set = $ilDB->query(
1416  "SELECT id FROM exc_assignment " .
1417  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1418  " ORDER BY time_stamp ASC"
1419  );
1420  $nr = 10;
1421  while ($rec = $ilDB->fetchAssoc($set)) {
1422  $ilDB->manipulate(
1423  "UPDATE exc_assignment SET " .
1424  " order_nr = " . $ilDB->quote($nr, "integer") .
1425  " WHERE id = " . $ilDB->quote($rec["id"], "integer")
1426  );
1427  $nr += 10;
1428  }
1429  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )

Read from db.

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

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

Referenced by __construct().

930  {
931  $ilDB = $this->db;
932 
933  $set = $ilDB->query(
934  "SELECT * FROM exc_assignment " .
935  " WHERE id = " . $ilDB->quote($this->getId(), "integer")
936  );
937  $rec = $ilDB->fetchAssoc($set);
938 
939  // #16172 - might be deleted
940  if (is_array($rec)) {
941  $this->initFromDB($rec);
942  }
943  }
initFromDB(array $a_set)
Import DB record.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )

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

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

2132  {
2133  $ilDB = $this->db;
2134 
2135  // see JF, 2015-05-11
2136 
2137  $ext_deadline = $this->getExtendedDeadline();
2138 
2139  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
2140  foreach (ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file) {
2141  $id = $file["returned_id"];
2142  $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
2143  $uploaded = $uploaded->get(IL_CAL_UNIX);
2144 
2145  $deadline = $this->getPersonalDeadline($file["user_id"]);
2146  $last_deadline = max($deadline, $this->getExtendedDeadline());
2147 
2148  $late = null;
2149 
2150  // upload is not late anymore
2151  if ($file["late"] &&
2152  (!$last_deadline ||
2153  !$ext_deadline ||
2154  $uploaded < $deadline)) {
2155  $late = false;
2156  }
2157  // upload is now late
2158  elseif (!$file["late"] &&
2159  $ext_deadline &&
2160  $deadline &&
2161  $uploaded > $deadline) {
2162  $late = true;
2163  } elseif ($last_deadline && $uploaded > $last_deadline) {
2164  // do nothing, we do not remove submissions?
2165  }
2166 
2167  if ($late !== null) {
2168  $ilDB->manipulate("UPDATE exc_returned" .
2169  " SET late = " . $ilDB->quote($late, "integer") .
2170  " WHERE returned_id = " . $ilDB->quote($id, "integer"));
2171  }
2172  }
2173  }
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline) ...
const IL_CAL_DATETIME
getId()
Get assignment id.
const IL_CAL_UNIX
Date and time handling
getExtendedDeadline()
Get extended deadline (timestamp)
global $ilDB
static getAllAssignmentFiles($a_exc_id, $a_ass_id)
+ Here is the call graph for this function:

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

References $db, and $DIC.

Referenced by ilExAssignmentFileSystemGUI\renameFile().

2334  {
2335  global $DIC;
2336 
2337  $db = $DIC->database();
2338 
2339  if ($a_ass_id) {
2340  $db->manipulate(
2341  "DELETE FROM exc_ass_file_order" .
2342  " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2343  " AND filename = " . $db->quote($a_new_name, 'string')
2344  );
2345 
2346  $db->manipulate(
2347  "UPDATE exc_ass_file_order SET" .
2348  " filename = " . $db->quote($a_new_name, 'string') .
2349  " WHERE assignment_id = " . $db->quote((int) $a_ass_id, 'integer') .
2350  " AND filename = " . $db->quote($a_old_name, 'string')
2351  );
2352  }
2353  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ save()

ilExAssignment::save ( )

Save assignment.

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

991  {
992  $ilDB = $this->db;
993 
994  if ($this->getOrderNr() == 0) {
995  $this->setOrderNr(
996  self::lookupMaxOrderNrForEx($this->getExerciseId())
997  + 10
998  );
999  }
1000 
1001  $next_id = $ilDB->nextId("exc_assignment");
1002  $ilDB->insert("exc_assignment", array(
1003  "id" => array("integer", $next_id),
1004  "exc_id" => array("integer", $this->getExerciseId()),
1005  "time_stamp" => array("integer", $this->getDeadline()),
1006  "deadline2" => array("integer", $this->getExtendedDeadline()),
1007  "instruction" => array("clob", $this->getInstruction()),
1008  "title" => array("text", $this->getTitle()),
1009  "start_time" => array("integer", $this->getStartTime()),
1010  "order_nr" => array("integer", $this->getOrderNr()),
1011  "mandatory" => array("integer", $this->getMandatory()),
1012  "type" => array("integer", $this->getType()),
1013  "peer" => array("integer", $this->getPeerReview()),
1014  "peer_min" => array("integer", $this->getPeerReviewMin()),
1015  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
1016  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
1017  "peer_valid" => array("integer", $this->getPeerReviewValid()),
1018  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
1019  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
1020  "peer_char" => array("integer", $this->getPeerReviewChars()),
1021  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
1022  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
1023  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
1024  "fb_file" => array("text", $this->getFeedbackFile()),
1025  "fb_date" => array("integer", $this->getFeedbackDate()),
1026  "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
1027  "fb_cron" => array("integer", $this->hasFeedbackCron()),
1028  "team_tutor" => array("integer", $this->getTeamTutor()),
1029  "max_file" => array("integer", $this->getMaxFile()),
1030  "portfolio_template" => array("integer", $this->getPortFolioTemplateId()),
1031  "min_char_limit" => array("integer", $this->getMinCharLimit()),
1032  "max_char_limit" => array("integer", $this->getMaxCharLimit()),
1033  "relative_deadline" => array("integer", $this->getRelativeDeadline()),
1034  "deadline_mode" => array("integer", $this->getDeadlineMode())
1035  ));
1036  $this->setId($next_id);
1037  $exc = new ilObjExercise($this->getExerciseId(), false);
1038  $exc->updateAllUsersStatus();
1039  self::createNewAssignmentRecords($next_id, $exc);
1040 
1041  $this->handleCalendarEntries("create");
1042  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getMaxCharLimit()
get limit maximum characters return int max limit
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
setOrderNr($a_val)
Set order nr.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
getDeadlineMode()
Get deadline mode.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
setId($a_val)
Set assignment id.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
getFeedbackDateCustom()
Get feedback file availability using custom date.
getMinCharLimit()
Get limit minimum characters.
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
getRelativeDeadline()
Get relative deadline.
+ 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 1385 of file class.ilExAssignment.php.

References $DIC, $ilDB, and $t.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

1386  {
1387  global $DIC;
1388 
1389  $ilDB = $DIC->database();
1390 
1391  $result_order = array();
1392  asort($a_order);
1393  $nr = 10;
1394  foreach ($a_order as $k => $v) {
1395  // the check for exc_id is for security reasons. ass ids are unique.
1396  $ilDB->manipulate(
1397  $t = "UPDATE exc_assignment SET " .
1398  " order_nr = " . $ilDB->quote($nr, "integer") .
1399  " WHERE id = " . $ilDB->quote((int) $k, "integer") .
1400  " AND exc_id = " . $ilDB->quote((int) $a_ex_id, "integer")
1401  );
1402  $nr += 10;
1403  }
1404  }
global $DIC
Definition: saml.php:7
global $ilDB
+ 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 2252 of file class.ilExAssignment.php.

References $db, $DIC, and $t.

Referenced by ilExAssignmentFileSystemGUI\saveFilesOrder().

2253  {
2254  global $DIC;
2255 
2256  $db = $DIC->database();
2257 
2258  asort($a_order, SORT_NUMERIC);
2259 
2260  $nr = 10;
2261  foreach ($a_order as $k => $v) {
2262  // the check for exc_id is for security reasons. ass ids are unique.
2263  $db->manipulate(
2264  $t = "UPDATE exc_ass_file_order SET " .
2265  " order_nr = " . $db->quote($nr, "integer") .
2266  " WHERE id = " . $db->quote((int) $k, "integer") .
2267  " AND assignment_id = " . $db->quote((int) $a_ass_id, "integer")
2268  );
2269  $nr += 10;
2270  }
2271  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ saveMultiFeedbackFiles()

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

Save multi feedback files.

Parameters

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

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

1814  {
1815  if ($this->getExerciseId() != $a_exc->getId()) {
1816  return;
1817  }
1818 
1819  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1820  $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1821  $fstorage->create();
1822 
1823  $team_map = array();
1824 
1825  $mf_files = $this->getMultiFeedbackFiles();
1826  foreach ($mf_files as $f) {
1827  $user_id = $f["user_id"];
1828  $file_path = $f["full_path"];
1829  $file_name = $f["file"];
1830 
1831  // if checked in confirmation gui
1832  if ($a_files[$user_id][md5($file_name)] != "") {
1833  $submission = new ilExSubmission($this, $user_id);
1834  $feedback_id = $submission->getFeedbackId();
1835  $noti_rec_ids = $submission->getUserIds();
1836 
1837  if ($feedback_id) {
1838  $fb_path = $fstorage->getFeedbackPath($feedback_id);
1839  $target = $fb_path . "/" . $file_name;
1840  if (is_file($target)) {
1841  unlink($target);
1842  }
1843  // rename file
1844  rename($file_path, $target);
1845 
1846  if ($noti_rec_ids) {
1847  foreach ($noti_rec_ids as $user_id) {
1848  $member_status = $this->getMemberStatus($user_id);
1849  $member_status->setFeedback(true);
1850  $member_status->update();
1851  }
1852 
1854  $file_name,
1855  $noti_rec_ids,
1856  (int) $this->getId()
1857  );
1858  }
1859  }
1860  }
1861  }
1862 
1863  $this->clearMultiFeedbackDirectory();
1864  }
getMemberStatus($a_user_id=null)
getId()
Get assignment id.
getExerciseId()
Get exercise id.
getId()
get object id public
sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback=false)
Send feedback file notification to user.
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getMultiFeedbackFiles($a_user_id=0)
Get multi feedback files (of uploader)
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$target
Definition: test.php:19
+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

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

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

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

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

1969  {
1970  global $DIC;
1971 
1972  $ilDB = $DIC->database();
1973 
1974  $ass = new self($a_ass_id);
1975 
1976  // valid assignment?
1977  if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
1978  return false;
1979  }
1980 
1981  if (!$a_user_id) {
1982  // already done?
1983  $set = $ilDB->query("SELECT fb_cron_done" .
1984  " FROM exc_assignment" .
1985  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
1986  $row = $ilDB->fetchAssoc($set);
1987  if ($row["fb_cron_done"]) {
1988  return false;
1989  }
1990  }
1991 
1992  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1993  $ntf = new ilSystemNotification();
1994  $ntf->setLangModules(array("exc"));
1995  $ntf->setObjId($ass->getExerciseId());
1996  $ntf->setSubjectLangId("exc_feedback_notification_subject");
1997  $ntf->setIntroductionLangId("exc_feedback_notification_body");
1998  $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
1999  $ntf->setGotoLangId("exc_feedback_notification_link");
2000  $ntf->setReasonLangId("exc_feedback_notification_reason");
2001 
2002  if (!$a_user_id) {
2003  include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
2004  $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
2005 
2006  $ilDB->manipulate("UPDATE exc_assignment" .
2007  " SET fb_cron_done = " . $ilDB->quote(1, "integer") .
2008  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
2009  } else {
2010  $ntf->sendMail(array($a_user_id));
2011  }
2012 
2013  return true;
2014  }
global $DIC
Definition: saml.php:7
$row
global $ilDB
Wrapper classes for system notifications.
static _getMembers($a_obj_id)
+ 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 1640 of file class.ilExAssignment.php.

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

1641  {
1642  global $DIC;
1643 
1644 
1645  // send and delete the zip file
1646  $deliverFilename = trim(str_replace(" ", "_", $this->getTitle() . "_" . $this->getId()));
1647  $deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
1648  $deliverFilename = "multi_feedback_" . $deliverFilename;
1649 
1650  $exc = new ilObjExercise($this->getExerciseId(), false);
1651 
1652  $cdir = getcwd();
1653 
1654  // create temporary directoy
1655  $tmpdir = ilUtil::ilTempnam();
1656  ilUtil::makeDir($tmpdir);
1657  $mfdir = $tmpdir . "/" . $deliverFilename;
1658  ilUtil::makeDir($mfdir);
1659 
1660  // create subfolders <lastname>_<firstname>_<id> for each participant
1661  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1662  $exmem = new ilExerciseMembers($exc);
1663  $mems = $exmem->getMembers();
1664 
1665  $mems = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1666  'edit_submissions_grades',
1667  'edit_submissions_grades',
1668  $exercise->getRefId(),
1669  $mems
1670  );
1671  foreach ($mems as $mem) {
1672  $name = ilObjUser::_lookupName($mem);
1673  $subdir = $name["lastname"] . "_" . $name["firstname"] . "_" . $name["login"] . "_" . $name["user_id"];
1674  $subdir = ilUtil::getASCIIFilename($subdir);
1675  ilUtil::makeDir($mfdir . "/" . $subdir);
1676  }
1677 
1678  // create the zip file
1679  chdir($tmpdir);
1680  $tmpzipfile = $tmpdir . "/multi_feedback.zip";
1681  ilUtil::zip($tmpdir, $tmpzipfile, true);
1682  chdir($cdir);
1683 
1684 
1685  ilUtil::deliverFile($tmpzipfile, $deliverFilename . ".zip", "", false, true);
1686  }
static _lookupName($a_user_id)
lookup user name
Class ilExerciseMembers.
global $DIC
Definition: saml.php:7
getId()
Get assignment id.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
getExerciseId()
Get exercise id.
Class ilObjExercise.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
getRefId()
get reference id public
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline (   $a_val)

Set deadline (timestamp)

Parameters
intdeadline (timestamp)

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

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

273  {
274  $this->deadline = $a_val;
275  }
+ Here is the caller graph for this function:

◆ setDeadlineMode()

ilExAssignment::setDeadlineMode (   $a_val)

Set deadline mode.

Parameters
int$a_valdeadline mode

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

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

293  {
294  $this->deadline_mode = $a_val;
295  }
+ Here is the caller graph for this function:

◆ setExerciseId()

ilExAssignment::setExerciseId (   $a_val)

Set exercise id.

Parameters
intexercise id

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

Referenced by initFromDB().

233  {
234  $this->exc_id = $a_val;
235  }
+ Here is the caller graph for this function:

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline (   $a_val)

Set extended deadline (timestamp)

Parameters
int

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

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

379  {
380  if ($a_val !== null) {
381  $a_val = (int) $a_val;
382  }
383  $this->deadline2 = $a_val;
384  }
+ 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 809 of file class.ilExAssignment.php.

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

810  {
811  $this->feedback_cron = (string) $a_value;
812  }
+ 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 829 of file class.ilExAssignment.php.

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

830  {
831  $this->feedback_date = (int) $a_value;
832  }
+ 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 848 of file class.ilExAssignment.php.

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

849  {
850  $this->feedback_date_custom = $a_value;
851  }
+ Here is the caller graph for this function:

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile (   $a_value)

Set (global) feedback file.

Parameters
string$a_value

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

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

790  {
791  $this->feedback_file = (string) $a_value;
792  }
+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

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

213  {
214  $this->id = $a_val;
215  }
+ Here is the caller graph for this function:

◆ setIndividualDeadline()

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

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

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

2181  {
2182  $ilDB = $this->db;
2183 
2184  $is_team = false;
2185  if (!is_numeric($id)) {
2186  $id = substr($id, 1);
2187  $is_team = true;
2188  }
2189 
2190  include_once("./Modules/Exercise/classes/class.ilExcIndividualDeadline.php");
2191  $idl = ilExcIndividualDeadline::getInstance($this->getId(), $id, $is_team);
2192  $idl->setIndividualDeadline($date->get(IL_CAL_UNIX));
2193  $idl->save();
2194 
2195  /*
2196  $ilDB->replace("exc_idl",
2197  array(
2198  "ass_id" => array("integer", $this->getId()),
2199  "member_id" => array("integer", $id),
2200  "is_team" => array("integer", $is_team)
2201  ),
2202  array(
2203  "tstamp" => array("integer", $date->get(IL_CAL_UNIX))
2204  )
2205  );*/
2206  }
getId()
Get assignment id.
const IL_CAL_UNIX
static getInstance($a_ass_id, $a_participant_id, $a_is_team=false)
Get instance.
get($a_format, $a_format_str='', $a_tz='')
get formatted date
global $ilDB
+ Here is the call graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction (   $a_val)

Set instruction.

Parameters
stringinstruction

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

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

402  {
403  $this->instruction = $a_val;
404  }
+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory (   $a_val)

Set mandatory.

Parameters
intmandatory

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

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

442  {
443  $this->mandatory = $a_val;
444  }
+ Here is the caller graph for this function:

◆ setMaxCharLimit()

ilExAssignment::setMaxCharLimit (   $a_val)

Set limit maximum characters.

Parameters
intmax limit

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

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

2485  {
2486  $this->max_char_limit = $a_val;
2487  }
+ 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 887 of file class.ilExAssignment.php.

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

888  {
889  if ($a_value !== null) {
890  $a_value = (int) $a_value;
891  }
892  $this->max_file = $a_value;
893  }
+ Here is the caller graph for this function:

◆ setMinCharLimit()

ilExAssignment::setMinCharLimit (   $a_val)

Set limit minimum characters.

Parameters
intminim limit

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

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

2466  {
2467  $this->min_char_limit = $a_val;
2468  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

Referenced by initFromDB(), and save().

462  {
463  $this->order_nr = $a_val;
464  }
+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview (   $a_value)

Toggle peer review.

Parameters
bool$a_value

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

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

535  {
536  $this->peer = (bool) $a_value;
537  }
+ 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 714 of file class.ilExAssignment.php.

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

715  {
716  $a_value = (is_numeric($a_value) && (int) $a_value > 0)
717  ? (int) $a_value
718  : null;
719  $this->peer_char = $a_value;
720  }
+ 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 737 of file class.ilExAssignment.php.

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

738  {
739  $a_value = is_numeric($a_value)
740  ? (int) $a_value
741  : null;
742  $this->crit_cat = $a_value;
743  }
+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

ilExAssignment::setPeerReviewDeadline (   $a_val)

Set peer review deadline (timestamp)

Parameters
intdeadline (timestamp)

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

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

595  {
596  $this->peer_dl = $a_val;
597  }
+ Here is the caller graph for this function:

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload (   $a_val)

Set peer review file upload.

Parameters
bool

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

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

675  {
676  $this->peer_file = (bool) $a_val;
677  }
+ Here is the caller graph for this function:

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin (   $a_value)

Set peer review minimum.

Parameters
int$a_value

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

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

555  {
556  $this->peer_min = (int) $a_value;
557  }
+ Here is the caller graph for this function:

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized (   $a_val)

Set peer review personalized.

Parameters
bool

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

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

695  {
696  $this->peer_personal = (bool) $a_val;
697  }
+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating (   $a_val)

Set peer review rating.

Parameters
bool

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

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

635  {
636  $this->peer_rating = (bool) $a_val;
637  }
+ 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 574 of file class.ilExAssignment.php.

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

575  {
576  $this->peer_unlock = (bool) $a_value;
577  }
+ Here is the caller graph for this function:

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText (   $a_val)

Set peer review text.

Parameters
bool

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

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

655  {
656  $this->peer_text = (bool) $a_val;
657  }
+ Here is the caller graph for this function:

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid (   $a_value)

Set peer review validation.

Parameters
int$a_value

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

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

615  {
616  $this->peer_valid = (int) $a_value;
617  }
+ Here is the caller graph for this function:

◆ setPortfolioTemplateId()

ilExAssignment::setPortfolioTemplateId (   $a_val)

Set portfolio template id.

Parameters
int$a_val

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

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

911  {
912  $this->portfolio_template = $a_val;
913  }
+ Here is the caller graph for this function:

◆ setRelativeDeadline()

ilExAssignment::setRelativeDeadline (   $a_val)

Set relative deadline.

Parameters
int$a_valrelative deadline

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

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

313  {
314  $this->relative_deadline = $a_val;
315  }
+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime (   $a_val)

Set start time (timestamp)

Parameters
intstart time (timestamp)

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

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

253  {
254  $this->start_time = $a_val;
255  }
+ 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 867 of file class.ilExAssignment.php.

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

868  {
869  $this->team_tutor = (bool) $a_value;
870  }
+ Here is the caller graph for this function:

◆ setTitle()

ilExAssignment::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

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

422  {
423  $this->title = $a_val;
424  }
+ 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 482 of file class.ilExAssignment.php.

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

483  {
484  if ($this->isValidType($a_value)) {
485  $this->type = (int) $a_value;
486 
487  $this->ass_type = $this->types->getById($a_value);
488 
489  if ($this->ass_type->usesTeams()) {
490  $this->setPeerReview(false);
491  }
492  }
493  }
setPeerReview($a_value)
Toggle peer review.
isValidType($a_value)
Is given type valid?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )

Update.

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

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

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

1048  {
1049  $ilDB = $this->db;
1050 
1051  $ilDB->update(
1052  "exc_assignment",
1053  array(
1054  "exc_id" => array("integer", $this->getExerciseId()),
1055  "time_stamp" => array("integer", $this->getDeadline()),
1056  "deadline2" => array("integer", $this->getExtendedDeadline()),
1057  "instruction" => array("clob", $this->getInstruction()),
1058  "title" => array("text", $this->getTitle()),
1059  "start_time" => array("integer", $this->getStartTime()),
1060  "order_nr" => array("integer", $this->getOrderNr()),
1061  "mandatory" => array("integer", $this->getMandatory()),
1062  "type" => array("integer", $this->getType()),
1063  "peer" => array("integer", $this->getPeerReview()),
1064  "peer_min" => array("integer", $this->getPeerReviewMin()),
1065  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
1066  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
1067  "peer_valid" => array("integer", $this->getPeerReviewValid()),
1068  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
1069  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
1070  "peer_char" => array("integer", $this->getPeerReviewChars()),
1071  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
1072  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
1073  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
1074  "fb_file" => array("text", $this->getFeedbackFile()),
1075  "fb_date" => array("integer", $this->getFeedbackDate()),
1076  "fb_date_custom" => array("integer", $this->getFeedbackDateCustom()),
1077  "fb_cron" => array("integer", $this->hasFeedbackCron()),
1078  "team_tutor" => array("integer", $this->getTeamTutor()),
1079  "max_file" => array("integer", $this->getMaxFile()),
1080  "portfolio_template" => array("integer", $this->getPortFolioTemplateId()),
1081  "min_char_limit" => array("integer", $this->getMinCharLimit()),
1082  "max_char_limit" => array("integer", $this->getMaxCharLimit()),
1083  "deadline_mode" => array("integer", $this->getDeadlineMode()),
1084  "relative_deadline" => array("integer", $this->getRelativeDeadline())
1085  ),
1086  array(
1087  "id" => array("integer", $this->getId()),
1088  )
1089  );
1090  $exc = new ilObjExercise($this->getExerciseId(), false);
1091  $exc->updateAllUsersStatus();
1092 
1093  $this->handleCalendarEntries("update");
1094  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getId()
Get assignment id.
getMaxCharLimit()
get limit maximum characters return int max limit
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
getDeadlineMode()
Get deadline mode.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
getPeerReviewDeadline()
Get peer review deadline (timestamp)
getFeedbackDateCustom()
Get feedback file availability using custom date.
getMinCharLimit()
Get limit minimum characters.
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
getRelativeDeadline()
Get relative deadline.
+ 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 1623 of file class.ilExAssignment.php.

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1624  {
1625  ilLoggerFactory::getLogger("exc")->debug("upload assignment files files = ", $a_files);
1626  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
1627  $storage = new ilFSWebStorageExercise($this->getExerciseId(), $this->getId());
1628  $storage->create();
1629  $storage->uploadAssignmentFiles($a_files);
1630  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadMultiFeedbackFile()

ilExAssignment::uploadMultiFeedbackFile (   $a_file)

Upload multi feedback file.

Parameters
array
Returns

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

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

1695  {
1696  $lng = $this->lng;
1697  $ilUser = $this->user;
1698 
1699  include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
1700  if (!is_file($a_file["tmp_name"])) {
1701  throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1702  }
1703 
1704  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1705  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1706  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1707  ilUtil::delDir($mfu, true);
1708  ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu . "/" . "multi_feedback.zip");
1709  ilUtil::unzip($mfu . "/multi_feedback.zip", true);
1710  $subdirs = ilUtil::getDir($mfu);
1711  $subdir = "notfound";
1712  foreach ($subdirs as $s => $j) {
1713  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
1714  $subdir = $s;
1715  }
1716  }
1717 
1718  if (!is_dir($mfu . "/" . $subdir)) {
1719  throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1720  }
1721 
1722  return true;
1723  }
getId()
Get assignment id.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
$s
Definition: pwgen.php:45
getExerciseId()
Get exercise id.
$ilUser
Definition: imgupload.php:18
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Exercise exceptions class.
+ Here is the call graph for this function:

Field Documentation

◆ $app_event_handler

ilExAssignment::$app_event_handler
protected

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

Referenced by handleCalendarEntries().

◆ $ass_type

ilExAssignment::$ass_type
protected

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

Referenced by cloneAssignmentsOfExercise(), and getAssignmentType().

◆ $db

◆ $deadline

ilExAssignment::$deadline
protected

◆ $deadline2

ilExAssignment::$deadline2
protected

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

Referenced by getExtendedDeadline().

◆ $deadline_mode

ilExAssignment::$deadline_mode = 0
protected

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

Referenced by getDeadlineMode().

◆ $exc_id

ilExAssignment::$exc_id
protected

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

Referenced by getExerciseId().

◆ $feedback_cron

ilExAssignment::$feedback_cron
protected

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

Referenced by hasFeedbackCron().

◆ $feedback_date

ilExAssignment::$feedback_date
protected

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

Referenced by getFeedbackDate().

◆ $feedback_date_custom

ilExAssignment::$feedback_date_custom
protected

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

Referenced by getFeedbackDateCustom().

◆ $feedback_file

ilExAssignment::$feedback_file
protected

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

Referenced by getFeedbackFile().

◆ $id

ilExAssignment::$id
protected

◆ $instruction

ilExAssignment::$instruction
protected

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

Referenced by getInstruction().

◆ $lng

ilExAssignment::$lng
protected

◆ $log

ilExAssignment::$log
protected

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

◆ $mandatory

ilExAssignment::$mandatory
protected

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

Referenced by getMandatory().

◆ $max_char_limit

ilExAssignment::$max_char_limit
protected

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

Referenced by getMaxCharLimit().

◆ $max_file

ilExAssignment::$max_file
protected

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

Referenced by getMaxFile().

◆ $member_status

ilExAssignment::$member_status = array()
protected

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

Referenced by saveMultiFeedbackFiles().

◆ $min_char_limit

ilExAssignment::$min_char_limit
protected

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

Referenced by getMinCharLimit().

◆ $order_nr

ilExAssignment::$order_nr
protected

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

Referenced by fixInstructionFileOrdering(), and getOrderNr().

◆ $peer

ilExAssignment::$peer
protected

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

Referenced by getPeerReview().

◆ $peer_char

ilExAssignment::$peer_char
protected

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

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

ilExAssignment::$peer_crit_cat
protected

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

◆ $peer_dl

ilExAssignment::$peer_dl
protected

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

Referenced by getPeerReviewDeadline().

◆ $peer_file

ilExAssignment::$peer_file
protected

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

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

ilExAssignment::$peer_min
protected

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

Referenced by getPeerReviewMin().

◆ $peer_personal

ilExAssignment::$peer_personal
protected

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

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

ilExAssignment::$peer_rating
protected

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

Referenced by hasPeerReviewRating().

◆ $peer_text

ilExAssignment::$peer_text
protected

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

Referenced by hasPeerReviewText().

◆ $peer_unlock

ilExAssignment::$peer_unlock
protected

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

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

ilExAssignment::$peer_valid
protected

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

Referenced by getPeerReviewValid().

◆ $portfolio_template

ilExAssignment::$portfolio_template
protected

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

Referenced by getPortfolioTemplateId().

◆ $relative_deadline

ilExAssignment::$relative_deadline = 0
protected

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

Referenced by getRelativeDeadline().

◆ $start_time

ilExAssignment::$start_time
protected

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

Referenced by getStartTime().

◆ $starting_timestamp

ilExAssignment::$starting_timestamp = null
protected

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

◆ $team_tutor

ilExAssignment::$team_tutor = false
protected

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

Referenced by getTeamTutor().

◆ $title

ilExAssignment::$title
protected

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

Referenced by getTitle().

◆ $type

ilExAssignment::$type
protected

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

Referenced by getCalculatedDeadlines(), and getType().

◆ $types

ilExAssignment::$types = null
protected

Definition at line 107 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 66 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: