ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

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

Static Private Member Functions

static lookup (int $a_id, string $a_field)
 

Detailed Description

Exercise assignment.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

Exceptions
ilExcUnknownAssignmentTypeException

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

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

115  {
116  global $DIC;
117 
118  $this->domain = $DIC->exercise()->internal()->domain();
119  $this->db = $DIC->database();
120  $this->lng = $DIC->language();
121  $this->user = $DIC->user();
122  $this->app_event_handler = $DIC["ilAppEventHandler"];
123  $this->types = ilExAssignmentTypes::getInstance();
124  $this->access = $DIC->access();
125  $this->domain = $DIC->exercise()->internal()->domain();
126 
127  $this->setType(self::TYPE_UPLOAD);
128  $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
129 
130  $this->log = ilLoggerFactory::getLogger("exc");
131 
132  if ($a_id > 0) {
133  $this->setId($a_id);
134  $this->read();
135  }
136  $this->string_transform = $DIC->refinery()
137  ->string();
138  }
static getLogger(string $a_component_id)
Get component logger.
setType(int $a_value)
Set type this will most probably become an non public function in the future (or become obsolete) ...
global $DIC
Definition: shib_login.php:22
setFeedbackDate(int $a_value)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterCustomDate()

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

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

References getFeedbackDateCustom().

1564  : bool
1565  {
1566  $date_custom = $this->getFeedbackDateCustom();
1567  //if the solution will be displayed only after reach all the deadlines.
1568  //$final_deadline = $this->afterDeadlineStrict();
1569  //$dl = max($final_deadline, time());
1570  //return ($date_custom - $dl <= 0);
1571  return ($date_custom - time() <= 0);
1572  }
+ Here is the call graph for this function:

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

References $user, and getPersonalDeadline().

Referenced by afterDeadlineStrict().

1526  : bool
1527  {
1528  $ilUser = $this->user;
1529 
1530  // :TODO: always current user?
1531  $idl = $this->getPersonalDeadline($ilUser->getId()); // official deadline
1532 
1533  // no deadline === true
1534  $deadline = max($this->deadline, $this->deadline2, $idl); // includes grace period
1535  return ($deadline - time() <= 0);
1536  }
getPersonalDeadline(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict ( bool  $a_include_personal = true)

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

References afterDeadline(), getLastPersonalDeadline(), and null.

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

1538  : bool
1539  {
1540  // :TODO: this means that peer feedback, global feedback is available
1541  // after LAST personal deadline
1542  // team management is currently ignoring personal deadlines
1543  $idl = $a_include_personal
1544  ? $this->getLastPersonalDeadline()
1545  : null;
1546 
1547  // no deadline === false
1548  $deadline = max($this->deadline, $this->deadline2, $idl);
1549 
1550  // #18271 - afterDeadline() does not handle last personal deadline
1551  // after effective deadline of all users
1552  if ($idl && $deadline == $idl) {
1553  return ($deadline - time() <= 0);
1554  }
1555 
1556  // like: after effective deadline (for single user), except: no deadline false
1557  return ($deadline > 0 &&
1558  $this->afterDeadline());
1559  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

References afterDeadlineStrict().

1575  : bool
1576  {
1577  // no deadline === true
1578  return !$this->afterDeadlineStrict();
1579  }
afterDeadlineStrict(bool $a_include_personal=true)
+ Here is the call graph for this function:

◆ canParticipantReceiveFeedback()

ilExAssignment::canParticipantReceiveFeedback ( int  $part_id)

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

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

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

1961  : bool
1962  {
1963  if ($this->hasTeam()) {
1964  if (!ilExAssignmentTeam::getTeamId($this->getId(), $part_id)) {
1965  return false;
1966  }
1967  }
1968  return true;
1969  }
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

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

Clone assignments of exercise.

Exceptions
DirectoryNotFoundException
FileNotFoundException
IOException
ilExcUnknownAssignmentTypeException|ilDateTimeException

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

References Vendor\Package\$d, $DIC, ilExAssignmentTypeInterface\cloneSpecificProperties(), ilExAssignmentReminder\FEEDBACK_REMINDER, ilExAssignmentReminder\GRADE_REMINDER, ilExAssignmentReminder\setReminderStatus(), and ilExAssignmentReminder\SUBMIT_REMINDER.

Referenced by ilObjExercise\saveData().

945  : void {
946  global $DIC;
947 
948  $ass_domain = $DIC->exercise()->internal()->domain()->assignment();
949  $ass_data = self::getInstancesByExercise($a_old_exc_id);
950  foreach ($ass_data as $d) {
951  // clone assignment
952  $new_ass = new ilExAssignment();
953  $new_ass->setExerciseId($a_new_exc_id);
954  $new_ass->setTitle($d->getTitle());
955  $new_ass->setDeadline($d->getDeadline());
956  $new_ass->setExtendedDeadline($d->getExtendedDeadline());
957  $new_ass->setInstruction($d->getInstruction());
958  $new_ass->setMandatory($d->getMandatory());
959  $new_ass->setOrderNr($d->getOrderNr());
960  $new_ass->setStartTime($d->getStartTime());
961  $new_ass->setType($d->getType());
962  $new_ass->setPeerReview($d->getPeerReview());
963  $new_ass->setPeerReviewMin($d->getPeerReviewMin());
964  $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
965  $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
966  $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
967  $new_ass->setPeerReviewValid($d->getPeerReviewValid());
968  $new_ass->setPeerReviewChars($d->getPeerReviewChars());
969  $new_ass->setPeerReviewText($d->hasPeerReviewText());
970  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
971  $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
972  $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
973  $new_ass->setFeedbackFile($d->getFeedbackFile());
974  $new_ass->setFeedbackDate($d->getFeedbackDate());
975  $new_ass->setFeedbackDateCustom($d->getFeedbackDateCustom());
976  $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
977  $new_ass->setTeamTutor($d->getTeamTutor());
978  $new_ass->setMaxFile($d->getMaxFile());
979  $new_ass->setMinCharLimit($d->getMinCharLimit());
980  $new_ass->setMaxCharLimit($d->getMaxCharLimit());
981  $new_ass->setPortfolioTemplateId($d->getPortfolioTemplateId());
982  $new_ass->setDeadlineMode($d->getDeadlineMode());
983  $new_ass->setRelativeDeadline($d->getRelativeDeadline());
984  $new_ass->setRelDeadlineLastSubmission($d->getRelDeadlineLastSubmission());
985 
986  // criteria catalogue(s)
987  if ($d->getPeerReviewCriteriaCatalogue() &&
988  array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map)) {
989  $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
990  }
991 
992  $new_ass->save();
993 
994  // clone assignment files
995  $ass_domain->instructionFiles($d->getId())->cloneTo($new_ass->getId());
996 
997  // clone global feedback file
998  $ass_domain->sampleSolution($d->getId())->cloneTo($new_ass->getId());
999 
1000  // clone reminders
1004  $rmd_sub = new ilExAssignmentReminder($a_old_exc_id, $d->getId(), $rem_type);
1005  if ($rmd_sub->getReminderStatus()) {
1006  $new_rmd_sub = new ilExAssignmentReminder($a_new_exc_id, $new_ass->getId(), $rem_type);
1007  $new_rmd_sub->setReminderStatus($rmd_sub->getReminderStatus());
1008  $new_rmd_sub->setReminderStart($rmd_sub->getReminderStart());
1009  $new_rmd_sub->setReminderEnd($rmd_sub->getReminderEnd());
1010  $new_rmd_sub->setReminderFrequency($rmd_sub->getReminderFrequency());
1011  $new_rmd_sub->setReminderMailTemplate($rmd_sub->getReminderMailTemplate());
1012  $new_rmd_sub->save();
1013  }
1014  }
1015 
1016 
1017  // type specific properties
1018  $ass_type = $d->getAssignmentType();
1019  $ass_type->cloneSpecificProperties($d, $new_ass);
1020  }
1021  }
Exercise assignment.
cloneSpecificProperties(ilExAssignment $source, ilExAssignment $target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
ilExAssignmentTypeInterface $ass_type
setReminderStatus(?bool $a_status)
Set reminder for users without submission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ count()

static ilExAssignment::count ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by ILIAS\Exercise\Settings\SettingsGUI\getEditForm(), ilObjExerciseGUI\listAssignmentsObject(), and sendFeedbackNotifications().

1179  : int
1180  {
1181  global $DIC;
1182 
1183  $ilDB = $DIC->database();
1184 
1185  $set = $ilDB->query(
1186  "SELECT count(*) cntm FROM exc_assignment " .
1187  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer")
1188  );
1189  $rec = $ilDB->fetchAssoc($set);
1190  return $rec["cntm"];
1191  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ countMandatory()

static ilExAssignment::countMandatory ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by ILIAS\Exercise\Settings\SettingsGUI\getEditForm(), and ilObjExerciseGUI\listAssignmentsObject().

1163  : int
1164  {
1165  global $DIC;
1166 
1167  $ilDB = $DIC->database();
1168 
1169  $set = $ilDB->query(
1170  "SELECT count(*) cntm FROM exc_assignment " .
1171  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1172  " AND mandatory = " . $ilDB->quote(1, "integer")
1173  );
1174  $rec = $ilDB->fetchAssoc($set);
1175  return (int) $rec["cntm"];
1176  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

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

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

References $DIC, and $ilDB.

1343  : void {
1344  global $DIC;
1345 
1346  $ilDB = $DIC->database();
1347  $ass_domain = $DIC->exercise()->internal()->domain()->assignment();
1348 
1349  $exmem = new ilExerciseMembers($a_exc);
1350  $mems = $exmem->getMembers();
1351 
1352  foreach ($mems as $mem) {
1353  $ilDB->replace("exc_mem_ass_status", array(
1354  "ass_id" => array("integer", $a_ass_id),
1355  "usr_id" => array("integer", $mem)
1356  ), array(
1357  "status" => array("text", "notgraded")
1358  ));
1359  if (!$ass_domain->tutorFeedbackFile($a_ass_id)->hasCollection($mem)) {
1360  $ass_domain->tutorFeedbackFile($a_ass_id)->createCollection($mem);
1361  }
1362  }
1363  }
global $DIC
Definition: shib_login.php:22

◆ createNewUserRecords()

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

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

References $DIC, and $ilDB.

Referenced by ilExerciseMembers\assignMember().

1318  : void {
1319  global $DIC;
1320 
1321  $ilDB = $DIC->database();
1322  $ass_domain = $DIC->exercise()->internal()->domain()->assignment();
1323 
1324  $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1325  foreach ($ass_data as $ass) {
1326  //echo "-".$ass["id"]."-".$a_user_id."-";
1327  $ilDB->replace("exc_mem_ass_status", array(
1328  "ass_id" => array("integer", $ass["id"]),
1329  "usr_id" => array("integer", $a_user_id)
1330  ), array(
1331  "status" => array("text", "notgraded")
1332  ));
1333  if (!$ass_domain->tutorFeedbackFile((int) $ass["id"])->hasCollection($a_user_id)) {
1334  $ass_domain->tutorFeedbackFile((int) $ass["id"])->createCollection($a_user_id);
1335  }
1336  }
1337  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ delete()

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

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

References $db, $ilDB, ilExcIndividualDeadline\deleteForAssignment(), getId(), getPeerReview(), handleCalendarEntries(), and ilObjExercise\updateAllUsersStatus().

832  : void {
833  $ilDB = $this->db;
834 
835  // delete submissions
836  $exc_members = new ilExerciseMembers($exc);
837  foreach ($exc_members->getMembers() as $mem) {
838  $submission = new ilExSubmission($this, $mem);
839  $submission->deleteAllFiles();
840  }
841 
842  $ilDB->manipulateF(
843  "DELETE FROM exc_usr_tutor " .
844  "WHERE ass_id = %s",
845  array("integer"),
846  array($this->getId())
847  );
848 
849  // remove peer review data
850  if ($this->getPeerReview()) {
851  $peer_review = new ilExPeerReview($this);
852  $peer_review->resetPeerReviews();
853  }
854 
855  $ilDB->manipulate(
856  "DELETE FROM exc_ass_file_order" .
857  " WHERE assignment_id = " . $ilDB->quote($this->getId(), 'integer')
858  );
859 
860  $ilDB->manipulate(
861  "DELETE FROM exc_mem_ass_status" .
862  " WHERE ass_id = " . $ilDB->quote($this->getId(), 'integer')
863  );
864 
865  $ilDB->manipulate(
866  "DELETE FROM exc_assignment WHERE " .
867  " id = " . $ilDB->quote($this->getId(), "integer")
868  );
869 
870  if ($update_user_status) {
871  $exc->updateAllUsersStatus();
872  }
873 
874  $this->handleCalendarEntries("delete", $exc);
875 
877 
878  $reminder = new ilExAssignmentReminder();
879  $reminder->deleteReminders($this->getId());
880 
881  // delete teams
882  $this->domain->team()->deleteTeamsOfAssignment($this->getId());
883 
884  // delete resource collections and resources
885  $this->domain->assignment()->instructionFiles($this->getId())
886  ->deleteCollection();
887  }
updateAllUsersStatus()
Update status of all users.
Exercise peer review.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handleCalendarEntries(string $a_event, ilObjExercise $exc)
Handle calendar entries for deadline(s)
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ fileAddOrder()

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

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

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

1876  : array {
1877  $this->fixInstructionFileOrdering();
1878 
1879  $order = $this->getInstructionFilesOrder();
1880  foreach ($a_entries as $k => $e) {
1881  $a_entries[$k]["order_val"] = $order[$e["file"]]["order_nr"] ?? 0;
1882  $a_entries[$k]["order_id"] = $order[$e["file"]]["id"] ?? "";
1883  }
1884 
1885  return $a_entries;
1886  }
+ Here is the call graph for this function:

◆ fixInstructionFileOrdering()

ilExAssignment::fixInstructionFileOrdering ( )

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

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

Referenced by fileAddOrder().

1835  : void
1836  {
1837  $db = $this->db;
1838 
1839  $files = array_map(function ($v) {
1840  return $v["name"];
1841  }, $this->getFiles());
1842 
1843  $set = $db->query("SELECT * FROM exc_ass_file_order " .
1844  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
1845  " ORDER BY order_nr");
1846  $order_nr = 10;
1847  $numbered_files = array();
1848  while ($rec = $db->fetchAssoc($set)) {
1849  // file exists, set correct order nr
1850  if (in_array($rec["filename"], $files)) {
1851  $db->manipulate(
1852  "UPDATE exc_ass_file_order SET " .
1853  " order_nr = " . $db->quote($order_nr, "integer") .
1854  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
1855  " AND id = " . $db->quote($rec["id"], "integer")
1856  );
1857  $order_nr += 10;
1858  $numbered_files[] = $rec["filename"];
1859  } else { // file does not exist, delete entry
1860  $db->manipulate(
1861  "DELETE FROM exc_ass_file_order " .
1862  " WHERE assignment_id = " . $db->quote($this->getId(), "integer") .
1863  " AND id = " . $db->quote($rec["id"], "integer")
1864  );
1865  }
1866  }
1867  foreach ($files as $f) {
1868  if (!in_array($f, $numbered_files)) {
1869  self::instructionFileInsertOrder($f, $this->getId());
1870  }
1871  }
1872  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise ( int  $a_exc_id)
static

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

References $data, $DIC, and $ilDB.

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

891  : array
892  {
893  global $DIC;
894 
895  $ilDB = $DIC->database();
896 
897  // should be changed to self::getInstancesByExerciseId()
898 
899  $set = $ilDB->query("SELECT * FROM exc_assignment " .
900  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer") .
901  " ORDER BY order_nr");
902  $data = array();
903 
904  $order_val = 10;
905  while ($rec = $ilDB->fetchAssoc($set)) {
906  $data[] = array(
907  "id" => (int) $rec["id"],
908  "exc_id" => (int) $rec["exc_id"],
909  "deadline" => (int) $rec["time_stamp"],
910  "deadline2" => (int) $rec["deadline2"],
911  "instruction" => (string) $rec["instruction"],
912  "title" => (string) $rec["title"],
913  "start_time" => (int) $rec["start_time"],
914  "order_val" => $order_val,
915  "mandatory" => (bool) $rec["mandatory"],
916  "type" => (int) $rec["type"],
917  "peer" => (bool) $rec["peer"],
918  "peer_min" => (int) $rec["peer_min"],
919  "peer_dl" => (int) $rec["peer_dl"],
920  "peer_file" => (bool) $rec["peer_file"],
921  "peer_prsl" => (bool) $rec["peer_prsl"],
922  "fb_file" => (string) $rec["fb_file"],
923  "fb_date" => (int) $rec["fb_date"],
924  "fb_cron" => (bool) $rec["fb_cron"],
925  "deadline_mode" => (int) $rec["deadline_mode"],
926  "relative_deadline" => (int) $rec["relative_deadline"],
927  "rel_deadline_last_subm" => (int) $rec["rel_deadline_last_subm"]
928  );
929  $order_val += 10;
930  }
931  return $data;
932  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getAssignmentType()

ilExAssignment::getAssignmentType ( )

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

References $ass_type.

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

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

◆ getCalculatedDeadlines()

ilExAssignment::getCalculatedDeadlines ( )

Get calculated deadlines for user/team members.

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

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

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

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

1939  : array
1940  {
1941  $calculated_deadlines = array(
1942  "user" => array(),
1943  "team" => array()
1944  );
1945 
1946  if ($this->getRelativeDeadline() && $this->getDeadlineMode() == self::DEADLINE_RELATIVE) {
1947  foreach (ilExcIndividualDeadline::getStartingTimestamps($this->getId()) as $ts) {
1948  $type = $ts["is_team"]
1949  ? "team"
1950  : "user";
1951 
1952  $calculated_deadlines[$type][$ts["member_id"]] = array(
1953  "calculated_deadline" => $ts["starting_ts"] + ($this->getRelativeDeadline() * 24 * 60 * 60)
1954  );
1955  }
1956  }
1957  return $calculated_deadlines;
1958  }
static getStartingTimestamps(int $a_ass_id)
Get starting timestamp data for an assignment.
+ Here is the call graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

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

References $deadline.

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

241  : ?int
242  {
243  return $this->deadline;
244  }
+ Here is the caller graph for this function:

◆ getDeadlineMode()

ilExAssignment::getDeadlineMode ( )

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

References $deadline_mode.

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

255  : int
256  {
257  return $this->deadline_mode;
258  }
+ Here is the caller graph for this function:

◆ getExerciseId()

ilExAssignment::getExerciseId ( )

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

References $exc_id.

Referenced by ilFeedbackConfirmationTable2GUI\__construct(), ilExAssTypeWikiTeam\handleNewUpload(), save(), and update().

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

◆ getExerciseMemberAssignmentData()

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

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

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

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

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

1281  : ?array {
1282  global $DIC;
1283  $ilDB = $DIC->database();
1284 
1285  $and_grade = "";
1286  if (in_array($a_grade, array("notgraded", "passed", "failed"))) {
1287  $and_grade = " AND status = " . $ilDB->quote($a_grade, "text");
1288  }
1289 
1290  $q = "SELECT * FROM exc_mem_ass_status " .
1291  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1292  " AND usr_id = " . $ilDB->quote($a_user_id, "integer") .
1293  $and_grade;
1294 
1295  $set = $ilDB->query($q);
1296 
1297  $data = null;
1298  while ($rec = $ilDB->fetchAssoc($set)) {
1299  $sub = new ilExSubmission($this, $a_user_id);
1300 
1301  $data["sent_time"] = $rec["sent_time"];
1302  $data["submission"] = $sub->getLastSubmission();
1303  $data["status_time"] = $rec["status_time"];
1304  $data["feedback_time"] = $rec["feedback_time"];
1305  $data["notice"] = $rec["notice"];
1306  $data["status"] = $rec["status"];
1307  $data["mark"] = $rec["mark"];
1308  $data["comment"] = $rec["u_comment"];
1309  }
1310 
1311  return $data;
1312  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

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

References $deadline2.

Referenced by ILIAS\Exercise\Submission\SubmissionManager\recalculateLateSubmissions(), save(), and update().

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

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

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

References $feedback_date.

Referenced by save(), and update().

599  : int
600  {
601  return $this->feedback_date;
602  }
+ Here is the caller graph for this function:

◆ getFeedbackDateCustom()

ilExAssignment::getFeedbackDateCustom ( )

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

References $feedback_date_custom.

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

613  : int
614  {
616  }
+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

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

References $feedback_file.

Referenced by save(), and update().

575  : ?string
576  {
577  return $this->feedback_file;
578  }
+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

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

References getId().

Referenced by ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI\buildFiles(), and fixInstructionFileOrdering().

1023  : array
1024  {
1025  return $this->domain->assignment()->instructionFiles($this->getId())->getFiles();
1026  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

References $db, $ilDB, and $res.

Referenced by getMemberListData().

1634  : array
1635  {
1636  $ilDB = $this->db;
1637 
1638  $res = array();
1639 
1640  $set = $ilDB->query("SELECT * FROM exc_idl" .
1641  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
1642  while ($row = $ilDB->fetchAssoc($set)) {
1643  if ($row["is_team"]) {
1644  $row["member_id"] = "t" . $row["member_id"];
1645  }
1646 
1647  $res[$row["member_id"]] = $row["tstamp"];
1648  }
1649 
1650  return $res;
1651  }
$res
Definition: ltiservices.php:66
+ Here is the caller graph for this function:

◆ getInstancesByExercise()

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

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

References $data, $DIC, and $ilDB.

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

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

◆ getInstruction()

ilExAssignment::getInstruction ( )

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

References $instruction.

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

334  : string
335  {
336  return $this->instruction;
337  }
+ Here is the caller graph for this function:

◆ getInstructionFilesOrder()

ilExAssignment::getInstructionFilesOrder ( )

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

References $data, $db, and $ilDB.

Referenced by fileAddOrder().

1028  : array
1029  {
1030  // TODO IRSS: currently the ilResourceCollectionGUI does not support the order of files done by the component,
1031  // this should be implemented as well there and will follow.
1032  $ilDB = $this->db;
1033 
1034  $set = $ilDB->query(
1035  "SELECT filename, order_nr, id FROM exc_ass_file_order " .
1036  " WHERE assignment_id = " . $ilDB->quote($this->getId(), "integer")
1037  );
1038 
1039  $data = array();
1040  while ($rec = $ilDB->fetchAssoc($set)) {
1041  $data[$rec['filename']] = $rec;
1042  }
1043 
1044  return $data;
1045  }
+ Here is the caller graph for this function:

◆ getInstructionPresentation()

ilExAssignment::getInstructionPresentation ( )

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

References getInstruction().

339  : string
340  {
341  $inst = $this->getInstruction();
342  if (trim($inst)) {
343  $is_html = (strlen($inst) != strlen(strip_tags($inst)));
344  if (!$is_html) {
345  $inst = nl2br(
346  $this->string_transform->makeClickable()->transform($inst)
347  );
348  }
349  }
350  return $inst;
351  }
+ Here is the call graph for this function:

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )

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

References $db, and $ilDB.

Referenced by afterDeadlineStrict().

308  : int
309  {
310  $ilDB = $this->db;
311 
312  $set = $ilDB->query("SELECT MAX(tstamp) FROM exc_idl" .
313  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer"));
314  $row = $ilDB->fetchAssoc($set);
315  return $row["tstamp"] ?? 0;
316  }
+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

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

References $mandatory.

Referenced by save(), and update().

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

◆ getMaxCharLimit()

ilExAssignment::getMaxCharLimit ( )

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

References $max_char_limit.

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

1926  : int
1927  {
1928  return $this->max_char_limit;
1929  }
+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

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

References $max_file.

Referenced by save(), and update().

635  : ?int
636  {
637  return $this->max_file;
638  }
+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

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

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

1211  : array
1212  {
1213  $ilDB = $this->db;
1214 
1215  $mem = array();
1216 
1217  // first get list of members from member table
1218  $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login" .
1219  " FROM exc_members excm" .
1220  " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)" .
1221  " WHERE excm.obj_id = " . $ilDB->quote($this->getExerciseId(), "integer"));
1222  while ($rec = $ilDB->fetchAssoc($set)) {
1223  $mem[$rec["usr_id"]] =
1224  array(
1225  "name" => $rec["lastname"] . ", " . $rec["firstname"],
1226  "login" => $rec["login"],
1227  "usr_id" => $rec["usr_id"],
1228  "lastname" => $rec["lastname"],
1229  "firstname" => $rec["firstname"]
1230  );
1231  }
1232 
1233  // users in idl may already exist before occuring in the members db table
1234  // if user starts an assignment with relative deadline
1235  $idl = $this->getIndividualDeadlines();
1236  if (!$this->ass_type->usesTeams()) {
1237  foreach ($idl as $user_id => $v) {
1238  if (!isset($mem[$user_id])) {
1239  if (ilObjUser::_exists((int) $user_id)) {
1240  $name = ilObjUser::_lookupName($user_id);
1241  $mem[$user_id] =
1242  array(
1243  "name" => $name["lastname"] . ", " . $name["firstname"],
1244  "login" => $name["login"],
1245  "usr_id" => $user_id,
1246  "lastname" => $name["lastname"],
1247  "firstname" => $name["firstname"]
1248  );
1249  }
1250  }
1251  }
1252  }
1253 
1254  $q = "SELECT * FROM exc_mem_ass_status " .
1255  "WHERE ass_id = " . $ilDB->quote($this->getId(), "integer");
1256  $set = $ilDB->query($q);
1257  while ($rec = $ilDB->fetchAssoc($set)) {
1258  if (isset($mem[$rec["usr_id"]])) {
1259  $sub = new ilExSubmission($this, $rec["usr_id"]);
1260 
1261  $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1262  $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1263  $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1264  $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1265  $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1266  $mem[$rec["usr_id"]]["status"] = $rec["status"];
1267  $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1268  $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1269  }
1270  }
1271  return $mem;
1272  }
static _lookupName(int $a_user_id)
lookup user name
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
$q
Definition: shib_logout.php:21
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ getMemberStatus()

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

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

References $user, getId(), and ilObject\getId().

Referenced by ilObjExercise\processExerciseStatus(), and ilObjExercise\update().

1603  {
1604  $ilUser = $this->user;
1605 
1606  if (!$a_user_id) {
1607  $a_user_id = $ilUser->getId();
1608  }
1609  if (!array_key_exists($a_user_id, $this->member_status)) {
1610  $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
1611  }
1612  return $this->member_status[$a_user_id];
1613  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinCharLimit()

ilExAssignment::getMinCharLimit ( )

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

References $min_char_limit.

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

1915  : int
1916  {
1917  return $this->min_char_limit;
1918  }
+ Here is the caller graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

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

References $order_nr.

Referenced by save(), and update().

378  : int
379  {
380  return $this->order_nr;
381  }
+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

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

References $peer.

Referenced by ilExPeerReviewGUI\buildSubmissionPropertiesAndActions(), delete(), ILIAS\Exercise\PeerReview\DomainService\exPeerReview(), handleCalendarEntries(), hasReadOnlyIDl(), save(), and update().

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

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

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

References $peer_char.

Referenced by save(), and update().

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

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

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

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

Referenced by save(), and update().

537  : ?int
538  {
539  return $this->crit_cat;
540  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

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

References $peer_dl.

Referenced by ilExPeerReviewGUI\buildSubmissionPropertiesAndActions(), handleCalendarEntries(), save(), and update().

459  : int
460  {
461  return $this->peer_dl;
462  }
+ Here is the caller graph for this function:

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

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

References $peer_min.

Referenced by save(), and update().

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

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

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

References $peer_unlock.

Referenced by save(), and update().

446  : int
447  {
448  return $this->peer_unlock;
449  }
+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

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

References $peer_valid.

Referenced by save(), and update().

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

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

References $DIC, $ilDB, $res, ilLogger\debug(), and ilLoggerFactory\getLogger().

Referenced by ilExcCronFeedbackNotification\run().

1421  : array
1422  {
1423  global $DIC;
1424 
1426  $log->debug("Get feedback notifications.");
1427 
1428  $ilDB = $DIC->database();
1429 
1430  $res = array();
1431 
1432  $set = $ilDB->query("SELECT id,fb_file,time_stamp,deadline2,fb_date FROM exc_assignment" .
1433  " WHERE fb_cron = " . $ilDB->quote(1, "integer") .
1434  " AND (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer") .
1435  " AND time_stamp IS NOT NULL" .
1436  " AND time_stamp > " . $ilDB->quote(0, "integer") .
1437  " AND time_stamp < " . $ilDB->quote(time(), "integer") .
1438  " AND fb_cron_done = " . $ilDB->quote(0, "integer") .
1439  ") OR (fb_date = " . $ilDB->quote(self::FEEDBACK_DATE_CUSTOM, "integer") .
1440  " AND fb_date_custom IS NOT NULL" .
1441  " AND fb_date_custom > " . $ilDB->quote(0, "integer") .
1442  " AND fb_date_custom < " . $ilDB->quote(time(), "integer") .
1443  " AND fb_cron_done = " . $ilDB->quote(0, "integer") . ")");
1444 
1445 
1446 
1447  while ($row = $ilDB->fetchAssoc($set)) {
1448  $log->debug("check assignment " . $row['id'] . ", fb_file " . $row["fb_file"]);
1449  if ($row['fb_date'] == self::FEEDBACK_DATE_DEADLINE) {
1450  $max = max($row['time_stamp'], $row['deadline2']);
1451  if (trim($row["fb_file"]) && $max <= time()) {
1452  $log->debug("...adding(1)");
1453  $res[] = $row["id"];
1454  }
1455  } elseif ($row['fb_date'] == self::FEEDBACK_DATE_CUSTOM) {
1456  if (trim($row["fb_file"] ?? "") && ($row['fb_date_custom'] ?? 0) <= time()) {
1457  $log->debug("...adding(2)");
1458  $res[] = $row["id"];
1459  }
1460  }
1461  }
1462 
1463  return $res;
1464  }
$res
Definition: ltiservices.php:66
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: shib_login.php:22
debug(string $message, array $context=[])
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalDeadline()

ilExAssignment::getPersonalDeadline ( int  $a_user_id)

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

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

Referenced by afterDeadline().

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

◆ getPortfolioTemplateId()

ilExAssignment::getPortfolioTemplateId ( )

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

References $portfolio_template.

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

646  : int
647  {
649  }
+ Here is the caller graph for this function:

◆ getRelativeDeadline()

ilExAssignment::getRelativeDeadline ( )

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

References $relative_deadline.

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

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

◆ getRelDeadlineLastSubmission()

ilExAssignment::getRelDeadlineLastSubmission ( )

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

References $rel_deadline_last_subm.

Referenced by save(), and update().

275  : int
276  {
278  }
+ Here is the caller graph for this function:

◆ getRequestedDeadlines()

ilExAssignment::getRequestedDeadlines ( )

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

References $db, $ilDB, and $res.

1653  : array
1654  {
1655  $ilDB = $this->db;
1656 
1657  $res = array();
1658 
1659  $set = $ilDB->query("SELECT * FROM exc_idl" .
1660  " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") .
1661  " AND requested = " . $ilDB->quote(1, "integer"));
1662  while ($row = $ilDB->fetchAssoc($set)) {
1663  if ($row["is_team"]) {
1664  $row["member_id"] = "t" . $row["member_id"];
1665  }
1666 
1667  $res[$row["member_id"]] = $row["requested"];
1668  }
1669 
1670  return $res;
1671  }
$res
Definition: ltiservices.php:66

◆ getStartTime()

ilExAssignment::getStartTime ( )

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

References $start_time.

Referenced by save(), and update().

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

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

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

References $team_tutor.

Referenced by save(), and update().

624  : bool
625  {
626  return $this->team_tutor;
627  }
+ Here is the caller graph for this function:

◆ getTitle()

ilExAssignment::getTitle ( )

◆ getType()

ilExAssignment::getType ( )

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

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

References $type.

Referenced by ilExerciseSubmissionTableGUI\parseColumns(), save(), and update().

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

◆ handleCalendarEntries()

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

Handle calendar entries for deadline(s)

Exceptions
ilDateTimeException

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

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

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

1373  : void {
1374  $ilAppEventHandler = $this->app_event_handler;
1375 
1376  $dl_id = $this->getId() . "0";
1377  $fbdl_id = $this->getId() . "1";
1378 
1379  $context_ids = array($dl_id, $fbdl_id);
1380  $apps = array();
1381 
1382  if ($a_event != "delete") {
1383  // deadline or relative deadline given
1384  if ($this->getDeadline() || $this->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
1385  $app = new ilCalendarAppointmentTemplate($dl_id);
1386  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1387  $app->setSubtitle("cal_exc_deadline");
1388  $app->setTitle($this->getTitle());
1389  $app->setFullday(false);
1390  // note: in the case of a relative deadline this will be set to 0 / 1970...)
1391  // see ilCalendarScheduleFilterExercise for appointment modification
1392  $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1393 
1394  $apps[] = $app;
1395  }
1396 
1397  if ($this->getPeerReview() &&
1398  $this->getPeerReviewDeadline()) {
1399  $app = new ilCalendarAppointmentTemplate($fbdl_id);
1400  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1401  $app->setSubtitle("cal_exc_peer_review_deadline");
1402  $app->setTitle($this->getTitle());
1403  $app->setFullday(false);
1404  $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1405 
1406  $apps[] = $app;
1407  }
1408  }
1409 
1410  $ilAppEventHandler->raise(
1411  'components/ILIAS/Exercise',
1412  $a_event . 'Assignment',
1413  array(
1414  'object' => $exc,
1415  'obj_id' => $exc->getId(),
1416  'context_ids' => $context_ids,
1417  'appointments' => $apps)
1418  );
1419  }
ilAppEventHandler $app_event_handler
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( int  $ass_id,
array  $a_file 
)
Exceptions
ilException

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

References setFeedbackFile().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1594  : bool
1595  {
1596  $rcid = $this->domain->assignment()->sampleSolution($ass_id)->importFromLegacyUpload($a_file);
1597  $this->setFeedbackFile($a_file["name"]);
1598  return ($rcid !== "");
1599  }
setFeedbackFile(?string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

References getDeadline(), and getDeadlineMode().

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

1673  : bool
1674  {
1675  return (bool) ($this->getDeadline() || $this->getDeadlineMode() === self::DEADLINE_ABSOLUTE_INDIVIDUAL);
1676  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

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

References $feedback_cron.

Referenced by save(), and update().

588  : bool
589  {
590  return $this->feedback_cron;
591  }
+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

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

References $peer_file.

Referenced by save(), and update().

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

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

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

References $peer_personal.

Referenced by ilExPeerReviewGUI\getPeerReviewReceiverPanel(), save(), and update().

514  : bool
515  {
516  return $this->peer_personal;
517  }
+ Here is the caller graph for this function:

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

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

References $peer_rating.

Referenced by save(), and update().

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

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

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

References $peer_text.

Referenced by save(), and update().

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

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

References getPeerReview().

Referenced by ilExerciseSubmissionTableGUI\parseColumns().

1678  : bool
1679  {
1680  if (!$this->ass_type->usesTeams() &&
1681  $this->getPeerReview()) {
1682  // all deadlines are read-only if we have peer feedback
1683  $peer_review = new ilExPeerReview($this);
1684  if ($peer_review->hasPeerReviewGroups()) {
1685  return true;
1686  }
1687  }
1688 
1689  return false;
1690  }
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 201 of file class.ilExAssignment.php.

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

201  : bool
202  {
203  return $this->ass_type->usesTeams();
204  }
+ Here is the caller graph for this function:

◆ initFromDB()

ilExAssignment::initFromDB ( array  $a_set)
protected

Import DB record.

Parameters
array$a_set
Exceptions
ilExcUnknownAssignmentTypeException

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

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

Referenced by read().

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

◆ insertFileOrderNr()

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

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

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

1719  : void {
1720  global $DIC;
1721  $db = $DIC->database();
1722  $id = $db->nextId("exc_ass_file_order");
1723  $db->insert(
1724  "exc_ass_file_order",
1725  [
1726  "id" => ["integer", $id],
1727  "order_nr" => ["integer", $a_order_nr],
1728  "assignment_id" => ["integer", $a_ass_id],
1729  "filename" => ["text", $a_filename]
1730  ]
1731  );
1732  }
insert(string $table_name, array $values)
nextId(string $table_name)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ instructionFileDeleteOrder()

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

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

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

1774  : void {
1775  global $DIC;
1776 
1777  $db = $DIC->database();
1778 
1779  //now its done by filename. We need to figure how to get the order id in the confirmdelete method
1780  foreach ($a_file as $v) {
1781  $db->manipulate(
1782  "DELETE FROM exc_ass_file_order " .
1783  "WHERE filename = " . $db->quote($v, 'text') .
1784  " AND assignment_id = " . $db->quote($a_ass_id, 'integer')
1785  );
1786  }
1787  }
quote($value, string $type)
global $DIC
Definition: shib_login.php:22
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ instructionFileExistsInDb()

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

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

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

1817  : int {
1818  global $DIC;
1819 
1820  $db = $DIC->database();
1821 
1822  if ($a_ass_id) {
1823  $result = $db->query(
1824  "SELECT id FROM exc_ass_file_order" .
1825  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
1826  " AND filename = " . $db->quote($a_filename, 'text')
1827  );
1828 
1829  return $db->numRows($result);
1830  }
1831 
1832  return 0;
1833  }
numRows(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:22
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ instructionFileGetFileOrderData()

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

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

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

179  : array {
180  global $DIC;
181 
182  $db = $DIC->database();
183  $db->setLimit(1, 0);
184 
185  $result_order_val = $db->query("
186  SELECT id, order_nr
187  FROM exc_ass_file_order
188  WHERE assignment_id = {$db->quote($a_ass_id, 'integer')}
189  AND filename = {$db->quote($a_file_data['entry'], 'text')}
190  ");
191 
192  $order_val = 0;
193  $order_id = 0;
194  while ($row = $db->fetchAssoc($result_order_val)) {
195  $order_val = (int) $row['order_nr'];
196  $order_id = (int) $row['id'];
197  }
198  return array($order_val, $order_id);
199  }
fetchAssoc(ilDBStatement $statement)
setLimit(int $limit, int $offset=0)
global $DIC
Definition: shib_login.php:22
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ instructionFileInsertOrder()

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

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

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

Referenced by ilExerciseDataSet\importRecord().

1739  : void {
1740  global $DIC;
1741 
1742  $db = $DIC->database();
1743 
1744  if ($a_ass_id) {
1745  //first of all check the suffix and change if necessary
1746  $filename = ilFileUtils::getSafeFilename($a_filename);
1747 
1748  if (self::instructionFileExistsInDb($filename, $a_ass_id) == 0) {
1749  if ($a_order_nr == 0) {
1750  $order_val = self::instructionFileOrderGetMax($a_ass_id);
1751  $order = $order_val + 10;
1752  } else {
1753  $order = $a_order_nr;
1754  }
1755 
1756  $id = $db->nextID('exc_ass_file_order');
1757  $db->manipulate("INSERT INTO exc_ass_file_order " .
1758  "(id, assignment_id, filename, order_nr) VALUES (" .
1759  $db->quote($id, "integer") . "," .
1760  $db->quote($a_ass_id, "integer") . "," .
1761  $db->quote($filename, "text") . "," .
1762  $db->quote($order, "integer") .
1763  ")");
1764  }
1765  }
1766  }
quote($value, string $type)
static getSafeFilename(string $a_initial_filename)
global $DIC
Definition: shib_login.php:22
$filename
Definition: buildRTE.php:78
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instructionFileOrderGetMax()

static ilExAssignment::instructionFileOrderGetMax ( int  $a_ass_id)
static

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

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

1888  : int
1889  {
1890  global $DIC;
1891 
1892  $db = $DIC->database();
1893 
1894  //get max order number
1895  $result = $db->queryF(
1896  "SELECT max(order_nr) as max_order FROM exc_ass_file_order WHERE assignment_id = %s",
1897  array('integer'),
1898  array($db->quote($a_ass_id, 'integer'))
1899  );
1900 
1901  $order_val = 0;
1902  while ($row = $db->fetchAssoc($result)) {
1903  $order_val = (int) $row['max_order'];
1904  }
1905  return $order_val;
1906  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:22
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:

◆ isInExercise()

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

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

References $DIC, and $ilDB.

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

1194  : bool
1195  {
1196  global $DIC;
1197 
1198  $ilDB = $DIC->database();
1199 
1200  $set = $ilDB->query(
1201  "SELECT * FROM exc_assignment " .
1202  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1203  " AND id = " . $ilDB->quote($a_ass_id, "integer")
1204  );
1205  if ($ilDB->fetchAssoc($set)) {
1206  return true;
1207  }
1208  return false;
1209  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType ( int  $a_value)

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

Referenced by setType().

416  : bool
417  {
418  return $this->types->isValidId($a_value);
419  }
+ Here is the caller graph for this function:

◆ lookup()

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

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

References $DIC, and $ilDB.

1093  : string
1094  {
1095  global $DIC;
1096 
1097  $ilDB = $DIC->database();
1098 
1099  $set = $ilDB->query(
1100  "SELECT " . $a_field . " FROM exc_assignment " .
1101  " WHERE id = " . $ilDB->quote($a_id, "integer")
1102  );
1103 
1104  $rec = $ilDB->fetchAssoc($set);
1105 
1106  return $rec[$a_field] ?? "";
1107  }
global $DIC
Definition: shib_login.php:22

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline ( int  $a_ass_id)
static

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

References $DIC, $ilDB, and $res.

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

1066  : bool
1067  {
1068  global $DIC;
1069 
1070  $ilDB = $DIC->database();
1071 
1072  $query = "SELECT id FROM exc_assignment " .
1073  "WHERE start_time <= " . $ilDB->quote(time(), 'integer') . ' ' .
1074  "AND time_stamp >= " . $ilDB->quote(time(), 'integer') . ' ' .
1075  "AND id = " . $ilDB->quote($a_ass_id, 'integer');
1076  $res = $ilDB->query($query);
1077 
1078  return (bool) $res->numRows();
1079  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ lookupExerciseId()

static ilExAssignment::lookupExerciseId ( int  $a_ass_id)
static

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

References $DIC, $ilDB, and $res.

Referenced by ilObjExerciseGUI\__construct(), ilExerciseGSToolProvider\getAssignmentInfo(), and ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\sendNotification().

1081  : int
1082  {
1083  global $DIC;
1084 
1085  $ilDB = $DIC->database();
1086  $query = "SELECT exc_id FROM exc_assignment " .
1087  "WHERE id = " . $ilDB->quote($a_ass_id, 'integer');
1088  $res = $ilDB->fetchAssoc($ilDB->query($query));
1089 
1090  return (int) ($res["exc_id"] ?? 0);
1091  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ lookupMaxOrderNrForEx()

static ilExAssignment::lookupMaxOrderNrForEx ( int  $a_exc_id)
static

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

References $DIC, and $ilDB.

1048  : int
1049  {
1050  // TODO IRSS: currently the ilResourceCollectionGUI does not support the order of files done by the component,
1051  // this should be implemented as well there and will follow.
1052  global $DIC;
1053 
1054  $ilDB = $DIC->database();
1055 
1056  $set = $ilDB->query(
1057  "SELECT MAX(order_nr) mnr FROM exc_assignment " .
1058  " WHERE exc_id = " . $ilDB->quote($a_exc_id, "integer")
1059  );
1060  if ($rec = $ilDB->fetchAssoc($set)) {
1061  return (int) $rec["mnr"];
1062  }
1063  return 0;
1064  }
global $DIC
Definition: shib_login.php:22

◆ lookupTitle()

◆ lookupType()

static ilExAssignment::lookupType ( int  $a_id)
static

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

Referenced by ilParticipantsPerAssignmentTableGUI\__construct(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\__construct(), and ilExerciseMailNotification\send().

1114  : int
1115  {
1116  return (int) self::lookup($a_id, "type");
1117  }
+ Here is the caller graph for this function:

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

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

1581  : bool
1582  {
1583  return (time() - $this->start_time <= 0);
1584  }

◆ orderAssByDeadline()

static ilExAssignment::orderAssByDeadline ( int  $a_ex_id)
static

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

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

1141  : void
1142  {
1143  global $DIC;
1144  $ilDB = $DIC->database();
1145 
1146  $set = $ilDB->query(
1147  "SELECT id FROM exc_assignment " .
1148  " WHERE exc_id = " . $ilDB->quote($a_ex_id, "integer") .
1149  " ORDER BY time_stamp"
1150  );
1151  $nr = 10;
1152  while ($rec = $ilDB->fetchAssoc($set)) {
1153  $ilDB->manipulate(
1154  "UPDATE exc_assignment SET " .
1155  " order_nr = " . $ilDB->quote($nr, "integer") .
1156  " WHERE id = " . $ilDB->quote($rec["id"], "integer")
1157  );
1158  $nr += 10;
1159  }
1160  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ read()

ilExAssignment::read ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

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

Referenced by __construct().

654  : void
655  {
656  $ilDB = $this->db;
657 
658  $set = $ilDB->query(
659  "SELECT * FROM exc_assignment " .
660  " WHERE id = " . $ilDB->quote($this->getId(), "integer")
661  );
662  $rec = $ilDB->fetchAssoc($set);
663 
664  // #16172 - might be deleted
665  if (is_array($rec)) {
666  $this->initFromDB($rec);
667  }
668  }
initFromDB(array $a_set)
Import DB record.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renameInstructionFile()

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

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

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

1793  : void {
1794  global $DIC;
1795 
1796  $db = $DIC->database();
1797 
1798  if ($a_ass_id) {
1799  $db->manipulate(
1800  "DELETE FROM exc_ass_file_order" .
1801  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
1802  " AND filename = " . $db->quote($a_new_name, 'text')
1803  );
1804 
1805  $db->manipulate(
1806  "UPDATE exc_ass_file_order SET" .
1807  " filename = " . $db->quote($a_new_name, 'text') .
1808  " WHERE assignment_id = " . $db->quote($a_ass_id, 'integer') .
1809  " AND filename = " . $db->quote($a_old_name, 'text')
1810  );
1811  }
1812  }
quote($value, string $type)
global $DIC
Definition: shib_login.php:22
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ save()

ilExAssignment::save ( )
Exceptions
ilDateTimeException

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

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

◆ saveAssOrderOfExercise()

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

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

References $DIC, and $ilDB.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

1120  : void
1121  {
1122  global $DIC;
1123 
1124  $ilDB = $DIC->database();
1125 
1126  asort($a_order);
1127  $nr = 10;
1128  foreach ($a_order as $k => $v) {
1129  // the check for exc_id is for security reasons. ass ids are unique.
1130  $ilDB->manipulate(
1131  "UPDATE exc_assignment SET " .
1132  " order_nr = " . $ilDB->quote($nr, "integer") .
1133  " WHERE id = " . $ilDB->quote((int) $k, "integer") .
1134  " AND exc_id = " . $ilDB->quote($a_ex_id, "integer")
1135  );
1136  $nr += 10;
1137  }
1138  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ saveInstructionFilesOrderOfAssignment()

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

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

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

1695  : void {
1696  global $DIC;
1697 
1698  $db = $DIC->database();
1699 
1700  asort($a_order, SORT_NUMERIC);
1701 
1702  $nr = 10;
1703  foreach (array_keys($a_order) as $k) {
1704  // the check for exc_id is for security reasons. ass ids are unique.
1705  $db->manipulate(
1706  "UPDATE exc_ass_file_order SET " .
1707  " order_nr = " . $db->quote($nr, "integer") .
1708  " WHERE id = " . $db->quote((int) $k, "integer") .
1709  " AND assignment_id = " . $db->quote($a_ass_id, "integer")
1710  );
1711  $nr += 10;
1712  }
1713  }
quote($value, string $type)
global $DIC
Definition: shib_login.php:22
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

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

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

References $DIC, $ilDB, ilExerciseMembers\_getMembers(), count(), ilLogger\debug(), and ilLoggerFactory\getLogger().

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

1472  : bool {
1473  global $DIC;
1474 
1475  $ilDB = $DIC->database();
1477 
1478  $ass = new self($a_ass_id);
1479 
1480  // valid assignment?
1481  if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
1482  $log->debug("return(1)");
1483  return false;
1484  }
1485 
1486  if (!$a_user_id) {
1487  // already done?
1488  $set = $ilDB->query("SELECT fb_cron_done" .
1489  " FROM exc_assignment" .
1490  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
1491  $row = $ilDB->fetchAssoc($set);
1492  if ($row["fb_cron_done"]) {
1493  $log->debug("return(2)");
1494  return false;
1495  }
1496  }
1497 
1498  $ntf = new ilSystemNotification();
1499  $ntf->setLangModules(array("exc"));
1500  $ntf->setObjId($ass->getExerciseId());
1501  $ntf->setSubjectLangId("exc_feedback_notification_subject");
1502  $ntf->setIntroductionLangId("exc_feedback_notification_body");
1503  $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
1504  $ntf->setGotoLangId("exc_feedback_notification_link");
1505  $ntf->setReasonLangId("exc_feedback_notification_reason");
1506 
1507  if (!$a_user_id) {
1508  $log->debug("send to members, cnt: " . count(ilExerciseMembers::_getMembers($ass->getExerciseId())));
1509  $ntf->sendMailAndReturnRecipients(ilExerciseMembers::_getMembers($ass->getExerciseId()));
1510 
1511  $ilDB->manipulate("UPDATE exc_assignment" .
1512  " SET fb_cron_done = " . $ilDB->quote(1, "integer") .
1513  " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
1514  } else {
1515  $log->debug("send to user: " . $a_user_id);
1516  $ntf->sendMailAndReturnRecipients(array($a_user_id));
1517  }
1518 
1519  return true;
1520  }
static getLogger(string $a_component_id)
Get component logger.
static count(int $a_ex_id)
global $DIC
Definition: shib_login.php:22
static _getMembers(int $a_obj_id)
debug(string $message, array $context=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline ( ?int  $a_val)

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

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

236  : void
237  {
238  $this->deadline = $a_val;
239  }
+ Here is the caller graph for this function:

◆ setDeadlineMode()

ilExAssignment::setDeadlineMode ( int  $a_val)

Set deadline mode.

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

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

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

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

◆ setExerciseId()

ilExAssignment::setExerciseId ( int  $a_val)

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

Referenced by initFromDB().

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

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline ( ?int  $a_val)

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

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

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

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron ( bool  $a_value)

Toggle (global) feedback file cron.

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

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

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

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate ( int  $a_value)

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

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

594  : void
595  {
596  $this->feedback_date = $a_value;
597  }
+ Here is the caller graph for this function:

◆ setFeedbackDateCustom()

ilExAssignment::setFeedbackDateCustom ( int  $a_value)

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

Parameters
int$a_valuetimestamp

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

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

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

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile ( ?string  $a_value)

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

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

570  : void
571  {
572  $this->feedback_file = $a_value;
573  }
+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId ( int  $a_val)

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

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

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

◆ setIndividualDeadline()

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

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

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

1622  : void {
1623  $is_team = false;
1624  if (!is_numeric($id)) {
1625  $id = substr($id, 1);
1626  $is_team = true;
1627  }
1628 
1629  $idl = ilExcIndividualDeadline::getInstance($this->getId(), (int) $id, $is_team);
1630  $idl->setIndividualDeadline($date->get(IL_CAL_UNIX));
1631  $idl->save();
1632  }
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
const IL_CAL_UNIX
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
+ Here is the call graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction ( string  $a_val)

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

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

329  : void
330  {
331  $this->instruction = $a_val;
332  }
+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory ( bool  $a_val)

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

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

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

◆ setMaxCharLimit()

ilExAssignment::setMaxCharLimit ( int  $a_val)

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

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

1921  : void
1922  {
1923  $this->max_char_limit = $a_val;
1924  }
+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile ( ?int  $a_value)

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

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

630  : void
631  {
632  $this->max_file = $a_value;
633  }
+ Here is the caller graph for this function:

◆ setMinCharLimit()

ilExAssignment::setMinCharLimit ( int  $a_val)

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

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

1910  : void
1911  {
1912  $this->min_char_limit = $a_val;
1913  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr ( int  $a_val)

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

Referenced by initFromDB(), and save().

373  : void
374  {
375  $this->order_nr = $a_val;
376  }
+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview ( bool  $a_value)

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

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

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

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars ( ?int  $a_value)

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

References ILIAS\Repository\int(), and null.

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

519  : void
520  {
521  $a_value = (is_numeric($a_value) && (int) $a_value > 0)
522  ? (int) $a_value
523  : null;
524  $this->peer_char = $a_value;
525  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue ( ?int  $a_value)

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

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

532  : void
533  {
534  $this->crit_cat = $a_value;
535  }
+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

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

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

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

454  : void
455  {
456  $this->peer_dl = $a_val;
457  }
+ Here is the caller graph for this function:

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload ( bool  $a_val)

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

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

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

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin ( int  $a_value)

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

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

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

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized ( bool  $a_val)

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

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

509  : void
510  {
511  $this->peer_personal = $a_val;
512  }
+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating ( bool  $a_val)

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

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

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

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock ( int  $a_value)

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

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

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

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText ( bool  $a_val)

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

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

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

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid ( int  $a_value)

Set peer review validation.

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

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

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

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

◆ setPortfolioTemplateId()

ilExAssignment::setPortfolioTemplateId ( int  $a_val)

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

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

641  : void
642  {
643  $this->portfolio_template = $a_val;
644  }
+ Here is the caller graph for this function:

◆ setRelativeDeadline()

ilExAssignment::setRelativeDeadline ( int  $a_val)

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

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

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

◆ setRelDeadlineLastSubmission()

ilExAssignment::setRelDeadlineLastSubmission ( int  $a_val)

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

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

270  : void
271  {
272  $this->rel_deadline_last_subm = $a_val;
273  }
+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime ( ?int  $a_val)

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

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

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

◆ setTeamTutor()

ilExAssignment::setTeamTutor ( bool  $a_value)

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

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

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

◆ setTitle()

ilExAssignment::setTitle ( string  $a_val)

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

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

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

◆ setType()

ilExAssignment::setType ( int  $a_value)

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

Exceptions
ilExcUnknownAssignmentTypeException

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

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

388  : void
389  {
390  if ($this->isValidType($a_value)) {
391  $this->type = $a_value;
392 
393  $this->ass_type = $this->types->getById($a_value);
394 
395  if ($this->ass_type->usesTeams()) {
396  $this->setPeerReview(false);
397  }
398  }
399  }
isValidType(int $a_value)
setPeerReview(bool $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )
Exceptions
ilDateTimeException

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

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

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

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

Field Documentation

◆ $access

ilAccessHandler ilExAssignment::$access
protected

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

◆ $app_event_handler

ilAppEventHandler ilExAssignment::$app_event_handler
protected

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

Referenced by handleCalendarEntries().

◆ $ass_type

ilExAssignmentTypeInterface ilExAssignment::$ass_type
protected

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

Referenced by getAssignmentType().

◆ $crit_cat

int ilExAssignment::$crit_cat = 0
protected

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

Referenced by getPeerReviewCriteriaCatalogue().

◆ $db

◆ $deadline

int ilExAssignment::$deadline = null
protected

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

Referenced by getDeadline().

◆ $deadline2

int ilExAssignment::$deadline2 = null
protected

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

Referenced by getExtendedDeadline().

◆ $deadline_mode

int ilExAssignment::$deadline_mode = 0
protected

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

Referenced by getDeadlineMode().

◆ $domain

ILIAS Exercise InternalDomainService ilExAssignment::$domain
protected

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

◆ $exc_id

int ilExAssignment::$exc_id = 0
protected

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

Referenced by getExerciseId().

◆ $feedback_cron

bool ilExAssignment::$feedback_cron = false
protected

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

Referenced by hasFeedbackCron().

◆ $feedback_date

int ilExAssignment::$feedback_date = 0
protected

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

Referenced by getFeedbackDate().

◆ $feedback_date_custom

int ilExAssignment::$feedback_date_custom = 0
protected

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

Referenced by getFeedbackDateCustom().

◆ $feedback_file

string ilExAssignment::$feedback_file = null
protected

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

Referenced by getFeedbackFile().

◆ $id

int ilExAssignment::$id = 0
protected

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

Referenced by getId().

◆ $instruction

string ilExAssignment::$instruction = ""
protected

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

Referenced by getInstruction().

◆ $lng

ilLanguage ilExAssignment::$lng
protected

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

◆ $log

ilLogger ilExAssignment::$log
protected

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

◆ $mandatory

bool ilExAssignment::$mandatory = false
protected

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

Referenced by getMandatory().

◆ $max_char_limit

int ilExAssignment::$max_char_limit = 0
protected

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

Referenced by getMaxCharLimit().

◆ $max_file

int ilExAssignment::$max_file = null
protected

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

Referenced by getMaxFile().

◆ $member_status

array ilExAssignment::$member_status = []
protected

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

◆ $min_char_limit

int ilExAssignment::$min_char_limit = 0
protected

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

Referenced by getMinCharLimit().

◆ $order_nr

int ilExAssignment::$order_nr = 0
protected

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

Referenced by getOrderNr().

◆ $peer

bool ilExAssignment::$peer = false
protected

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

Referenced by getPeerReview().

◆ $peer_char

int ilExAssignment::$peer_char = null
protected

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

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

int ilExAssignment::$peer_crit_cat = 0
protected

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

◆ $peer_dl

int ilExAssignment::$peer_dl = 0
protected

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

Referenced by getPeerReviewDeadline().

◆ $peer_file

bool ilExAssignment::$peer_file = false
protected

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

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

int ilExAssignment::$peer_min = 0
protected

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

Referenced by getPeerReviewMin().

◆ $peer_personal

bool ilExAssignment::$peer_personal = false
protected

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

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

bool ilExAssignment::$peer_rating = false
protected

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

Referenced by hasPeerReviewRating().

◆ $peer_text

bool ilExAssignment::$peer_text = false
protected

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

Referenced by hasPeerReviewText().

◆ $peer_unlock

int ilExAssignment::$peer_unlock = 0
protected

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

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

int ilExAssignment::$peer_valid
protected

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

Referenced by getPeerReviewValid().

◆ $portfolio_template

int ilExAssignment::$portfolio_template = 0
protected

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

Referenced by getPortfolioTemplateId().

◆ $rel_deadline_last_subm

int ilExAssignment::$rel_deadline_last_subm = 0
protected

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

Referenced by getRelDeadlineLastSubmission().

◆ $relative_deadline

int ilExAssignment::$relative_deadline = 0
protected

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

Referenced by getRelativeDeadline().

◆ $start_time

int ilExAssignment::$start_time = null
protected

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

Referenced by getStartTime().

◆ $string_transform

ILIAS Refinery String Group ilExAssignment::$string_transform
protected

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

◆ $team_tutor

bool ilExAssignment::$team_tutor = false
protected

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

Referenced by getTeamTutor().

◆ $title

string ilExAssignment::$title = ""
protected

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

Referenced by getTitle().

◆ $type

int ilExAssignment::$type = 0
protected

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

Referenced by getCalculatedDeadlines(), and getType().

◆ $types

ilExAssignmentTypes ilExAssignment::$types
protected

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

◆ $user

ilObjUser ilExAssignment::$user
protected

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

Referenced by afterDeadline(), and getMemberStatus().

◆ DEADLINE_ABSOLUTE

◆ DEADLINE_ABSOLUTE_INDIVIDUAL

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