public interface AssignmentService extends EntityProducer
AssignmentService is the service that handles assignments.
Each Assignment has an associated AssignmentContent (an AssignmentContent can belong to more the one Assignment) and a list of AssignmentSubmission (the student responses to the Assignment).
| Modifier and Type | Method and Description |
|---|---|
Assignment |
addAssignment(String context)
Creates and adds a new Assignment to the service.
|
Assignment |
addDuplicateAssignment(String context,
String assignmentId)
Creates and adds a new Assignment to the service which is a copy of an existing Assignment.
|
AssignmentSubmission |
addSubmission(String assignmentId,
String submitter)
Adds an AssignmentSubmission
|
List<String> |
allowAddAnySubmissionUsers(String context)
Get the list of users who can add submission for at lease one assignment within the context
|
boolean |
allowAddAssignment(String context)
Check permissions for adding an Assignment.
|
boolean |
allowAddAssignment(String context,
String userId)
Check permissions for adding an Assignment.
|
List<User> |
allowAddAssignmentUsers(String context)
Get the List of Users who can add assignment
|
boolean |
allowAddSiteAssignment(String context)
Check if the user has permission to add a site-wide (not grouped) assignment.
|
boolean |
allowAddSubmission(String context)
Check permissions for add AssignmentSubmission
|
boolean |
allowAddSubmissionCheckGroups(Assignment assignment) |
List<User> |
allowAddSubmissionUsers(String assignmentReference)
Get the List of Users who can addSubmission() for this assignment.
|
boolean |
allowAllGroups(String context)
Check permissions for all.groups.
|
boolean |
allowGetAssignment(String assignmentReference)
Check permissions for reading an Assignment.
|
boolean |
allowGetSubmission(String submissionReference)
Check permissions for reading a Submission.
|
List<User> |
allowGradeAssignmentUsers(String assignmentReference) |
boolean |
allowGradeSubmission(String assignmentReference)
Check permissions for grading submissions on an assignment
|
boolean |
allowReceiveSubmissionNotification(String context)
Check permissions for receiving assignment submission notification email
|
List<User> |
allowReceiveSubmissionNotificationUsers(String context)
Get the List of Users who can add assignment
|
boolean |
allowRemoveAssignment(String assignmentReference)
Check permissions for removing an Assignment.
|
boolean |
allowRemoveAssignmentInContext(String context)
Check permissions for removing an Assignment.
|
boolean |
allowRemoveSubmission(String submissionReference)
Check permissions for remove Submission
|
boolean |
allowReviewService(Site site) |
boolean |
allowUpdateAssignment(String assignmentReference)
Check permissions for updating an Assignment.
|
boolean |
allowUpdateAssignmentInContext(String context)
Check permissions for updating an Assignment based on context.
|
boolean |
allowUpdateSubmission(String submissionReference)
Check permissions for updating Submission.
|
String |
assignmentReference(String id)
Access the internal reference which can be used to assess security clearance.
|
String |
assignmentReference(String context,
String id)
Access the internal reference which can be used to assess security clearance.
|
boolean |
assignmentUsesAnonymousGrading(Assignment a)
If the assignment uses anonymous grading returns true, else false
Params: AssignmentSubmission s
|
boolean |
canSubmit(Assignment assignment)
Whether the current user can submit to this assignment thereby creating a submission
|
boolean |
canSubmit(Assignment assignment,
String userId)
Whether a specific user can submit to this assignment thereby creating a submission
Of particular importance is whether userId is blank or not,
a blank userId will perform all security checks against the current user
while a non blank userId will perform all security checks against the specified user.
|
List<MultiGroupRecord> |
checkAssignmentForUsersInMultipleGroups(String siteId,
Collection<Group> asnGroups)
Returns a list of users that belong to multiple groups, if the user is considered a "student" in the group
by the standards of the Assignments tool.
|
List<MultiGroupRecord> |
checkSubmissionForUsersInMultipleGroups(String siteId,
Group submissionGroup,
Collection<Group> asnGroups)
Returns a list of users in the submission group that also belong to other assignment groups, if the user is considered
a "student" in the group by the standards of the Assignments tool.
|
int |
countSubmissions(String assignmentRef,
Boolean graded)
Count the number of submissions for a given assignment.
|
Entity |
createAssignmentEntity(Assignment assignment) |
Entity |
createAssignmentEntity(String assignmentId) |
String |
createContentReviewAssignment(Assignment a,
String assignmentRef,
Instant openTime,
Instant dueTime,
Instant closeTime)
Returns true if the content review implementation successfully created the assignment
|
void |
deleteAssignment(Assignment assignment)
Delete this Assignment
|
void |
deleteAssignmentAndAllReferences(Assignment assignment)
Softly delete this Assignment and remove all references to it.
|
String |
escapeInvalidCharsEntry(String accentedString) |
List<ContentResource> |
getAllAcceptableAttachments(AssignmentSubmission submission)
Gets all attachments in the submission that are acceptable to the content review service
|
boolean |
getAllowSubmitByInstructor()
Allow that the instructor can submit an assignment on behalf of student
|
Assignment |
getAssignment(Reference reference) |
Assignment |
getAssignment(String assignmentId)
Access the Assignment with the specified id.
|
AssignmentConstants.Status |
getAssignmentCannonicalStatus(String assignmentId)
Retrieves the current status of the specified assignment.
|
Assignment |
getAssignmentForGradebookLink(String context,
String linkId)
Get an assignment that is linked with a gradebook item
|
Collection<Assignment> |
getAssignmentsForContext(String context)
Access all the Assignemnts that are not deleted and self-drafted ones
|
String |
getAssignmentStatus(String assignmentId) |
List<ContentReviewResult> |
getContentReviewResults(AssignmentSubmission submission) |
String |
getCsvSeparator()
get csv separator for exporting to CSV.
|
String |
getDeepLink(String context,
String assignmentId,
String userId)
Get a link directly into an assignment itself.
|
String |
getDeepLinkWithPermissions(String context,
String assignmentId,
boolean allowReadAssignment,
boolean allowAddAssignment,
boolean allowSubmitAssignment,
boolean allowGradeAssignment)
Get a link directly into an assignment itself, supplying the permissions to use when
generating the link.
|
Collection<Assignment> |
getDeletedAssignmentsForContext(String context)
Access all the Assignments that are deleted
|
String |
getGradeDisplay(String grade,
Assignment.GradeType typeOfGrade,
Integer scaleFactor) |
String |
getGradeForSubmitter(AssignmentSubmission submission,
String submitter) |
String |
getGradeForSubmitter(String submissionId,
String submitter) |
byte[] |
getGradesSpreadsheet(String ref)
Access the grades spreadsheet for the reference, either for an assignment or all assignments in a context.
|
Collection<Group> |
getGroupsAllowAddAssignment(String context)
Get the collection of Groups defined for the context of this site that the end user has add assignment permissions in.
|
Collection<Group> |
getGroupsAllowAddAssignment(String context,
String userId)
Get the collection of Groups defined for the context of this site that the end user has add assignment permissions in.
|
Collection<Group> |
getGroupsAllowGradeAssignment(String assignmentReference)
Get the collection of Groups defined for the context of this site that the end user has grade assignment permissions in.
|
Collection<Group> |
getGroupsAllowRemoveAssignment(String context) |
Collection<Group> |
getGroupsAllowUpdateAssignment(String context)
Get the collection of Groups defined for the context of this site that the end user has update assignment permissions in.
|
String |
getMaxPointGradeDisplay(int factor,
int maxGradePoint) |
Map<String,Boolean> |
getProgressBarStatus(AssignmentSubmission submission) |
Integer |
getScaleFactor()
Get Scale Factor from the property assignment.grading.decimals
|
List<ContentReviewResult> |
getSortedContentReviewResults(AssignmentSubmission submission) |
List<User> |
getSortedGroupUsers(Group g)
Return a sorted list of users representing a group.
|
AssignmentSubmission |
getSubmission(List<AssignmentSubmission> submissions,
User person)
Deprecated.
|
AssignmentSubmission |
getSubmission(String submissionId)
Access the AssignmentSubmission with the specified id.
|
AssignmentSubmission |
getSubmission(String assignmentReference,
String submitterId)
Access a User or Group's AssignmentSubmission to a particular Assignment.
|
AssignmentSubmission |
getSubmission(String assignmentId,
User person)
Access a User's AssignmentSubmission to a particular Assignment.
|
AssignmentConstants.SubmissionStatus |
getSubmissionCanonicalStatus(AssignmentSubmission submission,
boolean canGrade) |
Set<AssignmentSubmission> |
getSubmissions(Assignment assignment)
Get the submissions for an assignment.
|
String |
getSubmissionStatus(String submissionId) |
Optional<AssignmentSubmissionSubmitter> |
getSubmissionSubmittee(AssignmentSubmission submission) |
Collection<User> |
getSubmissionSubmittersAsUsers(AssignmentSubmission submission) |
void |
getSubmissionsZip(OutputStream out,
String ref,
String queryString)
Access the submissions zip for the assignment reference.
|
Map<Assignment,List<String>> |
getSubmittableAssignmentsForContext(String context)
Retrieve a map of Assignments to a list of User IDs of those who
may submit each assignment.
|
Collection<Group> |
getSubmitterGroupList(String searchFilterOnly,
String allOrOneGroup,
String searchString,
String aRef,
String contextString) |
String |
getSubmitterIdForAssignment(Assignment assignment,
User user)
Given an Assignment and a User, rationalize who the submitter should be taking into account the assignment configuration
Will check the assignments access and group configuration to determine the submitter id
|
List<String> |
getSubmitterIdList(String searchFilterOnly,
String allOrOneGroup,
String search,
String aRef,
String contextString)
get appropriate submitter id list with group choice and site id
|
Map<User,AssignmentSubmission> |
getSubmitterMap(String searchFilterOnly,
String allOrOneGroup,
String search,
String aRef,
String contextString)
Alternative to getSubmittedIdList which returns full user and submissions, since submitterIdList retrieves them anyway
|
String |
getToolId()
This will return the assignment tool id.
|
String |
getUsersLocalDateTimeString(Instant date) |
String |
getXmlAssignment(Assignment assignment) |
boolean |
isContentReviewVisibleForSubmission(AssignmentSubmission submission)
Determines whether it is appropriate to display the content review results for a submission.
|
boolean |
isPeerAssessmentClosed(Assignment assignment)
peer assessment is set for this assignment but the current time is passed
the peer assessment period
|
boolean |
isPeerAssessmentOpen(Assignment assignment)
peer assessment is set for this assignment and the current time
falls between the assignment close time and the peer asseessment period time
|
boolean |
isPeerAssessmentPending(Assignment assignment)
peer assessment is set for this assignment but the close time hasn't passed
|
boolean |
permissionCheck(String permission,
String resource,
String user) |
void |
postReviewableSubmissionAttachments(AssignmentSubmission submission) |
String |
removeReferencePrefix(String referenceId)
This will return the reference removing from it the auxiliar prefix.
|
void |
removeSubmission(AssignmentSubmission submission)
Removes an AssignmentSubmission and all references to it
|
void |
resetAssignment(Assignment assignment) |
void |
softDeleteAssignment(Assignment assignment)
Softly delete this Assignment
|
String |
submissionReference(String context,
String id,
String assignmentId)
Access the internal reference which can be used to access the resource from within the system.
|
void |
updateAssignment(Assignment assignment) |
void |
updateSubmission(AssignmentSubmission submission) |
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getEntityUrl, getHttpAccess, getLabel, merge, parseEntityReference, willArchiveMergeEntity createAssignmentEntity(Assignment assignment)
boolean allowReceiveSubmissionNotification(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().List<User> allowReceiveSubmissionNotificationUsers(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().Collection<Group> getGroupsAllowRemoveAssignment(String context)
context - boolean allowAddAssignment(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowAddAssignment(String context, String userId)
context - -
Describes the portlet context - generated with DefaultId.getChannel().user - -
The user for which the permission will be checkedboolean allowUpdateAssignmentInContext(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowAddSiteAssignment(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowRemoveAssignmentInContext(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowAllGroups(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowGetAssignment(String assignmentReference)
assignmentReference - -
The Assignment's reference.Collection<Group> getGroupsAllowAddAssignment(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().Collection<Group> getGroupsAllowAddAssignment(String context, String userId)
context - -
Describes the portlet context - generated with DefaultId.getChannel().userId - -
The user for which the permission will be checkedCollection<Group> getGroupsAllowUpdateAssignment(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().Collection<Group> getGroupsAllowGradeAssignment(String assignmentReference)
boolean allowUpdateAssignment(String assignmentReference)
assignmentReference - -
The Assignment's reference.boolean allowRemoveAssignment(String assignmentReference)
assignmentReference - -
The Assignment's reference.boolean allowAddSubmission(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowAddSubmissionCheckGroups(Assignment assignment)
assignment - - An Assignment object. Needed for the groups to be checked.List<User> allowAddSubmissionUsers(String assignmentReference)
assignmentReference - -
a reference to an assignmentList<String> allowAddAnySubmissionUsers(String context)
context - the context stringList<User> allowAddAssignmentUsers(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().boolean allowGetSubmission(String submissionReference)
submissionReference - -
The Submission's reference.boolean allowUpdateSubmission(String submissionReference)
submissionReference - -
The Submission's reference.boolean allowRemoveSubmission(String submissionReference)
submissionReference - -
The Submission's reference.boolean allowReviewService(Site site)
boolean allowGradeSubmission(String assignmentReference)
assignmentReference - The assignment's reference.Assignment addAssignment(String context) throws PermissionException
context - The site id for this assignmentIdInvalidException - if the id contains prohibited characers.IdUsedException - if the id is already used in the service.PermissionException - if current User does not have permission to do this.Assignment addDuplicateAssignment(String context, String assignmentId) throws IdInvalidException, PermissionException, IdUsedException, IdUnusedException
context - The context for the new assignmentassignmentId - The id of the Assignment to be duplicated.PermissionException - if current User does not have permission to do this.IdInvalidExceptionIdUsedExceptionIdUnusedExceptionvoid deleteAssignment(Assignment assignment) throws PermissionException
assignment - - The Assignment to delete.PermissionException - if current User does not have permission to do this.void softDeleteAssignment(Assignment assignment) throws PermissionException
assignment - - The Assignment to softly delete.PermissionException - if current User does not have permission to do this.void deleteAssignmentAndAllReferences(Assignment assignment) throws PermissionException
assignment - - The Assignment to softly delete.PermissionException - if current User does not have permission to do this.AssignmentSubmission addSubmission(String assignmentId, String submitter) throws PermissionException
assignmentId - The assignment idsubmitter - The submitter idIdInvalidException - if the submission id is invalid.IdUsedException - if the submission id is already used.PermissionException - if the current User does not have permission to do this.void removeSubmission(AssignmentSubmission submission) throws PermissionException
submission - -
the AssignmentSubmission to remove.PermissionException - if current User does not have permission to do this.void updateAssignment(Assignment assignment) throws PermissionException
assignment - PermissionExceptionvoid updateSubmission(AssignmentSubmission submission) throws PermissionException
submission - PermissionExceptionAssignment getAssignment(Reference reference) throws IdUnusedException, PermissionException
reference - IdUnusedExceptionPermissionExceptionAssignment getAssignment(String assignmentId) throws IdUnusedException, PermissionException
assignmentId - -
The id of the Assignment.IdUnusedException - if there is no object with this id.PermissionException - if the current user is not allowed to read this.AssignmentConstants.Status getAssignmentCannonicalStatus(String assignmentId) throws IdUnusedException, PermissionException
IdUnusedExceptionPermissionExceptionAssignmentSubmission getSubmission(String submissionId) throws IdUnusedException, PermissionException
submissionId - -
The id of the AssignmentSubmission.IdUnusedException - if there is no object with this id.PermissionException - if the current user is not allowed to read this.Collection<Assignment> getAssignmentsForContext(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().Collection<Assignment> getDeletedAssignmentsForContext(String context)
context - -
Describes the portlet context - generated with DefaultId.getChannel().Map<Assignment,List<String>> getSubmittableAssignmentsForContext(String context)
context - the Site ID to searchAssignmentSubmission getSubmission(String assignmentId, User person) throws PermissionException
assignmentId - -
The id of the assignment.person - -
The User who's Submission you would like.PermissionExceptionAssignmentSubmission getSubmission(String assignmentReference, String submitterId) throws PermissionException
assignmentReference - -
The id of the assignment.submitterId - -
The string id of the person or group who's Submission you would like.PermissionException@Deprecated AssignmentSubmission getSubmission(List<AssignmentSubmission> submissions, User person)
- - submissions
The list of submissionsperson - -
The User who's Submission you would like.Set<AssignmentSubmission> getSubmissions(Assignment assignment)
assignment - -
the Assignment who's submissions you would like.String getAssignmentStatus(String assignmentId)
assignmentId - String getSubmissionStatus(String submissionId)
submissionId - AssignmentConstants.SubmissionStatus getSubmissionCanonicalStatus(AssignmentSubmission submission, boolean canGrade)
submissionId - Map<String,Boolean> getProgressBarStatus(AssignmentSubmission submission)
submissionId - List<User> getSortedGroupUsers(Group g)
int countSubmissions(String assignmentRef, Boolean graded)
assignmentRef - the assignment reference of the submissions to count.graded - count the number of submissions which have been submitted and are graded
respectively graded is true and ungraded is false or null for both.byte[] getGradesSpreadsheet(String ref) throws IdUnusedException, PermissionException
ref - The reference, either to a specific assignment, or just to an assignment context.IdUnusedException - if there is no object with this id.PermissionException - if the current user is not allowed to access this.void getSubmissionsZip(OutputStream out, String ref, String queryString) throws IdUnusedException, PermissionException
ref - The assignment reference.out - The outputStream to stream the zip file intoIdUnusedException - if there is no object with this id.PermissionException - if the current user is not allowed to access this.String assignmentReference(String context, String id)
id - The assignment id string.String assignmentReference(String id)
id - The assignment id string.String submissionReference(String context, String id, String assignmentId)
id - The submission id string.boolean canSubmit(Assignment assignment, String userId)
Of particular importance is whether userId is blank or not, a blank userId will perform all security checks against the current user while a non blank userId will perform all security checks against the specified user.
assignment - the Assignment to check for allowing to submit touserId - the specified user is checked vs the current userboolean canSubmit(Assignment assignment)
assignment - the Assignment to check for allowing to submit toCollection<Group> getSubmitterGroupList(String searchFilterOnly, String allOrOneGroup, String searchString, String aRef, String contextString)
searchFilterOnly - allOrOneGroup - searchString - aRef - contextString - boolean getAllowSubmitByInstructor()
List<String> getSubmitterIdList(String searchFilterOnly, String allOrOneGroup, String search, String aRef, String contextString)
searchFilterOnly - If true, return only those ids that matches the group filter and search criteriaallOrOneGroup - "all" or specific group referenceaRef - Assignment Referencesearch - The search stringcontextString - Site idMap<User,AssignmentSubmission> getSubmitterMap(String searchFilterOnly, String allOrOneGroup, String search, String aRef, String contextString)
searchFilterOnly - If true, return only those ids that matches the group filter and search criteriaallOrOneGroup - "all" or specific group referenceaRef - Assignment Referencesearch - The search stringcontextString - Site idString getSubmitterIdForAssignment(Assignment assignment, User user)
assignment - The assignmentuser - The userString escapeInvalidCharsEntry(String accentedString)
accentedString - boolean assignmentUsesAnonymousGrading(Assignment a)
Integer getScaleFactor()
String getDeepLinkWithPermissions(String context, String assignmentId, boolean allowReadAssignment, boolean allowAddAssignment, boolean allowSubmitAssignment, boolean allowGradeAssignment) throws Exception
context - The site idassignmentId - The assignment idallowReadAssignment - Is the current user allowed to read?allowAddAssignment - Is the current user allowed to add assignments?allowSubmitAssignment - Is the current user allowed to submit assignments?allowGradeAssignment - Is the current user allowed to grade assignments?ExceptionString getDeepLink(String context, String assignmentId, String userId) throws Exception
context - The site idassignmentId - The assignment iduserId - The user idExceptionString getCsvSeparator()
String getXmlAssignment(Assignment assignment)
assignment - String getGradeForSubmitter(AssignmentSubmission submission, String submitter)
String getGradeDisplay(String grade, Assignment.GradeType typeOfGrade, Integer scaleFactor)
grade - typeOfGrade - scaleFactor - String getMaxPointGradeDisplay(int factor, int maxGradePoint)
factor - maxGradePoint - Optional<AssignmentSubmissionSubmitter> getSubmissionSubmittee(AssignmentSubmission submission)
submission - Collection<User> getSubmissionSubmittersAsUsers(AssignmentSubmission submission)
submission - boolean isPeerAssessmentOpen(Assignment assignment)
boolean isPeerAssessmentPending(Assignment assignment)
boolean isPeerAssessmentClosed(Assignment assignment)
void resetAssignment(Assignment assignment)
assignment - void postReviewableSubmissionAttachments(AssignmentSubmission submission)
submissionId - String getToolId()
String removeReferencePrefix(String referenceId)
List<ContentReviewResult> getContentReviewResults(AssignmentSubmission submission)
List<ContentReviewResult> getSortedContentReviewResults(AssignmentSubmission submission)
boolean isContentReviewVisibleForSubmission(AssignmentSubmission submission)
submission - List<ContentResource> getAllAcceptableAttachments(AssignmentSubmission submission)
Assignment getAssignmentForGradebookLink(String context, String linkId) throws IdUnusedException, PermissionException
context - the context (site id)linkId - the link id of the gradebook item, usually the gradebook item name or idIdUnusedException - if the assignment doesn't existPermissionException - if the current user is not allowed to access the assignmentList<MultiGroupRecord> checkAssignmentForUsersInMultipleGroups(String siteId, Collection<Group> asnGroups)
siteId - the site idasnGroups - the assignment groups to check membership inList<MultiGroupRecord> checkSubmissionForUsersInMultipleGroups(String siteId, Group submissionGroup, Collection<Group> asnGroups)
siteId - the site idsubmissionGroup - the group the submission is fromasnGroups - the assignment groups to check membership inString createContentReviewAssignment(Assignment a, String assignmentRef, Instant openTime, Instant dueTime, Instant closeTime)
a - assignmentRef - openTime - dueTime - closeTime - Copyright © 2023. All rights reserved.