Interface SecureDeliveryServiceAPI
-
public interface SecureDeliveryServiceAPI- Author:
- Luis Camargo (lcamargo@respondus.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSecureDeliveryServiceAPI.Phasestatic classSecureDeliveryServiceAPI.PhaseStatus
-
Field Summary
Fields Modifier and Type Field Description static StringEXITPWD_KEYstatic StringMODULE_KEYstatic StringNONE_IDstatic StringTITLE_DECORATION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringdecryptPassword(String moduleId, String password)Uses the module specified to decrypt the exit password.StringencryptPassword(String moduleId, String password)Uses the module specified to encrypt the exit password before storing it on the assessment settings.Optional<String>getAlternativeDeliveryUrl(String moduleId, Long assessmentId, String uid)StringgetHTMLFragment(String moduleId, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request, SecureDeliveryServiceAPI.Phase phase, SecureDeliveryServiceAPI.PhaseStatus status, Locale locale)Returns an HTML appropriate for the combination of parameters.StringgetInitialHTMLFragments(javax.servlet.http.HttpServletRequest request, Locale locale)Returns the initial HTML fragments for all active modules.Optional<String>getInstructorReviewUrl(String moduleId, Long assessmentId, String studentId)SecureDeliveryModuleIfcgetModuleReference(String moduleId, Object context)Helper method to obtain a reference to the runtime instance of the module specified.SortedSet<RegisteredSecureDeliveryModuleIfc>getSecureDeliveryModules(Locale locale)Optional<String>getSecureDeliveryServiceNameForModule(String moduleId, Locale locale)Gets the name of the secure delivery service associated with the specified moduleStringgetTitleDecoration(String moduleId, Locale locale)booleanisSecureDeliveryAvaliable()booleanisSecureDeliveryAvaliable(Long publishedAssessmentId)booleanisSecureDeliveryModuleAvailable(String moduleId)SecureDeliveryServiceAPI.PhaseStatusvalidatePhase(String moduleId, SecureDeliveryServiceAPI.Phase phase, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request)Checks with the module specified by moduleId if the current delivery phase can continue.
-
-
-
Field Detail
-
MODULE_KEY
static final String MODULE_KEY
- See Also:
- Constant Field Values
-
EXITPWD_KEY
static final String EXITPWD_KEY
- See Also:
- Constant Field Values
-
TITLE_DECORATION
static final String TITLE_DECORATION
- See Also:
- Constant Field Values
-
NONE_ID
static final String NONE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSecureDeliveryAvaliable
boolean isSecureDeliveryAvaliable()
- Returns:
- true if at least one secure delivery module (other than NONE_ID) is available. A secure delivery module is available if the plugin that provides it was successfully loaded.
-
isSecureDeliveryModuleAvailable
boolean isSecureDeliveryModuleAvailable(String moduleId)
- Parameters:
moduleId-- Returns:
- true if the module with moduleId is available. NONE_ID is always available.
-
getSecureDeliveryModules
SortedSet<RegisteredSecureDeliveryModuleIfc> getSecureDeliveryModules(Locale locale)
- Returns:
- A set of RegisteredSecureDeliveryModuleIfc entries with the module name internationalized for the given locale. The list always includes NONE_ID as its first element. Others are ordered alphabetically by their name.
-
getTitleDecoration
String getTitleDecoration(String moduleId, Locale locale)
- Parameters:
moduleId-locale-- Returns:
- The title decoration for the given module and locale. Returns empty string if moduleId is NONE_ID, null, not available or disabled. The title decoration provides a visual indication that the assesment requires a particular secure delivery module.
-
validatePhase
SecureDeliveryServiceAPI.PhaseStatus validatePhase(String moduleId, SecureDeliveryServiceAPI.Phase phase, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request)
Checks with the module specified by moduleId if the current delivery phase can continue. Returns SUCCESS if moduleId is null or NONE_ID or if the module is no longer available or disabled.- Parameters:
moduleId-phase-assessment-request-- Returns:
-
getInitialHTMLFragments
String getInitialHTMLFragments(javax.servlet.http.HttpServletRequest request, Locale locale)
Returns the initial HTML fragments for all active modules. The fragments are inserted into the assessment list.- Parameters:
request-locale-- Returns:
-
getHTMLFragment
String getHTMLFragment(String moduleId, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request, SecureDeliveryServiceAPI.Phase phase, SecureDeliveryServiceAPI.PhaseStatus status, Locale locale)
Returns an HTML appropriate for the combination of parameters. The fragment is injected during delivery. Returns empty string if module id is null or NONE_ID or if the module is no longer available or disabled.- Parameters:
moduleId-assessment-request-phase-status-locale-- Returns:
-
encryptPassword
String encryptPassword(String moduleId, String password)
Uses the module specified to encrypt the exit password before storing it on the assessment settings. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.- Parameters:
moduleId-password-- Returns:
- the encrypted password
-
decryptPassword
String decryptPassword(String moduleId, String password)
Uses the module specified to decrypt the exit password. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.- Parameters:
moduleId-password-- Returns:
- the plain text password
-
getModuleReference
SecureDeliveryModuleIfc getModuleReference(String moduleId, Object context)
Helper method to obtain a reference to the runtime instance of the module specified. The context object provided is passed to the module itself for validation and the reference is only returned if the module validation is successful. How the actual context type and how it's validated is up to each module implementation.- Parameters:
moduleId-context-- Returns:
- the reference. null if the module is not avaliable or if the module rejected the context
-
getAlternativeDeliveryUrl
Optional<String> getAlternativeDeliveryUrl(String moduleId, Long assessmentId, String uid)
-
getInstructorReviewUrl
Optional<String> getInstructorReviewUrl(String moduleId, Long assessmentId, String studentId)
-
isSecureDeliveryAvaliable
boolean isSecureDeliveryAvaliable(Long publishedAssessmentId)
-
-