ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExAssignment Class Reference

Exercise assignment. More...

+ Collaboration diagram for ilExAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor.
 setId ($a_val)
 Set assignment id.
 getId ()
 Get assignment id.
 setExerciseId ($a_val)
 Set exercise id.
 getExerciseId ()
 Get exercise id.
 setStartTime ($a_val)
 Set start time (timestamp)
 getStartTime ()
 Get start time (timestamp)
 setDeadline ($a_val)
 Set deadline (timestamp)
 getDeadline ()
 Get deadline (timestamp)
 setInstruction ($a_val)
 Set instruction.
 getInstruction ()
 Get instruction.
 setTitle ($a_val)
 Set title.
 getTitle ()
 Get title.
 setMandatory ($a_val)
 Set mandatory.
 getMandatory ()
 Get mandatory.
 setOrderNr ($a_val)
 Set order nr.
 getOrderNr ()
 Get order nr.
 setType ($a_value)
 Set type.
 getType ()
 Get type.
 isValidType ($a_value)
 Is given type valid?
 setPeerReview ($a_value)
 Toggle peer review.
 getPeerReview ()
 Get peer review status.
 setPeerReviewMin ($a_value)
 Set peer review minimum.
 getPeerReviewMin ()
 Get peer review minimum.
 setPeerReviewDeadline ($a_val)
 Set peer review deadline (timestamp)
 getPeerReviewDeadline ()
 Get peer review deadline (timestamp)
 setPeerReviewFileUpload ($a_val)
 Set peer review file upload.
 hasPeerReviewFileUpload ()
 Get peer review file upload status.
 setPeerReviewPersonalized ($a_val)
 Set peer review personalized.
 hasPeerReviewPersonalized ()
 Get peer review personalized status.
 setFeedbackFile ($a_value)
 Set (global) feedback file.
 getFeedbackFile ()
 Get (global) feedback file.
 setFeedbackCron ($a_value)
 Toggle (global) feedback file cron.
 hasFeedbackCron ()
 Get (global) feedback file cron status.
 setFeedbackDate ($a_value)
 Set (global) feedback file availability date.
 getFeedbackDate ()
 Get (global) feedback file availability date.
 read ()
 Read from db.
 save ()
 Save assignment.
 update ()
 Update.
 delete ()
 Delete assignment.
 deleteFeedbackFile ()
 handleFeedbackFileUpload (array $a_file)
 getFeedbackFilePath ()
 cloneAssignmentsOfExercise ($a_old_exc_id, $a_new_exc_id)
 Clone assignments of exercise.
 saveAssOrderOfExercise ($a_ex_id, $a_order)
 Save ordering of all assignments of an exercise.
 orderAssByDeadline ($a_ex_id)
 Order assignments by deadline date.
 countMandatory ($a_ex_id)
 Order assignments by deadline date.
 lookupCommentForUser ($a_ass_id, $a_user_id)
 Lookup comment for the user.
 updateCommentForUser ($a_ass_id, $a_user_id, $a_value)
 Update comment.
 lookupMarkOfUser ($a_ass_id, $a_user_id)
 Lookup user mark.
 updateMarkOfUser ($a_ass_id, $a_user_id, $a_value)
 Update mark.
 lookupStatusOfUser ($a_ass_id, $a_user_id)
 was: getStatusByMember
 updateStatusOfUser ($a_ass_id, $a_user_id, $a_status)
 was: setStatusForMember($a_member_id,$a_status)
 updateStatusTimeOfUser ($a_ass_id, $a_user_id)
 was: updateStatusTimeForMember($a_user_id)
 lookupStatusSentOfUser ($a_ass_id, $a_user_id)
 was: getStatusSentByMember($a_member_id)
 updateStatusSentForUser ($a_ass_id, $a_user_id, $a_status)
 was: setStatusSentForMember($a_member_id,$a_status)
 lookupStatusReturnedOfUser ($a_ass_id, $a_user_id)
 was: getStatusReturnedByMember($a_member_id)
 updateStatusReturnedForUser ($a_ass_id, $a_user_id, $a_status)
 was: setStatusReturnedForMember($a_member_id,$a_status)
 lookupStatusFeedbackOfUser ($a_ass_id, $a_user_id)
 was: getStatusFeedbackByMember($a_member_id)
 updateStatusFeedbackForUser ($a_ass_id, $a_user_id, $a_status)
 was: setStatusFeedbackForMember($a_member_id,$a_status)
 lookupNoticeOfUser ($a_ass_id, $a_user_id)
 was: getNoticeByMember($a_member_id)
 hasReturned ($a_ass_id, $a_user_id)
 was: hasReturned($a_member_id)
 getAllDeliveredFiles ($a_exc_id, $a_ass_id)
 was: getAllDeliveredFiles()
 getDeliveredFiles ($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
 was: getDeliveredFiles($a_member_id)
 deleteDeliveredFiles ($a_exc_id, $a_ass_id, $file_id_array, $a_user_id)
 was: deleteDeliveredFiles($file_id_array, $a_member_id)
 deliverReturnedFiles ($a_exc_id, $a_ass_id, $a_user_id, $a_only_new=false, $a_peer_review_mask_filename=false)
 was: deliverReturnedFiles($a_member_id, $a_only_new = false)
 updateTutorDownloadTime ($a_exc_id, $a_ass_id, $a_user_id)
 was: updateTutorDownloadTime($member_id)
 downloadSelectedFiles ($a_exc_id, $a_ass_id, $a_user_id, $array_file_id)
 was: downloadSelectedFiles($array_file_id,$a_user_id)?
 downloadSingleFile ($a_exc_id, $a_ass_id, $a_user_id, $filename, $filetitle)
 was: downloadSingleFile($filename, $filetitle)
 downloadMultipleFiles ($a_exc_id, $a_ass_id, $array_filenames, $a_user_id, $a_multi_user=false)
 was: downloadMultipleFiles($array_filenames, $pathname, $a_member_id = 0)
 downloadAllDeliveredFiles ($a_exc_id, $a_ass_id, $members)
 Download all submitted files of an assignment (all user)
 updateNoticeForUser ($a_ass_id, $a_user_id, $a_notice)
 was: setNoticeForMember($a_member_id,$a_notice)
 _getReturned ($a_ass_id)
 was: _getReturned($a_obj_id)
 getMemberListData ($a_exc_id, $a_ass_id)
 get member list data
 uploadAssignmentFiles ($a_files)
 Upload assignment files (from creation form)
 getTeamId ($a_user_id, $a_create_on_demand=false)
 Get team id for member id.
 getTeamMembers ($a_team_id)
 Get members of assignment team.
 getMembersOfAllTeams ()
 Get members for all teams of assignment.
 addTeamMember ($a_team_id, $a_user_id, $a_exc_ref_id=null)
 Add new member to team.
 removeTeamMember ($a_team_id, $a_user_id, $a_exc_ref_id)
 Remove member from team.
 sendNotification ($a_exc_ref_id, $a_user_id, $a_action)
 Send notification about team status.
 hasPeerReviewGroups ()
 resetPeerReviewFileUploads ()
 resetPeerReviews ()
 validatePeerReviewGroups ()
 getPeerReviewsByGiver ($a_user_id)
 getPeerReviewsByPeerId ($a_user_id, $a_only_valid=false)
 getAllPeerReviews ($a_validate=true)
 hasPeerReviewAccess ($a_peer_id)
 updatePeerReviewTimestamp ($a_peer_id)
 getPeerUploadFiles ($a_peer_id, $a_giver_id)
 updatePeerReviewComment ($a_peer_id, $a_comment)
 sendFeedbackNotifications ($a_ass_id, $a_user_id=null)
 sendMultiFeedbackStructureFile ()
 Create member status record for a new assignment for all participants.
 uploadMultiFeedbackFile ($a_file)
 Upload multi feedback file.
 getMultiFeedbackFiles ($a_user_id=0)
 Get multi feedback files (of uploader)
 clearMultiFeedbackDirectory ()
 Clear multi feedback directory.
 saveMultiFeedbackFiles ($a_files)
 Save multi feedback files.
 adoptTeams ($a_source_ass_id, $a_user_id=null, $a_exc_ref_id=null)

Static Public Member Functions

static getAssignmentDataOfExercise ($a_exc_id)
 Get assignments data of an exercise in an array.
static getFiles ($a_exc_id, $a_ass_id)
 Get files.
static lookupMaxOrderNrForEx ($a_exc_id)
 Select the maximum order nr for an exercise.
static lookupAssignmentOnline ($a_ass_id)
 Check if assignment is online.
static lookupTitle ($a_id)
 Lookup title.
static lookupType ($a_id)
 Lookup type.
static lookupSentTimeOfUser ($a_ass_id, $a_user_id)
 Get time when exercise has been sent per e-mail to user.
static lookupFeedbackTimeOfUser ($a_ass_id, $a_user_id)
 Get time when feedback mail has been sent.
static lookupStatusTimeOfUser ($a_ass_id, $a_user_id)
 Get status time.
static deleteAllDeliveredFilesOfUser ($a_exc_id, $a_user_id)
 Delete all delivered files of user.
static getLastSubmission ($a_ass_id, $a_user_id)
 Get the date of the last submission of a user for the assignment.
static lookupAnyExerciseSent ($a_exc_id, $a_ass_id)
 Check whether exercise has been sent to any student per mail.
static lookupUpdatedSubmission ($ass_id, $member_id)
 Check whether student has upload new files after tutor has set the exercise to another than notgraded.
static lookupNewFiles ($ass_id, $member_id)
 Check how much files have been uploaded by the learner after the last download of the tutor.
static createNewUserRecords ($a_user_id, $a_exc_id)
 Create member status record for a new participant for all assignments.
static createNewAssignmentRecords ($a_ass_id, $a_exc)
 Create member status record for a new assignment for all participants.
static getTeamMembersByAssignmentId ($a_ass_id, $a_user_id)
 Find team members by assignment and team member.
static getTeamIdByAssignment ($a_ass_id, $a_user_id)
 Find team by assignment.
static getAssignmentTeamMap ($a_ass_id)
 Get team structure for assignment.
static writeTeamLog ($a_team_id, $a_action, $a_details=null)
 Add entry to team log.
static getTeamLog ($a_team_id)
 Get all log entries for team.
static getDownloadedFilesInfoForTableGUIS ($a_parent_obj, $a_exercise_id, $a_ass_type, $a_ass_id, $a_user_id, $a_parent_cmd=null)
static countGivenFeedback ($a_ass_id)
static getNumberOfMissingFeedbacks ($a_ass_id, $a_min)
static getPendingFeedbackNotifications ()
static getAdoptableTeamAssignments ($a_exercise_id, $a_exclude_ass_id=null, $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 TEAM_LOG_CREATE_TEAM = 1
const TEAM_LOG_ADD_MEMBER = 2
const TEAM_LOG_REMOVE_MEMBER = 3
const TEAM_LOG_ADD_FILE = 4
const TEAM_LOG_REMOVE_FILE = 5
const FEEDBACK_DATE_DEADLINE = 1
const FEEDBACK_DATE_SUBMISSION = 2

Protected Member Functions

 getValidPeerReviewUsers ()
 initPeerReviews ()
 handleCalendarEntries ($a_event)
 Handle calendar entries for deadline(s)

Static Protected Member Functions

static validatePeerReview (array $a_data, $a_rating=null)

Protected Attributes

 $id
 $exc_id
 $type
 $start_time
 $deadline
 $instruction
 $title
 $mandatory
 $order_nr
 $peer
 $peer_min
 $peer_dl
 $peer_file
 $peer_personal
 $feedback_file
 $feedback_cron
 $feedback_date

Private Member Functions

 lookupAssMemberField ($a_ass_id, $a_user_id, $a_field)
 Lookup a field value of ass/member table.
 updateAssMemberField ($a_ass_id, $a_user_id, $a_field, $a_value, $a_type)
 Update a field value of ass/member table.

Static Private Member Functions

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

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

ilExAssignment::__construct (   $a_id = 0)

Constructor.

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

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

{
$this->setType(self::TYPE_UPLOAD);
$this->setFeedbackDate(self::FEEDBACK_DATE_DEADLINE);
if ($a_id > 0)
{
$this->setId($a_id);
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilExAssignment::_getReturned (   $a_ass_id)

was: _getReturned($a_obj_id)

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

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

{
global $ilDB;
$query = "SELECT DISTINCT(usr_id) as ud FROM exc_mem_ass_status ".
"WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer")." ".
"AND returned = 1";
$res = $ilDB->query($query);
while($row = $ilDB->fetchObject($res))
{
$usr_ids[] = $row->ud;
}
return $usr_ids ? $usr_ids : array();
}
ilExAssignment::addTeamMember (   $a_team_id,
  $a_user_id,
  $a_exc_ref_id = null 
)

Add new member to team.

Parameters
int$a_team_id
int$a_user_id
int$a_exc_ref_id

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

References $ilDB, ilObjUser\_lookupFullname(), getId(), getTeamMembers(), sendNotification(), and writeTeamLog().

Referenced by adoptTeams().

{
global $ilDB;
$members = $this->getTeamMembers($a_team_id);
if(!in_array($a_user_id, $members))
{
$fields = array("id" => array("integer", $a_team_id),
"ass_id" => array("integer", $this->getId()),
"user_id" => array("integer", $a_user_id));
$ilDB->insert("il_exc_team", $fields);
if($a_exc_ref_id)
{
$this->sendNotification($a_exc_ref_id, $a_user_id, "add");
}
self::writeTeamLog($a_team_id, self::TEAM_LOG_ADD_MEMBER,
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::adoptTeams (   $a_source_ass_id,
  $a_user_id = null,
  $a_exc_ref_id = null 
)

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

References addTeamMember(), getAssignmentTeamMap(), getId(), getTeamId(), and sendNotification().

{
$teams = array();
$old_team = null;
foreach(self::getAssignmentTeamMap($a_source_ass_id) as $user_id => $team_id)
{
$teams[$team_id][] = $user_id;
if($a_user_id && $user_id == $a_user_id)
{
$old_team = $team_id;
}
}
if($a_user_id)
{
// no existing team (in source) or user already in team (in current)
if(!$old_team || $this->getTeamId($a_user_id))
{
return;
}
}
$current_map = self::getAssignmentTeamMap($this->getId());
foreach($teams as $team_id => $user_ids)
{
if(!$old_team || $team_id == $old_team)
{
// only not assigned users
$missing = array();
foreach($user_ids as $user_id)
{
if(!array_key_exists($user_id, $current_map))
{
$missing[] = $user_id;
}
}
if(sizeof($missing))
{
// create new team
$first = array_shift($missing);
$team_id = $this->getTeamId($first, true);
if($a_exc_ref_id)
{
// getTeamId() does NOT send notification
$this->sendNotification($a_exc_ref_id, $first, "add");
}
foreach($missing as $user_id)
{
$this->addTeamMember($team_id, $user_id, $a_exc_ref_id);
}
}
}
}
}

+ Here is the call graph for this function:

ilExAssignment::clearMultiFeedbackDirectory ( )

Clear multi feedback directory.

Parameters
array
Returns

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

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

Referenced by saveMultiFeedbackFiles().

{
global $lng, $ilUser;
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::cloneAssignmentsOfExercise (   $a_old_exc_id,
  $a_new_exc_id 
)

Clone assignments of exercise.

Parameters
@return

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

References $d, ilFSStorageExercise\create(), getAssignmentDataOfExercise(), and ilUtil\rCopy().

Referenced by ilObjExercise\cloneObject().

{
$ass_data = ilExAssignment::getAssignmentDataOfExercise($a_old_exc_id);
foreach ($ass_data as $d)
{
// clone assignment
$new_ass = new ilExAssignment();
$new_ass->setExerciseId($a_new_exc_id);
$new_ass->setTitle($d["title"]);
$new_ass->setDeadline($d["deadline"]);
$new_ass->setInstruction($d["instruction"]);
$new_ass->setMandatory($d["mandatory"]);
$new_ass->setOrderNr($d["order_val"]);
$new_ass->setStartTime($d["start_time"]);
$new_ass->setType($d["type"]);
$new_ass->setPeerReview($d["peer"]);
$new_ass->setPeerReviewMin($d["peer_min"]);
$new_ass->setPeerReviewDeadline($d["peer_dl"]);
$new_ass->setPeerReviewFileUpload($d["peer_file"]);
$new_ass->setPeerReviewPersonalized($d["peer_prsl"]);
$new_ass->setFeedbackFile($d["fb_file"]);
$new_ass->setFeedbackDate($d["fb_date"]);
$new_ass->setFeedbackCron($d["fb_cron"]);
$new_ass->save();
// clone assignment files
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$old_storage = new ilFSStorageExercise($a_old_exc_id, (int) $d["id"]);
$new_storage = new ilFSStorageExercise($a_new_exc_id, (int) $new_ass->getId());
$new_storage->create();
if (is_dir($old_storage->getPath()))
{
ilUtil::rCopy($old_storage->getPath(), $new_storage->getPath());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::countGivenFeedback (   $a_ass_id)
static

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

References $ilDB, $ilUser, and $row.

Referenced by ilExAssignmentListTextTableGUI\__construct().

{
global $ilDB, $ilUser;
$cnt = 0;
include_once './Services/Rating/classes/class.ilRating.php';
$set = $ilDB->query("SELECT *".
" FROM exc_assignment_peer".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND giver_id = ".$ilDB->quote($ilUser->getId(), "integer"));
while($row = $ilDB->fetchAssoc($set))
{
if(self::validatePeerReview($row))
{
$cnt++;
}
}
return $cnt;
}

+ Here is the caller graph for this function:

ilExAssignment::countMandatory (   $a_ex_id)

Order assignments by deadline date.

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

References $ilDB.

Referenced by ilObjExerciseGUI\initEditCustomForm().

{
global $ilDB;
$set = $ilDB->query("SELECT count(*) cntm FROM exc_assignment ".
" WHERE exc_id = ".$ilDB->quote($a_ex_id, "integer").
" AND mandatory = ".$ilDB->quote(1, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return $rec["cntm"];
}

+ Here is the caller graph for this function:

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

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

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

References $ilDB.

Referenced by save().

{
global $ilDB;
include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
$exmem = new ilExerciseMembers($a_exc);
$mems = $exmem->getMembers();
foreach ($mems as $mem)
{
$ilDB->replace("exc_mem_ass_status", array(
"ass_id" => array("integer", $a_ass_id),
"usr_id" => array("integer", $mem)
), array(
"status" => array("text", "notgraded")
));
}
}

+ Here is the caller graph for this function:

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

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

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

References $ilDB, and getAssignmentDataOfExercise().

Referenced by ilExerciseMembers\assignMember().

{
global $ilDB;
foreach ($ass_data as $ass)
{
//echo "-".$ass["id"]."-".$a_user_id."-";
$ilDB->replace("exc_mem_ass_status", array(
"ass_id" => array("integer", $ass["id"]),
"usr_id" => array("integer", $a_user_id)
), array(
"status" => array("text", "notgraded")
));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::delete ( )

Delete assignment.

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

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

{
global $ilDB;
$ilDB->manipulate("DELETE FROM exc_assignment WHERE ".
" id = ".$ilDB->quote($this->getId(), "integer")
);
$exc = new ilObjExercise($this->getExerciseId(), false);
$exc->updateAllUsersStatus();
$this->handleCalendarEntries("delete");
}

+ Here is the call graph for this function:

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

Delete all delivered files of user.

Parameters
int$a_exc_idexcercise id
int$a_user_iduser id

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

References $d, $filename, $ilDB, getTeamMembersByAssignmentId(), TYPE_UPLOAD_TEAM, and updateStatusOfUser().

{
global $ilDB;
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$delete_ids = array();
// get the files and...
$set = $ilDB->query("SELECT * FROM exc_returned ".
" WHERE obj_id = ".$ilDB->quote($a_exc_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer")
);
while ($rec = $ilDB->fetchAssoc($set))
{
$ass = new self($rec["ass_id"]);
if($ass->getType() == self::TYPE_UPLOAD_TEAM)
{
// switch upload to other team member
$team = self::getTeamMembersByAssignmentId($ass->getId(), $a_user_id);
if(sizeof($team) > 1)
{
$new_owner = array_pop($team);
while($new_owner == $a_user_id && sizeof($team))
{
$new_owner = array_pop($team);
}
$ilDB->manipulate("UPDATE exc_returned".
" SET user_id = ".$ilDB->quote($new_owner, "integer").
" WHERE returned_id = ".$ilDB->quote($rec["returned_id"], "integer")
);
// no need to delete
continue;
}
}
$delete_ids[] = $rec["returned_id"];
$fs = new ilFSStorageExercise($a_exc_id, $rec["ass_id"]);
// ...delete files
$filename = $fs->getAbsoluteSubmissionPath().
"/".$a_user_id."/".basename($rec["filename"]);
if (is_file($filename))
{
unlink($filename);
}
}
// delete exc_returned records
if($delete_ids)
{
$ilDB->manipulate("DELETE FROM exc_returned".
" WHERE ".$ilDB->in("returned_id", $delete_ids, "", "integer"));
}
// delete il_exc_team records
$ass_ids = array();
foreach(self::getAssignmentDataOfExercise($a_exc_id) as $item)
{
self::updateStatusOfUser($item["id"], $a_user_id, "notgraded"); // #14900
$ass_ids[] = $item["id"];
}
if($ass_ids)
{
$ilDB->manipulate($d = "DELETE FROM il_exc_team WHERE ".
"user_id = ".$ilDB->quote($a_user_id, "integer").
" AND ".$ilDB->in("ass_id", $ass_ids, "", "integer")
);
}
}

+ Here is the call graph for this function:

ilExAssignment::deleteDeliveredFiles (   $a_exc_id,
  $a_ass_id,
  $file_id_array,
  $a_user_id 
)

was: deleteDeliveredFiles($file_id_array, $a_member_id)

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

References $filename, $ilDB, $result, $row, getTeamIdByAssignment(), getTeamMembersByAssignmentId(), TEAM_LOG_REMOVE_FILE, and writeTeamLog().

Referenced by ilObjExerciseGUI\removeExistingSubmissions().

{
global $ilDB;
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fs = new ilFSStorageExercise($a_exc_id, $a_ass_id);
if (count($file_id_array))
{
$team_id = self::getTeamIdByAssignment($a_ass_id, $a_user_id);
if($team_id)
{
// #11733
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
return;
}
}
else
{
$user_ids = array($a_user_id);
}
$result = $ilDB->query("SELECT * FROM exc_returned".
" WHERE ".$ilDB->in("returned_id", $file_id_array, false, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer"));
if ($ilDB->numRows($result))
{
$result_array = array();
while ($row = $ilDB->fetchAssoc($result))
{
$row["timestamp"] = $row["ts"];
array_push($result_array, $row);
}
// delete the entries in the database
$ilDB->manipulate("DELETE FROM exc_returned".
" WHERE ".$ilDB->in("returned_id", $file_id_array, false, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer"));
// delete the files
foreach ($result_array as $key => $value)
{
if($value["filename"])
{
if($team_id)
{
ilExAssignment::TEAM_LOG_REMOVE_FILE, $value["filetitle"]);
}
$filename = $fs->getAbsoluteSubmissionPath().
"/".$value["user_id"]."/".basename($value["filename"]);
unlink($filename);
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::deleteFeedbackFile ( )

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

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

Referenced by delete().

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$path = $storage->getGlobalFeedbackPath();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::deliverReturnedFiles (   $a_exc_id,
  $a_ass_id,
  $a_user_id,
  $a_only_new = false,
  $a_peer_review_mask_filename = false 
)

was: deliverReturnedFiles($a_member_id, $a_only_new = false)

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

References $ilDB, $ilUser, $query, $result, $row, ilObjUser\_lookupName(), ilObject\_lookupTitle(), downloadMultipleFiles(), downloadSingleFile(), getTeamMembersByAssignmentId(), lookupTitle(), and updateTutorDownloadTime().

Referenced by ilObjExerciseGUI\downloadNewReturnedObject(), and ilObjExerciseGUI\downloadReturnedObject().

{
global $ilUser, $ilDB;
// #11000 / #11785
$is_team = true;
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
$is_team = false;
$user_ids = array($a_user_id);
}
// get last download time
$and_str = "";
if ($a_only_new)
{
$q = "SELECT download_time FROM exc_usr_tutor WHERE ".
" ass_id = ".$ilDB->quote($a_ass_id, "integer")." AND ".
$ilDB->in("usr_id", $user_ids, "", "integer")." AND ".
" tutor_id = ".$ilDB->quote($ilUser->getId(), "integer");
$lu_set = $ilDB->query($q);
if ($lu_rec = $ilDB->fetchAssoc($lu_set))
{
if ($lu_rec["download_time"] > 0)
{
$and_str = " AND ts > ".$ilDB->quote($lu_rec["download_time"], "timestamp");
}
}
}
foreach($user_ids as $user_id)
{
ilExAssignment::updateTutorDownloadTime($a_exc_id, $a_ass_id, $user_id);
}
if($a_peer_review_mask_filename)
{
// process peer review sequence id
$peer_id = null;
foreach($this->ass->getPeerReviewsByGiver($ilUser->getId()) as $idx => $item)
{
if($item["peer_id"] == $a_user_id)
{
$peer_id = $idx+1;
break;
}
}
}
$query = "SELECT * FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer").
$and_str;
$result = $ilDB->query($query);
$count = $ilDB->numRows($result);
if ($count == 1)
{
$row = $ilDB->fetchAssoc($result);
switch(self::lookupType($a_ass_id))
{
case self::TYPE_BLOG:
case self::TYPE_PORTFOLIO:
$row["filetitle"] = ilObjUser::_lookupName($row["user_id"]);
$row["filetitle"] = ilObject::_lookupTitle($a_exc_id)." - ".
self::lookupTitle($a_ass_id)." - ".
$row["filetitle"]["firstname"]." ".
$row["filetitle"]["lastname"]." (".
$row["filetitle"]["login"].").zip";
break;
default:
break;
}
if($a_peer_review_mask_filename)
{
$suffix = array_pop(explode(".", $row["filetitle"]));
$row["filetitle"] = self::lookupTitle($a_ass_id)."_peer".$peer_id.".".$suffix;
}
ilExAssignment::downloadSingleFile($a_exc_id, $a_ass_id, $row["user_id"],
$row["filename"], $row["filetitle"]);
}
else if ($count > 0)
{
$array_files = array();
$seq = 0;
while ($row = $ilDB->fetchAssoc($result))
{
$src = basename($row["filename"]);
if($a_peer_review_mask_filename)
{
$suffix = array_pop(explode(".", $src));
$tgt = self::lookupTitle($a_ass_id)."_peer".$peer_id.
"_".(++$seq).".".$suffix;
$array_files[$row["user_id"]][] = array($src, $tgt);
}
else
{
$array_files[$row["user_id"]][] = $src;
}
}
ilExAssignment::downloadMultipleFiles($a_exc_id, $a_ass_id, $array_files,
($is_team ? null : $a_user_id), $is_team);
}
else
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::downloadAllDeliveredFiles (   $a_exc_id,
  $a_ass_id,
  $members 
)

Download all submitted files of an assignment (all user)

Parameters
$membersarray of user names, key is user id

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

References $id, $lng, ilObjUser\_lookupName(), ilUtil\delDir(), ilUtil\deliverFile(), ilUtil\dirsize(), ilUtil\escapeShellArg(), ilUtil\getASCIIFilename(), ilUtil\ilTempnam(), lookupTitle(), lookupType(), ilUtil\makeDir(), TYPE_BLOG, TYPE_PORTFOLIO, and ilUtil\unzip().

Referenced by ilObjExerciseGUI\downloadAllObject().

{
global $lng, $ilObjDataCache, $ilias;
include_once "./Services/Utilities/classes/class.ilUtil.php";
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($a_exc_id, $a_ass_id);
$storage->create();
ksort($members);
//$savepath = $this->getExercisePath() . "/" . $this->obj_id . "/";
$savepath = $storage->getAbsoluteSubmissionPath();
$cdir = getcwd();
// important check: if the directory does not exist
// ILIAS stays in the current directory (echoing only a warning)
// and the zip command below archives the whole ILIAS directory
// (including the data directory) and sends a mega file to the user :-o
if (!is_dir($savepath))
{
return;
}
// Safe mode fix
// chdir($this->getExercisePath());
chdir($storage->getTempPath());
$zip = PATH_TO_ZIP;
// check first, if we have enough free disk space to copy all files to temporary directory
$tmpdir = ilUtil::ilTempnam();
ilUtil::makeDir($tmpdir);
chdir($tmpdir);
$dirsize = 0;
foreach ($members as $id => $object) {
$directory = $savepath.DIRECTORY_SEPARATOR.$id;
$dirsize += ilUtil::dirsize($directory);
}
if ($dirsize > disk_free_space($tmpdir)) {
return -1;
}
$ass_type = self::lookupType($a_ass_id);
// copy all member directories to the temporary folder
// switch from id to member name and append the login if the member name is double
// ensure that no illegal filenames will be created
// remove timestamp from filename
$cache = array();
foreach ($members as $id => $user)
{
$sourcedir = $savepath.DIRECTORY_SEPARATOR.$id;
if (!is_dir($sourcedir))
continue;
//$directory = ilUtil::getASCIIFilename(trim($userName["lastname"])."_".trim($userName["firstname"]));
$directory = ilUtil::getASCIIFilename(trim($userName["lastname"])."_".
trim($userName["firstname"])."_".trim($userName["login"])."_".$userName["user_id"]);
/*if (array_key_exists($directory, $cache))
{
// first try is to append the login;
$directory = ilUtil::getASCIIFilename($directory."_".trim(ilObjUser::_lookupLogin($id)));
if (array_key_exists($directory, $cache)) {
// second and secure: append the user id as well.
$directory .= "_".$id;
}
}*/
$cache[$directory] = $directory;
ilUtil::makeDir ($directory);
$sourcefiles = scandir($sourcedir);
$duplicates = array();
foreach ($sourcefiles as $sourcefile) {
if ($sourcefile == "." || $sourcefile == "..")
{
continue;
}
$targetfile = trim(basename($sourcefile));
$pos = strpos($targetfile, "_");
if ($pos !== false)
{
$targetfile= substr($targetfile, $pos + 1);
}
// #14536
if(array_key_exists($targetfile, $duplicates))
{
$suffix = strrpos($targetfile, ".");
$targetfile = substr($targetfile, 0, $suffix).
" (".(++$duplicates[$targetfile]).")".
substr($targetfile, $suffix);
}
else
{
$duplicates[$targetfile] = 1;
}
$targetfile = $directory.DIRECTORY_SEPARATOR.$targetfile;
$sourcefile = $sourcedir.DIRECTORY_SEPARATOR.$sourcefile;
if (!copy ($sourcefile, $targetfile))
{
//echo 'Could not copy '.$sourcefile.' to '.$targetfile;
$ilias->raiseError('Could not copy '.basename($sourcefile)." to '".$targetfile."'.",
$ilias->error_obj->MESSAGE);
}
else
{
// preserve time stamp
touch($targetfile, filectime($sourcefile));
// blogs and portfolios are stored as zip and have to be unzipped
if($ass_type == ilExAssignment::TYPE_PORTFOLIO ||
{
ilUtil::unzip($targetfile);
unlink($targetfile);
}
}
}
}
$tmpfile = ilUtil::ilTempnam();
$tmpzipfile = $tmpfile . ".zip";
// Safe mode fix
$zipcmd = $zip." -r ".ilUtil::escapeShellArg($tmpzipfile)." .";
exec($zipcmd);
ilUtil::delDir($tmpdir);
$assTitle = ilExAssignment::lookupTitle($a_ass_id)."_".$a_ass_id;
chdir($cdir);
ilUtil::deliverFile($tmpzipfile, (strlen($assTitle) == 0
? strtolower($lng->txt("exc_assignment"))
: $assTitle). ".zip", "", false, true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::downloadMultipleFiles (   $a_exc_id,
  $a_ass_id,
  $array_filenames,
  $a_user_id,
  $a_multi_user = false 
)

was: downloadMultipleFiles($array_filenames, $pathname, $a_member_id = 0)

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

References $filename, ilObjUser\_lookupName(), ilUtil\delDir(), ilUtil\deliverFile(), ilUtil\escapeShellArg(), exit, ilUtil\getASCIIFilename(), ilUtil\ilTempnam(), lookupTitle(), and ilUtil\makeDir().

Referenced by deliverReturnedFiles(), and downloadSelectedFiles().

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fs = new ilFSStorageExercise($a_exc_id, $a_ass_id);
require_once "./Services/Utilities/classes/class.ilUtil.php";
$cdir = getcwd();
$zip = PATH_TO_ZIP;
$tmpdir = ilUtil::ilTempnam();
$tmpfile = ilUtil::ilTempnam();
$tmpzipfile = $tmpfile . ".zip";
ilUtil::makeDir($tmpdir);
chdir($tmpdir);
$assTitle = ilExAssignment::lookupTitle($a_ass_id);
$deliverFilename = str_replace(" ", "_", $assTitle);
if ($a_user_id > 0 && !$a_multi_user)
{
$userName = ilObjUser::_lookupName($a_user_id);
$deliverFilename .= "_".$userName["lastname"]."_".$userName["firstname"];
}
else
{
$deliverFilename .= "_files";
}
$orgDeliverFilename = trim($deliverFilename);
$deliverFilename = ilUtil::getASCIIFilename($orgDeliverFilename);
ilUtil::makeDir($tmpdir."/".$deliverFilename);
chdir($tmpdir."/".$deliverFilename);
//copy all files to a temporary directory and remove them afterwards
$parsed_files = $duplicates = array();
foreach ($array_filenames as $user_id => $files)
{
$pathname = $fs->getAbsoluteSubmissionPath()."/".$user_id;
foreach($files as $filename)
{
// peer review masked filenames, see deliverReturnedFiles()
if(is_array($filename))
{
$newFilename = $filename[1];
$filename = $filename[0];
}
else
{
// remove timestamp
$newFilename = trim($filename);
$pos = strpos($newFilename , "_");
if ($pos !== false)
{
$newFilename = substr($newFilename, $pos + 1);
}
// #11070
$chkName = strtolower($newFilename);
if(array_key_exists($chkName, $duplicates))
{
$suffix = strrpos($newFilename, ".");
$newFilename = substr($newFilename, 0, $suffix).
" (".(++$duplicates[$chkName]).")".
substr($newFilename, $suffix);
}
else
{
$duplicates[$chkName] = 1;
}
}
$newFilename = $tmpdir.DIRECTORY_SEPARATOR.$deliverFilename.DIRECTORY_SEPARATOR.$newFilename;
// copy to temporal directory
$oldFilename = $pathname.DIRECTORY_SEPARATOR.$filename;
if (!copy ($oldFilename, $newFilename))
{
echo 'Could not copy '.$oldFilename.' to '.$newFilename;
}
touch($newFilename, filectime($oldFilename));
$parsed_files[] = ilUtil::escapeShellArg($deliverFilename.DIRECTORY_SEPARATOR.basename($newFilename));
}
}
chdir($tmpdir);
$zipcmd = $zip." ".ilUtil::escapeShellArg($tmpzipfile)." ".join($parsed_files, " ");
exec($zipcmd);
ilUtil::delDir($tmpdir);
chdir($cdir);
ilUtil::deliverFile($tmpzipfile, $orgDeliverFilename.".zip", "", false, true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::downloadSelectedFiles (   $a_exc_id,
  $a_ass_id,
  $a_user_id,
  $array_file_id 
)

was: downloadSelectedFiles($array_file_id,$a_user_id)?

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

References $ilDB, $result, $row, ilObjUser\_lookupName(), ilObject\_lookupTitle(), downloadMultipleFiles(), downloadSingleFile(), getTeamMembersByAssignmentId(), TYPE_BLOG, and TYPE_PORTFOLIO.

Referenced by ilObjExerciseGUI\downloadObject().

{
global $ilDB;
if (count($array_file_id))
{
// #11785
$is_team = true;
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
$is_team = false;
$user_ids = array($a_user_id);
}
$result = $ilDB->query("SELECT * FROM exc_returned WHERE ".
$ilDB->in("returned_id", $array_file_id, false, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer"));
if ($ilDB->numRows($result))
{
$array_found = array();
while ($row = $ilDB->fetchAssoc($result))
{
$row["timestamp"] = $row["ts"];
array_push($array_found, $row);
}
if (count($array_found) == 1)
{
// blog/portfolio submission
if(is_numeric($array_found[0]["filetitle"]))
{
$ass = new ilExAssignment($array_found[0]["ass_id"]);
if($ass->getType() == ilExAssignment::TYPE_BLOG ||
$ass->getType() == ilExAssignment::TYPE_PORTFOLIO)
{
$user_data = ilObjUser::_lookupName($array_found[0]["user_id"]);
$array_found[0]["filetitle"] = ilObject::_lookupTitle($array_found[0]["obj_id"])." - ".
$ass->getTitle()." - ".
$user_data["firstname"]." ".
$user_data["lastname"]." (".
$user_data["login"].").zip";
}
}
ilExAssignment::downloadSingleFile($a_exc_id, $a_ass_id, $array_found[0]["user_id"],
$array_found[0]["filename"], $array_found[0]["filetitle"]);
}
else
{
$filenames = array();
foreach ($array_found as $value)
{
$filenames[$value["user_id"]][] = basename($value["filename"]);
}
$filenames, ($is_team ? null : $a_user_id), $is_team);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::downloadSingleFile (   $a_exc_id,
  $a_ass_id,
  $a_user_id,
  $filename,
  $filetitle 
)

was: downloadSingleFile($filename, $filetitle)

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

References $filename, and ilUtil\deliverFile().

Referenced by deliverReturnedFiles(), and downloadSelectedFiles().

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fs = new ilFSStorageExercise($a_exc_id, $a_ass_id);
$filename = $fs->getAbsoluteSubmissionPath().
"/".$a_user_id."/".basename($filename);
require_once "./Services/Utilities/classes/class.ilUtil.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getAdoptableTeamAssignments (   $a_exercise_id,
  $a_exclude_ass_id = null,
  $a_user_id = null 
)
static

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

References $res, $row, getAssignmentDataOfExercise(), getAssignmentTeamMap(), ilUtil\sortArray(), and TYPE_UPLOAD_TEAM.

Referenced by ilObjExerciseGUI\adoptTeamAssignmentsFormObject(), ilObjExerciseGUI\createTeamObject(), and ilObjExerciseGUI\saveAssignmentObject().

{
$res = array();
foreach($data as $row)
{
if($a_exclude_ass_id && $row["id"] == $a_exclude_ass_id)
{
continue;
}
{
if($a_user_id && !array_key_exists($a_user_id, $map))
{
continue;
}
if(sizeof($map))
{
$user_team = null;
if($a_user_id)
{
$user_team_id = $map[$a_user_id];
$user_team = array();
foreach($map as $user_id => $team_id)
{
if($user_id != $a_user_id &&
$user_team_id == $team_id)
{
$user_team[] = $user_id;
}
}
}
if(!$a_user_id ||
sizeof($user_team))
{
$res[$row["id"]] = array(
"title" => $row["title"],
"teams" => sizeof(array_flip($map)),
);
if($a_user_id)
{
$res[$row["id"]]["user_team"] = $user_team;
}
}
}
}
}
return ilUtil::sortArray($res, "title", "asc", false, true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::getAllDeliveredFiles (   $a_exc_id,
  $a_ass_id 
)

was: getAllDeliveredFiles()

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

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

Referenced by ilObjExerciseGUI\handleDisabledAssignmentFields(), ilObjExerciseGUI\membersObject(), and ilExAssignmentListTextTableGUI\parse().

{
global $ilDB;
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fs = new ilFSStorageExercise($a_exc_id, $a_ass_id);
$query = "SELECT * FROM exc_returned WHERE ass_id = ".
$ilDB->quote($a_ass_id, "integer");
$res = $ilDB->query($query);
while($row = $ilDB->fetchAssoc($res))
{
$row["timestamp"] = $row["ts"];
$row["filename"] = $fs->getAbsoluteSubmissionPath().
"/".$row["user_id"]."/".basename($row["filename"]);
$delivered[] = $row;
}
//$delivered = ilObjExercise::_fixFilenameArray($delivered);
return $delivered ? $delivered : array();
}

+ Here is the caller graph for this function:

ilExAssignment::getAllPeerReviews (   $a_validate = true)

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

References $ilDB, $res, $row, getId(), and ilRating\getRatingForUserAndObject().

Referenced by resetPeerReviews(), and validatePeerReviewGroups().

{
global $ilDB;
$res = array();
include_once './Services/Rating/classes/class.ilRating.php';
$set = $ilDB->query("SELECT *".
" FROM exc_assignment_peer".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer").
" ORDER BY peer_id");
while($row = $ilDB->fetchAssoc($set))
{
$rating = round(ilRating::getRatingForUserAndObject($this->getId(),
"ass", $row["peer_id"], "peer", $row["giver_id"]));
if(!$a_validate ||
self::validatePeerReview($row, $rating))
{
$res[$row["peer_id"]][$row["giver_id"]] = array($row["pcomment"], $rating);
}
}
return $res;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getAssignmentDataOfExercise (   $a_exc_id)
static

Get assignments data of an exercise in an array.

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

References $ilDB.

Referenced by ilAssignmentsTableGUI\__construct(), ilExGradesTableGUI\__construct(), ilExParticipantTableGUI\__construct(), cloneAssignmentsOfExercise(), createNewUserRecords(), ilObjExercise\determinStatusOfUser(), ilObjExercise\exportGradesExcel(), getAdoptableTeamAssignments(), ilExerciseXMLParser\ilExerciseXMLParser(), ilObjExerciseGUI\infoScreen(), ilObjExerciseGUI\membersObject(), ilObjExerciseGUI\showOverviewObject(), ilObjExerciseGUI\showParticipantObject(), and ilExerciseXMLWriter\start().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM exc_assignment ".
" WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer").
" ORDER BY order_nr ASC");
$data = array();
$order_val = 10;
while ($rec = $ilDB->fetchAssoc($set))
{
$data[] = array(
"id" => $rec["id"],
"exc_id" => $rec["exc_id"],
"deadline" => $rec["time_stamp"],
"instruction" => $rec["instruction"],
"title" => $rec["title"],
"start_time" => $rec["start_time"],
"order_val" => $order_val,
"mandatory" => $rec["mandatory"],
"type" => $rec["type"],
"peer" => $rec["peer"],
"peer_min" => $rec["peer_min"],
"peer_dl" => $rec["peer_dl"],
"peer_file" => $rec["peer_file"],
"peer_prsl" => $rec["peer_prsl"],
"fb_file" => $rec["fb_file"],
"fb_date" => $rec["fb_date"],
"fb_cron" => $rec["fb_cron"],
);
$order_val += 10;
}
return $data;
}

+ Here is the caller graph for this function:

static ilExAssignment::getAssignmentTeamMap (   $a_ass_id)
static

Get team structure for assignment.

Parameters
int$a_ass_id
Returns
array

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

References $ilDB, and $row.

Referenced by ilExerciseMemberTableGUI\__construct(), adoptTeams(), ilObjExerciseGUI\createTeamObject(), and getAdoptableTeamAssignments().

{
global $ilDB;
$map = array();
$sql = "SELECT * FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer");
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$map[$row["user_id"]] = $row["id"];
}
return $map;
}

+ Here is the caller graph for this function:

ilExAssignment::getDeadline ( )

Get deadline (timestamp)

Returns
int deadline (timestamp)

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

References $deadline.

Referenced by handleCalendarEntries(), ilObjExerciseGUI\handleDisabledAssignmentFields(), initPeerReviews(), save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::getDeliveredFiles (   $a_exc_id,
  $a_ass_id,
  $a_user_id,
  $a_filter_empty_filename = false 
)

was: getDeliveredFiles($a_member_id)

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

References $ilDB, $result, $row, and getTeamMembersByAssignmentId().

Referenced by ilObjExerciseGUI\confirmDeleteDeliveredObject(), ilObjExerciseGUI\confirmRemoveTeamMemberObject(), ilObjExercise\deleteDeliveredFiles(), ilObjPortfolioGUI\downloadExcSubFile(), ilObjBlogGUI\downloadExcSubFile(), ilObjExerciseGUI\editAssignmentTextObject(), ilPublicSubmissionsTableGUI\fillRow(), getDownloadedFilesInfoForTableGUIS(), ilObjPortfolioGUI\getExerciseInfo(), ilObjBlogGUI\getExerciseInfo(), ilExAssignmentGUI\getOverviewBody(), ilObjExerciseGUI\removeExistingSubmissions(), ilObjExerciseGUI\showAssignmentTextObject(), ilObjExerciseGUI\updateAssignmentTextObject(), and ilObjExercise\updateTextSubmission().

{
global $ilDB;
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
$user_ids = array($a_user_id);
}
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fs = new ilFSStorageExercise($a_exc_id, $a_ass_id);
$result = $ilDB->query("SELECT * FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer"));
$delivered_files = array();
if ($ilDB->numRows($result))
{
while ($row = $ilDB->fetchAssoc($result))
{
if($a_filter_empty_filename && !$row["filename"])
{
continue;
}
$row["owner_id"] = $row["user_id"];
$row["timestamp"] = $row["ts"];
$row["timestamp14"] = substr($row["ts"], 0, 4).
substr($row["ts"], 5, 2).substr($row["ts"], 8, 2).
substr($row["ts"], 11, 2).substr($row["ts"], 14, 2).
substr($row["ts"], 17, 2);
$row["filename"] = $fs->getAbsoluteSubmissionPath().
"/".$row["user_id"]."/".basename($row["filename"]);
array_push($delivered_files, $row);
}
}
//$delivered_files = ilObjExercise::_fixFilenameArray($delivered_files);
return $delivered_files;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getDownloadedFilesInfoForTableGUIS (   $a_parent_obj,
  $a_exercise_id,
  $a_ass_type,
  $a_ass_id,
  $a_user_id,
  $a_parent_cmd = null 
)
static

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

References $ilCtrl, $lng, $result, ilDatePresentation\formatDate(), getDeliveredFiles(), getLastSubmission(), IL_CAL_DATETIME, lookupNewFiles(), TYPE_BLOG, TYPE_PORTFOLIO, TYPE_TEXT, TYPE_UPLOAD, and TYPE_UPLOAD_TEAM.

Referenced by ilExParticipantTableGUI\fillRow(), ilExAssignmentPeerReviewTableGUI\fillRow(), and ilExerciseMemberTableGUI\fillRow().

{
global $lng, $ilCtrl;
$result = array();
$result["files"]["count"] = "---";
$ilCtrl->setParameter($a_parent_obj, "ass_id", $a_ass_id);
// submission:
// see if files have been resubmmited after solved
$last_sub = self::getLastSubmission($a_ass_id, $a_user_id);
if ($last_sub)
{
}
else
{
$last_sub = "---";
}
/* #13741 - status_time has been reduced to grading (mark/status)
if (ilExAssignment::lookupUpdatedSubmission($a_ass_id, $a_user_id) == 1)
{
$last_sub = "<b>".$last_sub."</b>";
}
*/
$result["last_submission"]["txt"] = $lng->txt("exc_last_submission");
$result["last_submission"]["value"] = $last_sub;
// assignment type specific
switch($a_ass_type)
{
// data is merged by team - see above
// fallthrough
// nr of submitted files
$result["files"]["txt"] = $lng->txt("exc_files_returned");
$sub_cnt = count(ilExAssignment::getDeliveredFiles($a_exercise_id, $a_ass_id, $a_user_id));
$new = ilExAssignment::lookupNewFiles($a_ass_id, $a_user_id);
if (count($new) > 0)
{
$sub_cnt.= " ".sprintf($lng->txt("cnt_new"),count($new));
}
$result["files"]["count"] = $sub_cnt;
// download command
$ilCtrl->setParameter($a_parent_obj, "member_id", $a_user_id);
if ($sub_cnt > 0)
{
$result["files"]["download_url"] =
$ilCtrl->getLinkTarget($a_parent_obj, "downloadReturned");
if (count($new) <= 0)
{
$result["files"]["download_txt"] = $lng->txt("exc_download_files");
}
else
{
$result["files"]["download_txt"] = $lng->txt("exc_download_all");
}
// download new files only
if (count($new) > 0)
{
$result["files"]["download_new_url"] =
$ilCtrl->getLinkTarget($a_parent_obj, "downloadNewReturned");
$result["files"]["download_new_txt"] = $lng->txt("exc_download_new");
}
}
break;
$result["files"]["txt"] =$lng->txt("exc_blog_returned");
$blogs = ilExAssignment::getDeliveredFiles($a_exercise_id, $a_ass_id, $a_user_id);
if($blogs)
{
$blogs = array_pop($blogs);
if($blogs && substr($blogs["filename"], -1) != "/")
{
$result["files"]["count"] = 1;
$ilCtrl->setParameter($a_parent_obj, "member_id", $a_user_id);
$result["files"]["download_url"] =
$ilCtrl->getLinkTarget($a_parent_obj, "downloadReturned");
$ilCtrl->setParameter($a_parent_obj, "member_id", "");
$result["files"]["download_txt"] = $lng->txt("exc_download_files");
}
}
break;
$result["files"]["txt"] = $lng->txt("exc_portfolio_returned");
$portfolios = ilExAssignment::getDeliveredFiles($a_exercise_id, $a_ass_id, $a_user_id);
if($portfolios)
{
$portfolios = array_pop($portfolios);
if($portfolios && substr($portfolios["filename"], -1) != "/")
{
$result["files"]["count"] = 1;
$ilCtrl->setParameter($a_parent_obj, "member_id", $a_user_id);
$result["files"]["download_url"] =
$ilCtrl->getLinkTarget($a_parent_obj, "downloadReturned");
$ilCtrl->setParameter($a_parent_obj, "member_id", "");
$result["files"]["download_txt"] = $lng->txt("exc_download_files");
}
}
break;
$result["files"]["txt"] = $lng->txt("exc_files_returned_text");
$files = ilExAssignment::getDeliveredFiles($a_exercise_id, $a_ass_id, $a_user_id);
if($files)
{
$result["files"]["count"] = 1;
$files = array_shift($files);
if(trim($files["atext"]))
{
// #11397
if($a_parent_cmd)
{
$ilCtrl->setParameter($a_parent_obj, "grd", (($a_parent_cmd == "members") ? 1 : 2));
}
$ilCtrl->setParameter($a_parent_obj, "member_id", $a_user_id);
$result["files"]["download_url"] =
$ilCtrl->getLinkTarget($a_parent_obj, "showAssignmentText");
$ilCtrl->setParameter($a_parent_obj, "member_id", "");
$ilCtrl->setParameter($a_parent_obj, "grd", "");
$result["files"]["download_txt"] = $lng->txt("exc_text_assignment_show");
}
}
break;
}
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::getFeedbackDate ( )

Get (global) feedback file availability date.

Returns
int

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

References $feedback_date.

Referenced by save(), and update().

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

+ Here is the caller graph for this function:

ilExAssignment::getFeedbackFile ( )

Get (global) feedback file.

Returns
int

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

References $feedback_file.

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

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

+ Here is the caller graph for this function:

ilExAssignment::getFeedbackFilePath ( )

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

References $file, $path, getExerciseId(), getFeedbackFile(), and getId().

{
$file = $this->getFeedbackFile();
if($file)
{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$path = $storage->getGlobalFeedbackPath();
return $path."/".$file;
}
}

+ Here is the call graph for this function:

static ilExAssignment::getFiles (   $a_exc_id,
  $a_ass_id 
)
static

Get files.

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

Referenced by ilObjPortfolioGUI\downloadExcAssFile(), ilObjBlogGUI\downloadExcAssFile(), ilObjPortfolioGUI\getExerciseInfo(), ilObjBlogGUI\getExerciseInfo(), and ilExAssignmentGUI\getOverviewBody().

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($a_exc_id, $a_ass_id);
return $storage->getFiles();
}

+ Here is the caller graph for this function:

ilExAssignment::getInstruction ( )

Get instruction.

Returns
string instruction

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

References $instruction.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

static ilExAssignment::getLastSubmission (   $a_ass_id,
  $a_user_id 
)
static

Get the date of the last submission of a user for the assignment.

Parameters
intAssignment ID
intUser ID
Returns
mixed false or mysql timestamp of last submission

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

References $ilDB, $lng, ilUtil\getMySQLTimestamp(), and getTeamMembersByAssignmentId().

Referenced by ilObjExerciseGUI\downloadGlobalFeedbackFileObject(), ilPublicSubmissionsTableGUI\fillRow(), getDownloadedFilesInfoForTableGUIS(), getMemberListData(), and ilExAssignmentGUI\getOverviewBody().

{
global $ilDB, $lng;
// team upload?
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
$user_ids = array($a_user_id);
}
$ilDB->setLimit(1);
$q = "SELECT obj_id,user_id,ts FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer").
" ORDER BY ts DESC";
$usr_set = $ilDB->query($q);
$array = $ilDB->fetchAssoc($usr_set);
if ($array["ts"]==NULL)
{
return false;
}
else
{
return ilUtil::getMySQLTimestamp($array["ts"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::getMandatory ( )

Get mandatory.

Returns
int mandatory

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

References $mandatory.

Referenced by ilObjExerciseGUI\initAssignmentTextForm(), save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::getMemberListData (   $a_exc_id,
  $a_ass_id 
)

get member list data

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

References $ilDB, and getLastSubmission().

Referenced by ilPublicSubmissionsTableGUI\__construct(), and ilExerciseMemberTableGUI\__construct().

{
global $ilDB;
$mem = array();
// first get list of members from member table
$set = $ilDB->query("SELECT ud.usr_id, ud.lastname, ud.firstname, ud.login".
" FROM exc_members excm".
" JOIN usr_data ud ON (ud.usr_id = excm.usr_id)".
" WHERE excm.obj_id = ".$ilDB->quote($a_exc_id, "integer"));
while($rec = $ilDB->fetchAssoc($set))
{
$mem[$rec["usr_id"]] =
array(
"name" => $rec["lastname"].", ".$rec["firstname"],
"login" => $rec["login"],
"usr_id" => $rec["usr_id"],
"lastname" => $rec["lastname"],
"firstname" => $rec["firstname"]
);
}
$q = "SELECT * FROM exc_mem_ass_status ".
"WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer");
$set = $ilDB->query($q);
while($rec = $ilDB->fetchAssoc($set))
{
if (isset($mem[$rec["usr_id"]]))
{
$mem[$rec["usr_id"]]["sent_time"] = $rec["sent_time"];
$mem[$rec["usr_id"]]["submission"] = ilExAssignment::getLastSubmission($a_ass_id, $rec["usr_id"]);
$mem[$rec["usr_id"]]["status_time"] = $rec["status_time"];
$mem[$rec["usr_id"]]["feedback_time"] = $rec["feedback_time"];
$mem[$rec["usr_id"]]["notice"] = $rec["notice"];
$mem[$rec["usr_id"]]["status"] = $rec["status"];
}
}
return $mem;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::getMembersOfAllTeams ( )

Get members for all teams of assignment.

Returns
array

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

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

{
global $ilDB;
$ids = array();
$sql = "SELECT user_id".
" FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$ids[] = $row["user_id"];
}
return $ids;
}

+ Here is the call graph for this function:

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

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

Referenced by saveMultiFeedbackFiles().

{
global $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$mf_files = array();
// get members
$exc = new ilObjExercise($this->getExerciseId(), false);
include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
$exmem = new ilExerciseMembers($exc);
$mems = $exmem->getMembers();
// read mf directory
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
// get subdir that starts with multi_feedback
$subdirs = ilUtil::getDir($mfu);
$subdir = "notfound";
foreach ($subdirs as $s => $j)
{
if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
{
$subdir = $s;
}
}
$items = ilUtil::getDir($mfu."/".$subdir);
foreach ($items as $k => $i)
{
// check directory
if ($i["type"] == "dir" && !in_array($k, array(".", "..")))
{
// check if valid member id is given
$parts = explode("_", $i["entry"]);
$user_id = (int) $parts[count($parts) - 1];
if (in_array($user_id, $mems))
{
// read dir of user
$name = ilObjUser::_lookupName($user_id);
$files = ilUtil::getDir($mfu."/".$subdir."/".$k);
foreach ($files as $k2 => $f)
{
// append files to array
if ($f["type"] == "file" && substr($k2, 0, 1) != ".")
{
$mf_files[] = array(
"lastname" => $name["lastname"],
"firstname" => $name["firstname"],
"login" => $name["login"],
"user_id" => $name["user_id"],
"full_path" => $mfu."/".$subdir."/".$k."/".$k2,
"file" => $k2);
}
}
}
}
}
return $mf_files;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getNumberOfMissingFeedbacks (   $a_ass_id,
  $a_min 
)
static

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

References $ilDB.

Referenced by ilObjExerciseGUI\editPeerReviewObject(), and ilExAssignmentGUI\getOverviewBody().

{
global $ilDB;
// check if number of returned assignments is lower than assignment peer min
$set = $ilDB->query("SELECT COUNT(DISTINCT(user_id)) cnt".
" FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer"));
$cnt = $ilDB->fetchAssoc($set);
$cnt = (int)$cnt["cnt"];
// forever alone
if($cnt < 2)
{
return;
}
$a_min = min($cnt-1, $a_min);
return max(0, $a_min-self::countGivenFeedback($a_ass_id));
}

+ Here is the caller graph for this function:

ilExAssignment::getOrderNr ( )

Get order nr.

Returns
int order nr

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

References $order_nr.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::getPeerReview ( )

Get peer review status.

Returns
bool

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

References $peer.

Referenced by handleCalendarEntries(), ilObjExerciseGUI\handleDisabledAssignmentFields(), save(), and update().

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

+ Here is the caller graph for this function:

ilExAssignment::getPeerReviewDeadline ( )

Get peer review deadline (timestamp)

Returns
int deadline (timestamp)

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

References $peer_dl.

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

{
}

+ Here is the caller graph for this function:

ilExAssignment::getPeerReviewMin ( )

Get peer review minimum.

Returns
int

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

References $peer_min.

Referenced by ilObjExerciseGUI\handleDisabledAssignmentFields(), initPeerReviews(), save(), and update().

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

+ Here is the caller graph for this function:

ilExAssignment::getPeerReviewsByGiver (   $a_user_id)

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

References $ilDB, $res, $row, getId(), and initPeerReviews().

{
global $ilDB;
$res = array();
if($this->initPeerReviews())
{
$set = $ilDB->query("SELECT *".
" FROM exc_assignment_peer".
" WHERE giver_id = ".$ilDB->quote($a_user_id, "integer").
" AND ass_id = ".$ilDB->quote($this->getId(), "integer").
" ORDER BY peer_id");
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row;
}
}
return $res;
}

+ Here is the call graph for this function:

ilExAssignment::getPeerReviewsByPeerId (   $a_user_id,
  $a_only_valid = false 
)

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

References $ilDB, $res, $row, and getId().

{
global $ilDB;
$res = array();
$set = $ilDB->query("SELECT *".
" FROM exc_assignment_peer".
" WHERE peer_id = ".$ilDB->quote($a_user_id, "integer").
" AND ass_id = ".$ilDB->quote($this->getId(), "integer").
" ORDER BY peer_id");
while($row = $ilDB->fetchAssoc($set))
{
if(!$a_only_valid ||
self::validatePeerReview($row))
{
$res[] = $row;
}
}
return $res;
}

+ Here is the call graph for this function:

ilExAssignment::getPeerUploadFiles (   $a_peer_id,
  $a_giver_id 
)

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

References $path, getExerciseId(), getId(), and hasPeerReviewFileUpload().

{
{
return array();
}
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$path = $storage->getPeerReviewUploadPath($a_peer_id, $a_giver_id);
return glob($path."/*.*");
}

+ Here is the call graph for this function:

static ilExAssignment::getPendingFeedbackNotifications ( )
static

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

References $ilDB, $res, and $row.

Referenced by ilExcCronFeedbackNotification\run().

{
global $ilDB;
$res = array();
$set = $ilDB->query("SELECT id,fb_file FROM exc_assignment".
" WHERE fb_cron = ".$ilDB->quote(1, "integer").
" AND fb_date = ".$ilDB->quote(self::FEEDBACK_DATE_DEADLINE, "integer").
" AND time_stamp IS NOT NULL".
" AND time_stamp > ".$ilDB->quote(0, "integer").
" AND time_stamp < ".$ilDB->quote(time(), "integer").
" AND fb_cron_done = ".$ilDB->quote(0, "integer"));
while($row = $ilDB->fetchAssoc($set))
{
if(trim($row["fb_file"]))
{
$res[] = $row["id"];
}
}
return $res;
}

+ Here is the caller graph for this function:

ilExAssignment::getStartTime ( )

Get start time (timestamp)

Returns
int start time (timestamp)

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

References $start_time.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::getTeamId (   $a_user_id,
  $a_create_on_demand = false 
)

Get team id for member id.

team will be created if no team yet

Parameters
int$a_user_id
bool$a_create_on_demand
Returns
int

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

References $id, $ilDB, $row, ilObjUser\_lookupFullname(), getId(), and writeTeamLog().

Referenced by adoptTeams(), and saveMultiFeedbackFiles().

{
global $ilDB;
$sql = "SELECT id FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer");
$set = $ilDB->query($sql);
$row = $ilDB->fetchAssoc($set);
$id = $row["id"];
if(!$id && $a_create_on_demand)
{
$id = $ilDB->nextId("il_exc_team");
$fields = array("id" => array("integer", $id),
"ass_id" => array("integer", $this->getId()),
"user_id" => array("integer", $a_user_id));
$ilDB->insert("il_exc_team", $fields);
self::writeTeamLog($id, self::TEAM_LOG_CREATE_TEAM);
self::writeTeamLog($id, self::TEAM_LOG_ADD_MEMBER,
}
return $id;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getTeamIdByAssignment (   $a_ass_id,
  $a_user_id 
)
static

Find team by assignment.

Parameters
int$a_ass_id
int$a_user_id
Returns
int

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

References $ilDB, $result, and $type.

Referenced by deleteDeliveredFiles(), ilObjExercise\deliverFile(), getTeamMembersByAssignmentId(), and ilObjExerciseGUI\showTeamLogObject().

{
global $ilDB;
$result = $ilDB->query("SELECT type".
" FROM exc_assignment".
" WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
$type = $ilDB->fetchAssoc($result);
if($type["type"] == self::TYPE_UPLOAD_TEAM)
{
$set = $ilDB->query("SELECT id".
" FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer"));
$team_id = $ilDB->fetchAssoc($set);
return $team_id["id"];
}
}

+ Here is the caller graph for this function:

static ilExAssignment::getTeamLog (   $a_team_id)
static

Get all log entries for team.

Parameters
int$a_team_id
Returns
array

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

References $ilDB, $res, and $row.

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

{
global $ilDB;
$res = array();
$sql = "SELECT * FROM il_exc_team_log".
" WHERE team_id = ".$ilDB->quote($a_team_id, "integer").
" ORDER BY tstamp DESC";
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row;
}
return $res;
}

+ Here is the caller graph for this function:

ilExAssignment::getTeamMembers (   $a_team_id)

Get members of assignment team.

Parameters
int$a_team_id
Returns
array

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

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

Referenced by addTeamMember(), and saveMultiFeedbackFiles().

{
global $ilDB;
$ids = array();
$sql = "SELECT user_id".
" FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer").
" AND id = ".$ilDB->quote($a_team_id, "integer");
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$ids[] = $row["user_id"];
}
return $ids;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::getTeamMembersByAssignmentId (   $a_ass_id,
  $a_user_id 
)
static

Find team members by assignment and team member.

Parameters
int$a_ass_id
int$a_user_id
Returns
array

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

References $ilDB, $row, and getTeamIdByAssignment().

Referenced by ilObjExerciseGUI\confirmDeassignMembersObject(), deleteAllDeliveredFilesOfUser(), ilObjExercise\deleteDeliveredFiles(), deleteDeliveredFiles(), ilObjExercise\deliverFile(), deliverReturnedFiles(), downloadSelectedFiles(), ilExParticipantTableGUI\fillRow(), getDeliveredFiles(), getLastSubmission(), ilExAssignmentGUI\getOverviewBody(), ilObjExercise\handleSubmission(), hasReturned(), lookupNewFiles(), lookupUpdatedSubmission(), ilObjExerciseGUI\redirectFeedbackMailObject(), and ilObjExerciseGUI\sendMembersObject().

{
global $ilDB;
$ids = array();
$team_id = self::getTeamIdByAssignment($a_ass_id, $a_user_id);
if($team_id)
{
$set = $ilDB->query("SELECT user_id".
" FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND id = ". $ilDB->quote($team_id, "integer"));
while($row = $ilDB->fetchAssoc($set))
{
$ids[] = $row["user_id"];
}
}
return $ids;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::getTitle ( )
ilExAssignment::getType ( )

Get type.

Returns
int

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

References $type.

Referenced by ilObjExerciseGUI\handleDisabledAssignmentFields(), save(), saveMultiFeedbackFiles(), and update().

{
return $this->type;
}

+ Here is the caller graph for this function:

ilExAssignment::getValidPeerReviewUsers ( )
protected

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

References $ilDB, and $row.

Referenced by initPeerReviews(), and validatePeerReviewGroups().

{
global $ilDB;
$user_ids = array();
// returned / assigned ?!
$set = $ilDB->query("SELECT DISTINCT(user_id)".
" FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer"));
while($row = $ilDB->fetchAssoc($set))
{
$user_ids[] = $row["user_id"];
}
return $user_ids;
}

+ Here is the caller graph for this function:

ilExAssignment::handleCalendarEntries (   $a_event)
protected

Handle calendar entries for deadline(s)

Parameters
string$a_event

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

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

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

{
global $ilAppEventHandler;
$dl_id = $this->getId()."0";
$fbdl_id = $this->getId()."1";
$context_ids = array($dl_id, $fbdl_id);
$apps = array();
if($a_event != "delete")
{
include_once "Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php";
if($this->getDeadline())
{
$app = new ilCalendarAppointmentTemplate($dl_id);
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setSubtitle("cal_exc_deadline");
$app->setTitle($this->getTitle());
$app->setFullday(false);
$app->setStart(new ilDateTime($this->getDeadline(), IL_CAL_UNIX));
$apps[] = $app;
}
if($this->getPeerReview() &&
{
$app = new ilCalendarAppointmentTemplate($fbdl_id);
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setSubtitle("cal_exc_peer_review_deadline");
$app->setTitle($this->getTitle());
$app->setFullday(false);
$app->setStart(new ilDateTime($this->getPeerReviewDeadline(), IL_CAL_UNIX));
$apps[] = $app;
}
}
include_once "Modules/Exercise/classes/class.ilObjExercise.php";
$exc = new ilObjExercise($this->getExerciseId(), false);
$ilAppEventHandler->raise('Modules/Exercise',
$a_event.'Assignment',
array(
'object' => $exc,
'obj_id' => $exc->getId(),
'context_ids' => $context_ids,
'appointments' => $apps));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::handleFeedbackFileUpload ( array  $a_file)

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

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

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$path = $storage->getGlobalFeedbackPath();
if(@move_uploaded_file($a_file["tmp_name"], $path."/".$a_file["name"]))
{
$this->setFeedbackFile($a_file["name"]);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilExAssignment::hasFeedbackCron ( )

Get (global) feedback file cron status.

Returns
int

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

References $feedback_cron.

Referenced by save(), and update().

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

+ Here is the caller graph for this function:

ilExAssignment::hasPeerReviewAccess (   $a_peer_id)

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

References $ilDB, $ilUser, $row, and getId().

{
global $ilDB, $ilUser;
$set = $ilDB->query("SELECT ass_id".
" FROM exc_assignment_peer".
" WHERE giver_id = ".$ilDB->quote($ilUser->getId(), "integer").
" AND peer_id = ".$ilDB->quote($a_peer_id, "integer").
" AND ass_id = ".$ilDB->quote($this->getId(), "integer"));
$row = $ilDB->fetchAssoc($set);
return (bool)$row["ass_id"];
}

+ Here is the call graph for this function:

ilExAssignment::hasPeerReviewFileUpload ( )

Get peer review file upload status.

Returns
bool

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

References $peer_file.

Referenced by getPeerUploadFiles(), ilObjExerciseGUI\handleDisabledAssignmentFields(), resetPeerReviewFileUploads(), save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::hasPeerReviewGroups ( )

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

References $ilDB.

Referenced by ilObjExerciseGUI\handleDisabledAssignmentFields(), initPeerReviews(), resetPeerReviews(), and validatePeerReviewGroups().

{
global $ilDB;
$set = $ilDB->query("SELECT count(*) cnt".
" FROM exc_assignment_peer".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer"));
$cnt = $ilDB->fetchAssoc($set);
return (bool)$cnt["cnt"];
}

+ Here is the caller graph for this function:

ilExAssignment::hasPeerReviewPersonalized ( )

Get peer review personalized status.

Returns
bool

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

References $peer_personal.

Referenced by ilObjExerciseGUI\handleDisabledAssignmentFields(), save(), and update().

{
}

+ Here is the caller graph for this function:

ilExAssignment::hasReturned (   $a_ass_id,
  $a_user_id 
)

was: hasReturned($a_member_id)

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

References $ilDB, $result, and getTeamMembersByAssignmentId().

{
global $ilDB;
$user_ids = self::getTeamMembersByAssignmentId($a_ass_id, $a_user_id);
if(!$user_ids)
{
$user_ids = array($a_user_id);
}
$result = $ilDB->query("SELECT returned_id FROM exc_returned".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND ".$ilDB->in("user_id", $user_ids, "", "integer"));
return $ilDB->numRows($result);
}

+ Here is the call graph for this function:

ilExAssignment::initPeerReviews ( )
protected

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

References $ilDB, getDeadline(), getPeerReviewMin(), getValidPeerReviewUsers(), and hasPeerReviewGroups().

Referenced by getPeerReviewsByGiver().

{
global $ilDB;
// only if assignment is through
if(!$this->getDeadline() || $this->getDeadline() > time())
{
return false;
}
if(!$this->hasPeerReviewGroups())
{
$user_ids = $this->getValidPeerReviewUsers();
// forever alone
if(sizeof($user_ids) < 2)
{
return false;
}
$rater_ids = $user_ids;
$matrix = array();
$max = min(sizeof($user_ids)-1, $this->getPeerReviewMin());
for($loop = 0; $loop < $max; $loop++)
{
$run_ids = array_combine($user_ids, $user_ids);
foreach($rater_ids as $rater_id)
{
$possible_peer_ids = $run_ids;
// may not rate himself
unset($possible_peer_ids[$rater_id]);
// already has linked peers
if(array_key_exists($rater_id, $matrix))
{
$possible_peer_ids = array_diff($possible_peer_ids, $matrix[$rater_id]);
}
// #15665 / #15883
if(!sizeof($possible_peer_ids))
{
// no more possible peers left? start over with all valid users
$run_ids = array_combine($user_ids, $user_ids);
// see above
$possible_peer_ids = $run_ids;
// may not rate himself
unset($possible_peer_ids[$rater_id]);
// already has linked peers
if(array_key_exists($rater_id, $matrix))
{
$possible_peer_ids = array_diff($possible_peer_ids, $matrix[$rater_id]);
}
}
// #14947
if(sizeof($possible_peer_ids))
{
$peer_id = array_rand($possible_peer_ids);
if(!array_key_exists($rater_id, $matrix))
{
$matrix[$rater_id] = array();
}
$matrix[$rater_id][] = $peer_id;
}
// remove peer_id from possible ids in this run
unset($run_ids[$peer_id]);
}
}
foreach($matrix as $rater_id => $peer_ids)
{
foreach($peer_ids as $peer_id)
{
$ilDB->manipulate("INSERT INTO exc_assignment_peer".
" (ass_id, giver_id, peer_id)".
" VALUES (".$ilDB->quote($this->getId(), "integer").
", ".$ilDB->quote($rater_id, "integer").
", ".$ilDB->quote($peer_id, "integer").")");
}
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::isValidType (   $a_value)

Is given type valid?

Parameters
int$a_value
Returns
bool

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

Referenced by setType().

{
if(in_array((int)$a_value, array(self::TYPE_UPLOAD, self::TYPE_BLOG,
self::TYPE_PORTFOLIO, self::TYPE_UPLOAD_TEAM, self::TYPE_TEXT)))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

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

Private lookup.

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

References $ilDB.

Referenced by lookupTitle(), and lookupType().

{
global $ilDB;
$set = $ilDB->query("SELECT ".$a_field." FROM exc_assignment ".
" WHERE id = ".$ilDB->quote($a_id, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return $rec[$a_field];
}

+ Here is the caller graph for this function:

static ilExAssignment::lookupAnyExerciseSent (   $a_exc_id,
  $a_ass_id 
)
static

Check whether exercise has been sent to any student per mail.

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

References $ilDB.

Referenced by ilExerciseMemberTableGUI\__construct().

{
global $ilDB;
$q = "SELECT count(*) AS cnt FROM exc_mem_ass_status".
" WHERE NOT sent_time IS NULL".
" AND ass_id = ".$ilDB->quote($a_ass_id, "integer")." ".
" ";
$set = $ilDB->query($q);
$rec = $ilDB->fetchAssoc($set);
if ($rec["cnt"] > 0)
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

static ilExAssignment::lookupAssignmentOnline (   $a_ass_id)
static

Check if assignment is online.

Parameters
int$a_ass_id
Returns
bool

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

References $ilDB, $query, and $res.

Referenced by ilObjExerciseSubItemListGUI\isAssignmentVisible().

{
global $ilDB;
$query = "SELECT id FROM exc_assignment ".
"WHERE start_time <= ".$ilDB->quote(time(),'integer').' '.
"AND time_stamp >= ".$ilDB->quote(time(),'integer').' '.
"AND id = ".$ilDB->quote($a_ass_id,'integer');
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

ilExAssignment::lookupAssMemberField (   $a_ass_id,
  $a_user_id,
  $a_field 
)
private

Lookup a field value of ass/member table.

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

References $ilDB.

Referenced by lookupCommentForUser(), lookupFeedbackTimeOfUser(), lookupMarkOfUser(), lookupNoticeOfUser(), lookupSentTimeOfUser(), lookupStatusFeedbackOfUser(), lookupStatusOfUser(), lookupStatusReturnedOfUser(), lookupStatusSentOfUser(), and lookupStatusTimeOfUser().

{
global $ilDB;
$set = $ilDB->query("SELECT ".$a_field." FROM exc_mem_ass_status ".
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND usr_id = ".$ilDB->quote($a_user_id, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return $rec[$a_field];
}

+ Here is the caller graph for this function:

ilExAssignment::lookupCommentForUser (   $a_ass_id,
  $a_user_id 
)

Lookup comment for the user.

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

References lookupAssMemberField().

Referenced by ilExerciseXMLWriter\attachMarking(), ilExParticipantTableGUI\fillRow(), ilExerciseMemberTableGUI\fillRow(), and ilExAssignmentGUI\getOverviewBody().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "u_comment");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::lookupFeedbackTimeOfUser (   $a_ass_id,
  $a_user_id 
)
static

Get time when feedback mail has been sent.

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

References ilUtil\getMySQLTimestamp(), and lookupAssMemberField().

Referenced by ilExParticipantTableGUI\fillRow(), and ilExerciseMemberTableGUI\fillRow().

{
ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "feedback_time"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::lookupMarkOfUser (   $a_ass_id,
  $a_user_id 
)

Lookup user mark.

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

References lookupAssMemberField().

Referenced by ilExerciseXMLWriter\attachMarking(), ilObjExercise\exportGradesExcel(), ilExGradesTableGUI\fillRow(), ilExParticipantTableGUI\fillRow(), ilExerciseMemberTableGUI\fillRow(), ilExAssignmentGUI\getOverviewBody(), and ilObjExerciseGUI\saveStatusObject().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "mark");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::lookupMaxOrderNrForEx (   $a_exc_id)
static

Select the maximum order nr for an exercise.

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

References $ilDB.

Referenced by save().

{
global $ilDB;
$set = $ilDB->query("SELECT MAX(order_nr) mnr FROM exc_assignment ".
" WHERE exc_id = ".$ilDB->quote($a_exc_id, "integer")
);
while ($rec = $ilDB->fetchAssoc($set))
{
return (int) $rec["mnr"];
}
return 0;
}

+ Here is the caller graph for this function:

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

Check how much files have been uploaded by the learner after the last download of the tutor.

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

References $ilDB, $ilUser, and getTeamMembersByAssignmentId().

Referenced by getDownloadedFilesInfoForTableGUIS().

{
global $ilDB, $ilUser;
// team upload?
$user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
if(!$user_ids)
{
$user_ids = array($member_id);
}
$q = "SELECT exc_returned.returned_id AS id ".
"FROM exc_usr_tutor, exc_returned ".
"WHERE exc_returned.ass_id = exc_usr_tutor.ass_id ".
" AND exc_returned.user_id = exc_usr_tutor.usr_id ".
" AND exc_returned.ass_id = ".$ilDB->quote($ass_id, "integer").
" AND ".$ilDB->in("exc_returned.user_id", $user_ids, "", "integer").
" AND exc_usr_tutor.tutor_id = ".$ilDB->quote($ilUser->getId(), "integer").
" AND exc_usr_tutor.download_time < exc_returned.ts ";
$new_up_set = $ilDB->query($q);
$new_up = array();
while ($new_up_rec = $ilDB->fetchAssoc($new_up_set))
{
$new_up[] = $new_up_rec["id"];
}
return $new_up;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::lookupNoticeOfUser (   $a_ass_id,
  $a_user_id 
)

was: getNoticeByMember($a_member_id)

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

References lookupAssMemberField().

Referenced by ilExerciseXMLWriter\attachMarking(), ilExParticipantTableGUI\fillRow(), and ilExerciseMemberTableGUI\fillRow().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "notice");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::lookupSentTimeOfUser (   $a_ass_id,
  $a_user_id 
)
static

Get time when exercise has been sent per e-mail to user.

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

References ilUtil\getMySQLTimestamp(), and lookupAssMemberField().

Referenced by ilExerciseMemberTableGUI\fillRow().

{
ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "sent_time"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::lookupStatusFeedbackOfUser (   $a_ass_id,
  $a_user_id 
)

was: getStatusFeedbackByMember($a_member_id)

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

References lookupAssMemberField().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "feedback");
}

+ Here is the call graph for this function:

ilExAssignment::lookupStatusOfUser (   $a_ass_id,
  $a_user_id 
)

was: getStatusByMember

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

References lookupAssMemberField().

Referenced by ilExerciseXMLWriter\attachMarking(), ilObjExercise\determinStatusOfUser(), ilObjExercise\exportGradesExcel(), ilExGradesTableGUI\fillRow(), ilExParticipantTableGUI\fillRow(), ilExerciseMemberTableGUI\fillRow(), ilExAssignmentGUI\getOverviewBody(), and ilExAssignmentGUI\getOverviewHeader().

{
$stat = ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "status");
if ($stat == "")
{
$stat = "notgraded";
}
return $stat;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::lookupStatusReturnedOfUser (   $a_ass_id,
  $a_user_id 
)

was: getStatusReturnedByMember($a_member_id)

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

References lookupAssMemberField().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "returned");
}

+ Here is the call graph for this function:

ilExAssignment::lookupStatusSentOfUser (   $a_ass_id,
  $a_user_id 
)

was: getStatusSentByMember($a_member_id)

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

References lookupAssMemberField().

Referenced by ilExerciseMemberTableGUI\fillRow().

{
return ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "sent");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::lookupStatusTimeOfUser (   $a_ass_id,
  $a_user_id 
)
static

Get status time.

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

References ilUtil\getMySQLTimestamp(), and lookupAssMemberField().

Referenced by ilExParticipantTableGUI\fillRow(), and ilExerciseMemberTableGUI\fillRow().

{
ilExAssignment::lookupAssMemberField($a_ass_id, $a_user_id, "status_time"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilExAssignment::lookupType (   $a_id)
static

Lookup type.

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

References lookup().

Referenced by ilExerciseMemberTableGUI\__construct(), and downloadAllDeliveredFiles().

{
return ilExAssignment::lookup($a_id, "type");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $ilDB, $lng, and getTeamMembersByAssignmentId().

{
global $ilDB, $lng;
// team upload?
$user_ids = self::getTeamMembersByAssignmentId($ass_id, $member_id);
if(!$user_ids)
{
$user_ids = array($member_id);
}
$q="SELECT exc_mem_ass_status.status_time, exc_returned.ts ".
"FROM exc_mem_ass_status, exc_returned ".
"WHERE exc_mem_ass_status.status_time < exc_returned.ts ".
"AND NOT exc_mem_ass_status.status_time IS NULL ".
"AND exc_returned.ass_id = exc_mem_ass_status.ass_id ".
"AND exc_returned.user_id = exc_mem_ass_status.usr_id ".
"AND exc_returned.ass_id=".$ilDB->quote($ass_id, "integer").
" AND ".$ilDB->in("exc_returned.user_id", $user_ids, "", "integer");
$usr_set = $ilDB->query($q);
$array = $ilDB->fetchAssoc($usr_set);
if (count($array)==0)
{
return 0;
}
else
{
return 1;
}
}

+ Here is the call graph for this function:

ilExAssignment::orderAssByDeadline (   $a_ex_id)

Order assignments by deadline date.

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

References $ilDB.

Referenced by ilObjExerciseGUI\orderAssignmentsByDeadlineObject().

{
global $ilDB;
$set = $ilDB->query("SELECT id FROM exc_assignment ".
" WHERE exc_id = ".$ilDB->quote($a_ex_id, "integer").
" ORDER BY time_stamp ASC"
);
$nr = 10;
while ($rec = $ilDB->fetchAssoc($set))
{
$ilDB->manipulate("UPDATE exc_assignment SET ".
" order_nr = ".$ilDB->quote($nr, "integer").
" WHERE id = ".$ilDB->quote($rec["id"], "integer")
);
$nr += 10;
}
}

+ Here is the caller graph for this function:

ilExAssignment::read ( )

Read from db.

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

References $ilDB, setDeadline(), setExerciseId(), setFeedbackCron(), setFeedbackDate(), setFeedbackFile(), setInstruction(), setMandatory(), setOrderNr(), setPeerReview(), setPeerReviewDeadline(), setPeerReviewFileUpload(), setPeerReviewMin(), setPeerReviewPersonalized(), setStartTime(), setTitle(), and setType().

Referenced by __construct().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM exc_assignment ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer")
);
while ($rec = $ilDB->fetchAssoc($set))
{
$this->setExerciseId($rec["exc_id"]);
$this->setDeadline($rec["time_stamp"]);
$this->setInstruction($rec["instruction"]);
$this->setTitle($rec["title"]);
$this->setStartTime($rec["start_time"]);
$this->setOrderNr($rec["order_nr"]);
$this->setMandatory($rec["mandatory"]);
$this->setType($rec["type"]);
$this->setPeerReview($rec["peer"]);
$this->setPeerReviewMin($rec["peer_min"]);
$this->setPeerReviewDeadline($rec["peer_dl"]);
$this->setPeerReviewFileUpload($rec["peer_file"]);
$this->setPeerReviewPersonalized($rec["peer_prsl"]);
$this->setFeedbackFile($rec["fb_file"]);
$this->setFeedbackDate($rec["fb_date"]);
$this->setFeedbackCron($rec["fb_cron"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::removeTeamMember (   $a_team_id,
  $a_user_id,
  $a_exc_ref_id 
)

Remove member from team.

Parameters
int$a_team_id
int$a_user_id
int$a_exc_ref_id

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

References $ilDB, ilObjUser\_lookupFullname(), getId(), sendNotification(), and writeTeamLog().

{
global $ilDB;
$sql = "DELETE FROM il_exc_team".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer").
" AND id = ".$ilDB->quote($a_team_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer");
$ilDB->manipulate($sql);
$this->sendNotification($a_exc_ref_id, $a_user_id, "rmv");
self::writeTeamLog($a_team_id, self::TEAM_LOG_REMOVE_MEMBER,
}

+ Here is the call graph for this function:

ilExAssignment::resetPeerReviewFileUploads ( )

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

References getExerciseId(), getId(), and hasPeerReviewFileUpload().

Referenced by resetPeerReviews().

{
{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$storage->deletePeerReviewUploads();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::resetPeerReviews ( )

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

References $ilDB, getAllPeerReviews(), getId(), hasPeerReviewGroups(), resetPeerReviewFileUploads(), and ilRating\resetRatingForUserAndObject().

{
global $ilDB;
if($this->hasPeerReviewGroups())
{
// ratings
foreach($this->getAllPeerReviews(false) as $peer_id => $reviews)
{
foreach($reviews as $giver_id => $review)
{
$peer_id, "peer", $giver_id);
}
}
// files
// peer groups
$ilDB->manipulate("DELETE FROM exc_assignment_peer".
" WHERE ass_id = ".$ilDB->quote($this->getId(), "integer"));
}
}

+ Here is the call graph for this function:

ilExAssignment::save ( )

Save assignment.

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

References $ilDB, createNewAssignmentRecords(), getDeadline(), getExerciseId(), getFeedbackDate(), getFeedbackFile(), getInstruction(), getMandatory(), getOrderNr(), getPeerReview(), getPeerReviewDeadline(), getPeerReviewMin(), getStartTime(), getTitle(), getType(), handleCalendarEntries(), hasFeedbackCron(), hasPeerReviewFileUpload(), hasPeerReviewPersonalized(), lookupMaxOrderNrForEx(), setId(), and setOrderNr().

{
global $ilDB;
if ($this->getOrderNr() == 0)
{
$this->setOrderNr(
+ 10);
}
$next_id = $ilDB->nextId("exc_assignment");
$ilDB->insert("exc_assignment", array(
"id" => array("integer", $next_id),
"exc_id" => array("integer", $this->getExerciseId()),
"time_stamp" => array("integer", $this->getDeadline()),
"instruction" => array("clob", $this->getInstruction()),
"title" => array("text", $this->getTitle()),
"start_time" => array("integer", $this->getStartTime()),
"order_nr" => array("integer", $this->getOrderNr()),
"mandatory" => array("integer", $this->getMandatory()),
"type" => array("integer", $this->getType()),
"peer" => array("integer", $this->getPeerReview()),
"peer_min" => array("integer", $this->getPeerReviewMin()),
"peer_dl" => array("integer", $this->getPeerReviewDeadline()),
"peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
"peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
"fb_file" => array("text", $this->getFeedbackFile()),
"fb_date" => array("integer", $this->getFeedbackDate()),
"fb_cron" => array("integer", $this->hasFeedbackCron()))
);
$this->setId($next_id);
$exc = new ilObjExercise($this->getExerciseId(), false);
$exc->updateAllUsersStatus();
$this->handleCalendarEntries("create");
}

+ Here is the call graph for this function:

ilExAssignment::saveAssOrderOfExercise (   $a_ex_id,
  $a_order 
)

Save ordering of all assignments of an exercise.

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

References $ilDB, and $t.

Referenced by ilObjExerciseGUI\saveAssignmentOrderObject().

{
global $ilDB;
$result_order = array();
asort($a_order);
$nr = 10;
foreach ($a_order as $k => $v)
{
// the check for exc_id is for security reasons. ass ids are unique.
$ilDB->manipulate($t = "UPDATE exc_assignment SET ".
" order_nr = ".$ilDB->quote($nr, "integer").
" WHERE id = ".$ilDB->quote((int) $k, "integer").
" AND exc_id = ".$ilDB->quote((int) $a_ex_id, "integer")
);
$nr+=10;
}
}

+ Here is the caller graph for this function:

ilExAssignment::saveMultiFeedbackFiles (   $a_files)

Save multi feedback files.

Parameters
@return

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

References clearMultiFeedbackDirectory(), getExerciseId(), getId(), getMultiFeedbackFiles(), getTeamId(), getTeamMembers(), getType(), and TYPE_UPLOAD_TEAM.

{
$exc = new ilObjExercise($this->getExerciseId(), false);
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$fstorage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$fstorage->create();
$team_map = array();
$mf_files = $this->getMultiFeedbackFiles();
foreach ($mf_files as $f)
{
$user_id = $f["user_id"];
$file_path = $f["full_path"];
$file_name = $f["file"];
// if checked in confirmation gui
if ($a_files[$user_id][md5($file_name)] != "")
{
// #14294 - team assignment
{
// just once for each user
if (!array_key_exists($user_id, $team_map))
{
$team_id = $this->getTeamId($user_id);
$team_map[$user_id]["team_id"] = "t".$team_id;
$team_map[$user_id]["noti_rec_ids"] = array();
foreach ($this->getTeamMembers($team_id) as $team_user_id)
{
$team_map[$user_id]["noti_rec_ids"][] = $team_user_id;
}
}
$feedback_id = $team_map[$user_id]["team_id"];
$noti_rec_ids = $team_map[$user_id]["noti_rec_ids"];
}
else
{
$feedback_id = $user_id;
$noti_rec_ids = array($user_id);
}
if ($feedback_id)
{
$fb_path = $fstorage->getFeedbackPath($feedback_id);
$target = $fb_path."/".$file_name;
if (is_file($target))
{
unlink($target);
}
// rename file
rename($file_path, $target);
if ($noti_rec_ids)
{
$exc->sendFeedbackFileNotification($file_name, $noti_rec_ids,
(int) $this->getId());
}
}
}
}
}

+ Here is the call graph for this function:

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

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

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

Referenced by ilExcCronFeedbackNotification\run(), and updateStatusReturnedForUser().

{
global $ilDB;
$ass = new self($a_ass_id);
// valid assignment?
if(!$ass->hasFeedbackCron() || !$ass->getFeedbackFile())
{
return false;
}
if(!$a_user_id)
{
// already done?
$set = $ilDB->query("SELECT fb_cron_done".
" FROM exc_assignment".
" WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
$row = $ilDB->fetchAssoc($set);
if($row["fb_cron_done"])
{
return false;
}
}
include_once "./Services/Notification/classes/class.ilSystemNotification.php";
$ntf = new ilSystemNotification();
$ntf->setLangModules(array("exc"));
$ntf->setObjId($ass->getExerciseId());
$ntf->setSubjectLangId("exc_feedback_notification_subject");
$ntf->setIntroductionLangId("exc_feedback_notification_body");
$ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
$ntf->setGotoLangId("exc_feedback_notification_link");
$ntf->setReasonLangId("exc_feedback_notification_reason");
if(!$a_user_id)
{
include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
$ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
$ilDB->manipulate("UPDATE exc_assignment".
" SET fb_cron_done = ".$ilDB->quote(1, "integer").
" WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
}
else
{
$ntf->sendMail(array($a_user_id));
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::sendMultiFeedbackStructureFile ( )

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

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

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

{
global $ilDB;
// send and delete the zip file
$deliverFilename = trim(str_replace(" ", "_", $this->getTitle()."_".$this->getId()));
$deliverFilename = ilUtil::getASCIIFilename($deliverFilename);
$deliverFilename = "multi_feedback_".$deliverFilename;
$exc = new ilObjExercise($this->getExerciseId(), false);
$cdir = getcwd();
// create temporary directoy
$tmpdir = ilUtil::ilTempnam();
ilUtil::makeDir($tmpdir);
$mfdir = $tmpdir."/".$deliverFilename;
ilUtil::makeDir($mfdir);
// create subfolders <lastname>_<firstname>_<id> for each participant
include_once("./Modules/Exercise/classes/class.ilExerciseMembers.php");
$exmem = new ilExerciseMembers($exc);
$mems = $exmem->getMembers();
foreach ($mems as $mem)
{
$name = ilObjUser::_lookupName($mem);
$subdir = $name["lastname"]."_".$name["firstname"]."_".$name["login"]."_".$name["user_id"];
$subdir = ilUtil::getASCIIFilename($subdir);
ilUtil::makeDir($mfdir."/".$subdir);
}
// create the zip file
chdir($tmpdir);
$tmpzipfile = $tmpdir."/multi_feedback.zip";
ilUtil::zip($tmpdir, $tmpzipfile, true);
chdir($cdir);
ilUtil::deliverFile($tmpzipfile, $deliverFilename.".zip", "", false, true);
}

+ Here is the call graph for this function:

ilExAssignment::sendNotification (   $a_exc_ref_id,
  $a_user_id,
  $a_action 
)

Send notification about team status.

Parameters
int$a_exc_ref_id
int$a_user_id
string$a_action

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

References $ilUser, and getTitle().

Referenced by addTeamMember(), adoptTeams(), and removeTeamMember().

{
global $ilUser;
// no need to notify current user
if($ilUser->getId() == $a_user_id)
{
return;
}
include_once "./Services/Notification/classes/class.ilSystemNotification.php";
$ntf = new ilSystemNotification();
$ntf->setLangModules(array("exc"));
$ntf->setRefId($a_exc_ref_id);
$ntf->setChangedByUserId($ilUser->getId());
$ntf->setSubjectLangId('exc_team_notification_subject_'.$a_action);
$ntf->setIntroductionLangId('exc_team_notification_body_'.$a_action);
$ntf->addAdditionalInfo("exc_assignment", $this->getTitle());
$ntf->setGotoLangId('exc_team_notification_link');
$ntf->setReasonLangId('exc_team_notification_reason');
$ntf->sendMail(array($a_user_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::setDeadline (   $a_val)

Set deadline (timestamp)

Parameters
intdeadline (timestamp)

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

Referenced by read().

{
$this->deadline = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setExerciseId (   $a_val)

Set exercise id.

Parameters
intexercise id

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

Referenced by read().

{
$this->exc_id = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setFeedbackCron (   $a_value)

Toggle (global) feedback file cron.

Parameters
bool$a_value

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

Referenced by read().

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

+ Here is the caller graph for this function:

ilExAssignment::setFeedbackDate (   $a_value)

Set (global) feedback file availability date.

Parameters
int$a_value

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

Referenced by __construct(), and read().

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

+ Here is the caller graph for this function:

ilExAssignment::setFeedbackFile (   $a_value)

Set (global) feedback file.

Parameters
string$a_value

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

Referenced by handleFeedbackFileUpload(), and read().

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

+ Here is the caller graph for this function:

ilExAssignment::setId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

Referenced by __construct(), and save().

{
$this->id = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setInstruction (   $a_val)

Set instruction.

Parameters
stringinstruction

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

Referenced by read().

{
$this->instruction = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setMandatory (   $a_val)

Set mandatory.

Parameters
intmandatory

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

Referenced by read().

{
$this->mandatory = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

Referenced by read(), and save().

{
$this->order_nr = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setPeerReview (   $a_value)

Toggle peer review.

Parameters
bool$a_value

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

Referenced by read(), and setType().

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

+ Here is the caller graph for this function:

ilExAssignment::setPeerReviewDeadline (   $a_val)

Set peer review deadline (timestamp)

Parameters
intdeadline (timestamp)

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

Referenced by read().

{
$this->peer_dl = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setPeerReviewFileUpload (   $a_val)

Set peer review file upload.

Parameters
bool

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

Referenced by read().

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

+ Here is the caller graph for this function:

ilExAssignment::setPeerReviewMin (   $a_value)

Set peer review minimum.

Parameters
int$a_value

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

Referenced by read().

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

+ Here is the caller graph for this function:

ilExAssignment::setPeerReviewPersonalized (   $a_val)

Set peer review personalized.

Parameters
bool

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

Referenced by read().

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

+ Here is the caller graph for this function:

ilExAssignment::setStartTime (   $a_val)

Set start time (timestamp)

Parameters
intstart time (timestamp)

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

Referenced by read().

{
$this->start_time = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

Referenced by read().

{
$this->title = $a_val;
}

+ Here is the caller graph for this function:

ilExAssignment::setType (   $a_value)

Set type.

Parameters
int$a_value

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

References isValidType(), and setPeerReview().

Referenced by __construct(), and read().

{
if($this->isValidType($a_value))
{
$this->type = (int)$a_value;
if($this->type == self::TYPE_UPLOAD_TEAM)
{
$this->setPeerReview(false);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::update ( )

Update.

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

References $ilDB, getDeadline(), getExerciseId(), getFeedbackDate(), getFeedbackFile(), getId(), getInstruction(), getMandatory(), getOrderNr(), getPeerReview(), getPeerReviewDeadline(), getPeerReviewMin(), getStartTime(), getTitle(), getType(), handleCalendarEntries(), hasFeedbackCron(), hasPeerReviewFileUpload(), and hasPeerReviewPersonalized().

{
global $ilDB;
$ilDB->update("exc_assignment",
array(
"exc_id" => array("integer", $this->getExerciseId()),
"time_stamp" => array("integer", $this->getDeadline()),
"instruction" => array("clob", $this->getInstruction()),
"title" => array("text", $this->getTitle()),
"start_time" => array("integer", $this->getStartTime()),
"order_nr" => array("integer", $this->getOrderNr()),
"mandatory" => array("integer", $this->getMandatory()),
"type" => array("integer", $this->getType()),
"peer" => array("integer", $this->getPeerReview()),
"peer_min" => array("integer", $this->getPeerReviewMin()),
"peer_dl" => array("integer", $this->getPeerReviewDeadline()),
"peer_file" => array("integer", $this->hasPeerReviewFileUpload()),
"peer_prsl" => array("integer", $this->hasPeerReviewPersonalized()),
"fb_file" => array("text", $this->getFeedbackFile()),
"fb_date" => array("integer", $this->getFeedbackDate()),
"fb_cron" => array("integer", $this->hasFeedbackCron())
),
array(
"id" => array("integer", $this->getId()),
));
$exc = new ilObjExercise($this->getExerciseId(), false);
$exc->updateAllUsersStatus();
$this->handleCalendarEntries("update");
}

+ Here is the call graph for this function:

ilExAssignment::updateAssMemberField (   $a_ass_id,
  $a_user_id,
  $a_field,
  $a_value,
  $a_type 
)
private

Update a field value of ass/member table.

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

References $ilDB.

Referenced by updateCommentForUser(), updateMarkOfUser(), and updateStatusTimeOfUser().

{
global $ilDB;
$ilDB->manipulate("UPDATE exc_mem_ass_status SET ".
" ".$a_field." = ".$ilDB->quote($a_value, $a_type).
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND usr_id = ".$ilDB->quote($a_user_id, "integer")
);
}

+ Here is the caller graph for this function:

ilExAssignment::updateCommentForUser (   $a_ass_id,
  $a_user_id,
  $a_value 
)

Update comment.

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

References updateAssMemberField().

Referenced by ilObjExerciseGUI\saveCommentForLearnersObject(), and ilExerciseXMLParser\updateMarking().

{
ilExAssignment::updateAssMemberField($a_ass_id, $a_user_id,
"u_comment", $a_value, "text");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateMarkOfUser (   $a_ass_id,
  $a_user_id,
  $a_value 
)

Update mark.

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

References updateAssMemberField().

Referenced by ilObjExerciseGUI\saveStatusObject(), and ilExerciseXMLParser\updateMarking().

{
ilExAssignment::updateAssMemberField($a_ass_id, $a_user_id,
"mark", $a_value, "text");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateNoticeForUser (   $a_ass_id,
  $a_user_id,
  $a_notice 
)

was: setNoticeForMember($a_member_id,$a_notice)

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

References $ilDB.

Referenced by ilObjExerciseGUI\saveStatusObject(), and ilExerciseXMLParser\updateMarking().

{
global $ilDB;
// #12181 / #13741
$ilDB->manipulate("UPDATE exc_mem_ass_status".
" SET notice = ".$ilDB->quote($a_notice, "text").
" WHERE ass_id = ".$ilDB->quote($a_ass_id, "integer").
" AND usr_id = ".$ilDB->quote($a_user_id, "integer").
" AND ".$ilDB->equalsNot("notice", $a_notice, "text", true));
}

+ Here is the caller graph for this function:

ilExAssignment::updatePeerReviewComment (   $a_peer_id,
  $a_comment 
)

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

References $ilDB, $ilUser, getId(), and ilUtil\now().

{
global $ilDB, $ilUser;
$sql = "UPDATE exc_assignment_peer".
" SET tstamp = ".$ilDB->quote(ilUtil::now(), "timestamp").
",pcomment = ".$ilDB->quote(trim($a_comment), "text").
" WHERE giver_id = ".$ilDB->quote($ilUser->getId(), "integer").
" AND peer_id = ".$ilDB->quote($a_peer_id, "integer").
" AND ass_id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($sql);
}

+ Here is the call graph for this function:

ilExAssignment::updatePeerReviewTimestamp (   $a_peer_id)

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

References $ilDB, $ilUser, getId(), and ilUtil\now().

{
global $ilDB, $ilUser;
$ilDB->manipulate("UPDATE exc_assignment_peer".
" SET tstamp = ".$ilDB->quote(ilUtil::now(), "timestamp").
" WHERE giver_id = ".$ilDB->quote($ilUser->getId(), "integer").
" AND peer_id = ".$ilDB->quote($a_peer_id, "integer").
" AND ass_id = ".$ilDB->quote($this->getId(), "integer"));
}

+ Here is the call graph for this function:

ilExAssignment::updateStatusFeedbackForUser (   $a_ass_id,
  $a_user_id,
  $a_status 
)

was: setStatusFeedbackForMember($a_member_id,$a_status)

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

References $ilDB, and ilUtil\now().

Referenced by ilObjExerciseGUI\redirectFeedbackMailObject().

{
global $ilDB;
// #13741
$ilDB->manipulateF("UPDATE exc_mem_ass_status ".
"SET feedback = %s, feedback_time = %s ".
" WHERE ass_id = %s AND usr_id = %s",
array("integer", "timestamp", "integer", "integer"),
array((int) $a_status, ($a_status ? ilUtil::now() : null),
$a_ass_id, $a_user_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateStatusOfUser (   $a_ass_id,
  $a_user_id,
  $a_status 
)

was: setStatusForMember($a_member_id,$a_status)

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

References $ilDB, ilUtil\now(), and ilObjExercise\updateUserStatus().

Referenced by deleteAllDeliveredFilesOfUser(), ilObjExercise\handleSubmission(), ilObjExerciseGUI\saveStatusObject(), and ilExerciseXMLParser\updateMarking().

{
global $ilDB;
$ilDB->manipulateF("UPDATE exc_mem_ass_status ".
"SET status = %s, status_time= %s ".
" WHERE ass_id = %s AND usr_id = %s AND status <> %s ",
array("text", "timestamp", "integer", "integer", "text"),
array($a_status, ilUtil::now(), $a_ass_id, $a_user_id, $a_status));
$ass = new ilExAssignment($a_ass_id);
$exc = new ilObjExercise($ass->getExerciseId(), false);
$exc->updateUserStatus($a_user_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateStatusReturnedForUser (   $a_ass_id,
  $a_user_id,
  $a_status 
)

was: setStatusReturnedForMember($a_member_id,$a_status)

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

References $ilDB, $row, and sendFeedbackNotifications().

Referenced by ilObjExercise\addResourceObject(), ilObjExerciseGUI\addTeamMemberActionObject(), ilObjExercise\deleteDeliveredFiles(), ilObjExercise\deliverFile(), and ilObjExerciseGUI\removeTeamMemberObject().

{
global $ilDB;
// first upload => notification on submission?
if($a_status &&
!self::lookupStatusReturnedOfUser($a_ass_id, $a_user_id))
{
$set = $ilDB->query("SELECT fb_cron, fb_date, fb_file".
" FROM exc_assignment".
" WHERE id = ".$ilDB->quote($a_ass_id, "integer"));
$row = $ilDB->fetchAssoc($set);
if($row["fb_cron"] &&
$row["fb_file"] &&
$row["fb_date"] == self::FEEDBACK_DATE_SUBMISSION)
{
}
}
// #13741
$ilDB->manipulateF("UPDATE exc_mem_ass_status".
" SET returned = %s".
" WHERE ass_id = %s AND usr_id = %s",
array("integer", "integer", "integer"),
array((int) $a_status, $a_ass_id, $a_user_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateStatusSentForUser (   $a_ass_id,
  $a_user_id,
  $a_status 
)

was: setStatusSentForMember($a_member_id,$a_status)

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

References $ilDB, and ilUtil\now().

Referenced by ilObjExercise\sendAssignment().

{
global $ilDB;
// #13741
$ilDB->manipulateF("UPDATE exc_mem_ass_status ".
"SET sent = %s, sent_time = %s ".
" WHERE ass_id = %s AND usr_id = %s ",
array("integer", "timestamp", "integer", "integer"),
array((int) $a_status, ($a_status ? ilUtil::now() : null),
$a_ass_id, $a_user_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateStatusTimeOfUser (   $a_ass_id,
  $a_user_id 
)

was: updateStatusTimeForMember($a_user_id)

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

References ilUtil\now(), and updateAssMemberField().

Referenced by ilObjExerciseGUI\saveStatusObject().

{
// #13741 - is only used for mark
ilExAssignment::updateAssMemberField($a_ass_id, $a_user_id,
"status_time", ilUtil::now(), "timestamp");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::updateTutorDownloadTime (   $a_exc_id,
  $a_ass_id,
  $a_user_id 
)

was: updateTutorDownloadTime($member_id)

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

References $ilDB, $ilUser, and ilUtil\now().

Referenced by deliverReturnedFiles(), and ilObjExerciseGUI\downloadAllObject().

{
global $ilUser, $ilDB;
$ilDB->manipulateF("DELETE FROM exc_usr_tutor ".
"WHERE ass_id = %s AND usr_id = %s AND tutor_id = %s",
array("integer", "integer", "integer"),
array($a_ass_id, $a_user_id, $ilUser->getId()));
$ilDB->manipulateF("INSERT INTO exc_usr_tutor (ass_id, obj_id, usr_id, tutor_id, download_time) VALUES ".
"(%s, %s, %s, %s, %s)",
array("integer", "integer", "integer", "integer", "timestamp"),
array($a_ass_id, $a_exc_id, $a_user_id, $ilUser->getId(), ilUtil::now()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExAssignment::uploadAssignmentFiles (   $a_files)

Upload assignment files (from creation form)

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

References getExerciseId(), and getId().

{
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$storage->create();
$storage->uploadAssignmentFiles($a_files);
}

+ Here is the call graph for this function:

ilExAssignment::uploadMultiFeedbackFile (   $a_file)

Upload multi feedback file.

Parameters
array
Returns

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

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

{
global $lng, $ilUser;
include_once("./Modules/Exercise/exceptions/class.ilExerciseException.php");
if (!is_file($a_file["tmp_name"]))
{
throw new ilExerciseException($lng->txt("exc_feedback_file_could_not_be_uploaded"));
}
include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
$storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
$mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
ilUtil::delDir($mfu, true);
ilUtil::moveUploadedFile($a_file["tmp_name"], "multi_feedback.zip", $mfu."/"."multi_feedback.zip");
ilUtil::unzip($mfu."/multi_feedback.zip", true);
$subdirs = ilUtil::getDir($mfu);
$subdir = "notfound";
foreach ($subdirs as $s => $j)
{
if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback")
{
$subdir = $s;
}
}
if (!is_dir($mfu."/".$subdir))
{
throw new ilExerciseException($lng->txt("exc_no_feedback_dir_found_in_zip"));
}
return true;
}

+ Here is the call graph for this function:

static ilExAssignment::validatePeerReview ( array  $a_data,
  $a_rating = null 
)
staticprotected

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

References $valid, and ilRating\getRatingForUserAndObject().

{
$valid = false;
// comment
if(trim($a_data["pcomment"]))
{
$valid = true;
}
// rating
if(!$valid)
{
if($a_rating === null)
{
include_once './Services/Rating/classes/class.ilRating.php';
$valid = (bool)round(ilRating::getRatingForUserAndObject($a_data["ass_id"],
"ass", $a_data["peer_id"], "peer", $a_data["giver_id"]));
}
else if($a_rating)
{
$valid = true;
}
}
// file(s)
if(!$valid)
{
$ass = new self($a_data["ass_id"]);
$valid = (bool)sizeof($ass->getPeerUploadFiles($a_data["peer_id"], $a_data["giver_id"]));
}
return $valid;
}

+ Here is the call graph for this function:

ilExAssignment::validatePeerReviewGroups ( )

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

References $valid, ilExerciseMembers\_getMembers(), getAllPeerReviews(), getExerciseId(), getValidPeerReviewUsers(), and hasPeerReviewGroups().

{
if($this->hasPeerReviewGroups())
{
include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
$all_valid = $this->getValidPeerReviewUsers(); // only returned
$peer_ids = $invalid_peer_ids = $invalid_giver_ids = $all_reviews = array();
foreach($this->getAllPeerReviews(false) as $peer_id => $reviews)
{
$peer_ids[] = $peer_id;
if(!in_array($peer_id, $all_valid) ||
!in_array($peer_id, $all_exc))
{
$invalid_peer_ids[] = $peer_id;
}
foreach($reviews as $giver_id => $review)
{
if(!in_array($giver_id, $all_valid) ||
!in_array($giver_id, $all_exc))
{
$invalid_giver_ids[] = $giver_id;
}
else
{
$valid = (trim($review[0]) || $review[1]);
$all_reviews[$peer_id][$giver_id] = $valid;
}
}
}
$invalid_giver_ids = array_unique($invalid_giver_ids);
$missing_user_ids = array();
foreach($all_valid as $user_id)
{
// a missing peer is also a missing giver
if(!in_array($user_id, $peer_ids))
{
$missing_user_ids[] = $user_id;
}
}
$not_returned_ids = array();
foreach($all_exc as $user_id)
{
if(!in_array($user_id, $all_valid))
{
$not_returned_ids[] = $user_id;
}
}
return array(
"invalid" => (sizeof($missing_user_ids) ||
sizeof($invalid_peer_ids) ||
sizeof($invalid_giver_ids)),
"missing_user_ids" => $missing_user_ids,
"not_returned_ids" => $not_returned_ids,
"invalid_peer_ids" => $invalid_peer_ids,
"invalid_giver_ids" => $invalid_giver_ids,
"reviews" => $all_reviews);
}
}

+ Here is the call graph for this function:

static ilExAssignment::writeTeamLog (   $a_team_id,
  $a_action,
  $a_details = null 
)
static

Add entry to team log.

Parameters
int$a_team_id
int$a_action
string$a_details

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

References $ilDB, and $ilUser.

Referenced by addTeamMember(), deleteDeliveredFiles(), ilObjExercise\deliverFile(), getTeamId(), and removeTeamMember().

{
global $ilDB, $ilUser;
$fields = array(
"team_id" => array("integer", $a_team_id),
"user_id" => array("integer", $ilUser->getId()),
"action" => array("integer", $a_action),
"details" => array("text", $a_details),
"tstamp" => array("integer", time())
);
$ilDB->insert("il_exc_team_log", $fields);
}

+ Here is the caller graph for this function:

Field Documentation

ilExAssignment::$deadline
protected

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

Referenced by getDeadline().

ilExAssignment::$exc_id
protected

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

Referenced by getExerciseId().

ilExAssignment::$feedback_cron
protected

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

Referenced by hasFeedbackCron().

ilExAssignment::$feedback_date
protected

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

Referenced by getFeedbackDate().

ilExAssignment::$feedback_file
protected

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

Referenced by getFeedbackFile().

ilExAssignment::$id
protected

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

Referenced by downloadAllDeliveredFiles(), getId(), and getTeamId().

ilExAssignment::$instruction
protected

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

Referenced by getInstruction().

ilExAssignment::$mandatory
protected

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

Referenced by getMandatory().

ilExAssignment::$order_nr
protected

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

Referenced by getOrderNr().

ilExAssignment::$peer
protected

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

Referenced by getPeerReview().

ilExAssignment::$peer_dl
protected

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

Referenced by getPeerReviewDeadline().

ilExAssignment::$peer_file
protected

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

Referenced by hasPeerReviewFileUpload().

ilExAssignment::$peer_min
protected

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

Referenced by getPeerReviewMin().

ilExAssignment::$peer_personal
protected

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

Referenced by hasPeerReviewPersonalized().

ilExAssignment::$start_time
protected

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

Referenced by getStartTime().

ilExAssignment::$title
protected

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

Referenced by getTitle().

ilExAssignment::$type
protected

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

Referenced by getTeamIdByAssignment(), and getType().

const ilExAssignment::FEEDBACK_DATE_SUBMISSION = 2

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

Referenced by ilObjExerciseGUI\initAssignmentForm().

const ilExAssignment::TEAM_LOG_ADD_FILE = 4
const ilExAssignment::TEAM_LOG_ADD_MEMBER = 2

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

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

const ilExAssignment::TEAM_LOG_CREATE_TEAM = 1

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

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

const ilExAssignment::TEAM_LOG_REMOVE_FILE = 5
const ilExAssignment::TEAM_LOG_REMOVE_MEMBER = 3

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

Referenced by ilExAssignmentTeamLogTableGUI\getItems().


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