Interface AssessmentTakenAdminSession

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

public interface AssessmentTakenAdminSession extends OsidSession

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

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

The delete operations delete AssessmentsTaken . To unmap an AssessmentTakenForm from the current Bank , the AssessmentTakenFormBankAssignmentSession should be used. These delete operations attempt to remove the AssessmentTakenForm itself thus removing it from all known Bank catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getBankId

      Id getBankId()
      Gets the Bank Id associated with this session.
      Returns:
      the Bank Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBank

      Gets the Bank associated with this session.
      Returns:
      the Bank associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssessmentsTaken

      boolean canCreateAssessmentsTaken()
      Tests if this user can create AssessmentTaken objects. A return of true does not guarantee successful authoriization. A return of false indicates that it is known creating an AssessmentTaken 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 AssessmentTaken creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssessmentTakenWithRecordTypes

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

      AssessmentTakenForm getAssessmentTakenFormForCreate(Id assessmentOfferedId, Type[] assessmentTakenRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment taken form for creating new assessments taken. A new form should be requested for each create transaction.
      Parameters:
      assessmentOfferedId - the Id of the related AssessmentOffered
      assessmentTakenRecordTypes - array of assessment taken record types to be included in the create operation or an empty list if none
      Returns:
      the assessment taken form
      Throws:
      NotFoundException - assessmentOfferedId is not found
      NullArgumentException - assessmentOfferedId or assessmentTakenRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createAssessmentTaken

      AssessmentTaken createAssessmentTaken(AssessmentTakenForm assessmentTakenForm) throws OperationFailedException, PermissionDeniedException
      Creates a new AssessmentTaken .
      Parameters:
      assessmentTakenForm - the form for this AssessmentTaken
      Returns:
      the new AssessmentTaken
      Throws:
      IllegalStateException - assessmentTakenForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - assessmentTakenForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentOfferedForm did not originate from getAssessmentTakenFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateAssessmentsTaken

      boolean canUpdateAssessmentsTaken()
      Tests if this user can update AssessmentTaken objects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an AssessmentTaken 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 AssessmentTaken modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAssessmentTakenFormForUpdate

      AssessmentTakenForm getAssessmentTakenFormForUpdate(Id assessmentTakenId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment taken form for updating an existing assessment taken. A new assessment taken form should be requested for each update transaction.
      Parameters:
      assessmentTakenId - the Id of the AssessmentTaken
      Returns:
      the assessment taken form
      Throws:
      NotFoundException - assessmentTakenId is not found
      NullArgumentException - assessmentTakenId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • updateAssessmentTaken

      void updateAssessmentTaken(AssessmentTakenForm assessmentTakenForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing assessment taken.
      Parameters:
      assessmentTakenForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - assessmentTakenForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - assessmentTakenForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentOfferedForm did not originate from getAssessmentTakenFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteAssessmentsTaken

      boolean canDeleteAssessmentsTaken()
      Tests if this user can delete AssessmentsTaken . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an AssessmentTaken will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer a delete operations to unauthorized users.
      Returns:
      false if AssessmentTaken deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteAssessmentTaken

      void deleteAssessmentTaken(Id assessmentTakenId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes an AssessmentTaken .
      Parameters:
      assessmentTakenId - the Id of the AssessmentTaken to remove
      Throws:
      NotFoundException - assessmentTakenId not found
      NullArgumentException - assessmentTakenId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • canManageAssessmentTakenAliases

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

      void aliasAssessmentTaken(Id assessmentTakenId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to an AssessmentTaken for the purpose of creating compatibility. The primary Id of the AssessmentTaken is determined by the provider. The new Id is an alias to the primary Id . If the alias is a pointer to another assessment taken, it is reassigned to the given assessment taken Id .
      Parameters:
      assessmentTakenId - the Id of an AssessmentTaken
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - assessmentTakenId not found
      NullArgumentException - assessmentTakenId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.