@@ -80,6 +80,7 @@ def post_replace_result(self, score, result_data=None):
80
80
81
81
'text' : str text
82
82
'url' : str url
83
+ 'ltiLaunchUrl' : str url
83
84
'''
84
85
self .operation = REPLACE_REQUEST
85
86
self .score = score
@@ -89,9 +90,9 @@ def post_replace_result(self, score, result_data=None):
89
90
error_msg = ('Dictionary result_data can only have one entry. '
90
91
'{0} entries were found.' .format (len (result_data )))
91
92
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 :
93
94
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" .' )
95
96
raise InvalidLTIConfigError (error_msg )
96
97
else :
97
98
return self .post_outcome_request ()
@@ -234,5 +235,8 @@ def generate_request_xml(self):
234
235
elif 'url' in self .result_data :
235
236
resultDataURL = etree .SubElement (resultData , 'url' )
236
237
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' ]
237
241
238
242
return etree .tostring (root , xml_declaration = True , encoding = 'utf-8' )
0 commit comments