Skip to content

Commit

Permalink
chore: move lti launch tracking from xblock to django view
Browse files Browse the repository at this point in the history
  • Loading branch information
tecoholic committed Jul 23, 2022
1 parent 19daaa7 commit ed4e4b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lti_consumer/lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,13 +1180,6 @@ def lti_1p3_launch_callback(self, request, suffix=''):
Calls the plugin's launch_gate_endpoint and returns the response.
"""
# # emit tracking event
# event = {
# 'lti_version': self.lti_version,
# 'user_roles': user_role,
# 'launch_url': self.lti_1p3_launch_url,
# }
# track_event('xblock.launch_request', event)
if self.lti_version != "lti_1p3":
return Response(status=404)

Expand Down
7 changes: 7 additions & 0 deletions lti_consumer/plugin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
from lti_consumer.lti_1p3.extensions.rest_framework.utils import IgnoreContentNegotiation
from lti_consumer.plugin import compat
from lti_consumer.utils import _
from lti_consumer.track import track_event


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -244,6 +245,12 @@ def launch_gate_endpoint(request, suffix=None): # pylint: disable=unused-argume
preflight_response=preflight_response
)
})
event = {
'lti_version': lti_config.version,
'user_roles': user_role,
'launch_url': context['launch_url']
}
track_event('xblock.launch_request', event)

return render(request, 'html/lti_1p3_launch.html', context)
except Lti1p3Exception as exc:
Expand Down

0 comments on commit ed4e4b3

Please sign in to comment.