public interface GradeEntryAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasGradeEntry(Id gradeEntryId,
Id aliasId)
Adds an
Id to a GradeEntry for the
purpose of creating compatibility. |
boolean |
canCreateGradeEntries()
Tests if this user can create grade entries.
|
boolean |
canCreateGradeEntryWithRecordTypes(Type[] gradeEntryRecordTypes)
Tests if this user can create a single
GradeEntry using
the desired record types. |
boolean |
canDeleteGradeEntries()
Tests if this user can delete grade entries.
|
boolean |
canManageGradeEntryAliases()
Tests if this user can manage
Id aliases for
GradeEntries. |
boolean |
canOverridecalculatedGradeEntries()
Tests if this user can override grade entries calculated from another.
|
boolean |
canUpdateGradeEntries()
Tests if this user can update grade entries.
|
GradeEntry |
createGradeEntry(GradeEntryForm gradeEntryForm)
Creates a new
GradeEntry. |
void |
deleteGradeEntry(Id gradeEntryId)
Deletes the
GradeEntry identified by the given
Id. |
Gradebook |
getGradebook()
Gets the
Gradebook associated with this session. |
Id |
getGradebookId()
Gets the
Gradebook Id associated with
this session. |
GradeEntryForm |
getGradeEntryFormForCreate(Id gradebookColumnId,
Id resourceId,
Type[] gradeEntryRecordTypes)
Gets the grade entry form for creating new grade entries.
|
GradeEntryForm |
getGradeEntryFormForOverride(Id gradeEntryId,
Type[] gradeEntryRecordTypes)
Gets the grade entry form for overriding calculated grade entries.
|
GradeEntryForm |
getGradeEntryFormForUpdate(Id gradeEntryId)
Gets the grade entry form for updating an existing entry.
|
GradeEntry |
overrideCalculatedGradeEntry(GradeEntryForm gradeEntryForm)
Creates a new overriding
GradeEntry. |
void |
updateGradeEntry(GradeEntryForm gradeEntryForm)
Updates an existing grade entry.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getGradebookId()
Gradebook Id associated with
this session. Gradebook Id associated with this sessionmandatory - This method must be implemented. Gradebook getGradebook() throws OperationFailedException, PermissionDeniedException
Gradebook associated with this session. Gradebook associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateGradeEntries()
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer create operations to an
unauthorized user. false if GradeEntry creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateGradeEntryWithRecordTypes(Type[] gradeEntryRecordTypes)
GradeEntry using
the desired record types. While
GradingManager.getGradeEntryRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific GradeEntry.
Providing an empty array tests if a GradeEntry can be
created with no records.gradeEntryRecordTypes - array of grade entry record types true if GradeEntry creation
using the specified record Types is supported,
false otherwiseNullArgumentException - gradeEntryRecordTypes
is null mandatory - This method must be implemented. GradeEntryForm getGradeEntryFormForCreate(Id gradebookColumnId, Id resourceId, Type[] gradeEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradebookColumnId - the gradebook columnresourceId - the key resourcegradeEntryRecordTypes - array of grade entry record typesNotFoundException - gradebookColumnId or
resourceId not foundNullArgumentException - gradebookColumnId,
resourceId, or gradeEntryRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. GradeEntry createGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException
GradeEntry. gradeEntryForm - the form for this GradeEntry GradeEntry IllegalStateException - gradeEntryForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - gradeEntryForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - gradeEntryForm
did not originate from getGradeEntryFormForCreate()
mandatory - This method must be implemented. boolean canOverridecalculatedGradeEntries()
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false if GradeEntry override is
not authorized, true otherwisemandatory - This method must be implemented. GradeEntryForm getGradeEntryFormForOverride(Id gradeEntryId, Type[] gradeEntryRecordTypes) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
gradeEntryId - the Id of the grade entry to be
overriddengradeEntryRecordTypes - array of grade entry record typesAlreadyExistsException - gradeEntryId is
already overriddenNotFoundException - gradeEntryId not
found or gradeEntryId is not a calculated entryNullArgumentException - gradeEntryId or
gradeEntryRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. GradeEntry overrideCalculatedGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException
GradeEntry. gradeEntryForm - the form for this GradeEntry GradeEntry IllegalStateException - gradeEntryForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - gradeEntryForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - gradeEntryForm
did not originate from getGradeEntryFormForOverride()
mandatory - This method must be implemented. boolean canUpdateGradeEntries()
GradeEntry will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer update operations to an
unauthorized user. false if grade entry modification is not
authorized, true otherwisemandatory - This method must be implemented. GradeEntryForm getGradeEntryFormForUpdate(Id gradeEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradeEntryId - the Id of the GradeEntry
NotFoundException - gradeEntryId is not
foundNullArgumentException - gradeEntryId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateGradeEntry(GradeEntryForm gradeEntryForm) throws OperationFailedException, PermissionDeniedException
gradeEntryForm - the form containing the elements to be updatedIllegalStateException - gradeEntryForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - gradeEntryForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - gradeEntryForm
did not originate from getGradeEntryFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteGradeEntries()
GradeEntry will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer delete operations to an
unauthorized user. false if GradeEntry deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteGradeEntry(Id gradeEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
GradeEntry identified by the given
Id. gradeEntryId - the Id of the GradeEntry
to deleteNotFoundException - a GradeEntry was not
found identified by the given Id NullArgumentException - gradeEntryId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageGradeEntryAliases()
Id aliases for
GradeEntries. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if GradeEntry aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasGradeEntry(Id gradeEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a GradeEntry for the
purpose of creating compatibility. The primary Id of
the GradeEntry is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another grade entry, it is
reassigned to the given grade entry Id. gradeEntryId - the Id of a GradeEntry
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - gradeEntryId not
foundNullArgumentException - gradeEntryId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.