Interface GradeEntryAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
GradeEntryBatchAdminSession

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 .

  • Method Details

    • getGradebookId

      Id getGradebookId()
      Gets the Gradebook Id associated with this session.
      Returns:
      the Gradebook Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getGradebook

      Gets the Gradebook associated with this session.
      Returns:
      the Gradebook associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if GradeEntry creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradeEntryWithRecordTypes

      boolean canCreateGradeEntryWithRecordTypes(Type[] gradeEntryRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      gradeEntryRecordTypes - array of grade entry record types
      Returns:
      true if GradeEntry creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - gradeEntryRecordTypes is null
      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 column
      resourceId - the key resource
      gradeEntryRecordTypes - array of grade entry record types
      Returns:
      the grade entry form
      Throws:
      NotFoundException - gradebookColumnId or resourceId not found
      NullArgumentException - gradebookColumnId, resourceId , or gradeEntryRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createGradeEntry

      Creates a new GradeEntry .
      Parameters:
      gradeEntryForm - the form for this GradeEntry
      Returns:
      the new GradeEntry
      Throws:
      IllegalStateException - gradeEntryForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - gradeEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradeEntryForm did not originate from getGradeEntryFormForCreate()
      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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if GradeEntry override is not authorized, true otherwise
      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 - the Id of the grade entry to be overridden
      gradeEntryRecordTypes - array of grade entry record types
      Returns:
      the grade entry form
      Throws:
      AlreadyExistsException - gradeEntryId is already overridden
      NotFoundException - gradeEntryId not found or gradeEntryId is not a calculated entry
      NullArgumentException - gradeEntryId or gradeEntryRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - 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 overriding GradeEntry .
      Parameters:
      gradeEntryForm - the form for this GradeEntry
      Returns:
      the new GradeEntry
      Throws:
      IllegalStateException - gradeEntryForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - gradeEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradeEntryForm did not originate from getGradeEntryFormForOverride()
      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 a 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.
      Returns:
      false if grade entry modification is not authorized, true otherwise
      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 - the Id of the GradeEntry
      Returns:
      the grade entry form
      Throws:
      NotFoundException - gradeEntryId is not found
      NullArgumentException - gradeEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - gradeEntryForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - gradeEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradeEntryForm did not originate from getGradeEntryFormForUpdate()
      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 a 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.
      Returns:
      false if GradeEntry deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteGradeEntry

      void deleteGradeEntry(Id gradeEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes the GradeEntry identified by the given Id .
      Parameters:
      gradeEntryId - the Id of the GradeEntry to delete
      Throws:
      NotFoundException - a GradeEntry was not found identified by the given Id
      NullArgumentException - gradeEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageGradeEntryAliases

      boolean canManageGradeEntryAliases()
      Tests if this user can manage 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.
      Returns:
      false if GradeEntry aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasGradeEntry

      void aliasGradeEntry(Id gradeEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an 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 .
      Parameters:
      gradeEntryId - the Id of a GradeEntry
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - gradeEntryId not found
      NullArgumentException - gradeEntryId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.