ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 hasTeam ()
 
 setId ($a_val)
 Set assignment id. More...
 
 getId ()
 Get assignment id. More...
 
 setExerciseId ($a_val)
 Set exercise id. More...
 
 getExerciseId ()
 Get exercise id. More...
 
 setStartTime ($a_val)
 Set start time (timestamp) More...
 
 getStartTime ()
 Get start time (timestamp) More...
 
 setDeadline ($a_val)
 Set deadline (timestamp) More...
 
 getDeadline ()
 Get deadline (timestamp) More...
 
 getPersonalDeadline ($a_user_id)
 Get individual deadline. More...
 
 setExtendedDeadline ($a_val)
 Set extended deadline (timestamp) More...
 
 getExtendedDeadline ()
 Get extended deadline (timestamp) More...
 
 setInstruction ($a_val)
 Set instruction. More...
 
 getInstruction ()
 Get instruction. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setMandatory ($a_val)
 Set mandatory. More...
 
 getMandatory ()
 Get mandatory. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setType ($a_value)
 Set type. More...
 
 getType ()
 Get type. More...
 
 isValidType ($a_value)
 Is given type valid? More...
 
 setPeerReview ($a_value)
 Toggle peer review. More...
 
 getPeerReview ()
 Get peer review status. More...
 
 setPeerReviewMin ($a_value)
 Set peer review minimum. More...
 
 getPeerReviewMin ()
 Get peer review minimum. More...
 
 setPeerReviewSimpleUnlock ($a_value)
 Set peer review simple unlock. More...
 
 getPeerReviewSimpleUnlock ()
 Get peer review simple unlock. More...
 
 setPeerReviewDeadline ($a_val)
 Set peer review deadline (timestamp) More...
 
 getPeerReviewDeadline ()
 Get peer review deadline (timestamp) More...
 
 setPeerReviewValid ($a_value)
 Set peer review validation. More...
 
 getPeerReviewValid ()
 Get peer review validatiob. More...
 
 setPeerReviewRating ($a_val)
 Set peer review rating. More...
 
 hasPeerReviewRating ()
 Get peer review rating status. More...
 
 setPeerReviewText ($a_val)
 Set peer review text. More...
 
 hasPeerReviewText ()
 Get peer review text status. More...
 
 setPeerReviewFileUpload ($a_val)
 Set peer review file upload. More...
 
 hasPeerReviewFileUpload ()
 Get peer review file upload status. More...
 
 setPeerReviewPersonalized ($a_val)
 Set peer review personalized. More...
 
 hasPeerReviewPersonalized ()
 Get peer review personalized status. More...
 
 setPeerReviewChars ($a_value)
 Set peer review minimum characters. More...
 
 getPeerReviewChars ()
 Get peer review minimum characters. More...
 
 setPeerReviewCriteriaCatalogue ($a_value)
 Set peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogue ()
 Get peer review criteria catalogue id. More...
 
 getPeerReviewCriteriaCatalogueItems ()
 
 setFeedbackFile ($a_value)
 Set (global) feedback file. More...
 
 getFeedbackFile ()
 Get (global) feedback file. More...
 
 setFeedbackCron ($a_value)
 Toggle (global) feedback file cron. More...
 
 hasFeedbackCron ()
 Get (global) feedback file cron status. More...
 
 setFeedbackDate ($a_value)
 Set (global) feedback file availability date. More...
 
 getFeedbackDate ()
 Get (global) feedback file availability date. More...
 
 setTeamTutor ($a_value)
 Set team management by tutor. More...
 
 getTeamTutor ()
 Get team management by tutor. More...
 
 setMaxFile ($a_value)
 Set max number of uploads. More...
 
 getMaxFile ()
 Get max number of uploads. More...
 
 read ()
 Read from db. More...
 
 save ()
 Save assignment. More...
 
 update ()
 Update. More...
 
 delete ()
 Delete assignment. More...
 
 getFiles ()
 Get files. More...
 
 saveAssOrderOfExercise ($a_ex_id, $a_order)
 Save ordering of all assignments of an exercise. More...
 
 getMemberListData ()
 get member list data More...
 
 uploadAssignmentFiles ($a_files)
 Upload assignment files (from creation form) More...
 
 sendMultiFeedbackStructureFile ()
 Create member status record for a new assignment for all participants. More...
 
 uploadMultiFeedbackFile ($a_file)
 Upload multi feedback file. More...
 
 getMultiFeedbackFiles ($a_user_id=0)
 Get multi feedback files (of uploader) More...
 
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory. More...
 
 saveMultiFeedbackFiles ($a_files, ilObjExercise $a_exc)
 Save multi feedback files. More...
 
 afterDeadline ()
 
 afterDeadlineStrict ($a_include_personal=true)
 
 beforeDeadline ()
 
 notStartedYet ()
 
 getGlobalFeedbackFileStoragePath ()
 
 deleteGlobalFeedbackFile ()
 
 handleGlobalFeedbackFileUpload (array $a_file)
 
 getGlobalFeedbackFilePath ()
 
 getMemberStatus ($a_user_id=null)
 
 recalculateLateSubmissions ()
 
 setIndividualDeadline ($id, ilDateTime $date)
 
 getIndividualDeadlines ()
 
 hasActiveIDl ()
 
 hasReadOnlyIDl ()
 

Static Public Member Functions

static getInstancesByExercise ($a_exc_id)
 
static getAssignmentDataOfExercise ($a_exc_id)
 Get assignments data of an exercise in an array. More...
 
static cloneAssignmentsOfExercise ($a_old_exc_id, $a_new_exc_id, array $a_crit_cat_map)
 Clone assignments of exercise. More...
 
static lookupMaxOrderNrForEx ($a_exc_id)
 Select the maximum order nr for an exercise. More...
 
static lookupAssignmentOnline ($a_ass_id)
 Check if assignment is online. More...
 
static lookupExerciseId ($a_ass_id)
 Lookup excercise id for assignment id. More...
 
static lookupTitle ($a_id)
 Lookup title. More...
 
static lookupType ($a_id)
 Lookup type. More...
 
static orderAssByDeadline ($a_ex_id)
 Order assignments by deadline date. More...
 
static countMandatory ($a_ex_id)
 Order assignments by deadline date. More...
 
static lookupUpdatedSubmission ($ass_id, $member_id)
 Check whether student has upload new files after tutor has set the exercise to another than notgraded. More...
 
static createNewUserRecords ($a_user_id, $a_exc_id)
 Create member status record for a new participant for all assignments. More...
 
static createNewAssignmentRecords ($a_ass_id, $a_exc)
 Create member status record for a new assignment for all participants. More...
 
static getPendingFeedbackNotifications ()
 
static sendFeedbackNotifications ($a_ass_id, $a_user_id=null)
 

Data Fields

const TYPE_UPLOAD = 1
 
const TYPE_BLOG = 2
 
const TYPE_PORTFOLIO = 3
 
const TYPE_UPLOAD_TEAM = 4
 
const TYPE_TEXT = 5
 
const FEEDBACK_DATE_DEADLINE = 1
 
const FEEDBACK_DATE_SUBMISSION = 2
 
const PEER_REVIEW_VALID_NONE = 1
 
const PEER_REVIEW_VALID_ONE = 2
 
const PEER_REVIEW_VALID_ALL = 3
 

Protected Member Functions

 getLastPersonalDeadline ()
 Get last/final personal deadline (of assignment) More...
 
 initFromDB (array $a_set)
 Import DB record. More...
 
 handleCalendarEntries ($a_event)
 Handle calendar entries for deadline(s) More...
 

Protected Attributes

 $id
 
 $exc_id
 
 $type
 
 $start_time
 
 $deadline
 
 $deadline2
 
 $instruction
 
 $title
 
 $mandatory
 
 $order_nr
 
 $peer
 
 $peer_min
 
 $peer_unlock
 
 $peer_dl
 
 $peer_valid
 
 $peer_file
 
 $peer_personal
 
 $peer_char
 
 $peer_text
 
 $peer_rating
 
 $peer_crit_cat
 
 $feedback_file
 
 $feedback_cron
 
 $feedback_date
 
 $team_tutor = false
 
 $max_file
 
 $member_status = array()
 

Static Private Member Functions

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

Detailed Description

Exercise assignment.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignment::__construct (   $a_id = 0)

Constructor.

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

References read(), setFeedbackDate(), setId(), and setType().

59  {
60  $this->setType(self::TYPE_UPLOAD);
61  $this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
62 
63  if ($a_id > 0)
64  {
65  $this->setId($a_id);
66  $this->read();
67  }
68  }
setType($a_value)
Set type.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setId($a_val)
Set assignment id.
read()
Read from db.
+ Here is the call graph for this function:

Member Function Documentation

◆ afterDeadline()

ilExAssignment::afterDeadline ( )

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

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

Referenced by ilExAssignmentGUI\addPublicSubmissions(), and afterDeadlineStrict().

1707  {
1708  global $ilUser;
1709 
1710  // :TODO: always current user?
1711  $idl = $this->getPersonalDeadline($ilUser->getId());
1712 
1713  // no deadline === true
1714  $deadline = max($this->deadline, $this->deadline2, $idl);
1715  return ($deadline - time() <= 0);
1716  }
getPersonalDeadline($a_user_id)
Get individual deadline.
$ilUser
Definition: imgupload.php:18
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDeadlineStrict()

ilExAssignment::afterDeadlineStrict (   $a_include_personal = true)

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

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

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

1719  {
1720  // :TODO: this means that peer feedback, global feedback is available
1721  // after LAST personal deadline
1722  // team management is currently ignoring personal deadlines
1723  $idl = (bool)$a_include_personal
1724  ? $this->getLastPersonalDeadline()
1725  : null;
1726 
1727  // no deadline === false
1728  $deadline = max($this->deadline, $this->deadline2, $idl);
1729 
1730  // #18271 - afterDeadline() does not handle last personal deadline
1731  if($idl && $deadline == $idl)
1732  {
1733  return ($deadline - time() <= 0);
1734  }
1735 
1736  return ($deadline > 0 &&
1737  $this->afterDeadline());
1738  }
getLastPersonalDeadline()
Get last/final personal deadline (of assignment)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beforeDeadline()

ilExAssignment::beforeDeadline ( )

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

References afterDeadlineStrict().

Referenced by ilExAssignmentGUI\addSchedule().

1741  {
1742  // no deadline === true
1743  return !$this->afterDeadlineStrict();
1744  }
afterDeadlineStrict($a_include_personal=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearMultiFeedbackDirectory()

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

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

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

Referenced by saveMultiFeedbackFiles().

1493  {
1494  global $lng, $ilUser;
1495 
1496  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1497  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1498  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1499  ilUtil::delDir($mfu);
1500  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAssignmentsOfExercise()

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

Clone assignments of exercise.

Parameters

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

References $d, ilFSStorageExercise\create(), ilFSStorageExercise\getGlobalFeedbackPath(), ilFileSystemStorage\getPath(), and ilUtil\rCopy().

Referenced by ilObjExercise\cloneObject().

961  {
962  $ass_data = self::getInstancesByExercise($a_old_exc_id);
963  foreach ($ass_data as $d)
964  {
965  // clone assignment
966  $new_ass = new ilExAssignment();
967  $new_ass->setExerciseId($a_new_exc_id);
968  $new_ass->setTitle($d->getTitle());
969  $new_ass->setDeadline($d->getDeadline());
970  $new_ass->setExtendedDeadline($d->getExtendedDeadline());
971  $new_ass->setInstruction($d->getInstruction());
972  $new_ass->setMandatory($d->getMandatory());
973  $new_ass->setOrderNr($d->getOrderNr());
974  $new_ass->setStartTime($d->getStartTime());
975  $new_ass->setType($d->getType());
976  $new_ass->setPeerReview($d->getPeerReview());
977  $new_ass->setPeerReviewMin($d->getPeerReviewMin());
978  $new_ass->setPeerReviewDeadline($d->getPeerReviewDeadline());
979  $new_ass->setPeerReviewFileUpload($d->hasPeerReviewFileUpload());
980  $new_ass->setPeerReviewPersonalized($d->hasPeerReviewPersonalized());
981  $new_ass->setPeerReviewValid($d->getPeerReviewValid());
982  $new_ass->setPeerReviewChars($d->getPeerReviewChars());
983  $new_ass->setPeerReviewText($d->hasPeerReviewText());
984  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
985  $new_ass->setPeerReviewCriteriaCatalogue($d->getPeerReviewCriteriaCatalogue());
986  $new_ass->setPeerReviewSimpleUnlock($d->getPeerReviewSimpleUnlock());
987  $new_ass->setPeerReviewText($d->hasPeerReviewText());
988  $new_ass->setPeerReviewRating($d->hasPeerReviewRating());
989  $new_ass->setFeedbackFile($d->getFeedbackFile());
990  $new_ass->setFeedbackDate($d->getFeedbackDate());
991  $new_ass->setFeedbackCron($d->hasFeedbackCron()); // #16295
992  $new_ass->setTeamTutor($d->getTeamTutor());
993  $new_ass->setMaxFile($d->getMaxFile());
994 
995  // criteria catalogue(s)
996  if($d->getPeerReviewCriteriaCatalogue() &&
997  array_key_exists($d->getPeerReviewCriteriaCatalogue(), $a_crit_cat_map))
998  {
999  $new_ass->setPeerReviewCriteriaCatalogue($a_crit_cat_map[$d->getPeerReviewCriteriaCatalogue()]);
1000  }
1001 
1002  $new_ass->save();
1003 
1004  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1005  $old_storage = new ilFSStorageExercise($a_old_exc_id, (int) $d->getId());
1006  $new_storage = new ilFSStorageExercise($a_new_exc_id, (int) $new_ass->getId());
1007  $new_storage->create();
1008 
1009  // clone assignment files
1010  if (is_dir($old_storage->getPath()))
1011  {
1012  ilUtil::rCopy($old_storage->getPath(), $new_storage->getPath());
1013  }
1014 
1015  // clone global feedback file
1016  if (is_dir($old_storage->getGlobalFeedbackPath()))
1017  {
1018  ilUtil::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
1019  }
1020  }
1021  }
Exercise assignment.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
for($col=0; $col< 50; $col++) $d
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ countMandatory()

static ilExAssignment::countMandatory (   $a_ex_id)
static

Order assignments by deadline date.

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

References $ilDB.

Referenced by ilObjExerciseGUI\initEditCustomForm().

1167  {
1168  global $ilDB;
1169 
1170  $set = $ilDB->query("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 $rec["cntm"];
1176  }
global $ilDB
+ Here is the caller graph for this function:

◆ createNewAssignmentRecords()

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

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

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

References $ilDB, and array.

1292  {
1293  global $ilDB;
1294 
1295  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1296  $exmem = new ilExerciseMembers($a_exc);
1297  $mems = $exmem->getMembers();
1298 
1299  foreach ($mems as $mem)
1300  {
1301  $ilDB->replace("exc_mem_ass_status", array(
1302  "ass_id" => array("integer", $a_ass_id),
1303  "usr_id" => array("integer", $mem)
1304  ), array(
1305  "status" => array("text", "notgraded")
1306  ));
1307  }
1308  }
Class ilExerciseMembers.
Create styles array
The data for the language used.
global $ilDB

◆ createNewUserRecords()

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

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

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

References $ilDB, and array.

Referenced by ilExerciseMembers\assignMember().

1272  {
1273  global $ilDB;
1274 
1275  $ass_data = self::getAssignmentDataOfExercise($a_exc_id);
1276  foreach ($ass_data as $ass)
1277  {
1278 //echo "-".$ass["id"]."-".$a_user_id."-";
1279  $ilDB->replace("exc_mem_ass_status", array(
1280  "ass_id" => array("integer", $ass["id"]),
1281  "usr_id" => array("integer", $a_user_id)
1282  ), array(
1283  "status" => array("text", "notgraded")
1284  ));
1285  }
1286  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ delete()

ilExAssignment::delete ( )

Delete assignment.

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

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

896  {
897  global $ilDB;
898 
899  $this->deleteGlobalFeedbackFile();
900 
901  $ilDB->manipulate("DELETE FROM exc_assignment WHERE ".
902  " id = ".$ilDB->quote($this->getId(), "integer")
903  );
904  $exc = new ilObjExercise($this->getExerciseId(), false);
905  $exc->updateAllUsersStatus();
906 
907  $this->handleCalendarEntries("delete");
908  }
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getExerciseId()
Get exercise id.
Class ilObjExercise.
global $ilDB
+ Here is the call graph for this function:

◆ deleteGlobalFeedbackFile()

ilExAssignment::deleteGlobalFeedbackFile ( )

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

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

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

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

◆ getAssignmentDataOfExercise()

static ilExAssignment::getAssignmentDataOfExercise (   $a_exc_id)
static

Get assignments data of an exercise in an array.

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

References $data, $ilDB, and array.

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

915  {
916  global $ilDB;
917 
918  // should be changed to self::getInstancesByExerciseId()
919 
920  $set = $ilDB->query("SELECT * FROM exc_assignment ".
921  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer").
922  " ORDER BY order_nr ASC");
923  $data = array();
924 
925  $order_val = 10;
926  while ($rec = $ilDB->fetchAssoc($set))
927  {
928 
929  $data[] = array(
930  "id" => $rec["id"],
931  "exc_id" => $rec["exc_id"],
932  "deadline" => $rec["time_stamp"],
933  "deadline2" => $rec["deadline2"],
934  "instruction" => $rec["instruction"],
935  "title" => $rec["title"],
936  "start_time" => $rec["start_time"],
937  "order_val" => $order_val,
938  "mandatory" => $rec["mandatory"],
939  "type" => $rec["type"],
940  "peer" => $rec["peer"],
941  "peer_min" => $rec["peer_min"],
942  "peer_dl" => $rec["peer_dl"],
943  "peer_file" => $rec["peer_file"],
944  "peer_prsl" => $rec["peer_prsl"],
945  "fb_file" => $rec["fb_file"],
946  "fb_date" => $rec["fb_date"],
947  "fb_cron" => $rec["fb_cron"],
948  );
949  $order_val += 10;
950  }
951  return $data;
952  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getDeadline()

ilExAssignment::getDeadline ( )

Get deadline (timestamp)

Returns
int deadline (timestamp)

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

References $deadline.

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

176  {
177  return $this->deadline;
178  }
+ Here is the caller graph for this function:

◆ getExerciseId()

◆ getExtendedDeadline()

ilExAssignment::getExtendedDeadline ( )

Get extended deadline (timestamp)

Returns
int

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

References $deadline2.

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

248  {
249  return $this->deadline2;
250  }
+ Here is the caller graph for this function:

◆ getFeedbackDate()

ilExAssignment::getFeedbackDate ( )

Get (global) feedback file availability date.

Returns
int

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

References $feedback_date.

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

694  {
695  return (int)$this->feedback_date;
696  }
+ Here is the caller graph for this function:

◆ getFeedbackFile()

ilExAssignment::getFeedbackFile ( )

Get (global) feedback file.

Returns
int

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

References $feedback_file.

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

654  {
655  return (string)$this->feedback_file;
656  }
+ Here is the caller graph for this function:

◆ getFiles()

ilExAssignment::getFiles ( )

Get files.

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

References getExerciseId(), and getId().

Referenced by ilExAssignmentGUI\addFiles().

1027  {
1028  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1029  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1030  return $storage->getFiles();
1031  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalFeedbackFilePath()

ilExAssignment::getGlobalFeedbackFilePath ( )

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

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

1781  {
1782  $file = $this->getFeedbackFile();
1783  if($file)
1784  {
1786  return $path."/".$file;
1787  }
1788  }
$path
Definition: aliased.php:25
getFeedbackFile()
Get (global) feedback file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getGlobalFeedbackFileStoragePath()

ilExAssignment::getGlobalFeedbackFileStoragePath ( )

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

References getExerciseId(), and getId().

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

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

◆ getId()

◆ getIndividualDeadlines()

ilExAssignment::getIndividualDeadlines ( )

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

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

1889  {
1890  global $ilDB;
1891 
1892  $res = array();
1893 
1894  $set = $ilDB->query("SELECT * FROM exc_idl".
1895  " WHERE ass_id = ".$ilDB->quote($this->getId(), "integer"));
1896  while($row = $ilDB->fetchAssoc($set))
1897  {
1898  if($row["is_team"])
1899  {
1900  $row["member_id"] = "t".$row["member_id"];
1901  }
1902 
1903  $res[$row["member_id"]] = $row["tstamp"];
1904  }
1905 
1906  return $res;
1907  }
Create styles array
The data for the language used.
global $ilDB

◆ getInstancesByExercise()

static ilExAssignment::getInstancesByExercise (   $a_exc_id)
static

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

References $data, $ilDB, and array.

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

71  {
72  global $ilDB;
73 
74  $set = $ilDB->query("SELECT * FROM exc_assignment ".
75  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer").
76  " ORDER BY order_nr ASC");
77  $data = array();
78 
79  $order_val = 10;
80  while ($rec = $ilDB->fetchAssoc($set))
81  {
82  // ???
83  $rec["order_val"] = $order_val;
84 
85  $ass = new self();
86  $ass->initFromDB($rec);
87  $data[] = $ass;
88 
89  $order_val += 10;
90  }
91 
92  return $data;
93  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getInstruction()

ilExAssignment::getInstruction ( )

Get instruction.

Returns
string instruction

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

References $instruction.

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

268  {
269  return $this->instruction;
270  }
+ Here is the caller graph for this function:

◆ getLastPersonalDeadline()

ilExAssignment::getLastPersonalDeadline ( )
protected

Get last/final personal deadline (of assignment)

Returns
int

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

References $ilDB, and $row.

Referenced by afterDeadlineStrict().

219  {
220  global $ilDB;
221 
222  $set = $ilDB->query("SELECT MAX(tstamp) FROM exc_idl".
223  " WHERE ass_id = ".$ilDB->quote($this->getId(), "integer"));
224  $row = $ilDB->fetchAssoc($set);
225  return $row["tstamp"];
226  }
global $ilDB
+ Here is the caller graph for this function:

◆ getMandatory()

ilExAssignment::getMandatory ( )

Get mandatory.

Returns
int mandatory

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

References $mandatory.

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

308  {
309  return $this->mandatory;
310  }
+ Here is the caller graph for this function:

◆ getMaxFile()

ilExAssignment::getMaxFile ( )

Get max number of uploads.

Returns
bool

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

References $max_file.

Referenced by save(), and update().

738  {
739  return $this->max_file;
740  }
+ Here is the caller graph for this function:

◆ getMemberListData()

ilExAssignment::getMemberListData ( )

get member list data

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

References $ilDB, array, and getId().

1222  {
1223  global $ilDB;
1224 
1225  $mem = array();
1226 
1227  // first get list of members from member table
1228  $set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login".
1229  " FROM exc_members excm".
1230  " JOIN usr_data ud ON (ud.usr_id = excm.usr_id)".
1231  " WHERE excm.obj_id = ".$ilDB->quote($this->getExerciseId(), "integer"));
1232  while($rec = $ilDB->fetchAssoc($set))
1233  {
1234  $mem[$rec["usr_id"]] =
1235  array(
1236  "name" => $rec["lastname"].", ".$rec["firstname"],
1237  "login" => $rec["login"],
1238  "usr_id" => $rec["usr_id"],
1239  "lastname" => $rec["lastname"],
1240  "firstname" => $rec["firstname"]
1241  );
1242  }
1243 
1244  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1245 
1246  $q = "SELECT * FROM exc_mem_ass_status ".
1247  "WHERE ass_id = ".$ilDB->quote($this->getId(), "integer");
1248  $set = $ilDB->query($q);
1249  while($rec = $ilDB->fetchAssoc($set))
1250  {
1251  if (isset($mem[$rec["usr_id"]]))
1252  {
1253  $sub = new ilExSubmission($this, $rec["usr_id"]);
1254 
1255  $mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
1256  $mem[$rec["usr_id"]]["submission"] = $sub->getLastSubmission();
1257  $mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
1258  $mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
1259  $mem[$rec["usr_id"]]["notice"] = $rec["notice"];
1260  $mem[$rec["usr_id"]]["status"] = $rec["status"];
1261  $mem[$rec["usr_id"]]["mark"] = $rec["mark"];
1262  $mem[$rec["usr_id"]]["comment"] = $rec["u_comment"];
1263  }
1264  }
1265  return $mem;
1266  }
getId()
Get assignment id.
Create styles array
The data for the language used.
global $ilDB
Exercise submission.
+ Here is the call graph for this function:

◆ getMemberStatus()

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

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

References $ilUser, and getId().

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

1795  {
1796  global $ilUser;
1797 
1798  if(!$a_user_id)
1799  {
1800  $a_user_id = $ilUser->getId();
1801  }
1802  if(!array_key_exists($a_user_id, $this->member_status))
1803  {
1804  include_once "Modules/Exercise/classes/class.ilExAssignmentMemberStatus.php";
1805  $this->member_status[$a_user_id] = new ilExAssignmentMemberStatus($this->getId(), $a_user_id);
1806  }
1807  return $this->member_status[$a_user_id];
1808  }
Exercise assignment member status.
getId()
Get assignment id.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiFeedbackFiles()

ilExAssignment::getMultiFeedbackFiles (   $a_user_id = 0)

Get multi feedback files (of uploader)

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

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

References $files, $ilUser, ilObjUser\_lookupName(), array, ilUtil\getDir(), getExerciseId(), and getId().

Referenced by saveMultiFeedbackFiles().

1420  {
1421  global $ilUser;
1422 
1423  if ($a_user_id == 0)
1424  {
1425  $a_user_id = $ilUser->getId();
1426  }
1427 
1428  $mf_files = array();
1429 
1430  // get members
1431  $exc = new ilObjExercise($this->getExerciseId(), false);
1432  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1433  $exmem = new ilExerciseMembers($exc);
1434  $mems = $exmem->getMembers();
1435 
1436  // read mf directory
1437  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1438  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1439  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1440 
1441  // get subdir that starts with multi_feedback
1442  $subdirs = ilUtil::getDir($mfu);
1443  $subdir = "notfound";
1444  foreach ($subdirs as $s => $j)
1445  {
1446  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
1447  {
1448  $subdir = $s;
1449  }
1450  }
1451 
1452  $items = ilUtil::getDir($mfu."/".$subdir);
1453  foreach ($items as $k => $i)
1454  {
1455  // check directory
1456  if ($i["type"] == "dir" && !in_array($k, array(".", "..")))
1457  {
1458  // check if valid member id is given
1459  $parts = explode("_", $i["entry"]);
1460  $user_id = (int) $parts[count($parts) - 1];
1461  if (in_array($user_id, $mems))
1462  {
1463  // read dir of user
1464  $name = ilObjUser::_lookupName($user_id);
1465  $files = ilUtil::getDir($mfu."/".$subdir."/".$k);
1466  foreach ($files as $k2 => $f)
1467  {
1468  // append files to array
1469  if ($f["type"] == "file" && substr($k2, 0, 1) != ".")
1470  {
1471  $mf_files[] = array(
1472  "lastname" => $name["lastname"],
1473  "firstname" => $name["firstname"],
1474  "login" => $name["login"],
1475  "user_id" => $name["user_id"],
1476  "full_path" => $mfu."/".$subdir."/".$k."/".$k2,
1477  "file" => $k2);
1478  }
1479  }
1480  }
1481  }
1482  }
1483  return $mf_files;
1484  }
$files
Definition: add-vimline.php:18
static _lookupName($a_user_id)
lookup user name
Class ilExerciseMembers.
getId()
Get assignment id.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
getExerciseId()
Get exercise id.
Class ilObjExercise.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilExAssignment::getOrderNr ( )

Get order nr.

Returns
int order nr

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

References $order_nr.

Referenced by save(), and update().

328  {
329  return $this->order_nr;
330  }
+ Here is the caller graph for this function:

◆ getPeerReview()

ilExAssignment::getPeerReview ( )

Get peer review status.

Returns
bool

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

References $peer.

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

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

◆ getPeerReviewChars()

ilExAssignment::getPeerReviewChars ( )

Get peer review minimum characters.

Returns
int

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

References $peer_char.

Referenced by save(), and update().

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

◆ getPeerReviewCriteriaCatalogue()

ilExAssignment::getPeerReviewCriteriaCatalogue ( )

Get peer review criteria catalogue id.

Returns
int

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

Referenced by save(), and update().

598  {
599  return $this->crit_cat;
600  }
+ Here is the caller graph for this function:

◆ getPeerReviewCriteriaCatalogueItems()

ilExAssignment::getPeerReviewCriteriaCatalogueItems ( )

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

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

603  {
604  include_once "Modules/Exercise/classes/class.ilExcCriteria.php";
605 
606  if($this->crit_cat)
607  {
608  return ilExcCriteria::getInstancesByParentId($this->crit_cat);
609  }
610  else
611  {
612  $res = array();
613 
614  if($this->peer_rating)
615  {
617  }
618 
619  if($this->peer_text)
620  {
621  $crit = ilExcCriteria::getInstanceByType("text");
622  if($this->peer_char)
623  {
624  $crit->setMinChars($this->peer_char);
625  }
626  $res[] = $crit;
627  }
628 
629  if($this->peer_file)
630  {
632  }
633 
634  return $res;
635  }
636  }
static getInstanceByType($a_type)
static getInstancesByParentId($a_parent_id)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getPeerReviewDeadline()

ilExAssignment::getPeerReviewDeadline ( )

Get peer review deadline (timestamp)

Returns
int deadline (timestamp)

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

References $peer_dl.

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

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

◆ getPeerReviewMin()

ilExAssignment::getPeerReviewMin ( )

Get peer review minimum.

Returns
int

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

References $peer_min.

Referenced by save(), and update().

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

◆ getPeerReviewSimpleUnlock()

ilExAssignment::getPeerReviewSimpleUnlock ( )

Get peer review simple unlock.

Returns
bool

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

References $peer_unlock.

Referenced by save(), and update().

432  {
433  return (bool)$this->peer_unlock;
434  }
+ Here is the caller graph for this function:

◆ getPeerReviewValid()

ilExAssignment::getPeerReviewValid ( )

Get peer review validatiob.

Returns
int

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

References $peer_valid.

Referenced by save(), and update().

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

◆ getPendingFeedbackNotifications()

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

References $ilDB, $res, $row, array, and time.

Referenced by ilExcCronFeedbackNotification\run().

1628  {
1629  global $ilDB;
1630 
1631  $res = array();
1632 
1633  $set = $ilDB->query("SELECT id,fb_file FROM exc_assignment".
1634  " WHERE fb_cron = ".$ilDB->quote(1, "integer").
1635  " AND fb_date = ".$ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer").
1636  " AND time_stamp IS NOT NULL".
1637  " AND time_stamp > ".$ilDB->quote(0, "integer").
1638  " AND time_stamp < ".$ilDB->quote(time(), "integer").
1639  " AND fb_cron_done = ".$ilDB->quote(0, "integer"));
1640  while($row = $ilDB->fetchAssoc($set))
1641  {
1642  if(trim($row["fb_file"]))
1643  {
1644  $res[] = $row["id"];
1645  }
1646  }
1647 
1648  return $res;
1649  }
Create styles array
The data for the language used.
global $ilDB
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the caller graph for this function:

◆ getPersonalDeadline()

ilExAssignment::getPersonalDeadline (   $a_user_id)

Get individual deadline.

Parameters
int$a_user_id
Returns
int

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

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

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

186  {
187  global $ilDB;
188 
189  $is_team = false;
190  if($this->getType() == self::TYPE_UPLOAD_TEAM)
191  {
192  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
193  $team_id = ilExAssignmentTeam::getTeamId($this->getId(), $a_user_id);
194  if(!$team_id)
195  {
196  // #0021043
197  $this->getDeadline();
198  }
199  $a_user_id = $team_id;
200  $is_team = true;
201  }
202 
203  $set = $ilDB->query("SELECT tstamp FROM exc_idl".
204  " WHERE ass_id = ".$ilDB->quote($this->getId(), "integer").
205  " AND member_id = ".$ilDB->quote($a_user_id, "integer").
206  " AND is_team = ".$ilDB->quote($is_team, "integer"));
207  $row = $ilDB->fetchAssoc($set);
208 
209  // use assignment deadline if no direct personal
210  return max($row["tstamp"], $this->getDeadline());
211  }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartTime()

ilExAssignment::getStartTime ( )

Get start time (timestamp)

Returns
int start time (timestamp)

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

References $start_time.

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

156  {
157  return $this->start_time;
158  }
+ Here is the caller graph for this function:

◆ getTeamTutor()

ilExAssignment::getTeamTutor ( )

Get team management by tutor.

Returns
bool

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

References $team_tutor.

Referenced by save(), and update().

714  {
715  return $this->team_tutor;
716  }
+ Here is the caller graph for this function:

◆ getTitle()

◆ getType()

ilExAssignment::getType ( )

Get type.

Returns
int

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

References $type.

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

356  {
357  return $this->type;
358  }
+ Here is the caller graph for this function:

◆ handleCalendarEntries()

ilExAssignment::handleCalendarEntries (   $a_event)
protected

Handle calendar entries for deadline(s)

Parameters
string$a_event

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

References array, getDeadline(), getExerciseId(), getId(), getPeerReview(), getPeerReviewDeadline(), getTitle(), IL_CAL_TRANSLATION_SYSTEM, and IL_CAL_UNIX.

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

1574  {
1575  global $ilAppEventHandler;
1576 
1577  $dl_id = $this->getId()."0";
1578  $fbdl_id = $this->getId()."1";
1579 
1580  $context_ids = array($dl_id, $fbdl_id);
1581  $apps = array();
1582 
1583  if($a_event != "delete")
1584  {
1585  include_once "Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php";
1586 
1587  if($this->getDeadline())
1588  {
1589  $app = new ilCalendarAppointmentTemplate($dl_id);
1590  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1591  $app->setSubtitle("cal_exc_deadline");
1592  $app->setTitle($this->getTitle());
1593  $app->setFullday(false);
1594  $app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
1595 
1596  $apps[] = $app;
1597  }
1598 
1599  if($this->getPeerReview() &&
1600  $this->getPeerReviewDeadline())
1601  {
1602  $app = new ilCalendarAppointmentTemplate($fbdl_id);
1603  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1604  $app->setSubtitle("cal_exc_peer_review_deadline");
1605  $app->setTitle($this->getTitle());
1606  $app->setFullday(false);
1607  $app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
1608 
1609  $apps[] = $app;
1610  }
1611 
1612  }
1613 
1614  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1615  $exc = new ilObjExercise($this->getExerciseId(), false);
1616 
1617  $ilAppEventHandler->raise('Modules/Exercise',
1618  $a_event.'Assignment',
1619  array(
1620  'object' => $exc,
1621  'obj_id' => $exc->getId(),
1622  'context_ids' => $context_ids,
1623  'appointments' => $apps));
1624  }
getPeerReview()
Get peer review status.
const IL_CAL_TRANSLATION_SYSTEM
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
Apointment templates are used for automatic generated apointments.
const IL_CAL_UNIX
getExerciseId()
Get exercise id.
Class ilObjExercise.
Date and time handling
Create styles array
The data for the language used.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleGlobalFeedbackFileUpload()

ilExAssignment::handleGlobalFeedbackFileUpload ( array  $a_file)

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1769  {
1771  ilUtil::delDir($path, true);
1772  if (ilUtil::moveUploadedFile($a_file["tmp_name"], $a_file["name"], $path."/".$a_file["name"]))
1773  {
1774  $this->setFeedbackFile($a_file["name"]);
1775  return true;
1776  }
1777  return false;
1778  }
$path
Definition: aliased.php:25
setFeedbackFile($a_value)
Set (global) feedback file.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasActiveIDl()

ilExAssignment::hasActiveIDl ( )

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

References getDeadline().

Referenced by ilExerciseSubmissionTableGUI\parseRow().

1910  {
1911  return (bool)$this->getDeadline();
1912  }
getDeadline()
Get deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasFeedbackCron()

ilExAssignment::hasFeedbackCron ( )

Get (global) feedback file cron status.

Returns
int

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

References $feedback_cron.

Referenced by save(), and update().

674  {
675  return (bool)$this->feedback_cron;
676  }
+ Here is the caller graph for this function:

◆ hasPeerReviewFileUpload()

ilExAssignment::hasPeerReviewFileUpload ( )

Get peer review file upload status.

Returns
bool

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

References $peer_file.

Referenced by save(), and update().

532  {
533  return $this->peer_file;
534  }
+ Here is the caller graph for this function:

◆ hasPeerReviewPersonalized()

ilExAssignment::hasPeerReviewPersonalized ( )

Get peer review personalized status.

Returns
bool

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

References $peer_personal.

Referenced by save(), and update().

552  {
553  return $this->peer_personal;
554  }
+ Here is the caller graph for this function:

◆ hasPeerReviewRating()

ilExAssignment::hasPeerReviewRating ( )

Get peer review rating status.

Returns
bool

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

References $peer_rating.

Referenced by save(), and update().

492  {
493  return $this->peer_rating;
494  }
+ Here is the caller graph for this function:

◆ hasPeerReviewText()

ilExAssignment::hasPeerReviewText ( )

Get peer review text status.

Returns
bool

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

References $peer_text.

Referenced by save(), and update().

512  {
513  return $this->peer_text;
514  }
+ Here is the caller graph for this function:

◆ hasReadOnlyIDl()

ilExAssignment::hasReadOnlyIDl ( )

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

References getPeerReview(), getType(), and TYPE_UPLOAD_TEAM.

Referenced by ilExerciseSubmissionTableGUI\parseRow().

1915  {
1916  if($this->getType() != ilExAssignment::TYPE_UPLOAD_TEAM &&
1917  $this->getPeerReview())
1918  {
1919  // all deadlines are read-only if we have peer feedback
1920  include_once "Modules/Exercise/classes/class.ilExPeerReview.php";
1921  $peer_review = new ilExPeerReview($this);
1922  if($peer_review->hasPeerReviewGroups())
1923  {
1924  return true;
1925  }
1926  }
1927 
1928  return false;
1929  }
getPeerReview()
Get peer review status.
Exercise peer review.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTeam()

ilExAssignment::hasTeam ( )

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

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

96  {
97  return $this->type == self::TYPE_UPLOAD_TEAM;
98  }
+ Here is the caller graph for this function:

◆ initFromDB()

ilExAssignment::initFromDB ( array  $a_set)
protected

Import DB record.

See also
getInstancesByExercise()
Parameters
array$a_set

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

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

Referenced by read().

768  {
769  $this->setId($a_set["id"]);
770  $this->setExerciseId($a_set["exc_id"]);
771  $this->setDeadline($a_set["time_stamp"]);
772  $this->setExtendedDeadline($a_set["deadline2"]);
773  $this->setInstruction($a_set["instruction"]);
774  $this->setTitle($a_set["title"]);
775  $this->setStartTime($a_set["start_time"]);
776  $this->setOrderNr($a_set["order_nr"]);
777  $this->setMandatory($a_set["mandatory"]);
778  $this->setType($a_set["type"]);
779  $this->setPeerReview($a_set["peer"]);
780  $this->setPeerReviewMin($a_set["peer_min"]);
781  $this->setPeerReviewSimpleUnlock($a_set["peer_unlock"]);
782  $this->setPeerReviewDeadline($a_set["peer_dl"]);
783  $this->setPeerReviewValid($a_set["peer_valid"]);
784  $this->setPeerReviewFileUpload($a_set["peer_file"]);
785  $this->setPeerReviewPersonalized($a_set["peer_prsl"]);
786  $this->setPeerReviewChars($a_set["peer_char"]);
787  $this->setPeerReviewText($a_set["peer_text"]);
788  $this->setPeerReviewRating($a_set["peer_rating"]);
789  $this->setPeerReviewCriteriaCatalogue($a_set["peer_crit_cat"]);
790  $this->setFeedbackFile($a_set["fb_file"]);
791  $this->setFeedbackDate($a_set["fb_date"]);
792  $this->setFeedbackCron($a_set["fb_cron"]);
793  $this->setTeamTutor($a_set["team_tutor"]);
794  $this->setMaxFile($a_set["max_file"]);
795  }
setMaxFile($a_value)
Set max number of uploads.
setFeedbackFile($a_value)
Set (global) feedback file.
setPeerReviewMin($a_value)
Set peer review minimum.
setTeamTutor($a_value)
Set team management by tutor.
setPeerReviewFileUpload($a_val)
Set peer review file upload.
setPeerReview($a_value)
Toggle peer review.
setPeerReviewDeadline($a_val)
Set peer review deadline (timestamp)
setPeerReviewValid($a_value)
Set peer review validation.
setType($a_value)
Set type.
setTitle($a_val)
Set title.
setOrderNr($a_val)
Set order nr.
setInstruction($a_val)
Set instruction.
setStartTime($a_val)
Set start time (timestamp)
setDeadline($a_val)
Set deadline (timestamp)
setPeerReviewCriteriaCatalogue($a_value)
Set peer review criteria catalogue id.
setPeerReviewPersonalized($a_val)
Set peer review personalized.
setPeerReviewRating($a_val)
Set peer review rating.
setPeerReviewSimpleUnlock($a_value)
Set peer review simple unlock.
setPeerReviewText($a_val)
Set peer review text.
setExerciseId($a_val)
Set exercise id.
setFeedbackCron($a_value)
Toggle (global) feedback file cron.
setFeedbackDate($a_value)
Set (global) feedback file availability date.
setPeerReviewChars($a_value)
Set peer review minimum characters.
setId($a_val)
Set assignment id.
setMandatory($a_val)
Set mandatory.
setExtendedDeadline($a_val)
Set extended deadline (timestamp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidType()

ilExAssignment::isValidType (   $a_value)

Is given type valid?

Parameters
int$a_value
Returns
bool

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

References array.

Referenced by setType().

367  {
368  if(in_array((int)$a_value, array(self::TYPE_UPLOAD, self::TYPE_BLOG,
369  self::TYPE_PORTFOLIO, self::TYPE_UPLOAD_TEAM, self::TYPE_TEXT)))
370  {
371  return true;
372  }
373  return false;
374  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ lookup()

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

Private lookup.

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

References $ilDB.

1091  {
1092  global $ilDB;
1093 
1094  $set = $ilDB->query("SELECT ".$a_field." FROM exc_assignment ".
1095  " WHERE id = ".$ilDB->quote($a_id, "integer")
1096  );
1097 
1098  $rec = $ilDB->fetchAssoc($set);
1099 
1100  return $rec[$a_field];
1101  }
global $ilDB

◆ lookupAssignmentOnline()

static ilExAssignment::lookupAssignmentOnline (   $a_ass_id)
static

Check if assignment is online.

Parameters
int$a_ass_id
Returns
bool

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

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

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

1056  {
1057  global $ilDB;
1058 
1059  $query = "SELECT id FROM exc_assignment ".
1060  "WHERE start_time <= ".$ilDB->quote(time(),'integer').' '.
1061  "AND time_stamp >= ".$ilDB->quote(time(),'integer').' '.
1062  "AND id = ".$ilDB->quote($a_ass_id,'integer');
1063  $res = $ilDB->query($query);
1064 
1065  return $res->numRows() ? true : false;
1066  }
global $ilDB
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the caller graph for this function:

◆ lookupExerciseId()

static ilExAssignment::lookupExerciseId (   $a_ass_id)
static

Lookup excercise id for assignment id.

Parameters
int$a_ass_id
Returns
int

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

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

Referenced by ilObjExerciseGUI\__construct().

1075  {
1076  global $DIC;
1077 
1078  $ilDB = $DIC->database();
1079 
1080  $query = "SELECT exc_id FROM exc_assignment ".
1081  "WHERE id = ".$ilDB->quote($a_ass_id,'integer');
1082  $res = $ilDB->fetchAssoc($ilDB->query($query));
1083 
1084  return (int) $res["exc_id"];
1085  }
global $ilDB
global $DIC
+ Here is the caller graph for this function:

◆ lookupMaxOrderNrForEx()

static ilExAssignment::lookupMaxOrderNrForEx (   $a_exc_id)
static

Select the maximum order nr for an exercise.

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

References $ilDB.

1037  {
1038  global $ilDB;
1039 
1040  $set = $ilDB->query("SELECT MAX(order_nr) mnr FROM exc_assignment ".
1041  " WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer")
1042  );
1043  while ($rec = $ilDB->fetchAssoc($set))
1044  {
1045  return (int) $rec["mnr"];
1046  }
1047  return 0;
1048  }
global $ilDB

◆ lookupTitle()

static ilExAssignment::lookupTitle (   $a_id)
static

Lookup title.

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

Referenced by ilExAssignmentEditorGUI\confirmAssignmentsDeletionObject(), ilExSubmission\downloadMultipleFiles(), ilObjExerciseSubItemListGUI\getHTML(), ilExerciseManagementGUI\initMultiFeedbackForm(), and ilExerciseMailNotification\send().

1107  {
1108  return self::lookup($a_id, "title");
1109  }
+ Here is the caller graph for this function:

◆ lookupType()

static ilExAssignment::lookupType (   $a_id)
static

Lookup type.

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

1115  {
1116  return self::lookup($a_id, "type");
1117  }

◆ lookupUpdatedSubmission()

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

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

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

References $ilDB, $lng, and array.

1184  {
1185  global $ilDB, $lng;
1186 
1187  // team upload?
1188  $user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
1189  if(!$user_ids)
1190  {
1191  $user_ids = array($member_id);
1192  }
1193 
1194  $q="SELECT exc_mem_ass_status.status_time, exc_returned.ts ".
1195  "FROM exc_mem_ass_status, exc_returned ".
1196  "WHERE exc_mem_ass_status.status_time < exc_returned.ts ".
1197  "AND NOT exc_mem_ass_status.status_time IS NULL ".
1198  "AND exc_returned.ass_id = exc_mem_ass_status.ass_id ".
1199  "AND exc_returned.user_id = exc_mem_ass_status.usr_id ".
1200  "AND exc_returned.ass_id=".$ilDB->quote($ass_id, "integer").
1201  " AND ".$ilDB->in("exc_returned.user_id", $user_ids, "", "integer");
1202 
1203  $usr_set = $ilDB->query($q);
1204 
1205  $array = $ilDB->fetchAssoc($usr_set);
1206 
1207  if (count($array)==0)
1208  {
1209  return 0;
1210  }
1211  else
1212  {
1213  return 1;
1214  }
1215 
1216  }
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
global $ilDB

◆ notStartedYet()

ilExAssignment::notStartedYet ( )

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

References time.

Referenced by ilExAssignmentGUI\addInstructions(), ilExAssignmentGUI\addSchedule(), ilExAssignmentGUI\getOverviewBody(), and ilExAssignmentGUI\getOverviewHeader().

1747  {
1748  return (time() - $this->start_time <= 0);
1749  }
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the caller graph for this function:

◆ orderAssByDeadline()

static ilExAssignment::orderAssByDeadline (   $a_ex_id)
static

Order assignments by deadline date.

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

References $ilDB.

Referenced by ilExAssignmentEditorGUI\orderAssignmentsByDeadlineObject().

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

◆ read()

ilExAssignment::read ( )

Read from db.

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

References $ilDB, and initFromDB().

Referenced by __construct().

746  {
747  global $ilDB;
748 
749  $set = $ilDB->query("SELECT * FROM exc_assignment ".
750  " WHERE id = ".$ilDB->quote($this->getId(), "integer")
751  );
752  $rec = $ilDB->fetchAssoc($set);
753 
754  // #16172 - might be deleted
755  if(is_array($rec))
756  {
757  $this->initFromDB($rec);
758  }
759  }
initFromDB(array $a_set)
Import DB record.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateLateSubmissions()

ilExAssignment::recalculateLateSubmissions ( )

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

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

1811  {
1812  global $ilDB;
1813 
1814  // see JF, 2015-05-11
1815 
1816  $ext_deadline = $this->getExtendedDeadline();
1817 
1818  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1819  foreach(ilExSubmission::getAllAssignmentFiles($this->exc_id, $this->getId()) as $file)
1820  {
1821  $id = $file["returned_id"];
1822  $uploaded = new ilDateTime($file["ts"], IL_CAL_DATETIME);
1823  $uploaded = $uploaded->get(IL_CAL_UNIX);
1824 
1825  $deadline = $this->getPersonalDeadline($file["user_id"]);
1826  $last_deadline = max($deadline, $this->getExtendedDeadline());
1827 
1828  $late = null;
1829 
1830  // upload is not late anymore
1831  if($file["late"] &&
1832  (!$last_deadline ||
1833  !$ext_deadline ||
1834  $uploaded < $deadline))
1835  {
1836  $late = false;
1837  }
1838  // upload is now late
1839  else if(!$file["late"] &&
1840  $ext_deadline &&
1841  $deadline &&
1842  $uploaded > $deadline)
1843  {
1844  $late = true;
1845  }
1846  else if($last_deadline && $uploaded > $last_deadline)
1847  {
1848  // do nothing, we do not remove submissions?
1849  }
1850 
1851  if($late !== null)
1852  {
1853  $ilDB->manipulate("UPDATE exc_returned".
1854  " SET late = ".$ilDB->quote($late, "integer").
1855  " WHERE returned_id = ".$ilDB->quote($id, "integer"));
1856  }
1857  }
1858  }
getPersonalDeadline($a_user_id)
Get individual deadline.
const IL_CAL_DATETIME
getId()
Get assignment id.
const IL_CAL_UNIX
Date and time handling
getExtendedDeadline()
Get extended deadline (timestamp)
global $ilDB
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static getAllAssignmentFiles($a_exc_id, $a_ass_id)
+ Here is the call graph for this function:

◆ save()

ilExAssignment::save ( )

Save assignment.

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

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

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

801  {
802  global $ilDB;
803 
804  if ($this->getOrderNr() == 0)
805  {
806  $this->setOrderNr(
807  self::lookupMaxOrderNrForEx($this->getExerciseId())
808  + 10);
809  }
810 
811  $next_id = $ilDB->nextId("exc_assignment");
812  $ilDB->insert("exc_assignment", array(
813  "id" => array("integer", $next_id),
814  "exc_id" => array("integer", $this->getExerciseId()),
815  "time_stamp" => array("integer", $this->getDeadline()),
816  "deadline2" => array("integer", $this->getExtendedDeadline()),
817  "instruction" => array("clob", $this->getInstruction()),
818  "title" => array("text", $this->getTitle()),
819  "start_time" => array("integer", $this->getStartTime()),
820  "order_nr" => array("integer", $this->getOrderNr()),
821  "mandatory" => array("integer", $this->getMandatory()),
822  "type" => array("integer", $this->getType()),
823  "peer" => array("integer", $this->getPeerReview()),
824  "peer_min" => array("integer", $this->getPeerReviewMin()),
825  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
826  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
827  "peer_valid" => array("integer", $this->getPeerReviewValid()),
828  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
829  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
830  "peer_char" => array("integer", $this->getPeerReviewChars()),
831  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
832  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
833  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
834  "fb_file" => array("text", $this->getFeedbackFile()),
835  "fb_date" => array("integer", $this->getFeedbackDate()),
836  "fb_cron" => array("integer", $this->hasFeedbackCron()),
837  "team_tutor" => array("integer", $this->getTeamTutor()),
838  "max_file" => array("integer", $this->getMaxFile())
839  ));
840  $this->setId($next_id);
841  $exc = new ilObjExercise($this->getExerciseId(), false);
842  $exc->updateAllUsersStatus();
843  self::createNewAssignmentRecords($next_id, $exc);
844 
845  $this->handleCalendarEntries("create");
846  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
setOrderNr($a_val)
Set order nr.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
Create styles array
The data for the language used.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
setId($a_val)
Set assignment id.
getPeerReviewDeadline()
Get peer review deadline (timestamp)
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssOrderOfExercise()

ilExAssignment::saveAssOrderOfExercise (   $a_ex_id,
  $a_order 
)

Save ordering of all assignments of an exercise.

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

References $ilDB, $t, and array.

Referenced by ilExAssignmentEditorGUI\saveAssignmentOrderObject().

1123  {
1124  global $ilDB;
1125 
1126  $result_order = array();
1127  asort($a_order);
1128  $nr = 10;
1129  foreach ($a_order as $k => $v)
1130  {
1131  // the check for exc_id is for security reasons. ass ids are unique.
1132  $ilDB->manipulate($t = "UPDATE exc_assignment SET ".
1133  " order_nr = ".$ilDB->quote($nr, "integer").
1134  " WHERE id = ".$ilDB->quote((int) $k, "integer").
1135  " AND exc_id = ".$ilDB->quote((int) $a_ex_id, "integer")
1136  );
1137  $nr+=10;
1138  }
1139  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ saveMultiFeedbackFiles()

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

Save multi feedback files.

Parameters

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

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

1509  {
1510  if($this->getExerciseId() != $a_exc->getId())
1511  {
1512  return;
1513  }
1514 
1515  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1516  $fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1517  $fstorage->create();
1518 
1519  $team_map = array();
1520 
1521  $mf_files = $this->getMultiFeedbackFiles();
1522  foreach ($mf_files as $f)
1523  {
1524  $user_id = $f["user_id"];
1525  $file_path = $f["full_path"];
1526  $file_name = $f["file"];
1527 
1528  // if checked in confirmation gui
1529  if ($a_files[$user_id][md5($file_name)] != "")
1530  {
1531  $submission = new ilExSubmission($this, $user_id);
1532  $feedback_id = $submission->getFeedbackId();
1533  $noti_rec_ids = $submission->getUserIds();
1534 
1535  if ($feedback_id)
1536  {
1537  $fb_path = $fstorage->getFeedbackPath($feedback_id);
1538  $target = $fb_path."/".$file_name;
1539  if (is_file($target))
1540  {
1541  unlink($target);
1542  }
1543  // rename file
1544  rename($file_path, $target);
1545 
1546  if ($noti_rec_ids)
1547  {
1548  foreach($noti_rec_ids as $user_id)
1549  {
1550  $member_status = $this->getMemberStatus($user_id);
1551  $member_status->setFeedback(true);
1552  $member_status->update();
1553  }
1554 
1555  $a_exc->sendFeedbackFileNotification($file_name, $noti_rec_ids,
1556  (int) $this->getId());
1557  }
1558  }
1559  }
1560  }
1561 
1562  $this->clearMultiFeedbackDirectory();
1563  }
getMemberStatus($a_user_id=null)
getId()
Get assignment id.
getExerciseId()
Get exercise id.
getId()
get object id public
Create styles array
The data for the language used.
sendFeedbackFileNotification($a_feedback_file, $a_user_id, $a_ass_id, $a_is_text_feedback=false)
Send feedback file notification to user.
clearMultiFeedbackDirectory()
Clear multi feedback directory.
getMultiFeedbackFiles($a_user_id=0)
Get multi feedback files (of uploader)
Exercise submission.
+ Here is the call graph for this function:

◆ sendFeedbackNotifications()

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

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

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

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

1652  {
1653  global $ilDB;
1654 
1655  $ass = new self($a_ass_id);
1656 
1657  // valid assignment?
1658  if(!$ass->hasFeedbackCron() || !$ass->getFeedbackFile())
1659  {
1660  return false;
1661  }
1662 
1663  if(!$a_user_id)
1664  {
1665  // already done?
1666  $set = $ilDB->query("SELECT fb_cron_done".
1667  " FROM exc_assignment".
1668  " WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
1669  $row = $ilDB->fetchAssoc($set);
1670  if($row["fb_cron_done"])
1671  {
1672  return false;
1673  }
1674  }
1675 
1676  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1677  $ntf = new ilSystemNotification();
1678  $ntf->setLangModules(array("exc"));
1679  $ntf->setObjId($ass->getExerciseId());
1680  $ntf->setSubjectLangId("exc_feedback_notification_subject");
1681  $ntf->setIntroductionLangId("exc_feedback_notification_body");
1682  $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
1683  $ntf->setGotoLangId("exc_feedback_notification_link");
1684  $ntf->setReasonLangId("exc_feedback_notification_reason");
1685 
1686  if(!$a_user_id)
1687  {
1688  include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
1689  $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
1690 
1691  $ilDB->manipulate("UPDATE exc_assignment".
1692  " SET fb_cron_done = ".$ilDB->quote(1, "integer").
1693  " WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
1694  }
1695  else
1696  {
1697  $ntf->sendMail(array($a_user_id));
1698  }
1699 
1700  return true;
1701  }
Create styles array
The data for the language used.
global $ilDB
Wrapper classes for system notifications.
static _getMembers($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMultiFeedbackStructureFile()

ilExAssignment::sendMultiFeedbackStructureFile ( )

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

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

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

1331  {
1332  global $ilDB;
1333 
1334 
1335  // send and delete the zip file
1336  $deliverFilename = trim(str_replace(" ", "_", $this->getTitle()."_".$this->getId()));
1337  $deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
1338  $deliverFilename = "multi_feedback_".$deliverFilename;
1339 
1340  $exc = new ilObjExercise($this->getExerciseId(), false);
1341 
1342  $cdir = getcwd();
1343 
1344  // create temporary directoy
1345  $tmpdir = ilUtil::ilTempnam();
1346  ilUtil::makeDir($tmpdir);
1347  $mfdir = $tmpdir."/".$deliverFilename;
1348  ilUtil::makeDir($mfdir);
1349 
1350  // create subfolders <lastname>_<firstname>_<id> for each participant
1351  include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
1352  $exmem = new ilExerciseMembers($exc);
1353  $mems = $exmem->getMembers();
1354 
1355  foreach ($mems as $mem)
1356  {
1357  $name = ilObjUser::_lookupName($mem);
1358  $subdir = $name["lastname"]."_".$name["firstname"]."_".$name["login"]."_".$name["user_id"];
1359  $subdir = ilUtil::getASCIIFilename($subdir);
1360  ilUtil::makeDir($mfdir."/".$subdir);
1361  }
1362 
1363  // create the zip file
1364  chdir($tmpdir);
1365  $tmpzipfile = $tmpdir."/multi_feedback.zip";
1366  ilUtil::zip($tmpdir, $tmpzipfile, true);
1367  chdir($cdir);
1368 
1369 
1370  ilUtil::deliverFile($tmpzipfile, $deliverFilename.".zip", "", false, true);
1371  }
static _lookupName($a_user_id)
lookup user name
Class ilExerciseMembers.
getId()
Get assignment id.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
getExerciseId()
Get exercise id.
Class ilObjExercise.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
global $ilDB
+ Here is the call graph for this function:

◆ setDeadline()

ilExAssignment::setDeadline (   $a_val)

Set deadline (timestamp)

Parameters
intdeadline (timestamp)

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

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

166  {
167  $this->deadline = $a_val;
168  }
+ Here is the caller graph for this function:

◆ setExerciseId()

ilExAssignment::setExerciseId (   $a_val)

Set exercise id.

Parameters
intexercise id

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

Referenced by initFromDB().

126  {
127  $this->exc_id = $a_val;
128  }
+ Here is the caller graph for this function:

◆ setExtendedDeadline()

ilExAssignment::setExtendedDeadline (   $a_val)

Set extended deadline (timestamp)

Parameters
int

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

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

234  {
235  if($a_val !== null)
236  {
237  $a_val = (int)$a_val;
238  }
239  $this->deadline2 = $a_val;
240  }
+ Here is the caller graph for this function:

◆ setFeedbackCron()

ilExAssignment::setFeedbackCron (   $a_value)

Toggle (global) feedback file cron.

Parameters
bool$a_value

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

References string.

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

664  {
665  $this->feedback_cron = (string)$a_value;
666  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

◆ setFeedbackDate()

ilExAssignment::setFeedbackDate (   $a_value)

Set (global) feedback file availability date.

Parameters
int$a_value

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

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

684  {
685  $this->feedback_date = (int)$a_value;
686  }
+ Here is the caller graph for this function:

◆ setFeedbackFile()

ilExAssignment::setFeedbackFile (   $a_value)

Set (global) feedback file.

Parameters
string$a_value

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

References string.

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

644  {
645  $this->feedback_file = (string)$a_value;
646  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

◆ setId()

ilExAssignment::setId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

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

106  {
107  $this->id = $a_val;
108  }
+ Here is the caller graph for this function:

◆ setIndividualDeadline()

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

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

References $id, $ilDB, array, ilDateTime\get(), getId(), and IL_CAL_UNIX.

1866  {
1867  global $ilDB;
1868 
1869  $is_team = false;
1870  if(!is_numeric($id))
1871  {
1872  $id = substr($id, 1);
1873  $is_team = true;
1874  }
1875 
1876  $ilDB->replace("exc_idl",
1877  array(
1878  "ass_id" => array("integer", $this->getId()),
1879  "member_id" => array("integer", $id),
1880  "is_team" => array("integer", $is_team)
1881  ),
1882  array(
1883  "tstamp" => array("integer", $date->get(IL_CAL_UNIX))
1884  )
1885  );
1886  }
getId()
Get assignment id.
const IL_CAL_UNIX
get($a_format, $a_format_str='', $a_tz='')
get formatted date
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ setInstruction()

ilExAssignment::setInstruction (   $a_val)

Set instruction.

Parameters
stringinstruction

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

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

258  {
259  $this->instruction = $a_val;
260  }
+ Here is the caller graph for this function:

◆ setMandatory()

ilExAssignment::setMandatory (   $a_val)

Set mandatory.

Parameters
intmandatory

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

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

298  {
299  $this->mandatory = $a_val;
300  }
+ Here is the caller graph for this function:

◆ setMaxFile()

ilExAssignment::setMaxFile (   $a_value)

Set max number of uploads.

Parameters
int$a_value

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

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

724  {
725  if($a_value !== null)
726  {
727  $a_value = (int)$a_value;
728  }
729  $this->max_file = $a_value;
730  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilExAssignment::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

Referenced by initFromDB(), and save().

318  {
319  $this->order_nr = $a_val;
320  }
+ Here is the caller graph for this function:

◆ setPeerReview()

ilExAssignment::setPeerReview (   $a_value)

Toggle peer review.

Parameters
bool$a_value

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

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

382  {
383  $this->peer = (bool)$a_value;
384  }
+ Here is the caller graph for this function:

◆ setPeerReviewChars()

ilExAssignment::setPeerReviewChars (   $a_value)

Set peer review minimum characters.

Parameters
int$a_value

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

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

562  {
563  $a_value = (is_numeric($a_value) && (int)$a_value > 0)
564  ? (int)$a_value
565  : null;
566  $this->peer_char = $a_value;
567  }
+ Here is the caller graph for this function:

◆ setPeerReviewCriteriaCatalogue()

ilExAssignment::setPeerReviewCriteriaCatalogue (   $a_value)

Set peer review criteria catalogue id.

Parameters
int$a_value

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

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

585  {
586  $a_value = is_numeric($a_value)
587  ? (int)$a_value
588  : null;
589  $this->crit_cat = $a_value;
590  }
+ Here is the caller graph for this function:

◆ setPeerReviewDeadline()

ilExAssignment::setPeerReviewDeadline (   $a_val)

Set peer review deadline (timestamp)

Parameters
intdeadline (timestamp)

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

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

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

◆ setPeerReviewFileUpload()

ilExAssignment::setPeerReviewFileUpload (   $a_val)

Set peer review file upload.

Parameters
bool

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

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

522  {
523  $this->peer_file = (bool)$a_val;
524  }
+ Here is the caller graph for this function:

◆ setPeerReviewMin()

ilExAssignment::setPeerReviewMin (   $a_value)

Set peer review minimum.

Parameters
int$a_value

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

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

402  {
403  $this->peer_min = (int)$a_value;
404  }
+ Here is the caller graph for this function:

◆ setPeerReviewPersonalized()

ilExAssignment::setPeerReviewPersonalized (   $a_val)

Set peer review personalized.

Parameters
bool

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

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

542  {
543  $this->peer_personal = (bool)$a_val;
544  }
+ Here is the caller graph for this function:

◆ setPeerReviewRating()

ilExAssignment::setPeerReviewRating (   $a_val)

Set peer review rating.

Parameters
bool

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

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

482  {
483  $this->peer_rating = (bool)$a_val;
484  }
+ Here is the caller graph for this function:

◆ setPeerReviewSimpleUnlock()

ilExAssignment::setPeerReviewSimpleUnlock (   $a_value)

Set peer review simple unlock.

Parameters
bool$a_value

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

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

422  {
423  $this->peer_unlock = (bool)$a_value;
424  }
+ Here is the caller graph for this function:

◆ setPeerReviewText()

ilExAssignment::setPeerReviewText (   $a_val)

Set peer review text.

Parameters
bool

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

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

502  {
503  $this->peer_text = (bool)$a_val;
504  }
+ Here is the caller graph for this function:

◆ setPeerReviewValid()

ilExAssignment::setPeerReviewValid (   $a_value)

Set peer review validation.

Parameters
int$a_value

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

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

462  {
463  $this->peer_valid = (int)$a_value;
464  }
+ Here is the caller graph for this function:

◆ setStartTime()

ilExAssignment::setStartTime (   $a_val)

Set start time (timestamp)

Parameters
intstart time (timestamp)

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

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

146  {
147  $this->start_time = $a_val;
148  }
+ Here is the caller graph for this function:

◆ setTeamTutor()

ilExAssignment::setTeamTutor (   $a_value)

Set team management by tutor.

Parameters
bool$a_value

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

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

704  {
705  $this->team_tutor = (bool)$a_value;
706  }
+ Here is the caller graph for this function:

◆ setTitle()

ilExAssignment::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

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

278  {
279  $this->title = $a_val;
280  }
+ Here is the caller graph for this function:

◆ setType()

ilExAssignment::setType (   $a_value)

Set type.

Parameters
int$a_value

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

References isValidType(), and setPeerReview().

Referenced by __construct(), and initFromDB().

338  {
339  if($this->isValidType($a_value))
340  {
341  $this->type = (int)$a_value;
342 
343  if($this->type == self::TYPE_UPLOAD_TEAM)
344  {
345  $this->setPeerReview(false);
346  }
347  }
348  }
setPeerReview($a_value)
Toggle peer review.
isValidType($a_value)
Is given type valid?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExAssignment::update ( )

Update.

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

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

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

852  {
853  global $ilDB;
854 
855  $ilDB->update("exc_assignment",
856  array(
857  "exc_id" => array("integer", $this->getExerciseId()),
858  "time_stamp" => array("integer", $this->getDeadline()),
859  "deadline2" => array("integer", $this->getExtendedDeadline()),
860  "instruction" => array("clob", $this->getInstruction()),
861  "title" => array("text", $this->getTitle()),
862  "start_time" => array("integer", $this->getStartTime()),
863  "order_nr" => array("integer", $this->getOrderNr()),
864  "mandatory" => array("integer", $this->getMandatory()),
865  "type" => array("integer", $this->getType()),
866  "peer" => array("integer", $this->getPeerReview()),
867  "peer_min" => array("integer", $this->getPeerReviewMin()),
868  "peer_unlock" => array("integer", $this->getPeerReviewSimpleUnlock()),
869  "peer_dl" => array("integer", $this->getPeerReviewDeadline()),
870  "peer_valid" => array("integer", $this->getPeerReviewValid()),
871  "peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
872  "peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
873  "peer_char" => array("integer", $this->getPeerReviewChars()),
874  "peer_text" => array("integer", (int) $this->hasPeerReviewText()),
875  "peer_rating" => array("integer", (int) $this->hasPeerReviewRating()),
876  "peer_crit_cat" => array("integer", $this->getPeerReviewCriteriaCatalogue()),
877  "fb_file" => array("text", $this->getFeedbackFile()),
878  "fb_date" => array("integer", $this->getFeedbackDate()),
879  "fb_cron" => array("integer", $this->hasFeedbackCron()),
880  "team_tutor" => array("integer", $this->getTeamTutor()),
881  "max_file" => array("integer", $this->getMaxFile())
882  ),
883  array(
884  "id" => array("integer", $this->getId()),
885  ));
886  $exc = new ilObjExercise($this->getExerciseId(), false);
887  $exc->updateAllUsersStatus();
888 
889  $this->handleCalendarEntries("update");
890  }
getPeerReview()
Get peer review status.
getFeedbackDate()
Get (global) feedback file availability date.
getStartTime()
Get start time (timestamp)
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
hasPeerReviewRating()
Get peer review rating status.
hasFeedbackCron()
Get (global) feedback file cron status.
handleCalendarEntries($a_event)
Handle calendar entries for deadline(s)
getTeamTutor()
Get team management by tutor.
getExerciseId()
Get exercise id.
getPeerReviewValid()
Get peer review validatiob.
Class ilObjExercise.
hasPeerReviewPersonalized()
Get peer review personalized status.
hasPeerReviewText()
Get peer review text status.
getFeedbackFile()
Get (global) feedback file.
Create styles array
The data for the language used.
getMandatory()
Get mandatory.
getPeerReviewMin()
Get peer review minimum.
getExtendedDeadline()
Get extended deadline (timestamp)
getInstruction()
Get instruction.
getPeerReviewSimpleUnlock()
Get peer review simple unlock.
global $ilDB
getPeerReviewDeadline()
Get peer review deadline (timestamp)
hasPeerReviewFileUpload()
Get peer review file upload status.
getPeerReviewChars()
Get peer review minimum characters.
getMaxFile()
Get max number of uploads.
getPeerReviewCriteriaCatalogue()
Get peer review criteria catalogue id.
getOrderNr()
Get order nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadAssignmentFiles()

ilExAssignment::uploadAssignmentFiles (   $a_files)

Upload assignment files (from creation form)

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

References getExerciseId(), and getId().

Referenced by ilExAssignmentEditorGUI\importFormToAssignment().

1315  {
1316  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1317  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1318  $storage->create();
1319  $storage->uploadAssignmentFiles($a_files);
1320  }
getId()
Get assignment id.
getExerciseId()
Get exercise id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadMultiFeedbackFile()

ilExAssignment::uploadMultiFeedbackFile (   $a_file)

Upload multi feedback file.

Parameters
array
Returns

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

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

1380  {
1381  global $lng, $ilUser;
1382 
1383  include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
1384  if (!is_file($a_file["tmp_name"]))
1385  {
1386  throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
1387  }
1388 
1389  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
1390  $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
1391  $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
1392  ilUtil::delDir($mfu, true);
1393  ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu."/"."multi_feedback.zip");
1394  ilUtil::unzip($mfu."/multi_feedback.zip", true);
1395  $subdirs = ilUtil::getDir($mfu);
1396  $subdir = "notfound";
1397  foreach ($subdirs as $s => $j)
1398  {
1399  if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
1400  {
1401  $subdir = $s;
1402  }
1403  }
1404 
1405  if (!is_dir($mfu."/".$subdir))
1406  {
1407  throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
1408  }
1409 
1410  return true;
1411  }
getId()
Get assignment id.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
getExerciseId()
Get exercise id.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Class to report exception.
+ Here is the call graph for this function:

Field Documentation

◆ $deadline

ilExAssignment::$deadline
protected

◆ $deadline2

ilExAssignment::$deadline2
protected

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

Referenced by getExtendedDeadline().

◆ $exc_id

ilExAssignment::$exc_id
protected

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

Referenced by getExerciseId().

◆ $feedback_cron

ilExAssignment::$feedback_cron
protected

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

Referenced by hasFeedbackCron().

◆ $feedback_date

ilExAssignment::$feedback_date
protected

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

Referenced by getFeedbackDate().

◆ $feedback_file

ilExAssignment::$feedback_file
protected

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

Referenced by getFeedbackFile().

◆ $id

ilExAssignment::$id
protected

◆ $instruction

ilExAssignment::$instruction
protected

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

Referenced by getInstruction().

◆ $mandatory

ilExAssignment::$mandatory
protected

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

Referenced by getMandatory().

◆ $max_file

ilExAssignment::$max_file
protected

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

Referenced by getMaxFile().

◆ $member_status

ilExAssignment::$member_status = array()
protected

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

Referenced by saveMultiFeedbackFiles().

◆ $order_nr

ilExAssignment::$order_nr
protected

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

Referenced by getOrderNr().

◆ $peer

ilExAssignment::$peer
protected

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

Referenced by getPeerReview().

◆ $peer_char

ilExAssignment::$peer_char
protected

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

Referenced by getPeerReviewChars().

◆ $peer_crit_cat

ilExAssignment::$peer_crit_cat
protected

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

◆ $peer_dl

ilExAssignment::$peer_dl
protected

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

Referenced by getPeerReviewDeadline().

◆ $peer_file

ilExAssignment::$peer_file
protected

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

Referenced by hasPeerReviewFileUpload().

◆ $peer_min

ilExAssignment::$peer_min
protected

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

Referenced by getPeerReviewMin().

◆ $peer_personal

ilExAssignment::$peer_personal
protected

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

Referenced by hasPeerReviewPersonalized().

◆ $peer_rating

ilExAssignment::$peer_rating
protected

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

Referenced by hasPeerReviewRating().

◆ $peer_text

ilExAssignment::$peer_text
protected

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

Referenced by hasPeerReviewText().

◆ $peer_unlock

ilExAssignment::$peer_unlock
protected

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

Referenced by getPeerReviewSimpleUnlock().

◆ $peer_valid

ilExAssignment::$peer_valid
protected

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

Referenced by getPeerReviewValid().

◆ $start_time

ilExAssignment::$start_time
protected

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

Referenced by getStartTime().

◆ $team_tutor

ilExAssignment::$team_tutor = false
protected

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

Referenced by getTeamTutor().

◆ $title

ilExAssignment::$title
protected

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

Referenced by getTitle().

◆ $type

ilExAssignment::$type
protected

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

Referenced by getType().

◆ 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

◆ TYPE_BLOG

◆ TYPE_PORTFOLIO

◆ TYPE_TEXT

◆ TYPE_UPLOAD

◆ TYPE_UPLOAD_TEAM


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