Interface AssessmentPartAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AssessmentPartAdminSession extends OsidSession

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

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

The delete operations delete AssessmentParts .

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
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssessmentParts

      boolean canCreateAssessmentParts()
      Tests if this user can create assessment parts. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to unauthorized users.
      Returns:
      false if AssessmentPart creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssessmentPartWithRecordTypes

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

      AssessmentPartForm getAssessmentPartFormForCreateForAssessment(Id assessmentId, Type[] assessmentPartRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment part form for creating new assessment parts for an assessment. A new form should be requested for each create transaction.
      Parameters:
      assessmentId - an assessment Id
      assessmentPartRecordTypes - array of assessment part record types to be included in the create operation or an empty list if none
      Returns:
      the assessment part form
      Throws:
      NotFoundException - assessmentId is not found
      NullArgumentException - assessmentId or assessmentPartRecordTypes 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.
    • createAssessmentPartForAssessment

      AssessmentPart createAssessmentPartForAssessment(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException
      Creates a new assessment part.
      Parameters:
      assessmentPartForm - assessment part form
      Returns:
      the new part
      Throws:
      IllegalStateException - assessmentPartForm already used in a create transaction
      InvalidArgumentException - assessmentPartForm is invalid
      NullArgumentException - assessmentPartForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentPartForm did not originate from getAssessmentPartFormForCreateForAssessment()
      Compliance:
      mandatory - This method must be implemented.
    • getAssessmentPartFormForCreateForAssessmentPart

      AssessmentPartForm getAssessmentPartFormForCreateForAssessmentPart(Id assessmentPartId, Type[] assessmentPartRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment part form for creating new assessment parts under another assessment part. A new form should be requested for each create transaction.
      Parameters:
      assessmentPartId - an assessment part Id
      assessmentPartRecordTypes - array of assessment part record types to be included in the create operation or an empty list if none
      Returns:
      the assessment part form
      Throws:
      NotFoundException - assessmentPartId is not found
      NullArgumentException - assessmentPartId or assessmentPartRecordTypes 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.
    • createAssessmentPartForAssessmentPart

      AssessmentPart createAssessmentPartForAssessmentPart(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException
      Creates a new assessment part.
      Parameters:
      assessmentPartForm - assessment part form
      Returns:
      the new part
      Throws:
      IllegalStateException - assessmentPartForm already used in a create transaction
      InvalidArgumentException - assessmentPartForm is invalid
      NullArgumentException - assessmentPartForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentPartForm did not originate from getAssessmentPartFormForCreateForAssessmentPart()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateAssessmentParts

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

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

      void updateAssessmentPart(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing assessment part.
      Parameters:
      assessmentPartForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - assessmentPartForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - assessmentPartForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - assessmentPartForm did not originate from getAssessmentPartFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteAssessmentParts

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

      void deleteAssessmentPart(Id assessmentPartId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an asessment part and all mapped items.
      Parameters:
      assessmentPartId - the Id of the AssessmentPart
      Throws:
      NotFoundException - assessmentPartId not found
      NullArgumentException - assessmentPartId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • canManageAssessmentPartAliases

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

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