Interface GradeBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, GradeAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Grades in bulk. The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Grade , a GradeForm is requested using
getGradeFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
GradeForms will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once a GradeForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each GradeForm corresponds to an attempted
transaction.
The GradeForms returned from getGradeFormsForCreate()
may be linked to the originating request through the peer Ids of
the GradeForm . In the case where there may be duplicates, any
GradeForm of the same peer Ids may be used for a create
operation.
Once a batch of GradeForms are submitted for create, a
CreateResponse is returned for each GradeForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createGrades() , errors specific to an
individual GradeForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
GradeForm through the GradeForm Id .
For updates, GradeForms are requested to the Grade
Id that is to be updated using getGradeFormsForUpdate()
where the reference Id in the GradeForm may be used to
link the request. Similarly, the GradeForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The GradeForm can only be used once for a successful
update and cannot be reused.
Once a batch of GradeForms are submitted for update, an
UpdateResponse is returned for each GradeForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateGrades() , errors specific to an
individual GradeForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
GradeForm through the GradeForm Id .
The delete operations delete GradeForms in bulk. To unmap a
GradeForm from the current Gradebook , the
GradeGradebookAssignmentSession should be used. These delete operations
attempt to remove the GradeForm itself thus removing it from all
known Gradebook catalogs. Bulk delete operations return the
results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasGrades(AliasRequestList aliasRequests) Adds anIdto aGradefor the purpose of creating compatibility.createGradeSystems(GradeBatchFormList gradeForms) Creates a new set ofGrades.Deletes allGradesin thisGradebook.deleteGrades(IdList gradeIds) Deletes grade for the givenIds.deleteGradesForGradeSystem(Id gradeSystemId) Deletes grade for the given grade system.getGradeFormsForCreate(IdList gradeSystemIds, Type[] gradeRecordTypes) Gets the grade forms for creating a bunch of new grades.getGradeFormsForUpdate(IdList gradeIds) Gets the grade forms for updating an existing set of grades.updateGrades(GradeBatchFormList gradeForms) Updates existing grades.Methods inherited from interface GradeAdminSession
aliasGrade, canCreateGrades, canCreateGradeWithRecordTypes, canDeleteGrades, canManageGradeAliases, canUpdateGrades, createGrade, deleteGrade, getGradebook, getGradebookId, getGradeFormForCreate, getGradeFormForUpdate, updateGradeModifier and TypeMethodDescriptionvoidaliasGrade(Id gradeId, Id aliasId) Adds anIdto aGradefor the purpose of creating compatibility.booleanTests if this user can createGrades.booleancanCreateGradeWithRecordTypes(Type[] gradeRecordTypes) Tests if this user can create a singleGradeusing the desired record types.booleanTests if this user can deleteGrades.booleanTests if this user can manageIdaliases forGradesA return of true does not guarantee successful authorization.booleanTests if this user can updateGrades.createGrade(GradeForm gradeForm) Creates a newGrade.voiddeleteGrade(Id gradeId) Deletes aGrade.Gets theGradebookassociated with this session.Gets theGradebookIdassociated with this session.getGradeFormForCreate(Id gradeSystemId, Type[] gradeRecordTypes) Gets the grade form for creating new grades.getGradeFormForUpdate(Id gradeId) Gets the grade form for updating an existing grade.voidupdateGrade(GradeForm gradeForm) Updates an existing grade.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getGradeFormsForCreate
GradeBatchFormList getGradeFormsForCreate(IdList gradeSystemIds, Type[] gradeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the grade forms for creating a bunch of new grades. A new form is retrieved for each supplied grade system.- Parameters:
gradeSystemIds- a list of grade systemIdsgradeRecordTypes- array of grade record types to be included in each create operation or an empty list if none- Returns:
- the grade system forms
- Throws:
NotFoundException-a gradeSystemId is not foundNullArgumentException-gradeSystemIdorgradeRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createGradeSystems
CreateResponseList createGradeSystems(GradeBatchFormList gradeForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofGrades. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
gradeForms- the grade forms- Returns:
- the create responses
- Throws:
NullArgumentException-gradeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getGradeFormsForUpdate
GradeBatchFormList getGradeFormsForUpdate(IdList gradeIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the grade forms for updating an existing set of grades. A new grade form should be requested for each update transaction.- Parameters:
gradeIds- theIdsof theGrade- Returns:
- the grade forms
- Throws:
NotFoundException- agradeIdis not foundNullArgumentException-gradeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateGrades
UpdateResponseList updateGrades(GradeBatchFormList gradeForms) throws OperationFailedException, PermissionDeniedException Updates existing grades. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
gradeForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-gradeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllGrades
Deletes allGradesin thisGradebook.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteGrades
DeleteResponseList deleteGrades(IdList gradeIds) throws OperationFailedException, PermissionDeniedException Deletes grade for the givenIds.- Parameters:
gradeIds- theIdsof the grades to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-gradeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteGradesForGradeSystem
DeleteResponseList deleteGradesForGradeSystem(Id gradeSystemId) throws OperationFailedException, PermissionDeniedException Deletes grade for the given grade system.- Parameters:
gradeSystemId- theIdsof a grade system- Returns:
- the delete responses
- Throws:
NullArgumentException-gradeSystemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasGrades
AliasResponseList aliasGrades(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aGradefor the purpose of creating compatibility. The primaryIdof theGradeis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another grade system, it is reassigned to the given gradeId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-