ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Exercise submission //TODO: This class has to much static methods related to delivered "files". More...
Public Member Functions | |
__construct (ilExAssignment $a_ass, $a_user_id, ilExAssignmentTeam $a_team=null, $a_is_tutor=false, $a_public_submissions=false) | |
getSubmissionType () | |
getAssignment () | |
getTeam () | |
getPeerReview () | |
validatePeerReviews () | |
getUserId () | |
getUserIds () | |
getFeedbackId () | |
hasSubmitted () | |
getSelectedObject () | |
canSubmit () | |
canView () | |
isTutor () | |
hasNoTeamYet () | |
isInTeam ($a_user_id=null) | |
isOwner () | |
hasPeerReviewAccess () | |
canAddFile () | |
uploadFile ($a_http_post_files, $unzip=false) | |
Save submitted file of user. More... | |
processUploadedZipFile ($fileTmp) | |
processes errorhandling etc for uploaded archive More... | |
getFiles (array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null) | |
Get submission items (not only files) More... | |
lookupNewFiles ($a_tutor=null) | |
Check how much files have been uploaded by the learner after the last download of the tutor. More... | |
deleteAllFiles () | |
deleteSelectedFiles (array $file_id_array) | |
Deletes already delivered files. More... | |
downloadFiles (array $a_file_ids=null, $a_only_new=false, $a_peer_review_mask_filename=false) | |
updateTutorDownloadTime () | |
getLastSubmission () | |
Get the date of the last submission of a user for the assignment. More... | |
addResourceObject ($a_wsp_id, $a_text=null) | |
Add personal resource or repository object (ref_id) to assigment. More... | |
deleteResourceObject ($a_returned_id) | |
Remove personal resource to assigment. More... | |
updateTextSubmission ($a_text) | |
Handle text assignment submissions. More... | |
getDownloadedFilesInfoForTableGUIS ($a_parent_obj, $a_parent_cmd=null) | |
Static Public Member Functions | |
static | hasAnySubmissions ($a_ass_id) |
static | getAllAssignmentFiles ($a_exc_id, $a_ass_id) |
static | getAssignmentFilesByUsers (int $a_exc_id, int $a_ass_id, array $a_users) |
static | lookupExerciseIdForReturnedId ($a_returned_id) |
Get exercise from submission id (used in ilObjMediaObject) More... | |
static | findUserFiles ($a_user_id, $a_filetitle) |
Check if given file was assigned. More... | |
static | deleteUser ($a_exc_id, $a_user_id) |
Delete all delivered files of user. More... | |
static | downloadAllAssignmentFiles (ilExAssignment $a_ass, array $members, $to_path) |
Download all submitted files of an assignment (all user) More... | |
static | getSubmissionsForFilename ($a_filename, $a_assignment_types=array()) |
Get assignment return entries for a filename. More... | |
static | getDirectoryNameFromUserData ($a_user_id) |
static | getAssignmentParticipants (int $a_exercise_id, int $a_ass_id) |
Data Fields | |
const | TYPE_FILE = "File" |
const | TYPE_OBJECT = "Object" |
const | TYPE_TEXT = "Text" |
const | TYPE_REPO_OBJECT = "RepoObject" |
Protected Member Functions | |
isLate () | |
initStorage () | |
getStorageId () | |
Get storage id. More... | |
getLastDownloadTime (array $a_user_ids) | |
downloadSingleFile ($a_user_id, $filename, $filetitle, $a_team_id) | |
downloadMultipleFiles ($a_filenames, $a_user_id, $a_multi_user=false) | |
getTableUserWhere ($a_team_mode=false) | |
Get user/team where clause. More... | |
Protected Attributes | |
$user | |
$db | |
$lng | |
$ctrl | |
$assignment | |
$user_id | |
$team | |
$peer_review | |
$is_tutor | |
$public_submissions | |
$ass_type | |
$ass_types | |
Exercise submission //TODO: This class has to much static methods related to delivered "files".
Extract them to classes.
Definition at line 11 of file class.ilExSubmission.php.
ilExSubmission::__construct | ( | ilExAssignment | $a_ass, |
$a_user_id, | |||
ilExAssignmentTeam | $a_team = null , |
||
$a_is_tutor = false , |
|||
$a_public_submissions = false |
|||
) |
Definition at line 55 of file class.ilExSubmission.php.
References $DIC, $ilUser, $user_id, ilExAssignment\getAssignmentType(), ilExAssignment\getId(), ilExAssignmentTypes\getInstance(), ilExcAssMemberState\getInstanceByIds(), ilExAssignmentTeam\getInstanceByUserId(), ilExAssignment\hasTeam(), and user().
ilExSubmission::addResourceObject | ( | $a_wsp_id, | |
$a_text = null |
|||
) |
Add personal resource or repository object (ref_id) to assigment.
int | $a_wsp_id | |
string | $a_text |
ilExerciseException |
Definition at line 1226 of file class.ilExSubmission.php.
References $db, $ilDB, $query, $user_id, getAssignment(), getSubmissionsForFilename(), getSubmissionType(), getTeam(), getUserId(), isLate(), ilUtil\now(), and TYPE_REPO_OBJECT.
Referenced by ilObjPortfolioGUI\linkPortfolioToAssignment(), and updateTextSubmission().
ilExSubmission::canAddFile | ( | ) |
Definition at line 255 of file class.ilExSubmission.php.
References canSubmit(), getAssignment(), and getFiles().
Referenced by uploadFile().
ilExSubmission::canSubmit | ( | ) |
Definition at line 188 of file class.ilExSubmission.php.
References isOwner().
Referenced by canAddFile(), canView(), ilExSubmissionTextGUI\getOverviewContent(), ilExSubmissionFileGUI\getOverviewContent(), ilExSubmissionObjectGUI\getOverviewContentBlog(), ilExSubmissionObjectGUI\getOverviewContentPortfolio(), and ilExAssTypeWikiTeamGUI\renderOverviewContent().
ilExSubmission::canView | ( | ) |
Definition at line 194 of file class.ilExSubmission.php.
References $ilUser, $user, canSubmit(), isInTeam(), and isTutor().
Referenced by ilExSubmissionGUI\getOverviewContent().
ilExSubmission::deleteAllFiles | ( | ) |
Definition at line 638 of file class.ilExSubmission.php.
References $files, deleteSelectedFiles(), and getFiles().
Referenced by updateTextSubmission().
ilExSubmission::deleteResourceObject | ( | $a_returned_id | ) |
Remove personal resource to assigment.
int | $a_returned_id |
Definition at line 1275 of file class.ilExSubmission.php.
References $db, $ilDB, and getTableUserWhere().
Referenced by ilExSubmissionObjectGUI\getOverviewContentBlog(), ilExSubmissionObjectGUI\getOverviewContentPortfolio(), ilExAssTypeWikiTeamGUI\renderOverviewContent(), and ilExSubmissionObjectGUI\unlinkPortfolioObject().
ilExSubmission::deleteSelectedFiles | ( | array | $file_id_array | ) |
Deletes already delivered files.
array | $file_id_array | An array containing database ids of the delivered files |
numeric | $user_id | The database id of the user public |
Definition at line 655 of file class.ilExSubmission.php.
References $db, $filename, $ilDB, $key, $path, $result, $row, getAssignment(), getTableUserWhere(), initStorage(), and ilExAssignmentTeam\TEAM_LOG_REMOVE_FILE.
Referenced by deleteAllFiles().
|
static |
Delete all delivered files of user.
int | $a_exc_id | excercise id |
int | $a_user_id | user id |
Definition at line 715 of file class.ilExSubmission.php.
References $team, and ilExAssignment\getInstancesByExercise().
Referenced by ilExerciseMembers\deassignMember().
|
static |
Download all submitted files of an assignment (all user)
$a_ass | ilExAssignment |
$members | array of user names, key is user id |
$to_path | string |
ilExerciseException |
Definition at line 994 of file class.ilExSubmission.php.
References $ass_type, $DIC, $id, $lng, $user, ilObject\_lookupObjId(), ilObject\_lookupType(), ilFSStorageExercise\create(), ilUtil\delDir(), ilUtil\dirsize(), ilUtil\escapeShellArg(), ilUtil\getASCIIFilename(), ilExAssignmentTeam\getAssignmentTeamMap(), ilExAssignment\getAssignmentType(), ilExAssignment\getExerciseId(), ilExAssignment\getId(), ilExAssignment\getType(), ilExAssignment\hasTeam(), ilUtil\makeDir(), ilExAssignment\TYPE_BLOG, ilExAssignment\TYPE_PORTFOLIO, and ilUtil\unzip().
Referenced by ilExerciseManagementCollectFilesJob\collectSubmissionFiles(), and ilExerciseManagementGUI\downloadAllObject().
ilExSubmission::downloadFiles | ( | array | $a_file_ids = null , |
$a_only_new = false , |
|||
$a_peer_review_mask_filename = false |
|||
) |
Definition at line 750 of file class.ilExSubmission.php.
References $files, $ilUser, $lng, $user, ilObjUser\_lookupName(), ilObject\_lookupTitle(), downloadMultipleFiles(), downloadSingleFile(), getFiles(), getLastDownloadTime(), getTeam(), getUserId(), getUserIds(), ilExAssignment\TYPE_BLOG, ilExAssignment\TYPE_PORTFOLIO, ilExAssignment\TYPE_WIKI_TEAM, and updateTutorDownloadTime().
|
protected |
Definition at line 897 of file class.ilExSubmission.php.
References $filename, $files, $lng, $path, ilObjUser\_lookupName(), ilUtil\delDir(), ilUtil\deliverFile(), ilUtil\escapeShellArg(), exit, ilUtil\getASCIIFilename(), ilUtil\ilTempnam(), initStorage(), ilExAssignment\lookupTitle(), and ilUtil\makeDir().
Referenced by downloadFiles().
|
protected |
Definition at line 883 of file class.ilExSubmission.php.
References $filename, ilUtil\deliverFile(), and initStorage().
Referenced by downloadFiles().
|
static |
Check if given file was assigned.
Used in Blog/Portfolio
int | $a_user_id | |
string | $a_filetitle |
Definition at line 621 of file class.ilExSubmission.php.
References $DIC, $ilDB, $res, and $row.
Referenced by ilPortfolioExerciseGUI\checkExercise(), and ilBlogExerciseGUI\checkExercise().
|
static |
Definition at line 428 of file class.ilExSubmission.php.
References $ass_type, $DIC, $ilDB, $path, $query, $res, $row, ilExAssignmentTypes\getInstance(), and ilExAssignment\lookupType().
Referenced by ilExAssignmentListTextTableGUI\parse(), and ilExAssignment\recalculateLateSubmissions().
ilExSubmission::getAssignment | ( | ) |
Definition at line 113 of file class.ilExSubmission.php.
References $assignment.
Referenced by ilExSubmissionBaseGUI\__construct(), ilExSubmissionTeamGUI\__construct(), addResourceObject(), canAddFile(), deleteSelectedFiles(), getFiles(), getLastDownloadTime(), ilExSubmissionObjectGUI\getOverviewContent(), ilExSubmissionTeamGUI\getOverviewContent(), ilExPeerReviewGUI\getOverviewContent(), ilExSubmissionGUI\getOverviewContent(), getTableUserWhere(), and lookupNewFiles().
|
static |
Definition at line 460 of file class.ilExSubmission.php.
References $ass_type, $DIC, $ilDB, $path, $query, $res, $row, ilExAssignmentTypes\getInstance(), and ilExAssignment\lookupType().
Referenced by ilExerciseManagementGUI\listTextAssignmentObject().
|
static |
$a_exercise_id | |
$a_ass_id |
Definition at line 1543 of file class.ilExSubmission.php.
References $DIC, $ilDB, $query, $res, and $row.
Referenced by ilExerciseManagementGUI\listTextAssignmentObject().
|
static |
Definition at line 1525 of file class.ilExSubmission.php.
References ilObjUser\_lookupName(), and ilUtil\getASCIIFilename().
Referenced by ilExerciseManagementCollectFilesJob\addLink(), ilExerciseManagementCollectFilesJob\createTargetDirectory(), ilDownloadSubmissionsBackgroundTask\run(), and ilExerciseManagementCollectFilesJob\run().
ilExSubmission::getDownloadedFilesInfoForTableGUIS | ( | $a_parent_obj, | |
$a_parent_cmd = null |
|||
) |
Definition at line 1327 of file class.ilExSubmission.php.
References $ctrl, $files, $ilCtrl, $lng, $result, ilDatePresentation\formatDate(), getFiles(), getLastSubmission(), getUserId(), IL_CAL_DATETIME, lookupNewFiles(), ilExAssignment\TYPE_BLOG, ilExAssignment\TYPE_PORTFOLIO, ilExAssignment\TYPE_TEXT, ilExAssignment\TYPE_UPLOAD, ilExAssignment\TYPE_UPLOAD_TEAM, and ilExAssignment\TYPE_WIKI_TEAM.
ilExSubmission::getFeedbackId | ( | ) |
Definition at line 166 of file class.ilExSubmission.php.
References getUserId().
ilExSubmission::getFiles | ( | array | $a_file_ids = null , |
$a_only_valid = false , |
|||
$a_min_timestamp = null |
|||
) |
Get submission items (not only files)
array | null | $a_file_ids | |
bool | $a_only_valid | |
null | $a_min_timestamp |
Definition at line 499 of file class.ilExSubmission.php.
References $db, $ilDB, $path, $result, $row, getAssignment(), getTableUserWhere(), and initStorage().
Referenced by canAddFile(), deleteAllFiles(), ilBlogExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), downloadFiles(), getDownloadedFilesInfoForTableGUIS(), ilExPeerReviewGUI\getLateSubmissionInfo(), ilExSubmissionFileGUI\getOverviewContent(), getSelectedObject(), ilExPeerReviewGUI\getSubmissionContent(), hasSubmitted(), processUploadedZipFile(), and updateTextSubmission().
|
protected |
Definition at line 736 of file class.ilExSubmission.php.
References $db, $ilDB, $ilUser, $user, and getAssignment().
Referenced by downloadFiles().
ilExSubmission::getLastSubmission | ( | ) |
Get the date of the last submission of a user for the assignment.
Definition at line 1196 of file class.ilExSubmission.php.
References $db, $ilDB, ilUtil\getMySQLTimestamp(), and getTableUserWhere().
Referenced by getDownloadedFilesInfoForTableGUIS(), and ilExSubmissionTeamGUI\getOverviewContent().
ilExSubmission::getPeerReview | ( | ) |
Definition at line 129 of file class.ilExSubmission.php.
References $peer_review.
Referenced by ilExPeerReviewGUI\getOverviewContent().
ilExSubmission::getSelectedObject | ( | ) |
Definition at line 180 of file class.ilExSubmission.php.
References $files, and getFiles().
Referenced by ilBlogExerciseGUI\getExerciseInfo(), ilExSubmissionObjectGUI\getOverviewContentBlog(), ilExSubmissionObjectGUI\getOverviewContentPortfolio(), ilWikiPageGUI\preview(), and ilExAssTypeWikiTeamGUI\renderOverviewContent().
|
protected |
Get storage id.
Definition at line 293 of file class.ilExSubmission.php.
References getTeam(), and getUserId().
Referenced by uploadFile().
|
static |
Get assignment return entries for a filename.
string | $a_filename | |
int[] | $a_assignment_types |
Definition at line 1497 of file class.ilExSubmission.php.
References $db, $DIC, and $query.
Referenced by addResourceObject(), ilExcRepoObjAssignmentInfo\getInfo(), and ilObjWikiListGUI\getProperties().
ilExSubmission::getSubmissionType | ( | ) |
Definition at line 91 of file class.ilExSubmission.php.
Referenced by addResourceObject(), and ilExSubmissionGUI\getOverviewContent().
|
protected |
Get user/team where clause.
Definition at line 1173 of file class.ilExSubmission.php.
References $db, $ilDB, getAssignment(), getTeam(), getUserId(), and getUserIds().
Referenced by deleteResourceObject(), deleteSelectedFiles(), getFiles(), getLastSubmission(), and lookupNewFiles().
ilExSubmission::getTeam | ( | ) |
Definition at line 121 of file class.ilExSubmission.php.
References $team.
Referenced by addResourceObject(), downloadFiles(), ilExSubmissionTeamGUI\getOverviewContent(), getStorageId(), getTableUserWhere(), ilExAssTypeWikiTeamGUI\renderOverviewContent(), and uploadFile().
ilExSubmission::getUserId | ( | ) |
Definition at line 150 of file class.ilExSubmission.php.
References $user_id.
Referenced by addResourceObject(), downloadFiles(), getDownloadedFilesInfoForTableGUIS(), getFeedbackId(), ilExSubmissionTeamGUI\getOverviewContent(), ilExPeerReviewGUI\getOverviewContent(), ilExSubmissionObjectGUI\getOverviewContentBlog(), ilExSubmissionObjectGUI\getOverviewContentPortfolio(), getStorageId(), getTableUserWhere(), isOwner(), and uploadFile().
ilExSubmission::getUserIds | ( | ) |
Definition at line 155 of file class.ilExSubmission.php.
References hasNoTeamYet().
Referenced by downloadFiles(), getTableUserWhere(), ilExAssTypeWikiTeam\handleNewUpload(), isInTeam(), updateTutorDownloadTime(), and validatePeerReviews().
|
static |
Definition at line 414 of file class.ilExSubmission.php.
References $DIC, $ilDB, $query, and $res.
Referenced by ilExerciseManagementGUI\membersObject().
ilExSubmission::hasNoTeamYet | ( | ) |
Definition at line 223 of file class.ilExSubmission.php.
Referenced by ilExSubmissionFileGUI\getOverviewContent(), and getUserIds().
ilExSubmission::hasPeerReviewAccess | ( | ) |
Definition at line 249 of file class.ilExSubmission.php.
ilExSubmission::hasSubmitted | ( | ) |
Definition at line 175 of file class.ilExSubmission.php.
References getFiles().
Referenced by ilExSubmissionTeamGUI\getOverviewContent(), ilExSubmissionObjectGUI\getOverviewContentBlog(), ilExSubmissionObjectGUI\getOverviewContentPortfolio(), ilExAssTypeWikiTeam\handleNewUpload(), ilExcAssMemberState\isGlobalFeedbackFileAccessible(), and ilExAssTypeWikiTeamGUI\renderOverviewContent().
|
protected |
Definition at line 282 of file class.ilExSubmission.php.
Referenced by deleteSelectedFiles(), downloadMultipleFiles(), downloadSingleFile(), getFiles(), and uploadFile().
ilExSubmission::isInTeam | ( | $a_user_id = null | ) |
Definition at line 232 of file class.ilExSubmission.php.
References $ilUser, $user, and getUserIds().
Referenced by canView().
|
protected |
Definition at line 275 of file class.ilExSubmission.php.
Referenced by addResourceObject(), and updateTextSubmission().
ilExSubmission::isOwner | ( | ) |
Definition at line 242 of file class.ilExSubmission.php.
References $ilUser, $user, and getUserId().
Referenced by canSubmit().
ilExSubmission::isTutor | ( | ) |
Definition at line 218 of file class.ilExSubmission.php.
References $is_tutor.
Referenced by canView().
|
static |
Get exercise from submission id (used in ilObjMediaObject)
int | $a_returned_id |
Definition at line 600 of file class.ilExSubmission.php.
References $DIC, $ilDB, and $row.
Referenced by ilObjMediaObject\getParentObjectIdForUsage().
ilExSubmission::lookupNewFiles | ( | $a_tutor = null | ) |
Check how much files have been uploaded by the learner after the last download of the tutor.
tutor | integer |
Definition at line 564 of file class.ilExSubmission.php.
References $db, $ilDB, $ilUser, $user, getAssignment(), and getTableUserWhere().
Referenced by getDownloadedFilesInfoForTableGUIS().
ilExSubmission::processUploadedZipFile | ( | $fileTmp | ) |
processes errorhandling etc for uploaded archive
string | $tmpFile | path and filename to uploaded file |
Definition at line 364 of file class.ilExSubmission.php.
References $filename, $key, $lng, $success, ilUtil\delDir(), getFiles(), ilUtil\ilTempnam(), ilUtil\makeDir(), ilFileUtils\processZipFile(), ilFileUtils\recursive_dirscan(), ilUtil\sendFailure(), uploadFile(), and ilFileUtils\utf8_encode().
ilExSubmission::updateTextSubmission | ( | $a_text | ) |
Handle text assignment submissions.
string | $a_text |
Definition at line 1292 of file class.ilExSubmission.php.
References $db, $files, $id, $ilDB, addResourceObject(), deleteAllFiles(), getFiles(), isLate(), and ilUtil\now().
ilExSubmission::updateTutorDownloadTime | ( | ) |
Definition at line 858 of file class.ilExSubmission.php.
References $db, $ilDB, $ilUser, $user, $user_id, getUserIds(), and ilUtil\now().
Referenced by downloadFiles().
ilExSubmission::uploadFile | ( | $a_http_post_files, | |
$unzip = false |
|||
) |
Save submitted file of user.
Definition at line 307 of file class.ilExSubmission.php.
References $db, $ilDB, $query, $user_id, canAddFile(), getStorageId(), getTeam(), getUserId(), ilFileUtils\getValidFilename(), initStorage(), ilUtil\now(), and ilExAssignmentTeam\TEAM_LOG_ADD_FILE.
Referenced by processUploadedZipFile().
ilExSubmission::validatePeerReviews | ( | ) |
Definition at line 134 of file class.ilExSubmission.php.
References $res, $user_id, $valid, and getUserIds().
Referenced by ilExAssTypeWikiTeam\handleNewUpload().
|
protected |
Definition at line 48 of file class.ilExSubmission.php.
Referenced by downloadAllAssignmentFiles(), getAllAssignmentFiles(), and getAssignmentFilesByUsers().
|
protected |
Definition at line 53 of file class.ilExSubmission.php.
|
protected |
Definition at line 38 of file class.ilExSubmission.php.
Referenced by getAssignment().
|
protected |
Definition at line 36 of file class.ilExSubmission.php.
Referenced by getDownloadedFilesInfoForTableGUIS().
|
protected |
Definition at line 26 of file class.ilExSubmission.php.
Referenced by addResourceObject(), deleteResourceObject(), deleteSelectedFiles(), getFiles(), getLastDownloadTime(), getLastSubmission(), getSubmissionsForFilename(), getTableUserWhere(), lookupNewFiles(), updateTextSubmission(), updateTutorDownloadTime(), and uploadFile().
|
protected |
Definition at line 42 of file class.ilExSubmission.php.
Referenced by isTutor().
|
protected |
Definition at line 31 of file class.ilExSubmission.php.
Referenced by downloadAllAssignmentFiles(), downloadFiles(), downloadMultipleFiles(), getDownloadedFilesInfoForTableGUIS(), and processUploadedZipFile().
|
protected |
Definition at line 41 of file class.ilExSubmission.php.
Referenced by getPeerReview().
|
protected |
Definition at line 43 of file class.ilExSubmission.php.
|
protected |
Definition at line 40 of file class.ilExSubmission.php.
Referenced by deleteUser(), and getTeam().
|
protected |
Definition at line 21 of file class.ilExSubmission.php.
Referenced by canView(), downloadAllAssignmentFiles(), downloadFiles(), getLastDownloadTime(), isInTeam(), isOwner(), lookupNewFiles(), and updateTutorDownloadTime().
|
protected |
Definition at line 39 of file class.ilExSubmission.php.
Referenced by __construct(), addResourceObject(), getUserId(), updateTutorDownloadTime(), uploadFile(), and validatePeerReviews().
const ilExSubmission::TYPE_FILE = "File" |
Definition at line 13 of file class.ilExSubmission.php.
Referenced by ilExAssTypeUpload\getSubmissionType(), and ilExAssTypeUploadTeam\getSubmissionType().
const ilExSubmission::TYPE_OBJECT = "Object" |
Definition at line 14 of file class.ilExSubmission.php.
Referenced by ilExAssTypePortfolio\getSubmissionType(), and ilExAssTypeBlog\getSubmissionType().
const ilExSubmission::TYPE_REPO_OBJECT = "RepoObject" |
Definition at line 16 of file class.ilExSubmission.php.
Referenced by addResourceObject(), ilExSubmissionGUI\executeCommand(), ilExcRepoObjAssignmentInfo\getInfo(), ilExSubmissionGUI\getOverviewContent(), and ilExAssTypeWikiTeam\getSubmissionType().
const ilExSubmission::TYPE_TEXT = "Text" |
Definition at line 15 of file class.ilExSubmission.php.
Referenced by ilExAssTypeText\getSubmissionType().