Interface GradeEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
GradeEntryBatchAdminSession
This session creates, updates, and deletes GradeEntries . 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
GradeEntry , a GradeEntryForm is requested using
getGradeEntryFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
GradeEntryForm 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 the GradeEntryForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each GradeEntryForm corresponds
to an attempted transaction.
For updates, GradeEntryForms are requested to the
GradeEntry Id that is to be updated using
getGradeEntryFormForUpdate() . Similarly, the GradeEntryForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The GradeEntryForm can only be used
once for a successful update and cannot be reused.
The delete operations delete GradeEntries . To unmap a
GradeEntry from the current Gradebook , the
GradeEntryGradebookAssignmentSession should be used. These delete
operations attempt to remove the GradeEntry itself thus removing
it from all known Gradebook catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasGradeEntry(Id gradeEntryId, Id aliasId) Adds anIdto aGradeEntryfor the purpose of creating compatibility.booleanTests if this user can create grade entries.booleancanCreateGradeEntryWithRecordTypes(Type[] gradeEntryRecordTypes) Tests if this user can create a singleGradeEntryusing the desired record types.booleanTests if this user can delete grade entries.booleanTests if this user can manageIdaliases forGradeEntries.booleanTests if this user can override grade entries calculated from another.booleanTests if this user can update grade entries.createGradeEntry(GradeEntryForm gradeEntryForm) Creates a newGradeEntry.voiddeleteGradeEntry(Id gradeEntryId) Deletes theGradeEntryidentified by the givenId.Gets theGradebookassociated with this session.Gets theGradebookIdassociated with this session.getGradeEntryFormForCreate(Id gradebookColumnId, Id resourceId, Type[] gradeEntryRecordTypes) Gets the grade entry form for creating new grade entries.getGradeEntryFormForOverride(Id gradeEntryId, Type[] gradeEntryRecordTypes) Gets the grade entry form for overriding calculated grade entries.getGradeEntryFormForUpdate(Id gradeEntryId) Gets the grade entry form for updating an existing entry.overrideCalculatedGradeEntry(GradeEntryForm gradeEntryForm) Creates a new overridingGradeEntry.voidupdateGradeEntry(GradeEntryForm gradeEntryForm) Updates an existing grade entry.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
-
getGradebookId
Id getGradebookId()Gets theGradebookIdassociated with this session.- Returns:
- the
Gradebook Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getGradebook
Gets theGradebookassociated with this session.- Returns:
- the
Gradebookassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateGradeEntries
boolean canCreateGradeEntries()Tests if this user can create grade entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a grade entry will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifGradeEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateGradeEntryWithRecordTypes
Tests if this user can create a singleGradeEntryusing the desired record types. WhileGradingManager.getGradeEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificGradeEntry. Providing an empty array tests if aGradeEntrycan be created with no records.- Parameters:
gradeEntryRecordTypes- array of grade entry record types- Returns:
trueifGradeEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-gradeEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getGradeEntryFormForCreate
GradeEntryForm getGradeEntryFormForCreate(Id gradebookColumnId, Id resourceId, Type[] gradeEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the grade entry form for creating new grade entries. A new form should be requested for each create transaction.- Parameters:
gradebookColumnId- the gradebook columnresourceId- the key resourcegradeEntryRecordTypes- array of grade entry record types- Returns:
- the grade entry form
- Throws:
NotFoundException-gradebookColumnId or resourceIdnot foundNullArgumentException-gradebookColumnId, resourceId, orgradeEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createGradeEntry
GradeEntry createGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newGradeEntry.- Parameters:
gradeEntryForm- the form for thisGradeEntry- Returns:
- the new
GradeEntry - Throws:
IllegalStateException-gradeEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-gradeEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-gradeEntryFormdid not originate fromgetGradeEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canOverrideCalculatedGradeEntries
boolean canOverrideCalculatedGradeEntries()Tests if this user can override grade entries calculated from another. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a grade entry will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifGradeEntryoverride is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getGradeEntryFormForOverride
GradeEntryForm getGradeEntryFormForOverride(Id gradeEntryId, Type[] gradeEntryRecordTypes) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Gets the grade entry form for overriding calculated grade entries. A new form should be requested for each create transaction.- Parameters:
gradeEntryId- theIdof the grade entry to be overriddengradeEntryRecordTypes- array of grade entry record types- Returns:
- the grade entry form
- Throws:
AlreadyExistsException-gradeEntryIdis already overriddenNotFoundException-gradeEntryIdnot found orgradeEntryIdis not a calculated entryNullArgumentException-gradeEntryIdorgradeEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
overrideCalculatedGradeEntry
GradeEntry overrideCalculatedGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException Creates a new overridingGradeEntry.- Parameters:
gradeEntryForm- the form for thisGradeEntry- Returns:
- the new
GradeEntry - Throws:
IllegalStateException-gradeEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-gradeEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-gradeEntryFormdid not originate fromgetGradeEntryFormForOverride()- Compliance:
mandatory- This method must be implemented.
-
canUpdateGradeEntries
boolean canUpdateGradeEntries()Tests if this user can update grade entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aGradeEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif grade entry modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getGradeEntryFormForUpdate
GradeEntryForm getGradeEntryFormForUpdate(Id gradeEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the grade entry form for updating an existing entry. A new grade entry form should be requested for each update transaction.- Parameters:
gradeEntryId- theIdof theGradeEntry- Returns:
- the grade entry form
- Throws:
NotFoundException-gradeEntryIdis not foundNullArgumentException-gradeEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateGradeEntry
void updateGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing grade entry.- Parameters:
gradeEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-gradeEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-gradeEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-gradeEntryFormdid not originate fromgetGradeEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteGradeEntries
boolean canDeleteGradeEntries()Tests if this user can delete grade entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aGradeEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifGradeEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteGradeEntry
void deleteGradeEntry(Id gradeEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theGradeEntryidentified by the givenId.- Parameters:
gradeEntryId- theIdof theGradeEntryto delete- Throws:
NotFoundException- aGradeEntrywas not found identified by the givenIdNullArgumentException-gradeEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageGradeEntryAliases
boolean canManageGradeEntryAliases()Tests if this user can manageIdaliases forGradeEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifGradeEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasGradeEntry
void aliasGradeEntry(Id gradeEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aGradeEntryfor the purpose of creating compatibility. The primaryIdof theGradeEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another grade entry, it is reassigned to the given grade entryId.- Parameters:
gradeEntryId- theIdof aGradeEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-gradeEntryIdnot foundNullArgumentException-gradeEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-