org.sakaiproject.service.legacy.assignment
Interface AssignmentService

All Superinterfaces:
EntityProducer
All Known Implementing Classes:
BaseAssignmentService

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).

Version:
$Revision: 6242 $
Author:
University of Michigan, CHEF Software Development Team
See Also:
org.chefproject.core.Assignment, org.chefproject.core.AssignmentContent, org.chefproject.core.AssignmentSubmission, org.chefproject.core.AssignmentEdit, org.chefproject.core.AssignmentContentEdit, org.chefproject.core.AssignmentSubmissionEdit

Nested Class Summary
 
Nested classes inherited from class org.sakaiproject.service.legacy.entity.EntityProducer
EntityProducer.ChangeType
 
Field Summary
static String REF_TYPE_ASSIGNMENT
          The Reference type for an assignment.
static String REF_TYPE_CONTENT
          The Reference type for a content.
static String REF_TYPE_GRADES
          The Reference type for a grade spreadsheet.
static String REF_TYPE_SUBMISSION
          The Reference type for a submission.
static String REF_TYPE_SUBMISSIONS
          The Reference type for a submissions zip.
static String REFERENCE_ROOT
          This string starts the references to resources in this service.
static String SECURE_ACCESS_ASSIGNMENT
          Security lock for accessing an assignment.
static String SECURE_ACCESS_ASSIGNMENT_CONTENT
          Security lock for accessing an assignment content.
static String SECURE_ACCESS_ASSIGNMENT_SUBMISSION
          Security lock for accessing an assignment submission.
static String SECURE_ADD_ASSIGNMENT
          Security lock for adding an assignment.
static String SECURE_ADD_ASSIGNMENT_CONTENT
          Security lock for adding an assignment.
static String SECURE_ADD_ASSIGNMENT_SUBMISSION
          Security lock for adding an assignment submission.
static String SECURE_GRADE_ASSIGNMENT_SUBMISSION
          Security lock for grading submission
static String SECURE_REMOVE_ASSIGNMENT
          Security lock for removing an assignment.
static String SECURE_REMOVE_ASSIGNMENT_CONTENT
          Security lock for removing an assignment content.
static String SECURE_REMOVE_ASSIGNMENT_SUBMISSION
          Security lock for removing an assignment submission.
static String SECURE_UPDATE_ASSIGNMENT
          Security lock for updating an assignment.
static String SECURE_UPDATE_ASSIGNMENT_CONTENT
          Security lock for updating an assignment content.
static String SECURE_UPDATE_ASSIGNMENT_SUBMISSION
          Security lock for updating an assignment submission.
static String SERVICE_NAME
          This string can be used to find the service in the service manager.
 
Method Summary
 AssignmentEdit addAssignment(String context)
          Creates and adds a new Assignment to the service.
 AssignmentContentEdit addAssignmentContent(String context)
          Creates and adds a new AssignmentContent to the service.
 AssignmentEdit addDuplicateAssignment(String context, String assignmentReference)
          Creates and adds a new Assignment to the service which is a copy of an existing Assignment.
 AssignmentContentEdit addDuplicateAssignmentContent(String context, String contentReference)
          Creates and adds a new AssignmentContent to the service which is a copy of an existing AssignmentContent.
 AssignmentSubmissionEdit addSubmission(String context, String assignmentId)
          Adds an AssignmentSubmission to the service.
 boolean allowAddAssignment(String context)
          Check permissions for adding an Assignment.
 boolean allowAddAssignmentContent(String context)
          Check permissions for adding an AssignmentContent.
 List allowAddAssignmentUsers(String context)
          Get the List of Users who can add assignment
 boolean allowAddSubmission(String context)
          Check permissions for add AssignmentSubmission
 List allowAddSubmissionUsers(String assignmentReference)
          Get the List of Users who can addSubmission() for this assignment.
 boolean allowGetAssignment(String assignmentReference)
          Check permissions for reading an Assignment.
 boolean allowGetAssignmentContent(String contentReference)
          Check permissions for get AssignmentContent
 boolean allowGetSubmission(String submissionReference)
          Check permissions for reading a Submission.
 boolean allowGradeSubmission(String submissionReference)
          Check permissions for grading Submission
 boolean allowRemoveAssignment(String assignmentReference)
          Check permissions for removing an Assignment.
 boolean allowRemoveAssignmentContent(String contentReference)
          Check permissions for remove Assignment content
 boolean allowRemoveSubmission(String submissionReference)
          Check permissions for remove Submission
 boolean allowUpdateAssignment(String assignmentReference)
          Check permissions for updating an Assignment.
 boolean allowUpdateAssignmentContent(String contentReference)
          Check permissions for updating AssignmentContent
 boolean allowUpdateSubmission(String submissionReference)
          Check permissions for updating Submission.
 String assignmentReference(String context, String id)
          Access the internal reference which can be used to assess security clearance.
 void cancelEdit(AssignmentContentEdit content)
          Cancel the changes made to a AssignmentContentEdit object, and release the lock.
 void cancelEdit(AssignmentEdit assignment)
          Cancel the changes made to a AssignmentEdit object, and release the lock.
 void cancelEdit(AssignmentSubmissionEdit submission)
          Cancel the changes made to a AssignmentSubmissionEdit object, and release the lock.
 void commitEdit(AssignmentContentEdit content)
          Commit the changes made to a AssignmentContentEdit object, and release the lock.
 void commitEdit(AssignmentEdit assignment)
          Commit the changes made to a AssignmentEdit object, and release the lock.
 void commitEdit(AssignmentSubmissionEdit submission)
          Commit the changes made to a AssignmentSubmissionEdit object, and release the lock.
 String contentReference(String context, String id)
          Access the internal reference which can be used to access the resource from within the system.
 AssignmentEdit editAssignment(String id)
          Get a locked assignment object for editing.
 AssignmentContentEdit editAssignmentContent(String id)
          Get a locked AssignmentContent object for editing.
 AssignmentSubmissionEdit editSubmission(String id)
          Get a locked AssignmentSubmission object for editing.
 Assignment getAssignment(String assignmentId)
          Access the Assignment with the specified id.
 AssignmentContent getAssignmentContent(String contentId)
          Access the AssignmentContent with the specified id.
 Iterator getAssignmentContents(User owner)
          Access list of all AssignmentContents created by the User.
 Iterator getAssignments(AssignmentContent content)
          Access all the Assignments which have the specified AssignmentContent.
 Iterator getAssignmentsForContext(String context)
          Access all the Assignemnts associated with a group.
 byte[] getGradesSpreadsheet(String ref)
          Access the grades spreadsheet for the reference, either for an assignment or all assignments in a context.
 AssignmentSubmission getSubmission(String submissionId)
          Access the AssignmentSubmission with the specified id.
 AssignmentSubmission getSubmission(String assignmentId, User person)
          Access a User's AssignmentSubmission to a particular Assignment.
 Iterator getSubmissions(Assignment assignment)
          Get the submissions for an assignment.
 byte[] getSubmissionsZip(String ref)
          Access the submissions zip for the assignment reference.
 String gradesSpreadsheetReference(String context, String assignmentId)
          Get the String to form an assignment grade spreadsheet
 AssignmentEdit mergeAssignment(Element el)
          Add a new assignment to the directory, from a definition in XML.
 AssignmentContentEdit mergeAssignmentContent(Element el)
          Add a new AssignmentContent to the directory, from a definition in XML.
 AssignmentSubmissionEdit mergeSubmission(Element el)
          Add a new AssignmentSubmission to the directory, from a definition in XML.
 void removeAssignment(AssignmentEdit assignment)
          Removes this Assignment and all references to it.
 void removeAssignmentContent(AssignmentContentEdit content)
          Removes an AssignmentContent
 void removeSubmission(AssignmentSubmissionEdit submission)
          Removes an AssignmentSubmission and all references to it
 String submissionReference(String context, String id, String assignmentId)
          Access the internal reference which can be used to access the resource from within the system.
 String submissionsZipReference(String context, String assignmentId)
          Get the string to form an assignment submissions zip file
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.EntityProducer
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getHttpAccess, getLabel, importEntities, merge, parseEntityReference, syncWithSiteChange, willArchiveMerge, willImport
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
This string can be used to find the service in the service manager.


REFERENCE_ROOT

public static final String REFERENCE_ROOT
This string starts the references to resources in this service.

See Also:
Constant Field Values

SECURE_ADD_ASSIGNMENT

public static final String SECURE_ADD_ASSIGNMENT
Security lock for adding an assignment.

See Also:
Constant Field Values

SECURE_ADD_ASSIGNMENT_CONTENT

public static final String SECURE_ADD_ASSIGNMENT_CONTENT
Security lock for adding an assignment.

See Also:
Constant Field Values

SECURE_ADD_ASSIGNMENT_SUBMISSION

public static final String SECURE_ADD_ASSIGNMENT_SUBMISSION
Security lock for adding an assignment submission.

See Also:
Constant Field Values

SECURE_REMOVE_ASSIGNMENT

public static final String SECURE_REMOVE_ASSIGNMENT
Security lock for removing an assignment.

See Also:
Constant Field Values

SECURE_REMOVE_ASSIGNMENT_CONTENT

public static final String SECURE_REMOVE_ASSIGNMENT_CONTENT
Security lock for removing an assignment content.

See Also:
Constant Field Values

SECURE_REMOVE_ASSIGNMENT_SUBMISSION

public static final String SECURE_REMOVE_ASSIGNMENT_SUBMISSION
Security lock for removing an assignment submission.

See Also:
Constant Field Values

SECURE_ACCESS_ASSIGNMENT

public static final String SECURE_ACCESS_ASSIGNMENT
Security lock for accessing an assignment.

See Also:
Constant Field Values

SECURE_ACCESS_ASSIGNMENT_CONTENT

public static final String SECURE_ACCESS_ASSIGNMENT_CONTENT
Security lock for accessing an assignment content.

See Also:
Constant Field Values

SECURE_ACCESS_ASSIGNMENT_SUBMISSION

public static final String SECURE_ACCESS_ASSIGNMENT_SUBMISSION
Security lock for accessing an assignment submission.

See Also:
Constant Field Values

SECURE_UPDATE_ASSIGNMENT

public static final String SECURE_UPDATE_ASSIGNMENT
Security lock for updating an assignment.

See Also:
Constant Field Values

SECURE_UPDATE_ASSIGNMENT_CONTENT

public static final String SECURE_UPDATE_ASSIGNMENT_CONTENT
Security lock for updating an assignment content.

See Also:
Constant Field Values

SECURE_UPDATE_ASSIGNMENT_SUBMISSION

public static final String SECURE_UPDATE_ASSIGNMENT_SUBMISSION
Security lock for updating an assignment submission.

See Also:
Constant Field Values

SECURE_GRADE_ASSIGNMENT_SUBMISSION

public static final String SECURE_GRADE_ASSIGNMENT_SUBMISSION
Security lock for grading submission

See Also:
Constant Field Values

REF_TYPE_ASSIGNMENT

public static final String REF_TYPE_ASSIGNMENT
The Reference type for an assignment.

See Also:
Constant Field Values

REF_TYPE_SUBMISSION

public static final String REF_TYPE_SUBMISSION
The Reference type for a submission.

See Also:
Constant Field Values

REF_TYPE_CONTENT

public static final String REF_TYPE_CONTENT
The Reference type for a content.

See Also:
Constant Field Values

REF_TYPE_GRADES

public static final String REF_TYPE_GRADES
The Reference type for a grade spreadsheet.

See Also:
Constant Field Values

REF_TYPE_SUBMISSIONS

public static final String REF_TYPE_SUBMISSIONS
The Reference type for a submissions zip.

See Also:
Constant Field Values
Method Detail

allowAddAssignment

public boolean allowAddAssignment(String context)
Check permissions for adding an Assignment.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
True if the current User is allowed to add an Assignment, false if not.

allowGetAssignment

public boolean allowGetAssignment(String assignmentReference)
Check permissions for reading an Assignment.

Parameters:
assignmentReference - - The Assignment's reference.
Returns:
True if the current User is allowed to get the Assignment, false if not.

allowUpdateAssignment

public boolean allowUpdateAssignment(String assignmentReference)
Check permissions for updating an Assignment.

Parameters:
assignmentReference - - The Assignment's reference.
Returns:
True if the current User is allowed to update the Assignment, false if not.

allowRemoveAssignment

public boolean allowRemoveAssignment(String assignmentReference)
Check permissions for removing an Assignment.

Parameters:
assignmentReference - - The Assignment's reference.
Returns:
True if the current User is allowed to remove the Assignment, false if not.

allowAddAssignmentContent

public boolean allowAddAssignmentContent(String context)
Check permissions for adding an AssignmentContent.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
True if the current User is allowed to add an AssignmentContent, false if not.

allowGetAssignmentContent

public boolean allowGetAssignmentContent(String contentReference)
Check permissions for get AssignmentContent

Parameters:
contentReference - - The AssignmentContent reference.
Returns:
True if the current User is allowed to get the AssignmentContent, false if not.

allowUpdateAssignmentContent

public boolean allowUpdateAssignmentContent(String contentReference)
Check permissions for updating AssignmentContent

Parameters:
contentReference - - The AssignmentContent reference.
Returns:
True if the current User is allowed to update the AssignmentContent, false if not.

allowRemoveAssignmentContent

public boolean allowRemoveAssignmentContent(String contentReference)
Check permissions for remove Assignment content

Parameters:
contentReference - - The AssignmentContent reference.
Returns:
True if the current User is allowed to remove the AssignmentContent, false if not.

allowAddSubmission

public boolean allowAddSubmission(String context)
Check permissions for add AssignmentSubmission

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
True if the current User is allowed to add an AssignmentSubmission, false if not.

allowAddSubmissionUsers

public List allowAddSubmissionUsers(String assignmentReference)
Get the List of Users who can addSubmission() for this assignment.

Parameters:
assignmentReference - - a reference to an assignment
Returns:
the List (User) of users who can addSubmission() for this assignment.

allowAddAssignmentUsers

public List allowAddAssignmentUsers(String context)
Get the List of Users who can add assignment

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
the List (User) of users who can add assignment

allowGetSubmission

public boolean allowGetSubmission(String submissionReference)
Check permissions for reading a Submission.

Parameters:
submissionReference - - The Submission's reference.
Returns:
True if the current User is allowed to get the AssignmentSubmission, false if not.

allowUpdateSubmission

public boolean allowUpdateSubmission(String submissionReference)
Check permissions for updating Submission.

Parameters:
submissionReference - - The Submission's reference.
Returns:
True if the current User is allowed to update the AssignmentSubmission, false if not.

allowRemoveSubmission

public boolean allowRemoveSubmission(String submissionReference)
Check permissions for remove Submission

Parameters:
submissionReference - - The Submission's reference.
Returns:
True if the current User is allowed to remove the AssignmentSubmission, false if not.

allowGradeSubmission

public boolean allowGradeSubmission(String submissionReference)
Check permissions for grading Submission

Parameters:
submissionReference - - The Submission's reference.
Returns:
True if the current User is allowed to grade the AssignmentSubmission, false if not.

addAssignment

public AssignmentEdit addAssignment(String context)
                             throws PermissionException
Creates and adds a new Assignment to the service.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
AssignmentEdit The new Assignment object.
Throws:
IdInvalidException - 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.

mergeAssignment

public AssignmentEdit mergeAssignment(Element el)
                               throws IdInvalidException,
                                      IdUsedException,
                                      PermissionException
Add a new assignment to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
el - The XML DOM Element defining the assignment.
Returns:
A locked AssignmentEdit object (reserving the id).
Throws:
IdInvalidException - if the assignment id is invalid.
IdUsedException - if the assignment id is already used.
PermissionException - if the current user does not have permission to add an assignnment.

addDuplicateAssignment

public AssignmentEdit addDuplicateAssignment(String context,
                                             String assignmentReference)
                                      throws IdInvalidException,
                                             PermissionException,
                                             IdUsedException,
                                             IdUnusedException
Creates and adds a new Assignment to the service which is a copy of an existing Assignment.

Parameters:
context - - From DefaultId.getChannel(RunData)
assignmentReference - - The reference of the Assignment to be duplicated.
Returns:
The new AssignmentEdit object, or null if the original Assignment does not exist.
Throws:
PermissionException - if current User does not have permission to do this.
IdInvalidException
IdUsedException
IdUnusedException

removeAssignment

public void removeAssignment(AssignmentEdit assignment)
                      throws PermissionException
Removes this Assignment and all references to it.

Parameters:
assignment - - The Assignment to remove.
Throws:
PermissionException - if current User does not have permission to do this.

editAssignment

public AssignmentEdit editAssignment(String id)
                              throws IdUnusedException,
                                     PermissionException,
                                     InUseException
Get a locked assignment object for editing. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
id - The assignment id string.
Returns:
A AssignmentEdit object for editing.
Throws:
IdUnusedException - if not found, or if not an AssignmentEdit object
PermissionException - if the current user does not have permission to edit this assignment.
InUseException - if the Assignment object is locked by someone else.

commitEdit

public void commitEdit(AssignmentEdit assignment)
Commit the changes made to a AssignmentEdit object, and release the lock. The AssignmentEdit is disabled, and not to be used after this call.

Parameters:
assignment - The AssignmentEdit object to commit.

cancelEdit

public void cancelEdit(AssignmentEdit assignment)
Cancel the changes made to a AssignmentEdit object, and release the lock. The AssignmentEdit is disabled, and not to be used after this call.

Parameters:
assignment - The AssignmentEdit object to commit.

addAssignmentContent

public AssignmentContentEdit addAssignmentContent(String context)
                                           throws PermissionException
Creates and adds a new AssignmentContent to the service.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
AssignmentContentEdit The new AssignmentContent object.
Throws:
PermissionException - if current User does not have permission to do this.

mergeAssignmentContent

public AssignmentContentEdit mergeAssignmentContent(Element el)
                                             throws IdInvalidException,
                                                    IdUsedException,
                                                    PermissionException
Add a new AssignmentContent to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
el - The XML DOM Element defining the AssignmentContent.
Returns:
A locked AssignmentContentEdit object (reserving the id).
Throws:
IdInvalidException - if the AssignmentContent id is invalid.
IdUsedException - if the AssignmentContent id is already used.
PermissionException - if the current user does not have permission to add an AssignnmentContent.

addDuplicateAssignmentContent

public AssignmentContentEdit addDuplicateAssignmentContent(String context,
                                                           String contentReference)
                                                    throws IdInvalidException,
                                                           PermissionException,
                                                           IdUnusedException
Creates and adds a new AssignmentContent to the service which is a copy of an existing AssignmentContent.

Parameters:
context - - From DefaultId.getChannel(RunData)
Returns:
AssignmentContentEdit The new AssignmentContentEdit object, or null if the original does not exist.
Throws:
PermissionException - if current User does not have permission to do this.
IdInvalidException
IdUnusedException

removeAssignmentContent

public void removeAssignmentContent(AssignmentContentEdit content)
                             throws AssignmentContentNotEmptyException,
                                    PermissionException
Removes an AssignmentContent

Parameters:
content - - the AssignmentContent to remove.
Throws:
an - AssignmentContentNotEmptyException if this content still has related Assignments.
PermissionException - if current User does not have permission to do this.
AssignmentContentNotEmptyException

editAssignmentContent

public AssignmentContentEdit editAssignmentContent(String id)
                                            throws IdUnusedException,
                                                   PermissionException,
                                                   InUseException
Get a locked AssignmentContent object for editing. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
id - The content id string.
Returns:
An AssignmentContentEdit object for editing.
Throws:
IdUnusedException - if not found, or if not an AssignmentContentEdit object
PermissionException - if the current user does not have permission to edit this content.
InUseException - if the AssignmentContent object is locked by someone else.

commitEdit

public void commitEdit(AssignmentContentEdit content)
Commit the changes made to a AssignmentContentEdit object, and release the lock. The AssignmentContentEdit is disabled, and not to be used after this call.

Parameters:
content - The AssignmentContentEdit object to commit.

cancelEdit

public void cancelEdit(AssignmentContentEdit content)
Cancel the changes made to a AssignmentContentEdit object, and release the lock. The AssignmentContentEdit is disabled, and not to be used after this call.

Parameters:
content - The AssignmentContentEdit object to commit.

addSubmission

public AssignmentSubmissionEdit addSubmission(String context,
                                              String assignmentId)
                                       throws PermissionException
Adds an AssignmentSubmission to the service.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
The new AssignmentSubmissionEdit.
Throws:
IdInvalidException - 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.

mergeSubmission

public AssignmentSubmissionEdit mergeSubmission(Element el)
                                         throws IdInvalidException,
                                                IdUsedException,
                                                PermissionException
Add a new AssignmentSubmission to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
el - The XML DOM Element defining the submission.
Returns:
A locked AssignmentSubmissionEdit object (reserving the id).
Throws:
IdInvalidException - if the submission id is invalid.
IdUsedException - if the submission id is already used.
PermissionException - if the current user does not have permission to add a submission.

removeSubmission

public void removeSubmission(AssignmentSubmissionEdit submission)
                      throws PermissionException
Removes an AssignmentSubmission and all references to it

Parameters:
submission - - the AssignmentSubmission to remove.
Throws:
PermissionException - if current User does not have permission to do this.

editSubmission

public AssignmentSubmissionEdit editSubmission(String id)
                                        throws IdUnusedException,
                                               PermissionException,
                                               InUseException
Get a locked AssignmentSubmission object for editing. Must commitEdit() to make official, or cancelEdit() when done!

Parameters:
id - The submission id string.
Returns:
An AssignmentSubmissionEdit object for editing.
Throws:
IdUnusedException - if not found, or if not an AssignmentSubmissionEdit object
PermissionException - if the current user does not have permission to edit this submission.
InUseException - if the AssignmentSubmission object is locked by someone else.

commitEdit

public void commitEdit(AssignmentSubmissionEdit submission)
Commit the changes made to a AssignmentSubmissionEdit object, and release the lock. The AssignmentSubmissionEdit is disabled, and not to be used after this call.

Parameters:
submission - The AssignmentSubmissionEdit object to commit.

cancelEdit

public void cancelEdit(AssignmentSubmissionEdit submission)
Cancel the changes made to a AssignmentSubmissionEdit object, and release the lock. The AssignmentSubmissionEdit is disabled, and not to be used after this call.

Parameters:
submission - The AssignmentSubmissionEdit object to commit.

getAssignmentContents

public Iterator getAssignmentContents(User owner)
Access list of all AssignmentContents created by the User.

Parameters:
owner - - The User who's AssignmentContents are requested.
Returns:
Iterator over all AssignmentContents owned by this User.

getAssignment

public Assignment getAssignment(String assignmentId)
                         throws IdUnusedException,
                                PermissionException
Access the Assignment with the specified id.

Parameters:
assignmentId - - The id of the Assignment.
Returns:
The Assignment corresponding to the id, or null if it does not exist.
Throws:
IdUnusedException - if there is no object with this id.
PermissionException - if the current user is not allowed to read this.

getAssignmentContent

public AssignmentContent getAssignmentContent(String contentId)
                                       throws IdUnusedException,
                                              PermissionException
Access the AssignmentContent with the specified id.

Parameters:
contentId - - The id of the AssignmentContent.
Returns:
The AssignmentContent corresponding to the id, or null if it does not exist.
Throws:
IdUnusedException - if there is no object with this id.
PermissionException - if the current user does not have permission to see this.

getSubmission

public AssignmentSubmission getSubmission(String submissionId)
                                   throws IdUnusedException,
                                          PermissionException
Access the AssignmentSubmission with the specified id.

Parameters:
submissionId - - The id of the AssignmentSubmission.
Returns:
The AssignmentSubmission corresponding to the id, or null if it does not exist.
Throws:
IdUnusedException - if there is no object with this id.
PermissionException - if the current user is not allowed to read this.

getAssignments

public Iterator getAssignments(AssignmentContent content)
Access all the Assignments which have the specified AssignmentContent.

Parameters:
content - - The particular AssignmentContent.
Returns:
Iterator over all the Assignments with the specified AssignmentContent.

getAssignmentsForContext

public Iterator getAssignmentsForContext(String context)
Access all the Assignemnts associated with a group.

Parameters:
context - - Describes the portlet context - generated with DefaultId.getChannel().
Returns:
Iterator over all the Assignments associated with a group.

getSubmission

public AssignmentSubmission getSubmission(String assignmentId,
                                          User person)
                                   throws IdUnusedException,
                                          PermissionException
Access a User's AssignmentSubmission to a particular Assignment.

Parameters:
assignmentId - - The id of the assignment.
person - - The User who's Submission you would like.
Returns:
AssignmentSubmission The user's submission for that Assignment, or null if one does not exist.
Throws:
IdUnusedException - if the assignmentId does not correspond to an existing Assignment.
PermissionException - if the current user is not allowed to read this.

getSubmissions

public Iterator getSubmissions(Assignment assignment)
Get the submissions for an assignment.

Parameters:
assignment - - the Assignment who's submissions you would like.
Returns:
Iterator over all the submissions for an Assignment.

getGradesSpreadsheet

public byte[] getGradesSpreadsheet(String ref)
                            throws IdUnusedException,
                                   PermissionException
Access the grades spreadsheet for the reference, either for an assignment or all assignments in a context.

Parameters:
ref - The reference, either to a specific assignment, or just to an assignment context.
Returns:
The grades spreadsheet bytes.
Throws:
IdUnusedException - if there is no object with this id.
PermissionException - if the current user is not allowed to access this.

getSubmissionsZip

public byte[] getSubmissionsZip(String ref)
                         throws IdUnusedException,
                                PermissionException
Access the submissions zip for the assignment reference.

Parameters:
ref - The assignment reference.
Returns:
The submissions zip bytes.
Throws:
IdUnusedException - if there is no object with this id.
PermissionException - if the current user is not allowed to access this.

assignmentReference

public String assignmentReference(String context,
                                  String id)
Access the internal reference which can be used to assess security clearance.

Parameters:
id - The assignment id string.
Returns:
The the internal reference which can be used to access the resource from within the system.

contentReference

public String contentReference(String context,
                               String id)
Access the internal reference which can be used to access the resource from within the system.

Parameters:
id - The content id string.
Returns:
The the internal reference which can be used to access the resource from within the system.

submissionReference

public String submissionReference(String context,
                                  String id,
                                  String assignmentId)
Access the internal reference which can be used to access the resource from within the system.

Parameters:
id - The submission id string.
Returns:
The the internal reference which can be used to access the resource from within the system.

gradesSpreadsheetReference

public String gradesSpreadsheetReference(String context,
                                         String assignmentId)
Get the String to form an assignment grade spreadsheet

Parameters:
context - The assignment context String
assignmentId - The id for the assignment object; when null, indicates all assignment in that context

submissionsZipReference

public String submissionsZipReference(String context,
                                      String assignmentId)
Get the string to form an assignment submissions zip file

Parameters:
context - The assignment context String
assignmentId - The id for the assignment object;