Interface AssessmentBasicAuthoringSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to manage assessment items in an assessment. This session is used for simple assessments without sections or parts. Updating the items on an assessment authored with sections and parts may result in an error.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an existingItemto an assessment.booleanTests if this user can author assessments.getBank()Gets theBankassociated with this session.Gets theBankIdassociated with this session.Gets the items in sequence from an assessment.voidMoves an existing item to follow another item in an assessment.voidorderItems(Id[] itemIds, Id assessmentId) Sequences existing items in an assessment.voidremoveItem(Id assessmentId, Id itemId) Removes anItemfrom this assessment.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getBankId
Id getBankId()Gets theBankIdassociated with this session.- Returns:
- the
Bank Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBank
Gets theBankassociated with this session.- Returns:
- the
Bankassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canAuthorAssessments
boolean canAuthorAssessments()Tests if this user can author assessments. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer authoring operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getItems
ItemList getItems(Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the items in sequence from an assessment.- Parameters:
assessmentId- theIdof theAssessment- Returns:
- list of items
- Throws:
NotFoundException-assessmentidnot foundNullArgumentException-assessmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
addItem
void addItem(Id assessmentId, Id itemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingItemto an assessment.- Parameters:
assessmentId- theIdof theAssessmentitemId- theIdof theItem- Throws:
NotFoundException-assessmentIdoritemIdnot foundNullArgumentException-assessmentIdoritemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
removeItem
void removeItem(Id assessmentId, Id itemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anItemfrom this assessment.- Parameters:
assessmentId- theIdof theAssessmentitemId- theIdof theItem- Throws:
NotFoundException-assessmentIdoritemIdnot found oritemIdnot onassessmentidNullArgumentException-assessmentIdoritemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
moveItem
void moveItem(Id assessmentId, Id itemId, Id precedingItemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Moves an existing item to follow another item in an assessment.- Parameters:
assessmentId- theIdof theAssessmentitemId- theIdof anItemprecedingItemId- theIdof a preceedingItemin the sequence- Throws:
NotFoundException-assessmentIdis not found, oritemIdorprecedingItemIdnot onassessmentIdNullArgumentException-assessmentId, itemIdorprecedingItemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
orderItems
void orderItems(Id[] itemIds, Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Sequences existing items in an assessment.- Parameters:
itemIds- theIdof theItemsassessmentId- theIdof theAssessment- Throws:
NotFoundException-assessmentIdis not found or anitemIdis not onassessmentIdNullArgumentException-assessmentIdoritemIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-