Interface GradebookColumnAdminSession

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

public interface GradebookColumnAdminSession extends OsidSession

This session creates, updates, and deletes GradebookColumns . 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 GradebookColumn , a GradebookColumnForm is requested using getGradebookColumnFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned GradebookColumnForm 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 GradebookColumnForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each GradebookColumnForm corresponds to an attempted transaction.

For updates, GradebookColumnForms are requested to the GradebookColumn Id that is to be updated using getGradebookColumnFormForUpdate() . Similarly, the GradebookColumnForm has metadata about the data that can be updated and it can perform validation before submitting the update. The GradebookColumnForm can only be used once for a successful update and cannot be reused.

The delete operations delete GradebookColumns To unmap a GradebookColumn from the current Gradebook , the GradebookColumnGradebookAssignmentSession should be used. These delete operations attempt to remove the GradebookColumnForm 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.
    • canCreateGradebookColumns

      boolean canCreateGradebookColumns()
      Tests if this user can create gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a gradebook column 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 GradebookColumn creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradebookColumnWithRecordTypes

      boolean canCreateGradebookColumnWithRecordTypes(Type[] gradebookColumnRecordTypes)
      Tests if this user can create a single GradebookColumn using the desired record types. While GradingManager.getGradebookColumnRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific GradebookColumn . Providing an empty array tests if a GradebookColumn can be created with no records.
      Parameters:
      gradebookColumnRecordTypes - array of gradebook column record types
      Returns:
      true if GradebookColumn creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - gradebookColumnRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getGradebookColumnFormForCreate

      GradebookColumnForm getGradebookColumnFormForCreate(Type[] gradebookColumnRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the gradebook column form for creating new gradebook columns. A new form should be requested for each create transaction.
      Parameters:
      gradebookColumnRecordTypes - array of gradebook column record types
      Returns:
      the gradebook column form
      Throws:
      NullArgumentException - gradebookColumnRecordTypes 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.
    • createGradebookColumn

      GradebookColumn createGradebookColumn(GradebookColumnForm gradebookColumnForm) throws OperationFailedException, PermissionDeniedException
      Creates a new GradebookColumn .
      Parameters:
      gradebookColumnForm - the form for this GradebookColumn
      Returns:
      the new GradebookColumn
      Throws:
      IllegalStateException - gradebookColumnForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - gradebookColumnForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradebookColumnForm did not originate from getGradebookColumnFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateGradebookColumns

      boolean canUpdateGradebookColumns()
      Tests if this user can update gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a GradebookColumn 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 gradebook column modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getGradebookColumnFormForUpdate

      GradebookColumnForm getGradebookColumnFormForUpdate(Id gradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the gradebook column form for updating an existing gradebook column. A new gradebook column form should be requested for each update transaction.
      Parameters:
      gradebookColumnId - the Id of the GradebookColumn
      Returns:
      the gradebook column form
      Throws:
      NotFoundException - gradebookColumnId is not found
      NullArgumentException - gradebookColumnId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateGradebookColumn

      void updateGradebookColumn(GradebookColumnForm gradebookColumnForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing gradebook column.
      Parameters:
      gradebookColumnForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - gradebookColumnForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - gradebookColumnForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradebookColumnForm did not originate from getGradebookColumnFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • sequenceGradebookColumns

      void sequenceGradebookColumns(IdList gradebookColumnIds) throws OperationFailedException, PermissionDeniedException
      Resequences the gradebook columns.
      Parameters:
      gradebookColumnIds - the Ids of the GradebookColumns
      Throws:
      NullArgumentException - gradebookColumnIdList is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • moveGradebookColumn

      void moveGradebookColumn(Id frontGradebookColumnId, Id backGradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a gradebook column in front of another.
      Parameters:
      frontGradebookColumnId - the Id of a GradebookColumn
      backGradebookColumnId - the Id of a GradebookColumn
      Throws:
      NotFoundException - frontGradebookColumnId or backGradebookColumnId is not found
      NullArgumentException - frontGradebookColumnId or backGradebookColumnId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • copyGradebookColumnEntries

      void copyGradebookColumnEntries(Id sourceGradebookColumnId, Id targetGradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Copies gradebook column entries from one column to another. If the target grade column grade system differs from the source, the grades in the entries are transformed to the new grade system.
      Parameters:
      sourceGradebookColumnId - the Id of a GradebookColumn
      targetGradebookColumnId - the Id of a GradebookColumn
      Throws:
      NotFoundException - sourceGradebookColumnId ortargetGradebookColumnId is not found
      NullArgumentException - sourceGradebookColumnId targetGradebookColumnId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteGradebookColumns

      boolean canDeleteGradebookColumns()
      Tests if this user can delete gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a GradebookColumn 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 GradebookColumn deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteGradebookColumn

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

      boolean canManageGradebookColumnAliases()
      Tests if this user can manage Id aliases for GradebookColumns . 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 GradebookColumn aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasGradebookColumn

      void aliasGradebookColumn(Id gradebookColumnId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a GradebookColumn for the purpose of creating compatibility. The primary Id of the GradebookColumn is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another gradebook column, it is reassigned to the given gradebook column Id .
      Parameters:
      gradebookColumnId - the Id of a GradebookColumn
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - gradebookColumnId not found
      NullArgumentException - gradebookColumnId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.