Commit 423d7de5 by Chris Dodge

change callback schema based on what we're seeing

parent 362240ff
...@@ -123,15 +123,11 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider): ...@@ -123,15 +123,11 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
) )
log.info(log_msg) log.info(log_msg)
# payload from SoftwareSecure is a JSON payload
# which has been converted to a dict by our caller
data = payload['payload']
# what we consider the external_id is SoftwareSecure's 'ssiRecordLocator' # what we consider the external_id is SoftwareSecure's 'ssiRecordLocator'
external_id = data['examMetaData']['ssiRecordLocator'] external_id = payload['examMetaData']['ssiRecordLocator']
# what we consider the attempt_code is SoftwareSecure's 'examCode' # what we consider the attempt_code is SoftwareSecure's 'examCode'
attempt_code = data['examMetaData']['examCode'] attempt_code = payload['examMetaData']['examCode']
# do a lookup on the attempt by examCode, and compare the # do a lookup on the attempt by examCode, and compare the
# passed in ssiRecordLocator and make sure it matches # passed in ssiRecordLocator and make sure it matches
...@@ -180,8 +176,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider): ...@@ -180,8 +176,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
raise ProctoredExamReviewAlreadyExists(err_msg) raise ProctoredExamReviewAlreadyExists(err_msg)
# do some limited parsing of the JSON payload # do some limited parsing of the JSON payload
review_status = data['reviewStatus'] review_status = payload['reviewStatus']
video_review_link = data['videoReviewLink'] video_review_link = payload['videoReviewLink']
# make a new record in the review table # make a new record in the review table
review = ProctoredExamSoftwareSecureReview( review = ProctoredExamSoftwareSecureReview(
...@@ -193,10 +189,10 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider): ...@@ -193,10 +189,10 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
review.save() review.save()
# go through and populate all of the specific comments # go through and populate all of the specific comments
for comment in data.get('webCamComments', []): for comment in payload.get('webCamComments', []):
self._save_review_comment(review, comment) self._save_review_comment(review, comment)
for comment in data.get('desktopComments', []): for comment in payload.get('desktopComments', []):
self._save_review_comment(review, comment) self._save_review_comment(review, comment)
def _save_review_comment(self, review, comment): def _save_review_comment(self, review, comment):
......
...@@ -4,8 +4,6 @@ Some canned data for SoftwareSecure callback testing. ...@@ -4,8 +4,6 @@ Some canned data for SoftwareSecure callback testing.
TEST_REVIEW_PAYLOAD = ''' TEST_REVIEW_PAYLOAD = '''
{ {
"orgCallbackURL": "http://reds.rpexams.com/reviewerdatatransfer",
"payload": {
"examDate": "Jul 15 2015 1:13AM", "examDate": "Jul 15 2015 1:13AM",
"examProcessingStatus": "Review Completed", "examProcessingStatus": "Review Completed",
"examTakerEmail": "4d07a01a-1502-422e-b943-93ac04dc6ced", "examTakerEmail": "4d07a01a-1502-422e-b943-93ac04dc6ced",
...@@ -94,5 +92,4 @@ TEST_REVIEW_PAYLOAD = ''' ...@@ -94,5 +92,4 @@ TEST_REVIEW_PAYLOAD = '''
} }
] ]
} }
}
''' '''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment