Skip to content

Commit 1f9c1c1

Browse files
committed
Merge branch 'ltiLaunchUrl' into production
2 parents 02d4d86 + 714af1d commit 1f9c1c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lti/outcome_request.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def post_replace_result(self, score, result_data=None):
8080
8181
'text' : str text
8282
'url' : str url
83+
'ltiLaunchUrl' : str url
8384
'''
8485
self.operation = REPLACE_REQUEST
8586
self.score = score
@@ -89,9 +90,9 @@ def post_replace_result(self, score, result_data=None):
8990
error_msg = ('Dictionary result_data can only have one entry. '
9091
'{0} entries were found.'.format(len(result_data)))
9192
raise InvalidLTIConfigError(error_msg)
92-
elif 'text' not in result_data and 'url' not in result_data:
93+
elif 'text' not in result_data and 'url' not in result_data and 'ltiLaunchUrl' not in result_data:
9394
error_msg = ('Dictionary result_data can only have the key '
94-
'"text" or the key "url".')
95+
'"text" or the key "url" or the key "ltiLaunchUrl".')
9596
raise InvalidLTIConfigError(error_msg)
9697
else:
9798
return self.post_outcome_request()
@@ -234,5 +235,8 @@ def generate_request_xml(self):
234235
elif 'url' in self.result_data:
235236
resultDataURL = etree.SubElement(resultData, 'url')
236237
resultDataURL.text = self.result_data['url']
238+
elif 'ltiLaunchUrl' in self.result_data:
239+
resultDataLaunchURL = etree.SubElement(resultData, 'ltiLaunchUrl')
240+
resultDataLaunchURL.text = self.result_data['ltiLaunchUrl']
237241

238242
return etree.tostring(root, xml_declaration=True, encoding='utf-8')

0 commit comments

Comments
 (0)