org.sakaiproject.service.gradebook.shared
Interface ExternalAssignmentProvider


public interface ExternalAssignmentProvider

Provider model to integrate external assessment sources with the gradebook. Its present use is to provide advice about activity grouping and visibility so that learners are not shown activities in which they cannot participate. https://jira.sakaiproject.org/browse/SAK-19668

Since:
2.9.0

Method Summary
 Map<String,List<String>> getAllExternalAssignments(String gradebookUid, Collection<String> studentIds)
          Retrieve all assignments for a gradebook that are marked as externally maintained and are (potentially variably) visible to a set of users.
 String getAppKey()
          Get the application identifier for this provider.
 List<String> getExternalAssignmentsForCurrentUser(String gradebookUid)
          Retrieve all assignments for a gradebook that are marked as externally maintained and are visible to the current user.
 boolean isAssignmentDefined(String id)
          Check if an assignment/assessment exists with the given identifier.
 boolean isAssignmentGrouped(String id)
          Check if the given assignment is grouped.
 boolean isAssignmentVisible(String id, String userId)
          Check if the given assignment is visible to the given user.
 

Method Detail

getAppKey

String getAppKey()
Get the application identifier for this provider. This must be unique to the external tool/service for proper operation.


isAssignmentDefined

boolean isAssignmentDefined(String id)
Check if an assignment/assessment exists with the given identifier. This will be in the form that is supplied to the Gradebook, so it will need to be parsed. If the prefix is not recognized as matching for this service, false is expected to be returned, even if there may be an assignment with the prefixed id. Note that this may seem strange but it is required because services do not currently register their prefixes with the Gradebook, so the external IDs are completely opaque and do not identify their source.


isAssignmentGrouped

boolean isAssignmentGrouped(String id)
Check if the given assignment is grouped. Note that this will be a prefixed ID and must be parsed.

Parameters:
id - The prefixed external ID as registered with Gradebook

isAssignmentVisible

boolean isAssignmentVisible(String id,
                            String userId)
Check if the given assignment is visible to the given user. The primary use of this check is to see if groups are in effect for the assignment and whether or not the user can see the item.

Parameters:
id - The prefixed external ID as registered with Gradebook
userId - The internal user ID for the user to check

getExternalAssignmentsForCurrentUser

List<String> getExternalAssignmentsForCurrentUser(String gradebookUid)
Retrieve all assignments for a gradebook that are marked as externally maintained and are visible to the current user.

Parameters:
gradebookUid - The gradebook's unique identifier
Returns:
A list of IDs (as for externalId) of assignments visible to the current user

getAllExternalAssignments

Map<String,List<String>> getAllExternalAssignments(String gradebookUid,
                                                   Collection<String> studentIds)
Retrieve all assignments for a gradebook that are marked as externally maintained and are (potentially variably) visible to a set of users.

Parameters:
gradebookUid - The gradebook's unique identifier
studentIds - The collection of user IDs to search/filter for
Returns:
A map of Student ID to list of external IDs of assignments visible to each user


Copyright © 2003-2013 Sakai Project. All Rights Reserved.