Commit f162ba8b by kimth

Moved xqueue_callback URLs into the course

parent 03bd7595
...@@ -157,9 +157,13 @@ def get_module(user, request, location, student_module_cache, position=None): ...@@ -157,9 +157,13 @@ def get_module(user, request, location, student_module_cache, position=None):
# ajax_url = settings.MITX_ROOT_URL + '/modx/' + descriptor.location.url() + '/' # ajax_url = settings.MITX_ROOT_URL + '/modx/' + descriptor.location.url() + '/'
# Fully qualified callback URL for external queueing system # Fully qualified callback URL for external queueing system
xqueue_callback_url = (request.build_absolute_uri('/') + settings.MITX_ROOT_URL + xqueue_callback_url = request.build_absolute_uri('/')[:-1] # Trailing slash provided by reverse
'xqueue/' + str(user.id) + '/' + descriptor.location.url() + '/' + xqueue_callback_url += reverse('xqueue_callback',
'score_update') kwargs=dict(course_id=descriptor.location.course_id,
userid=str(user.id),
id=descriptor.location.url(),
dispatch='score_update'),
)
# Default queuename is course-specific and is derived from the course that # Default queuename is course-specific and is derived from the course that
# contains the current module. # contains the current module.
...@@ -265,7 +269,7 @@ def get_shared_instance_module(user, module, student_module_cache): ...@@ -265,7 +269,7 @@ def get_shared_instance_module(user, module, student_module_cache):
return None return None
@csrf_exempt @csrf_exempt
def xqueue_callback(request, userid, id, dispatch): def xqueue_callback(request, course_id, userid, id, dispatch):
''' '''
Entry point for graded results from the queueing system. Entry point for graded results from the queueing system.
''' '''
......
...@@ -103,7 +103,9 @@ if settings.COURSEWARE_ENABLED: ...@@ -103,7 +103,9 @@ if settings.COURSEWARE_ENABLED:
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/modx/(?P<id>.*?)/(?P<dispatch>[^/]*)$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/modx/(?P<id>.*?)/(?P<dispatch>[^/]*)$',
'courseware.module_render.modx_dispatch', 'courseware.module_render.modx_dispatch',
name='modx_dispatch'), name='modx_dispatch'),
url(r'^xqueue/(?P<userid>[^/]*)/(?P<id>.*?)/(?P<dispatch>[^/]*)$', 'courseware.module_render.xqueue_callback'), url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/xqueue/(?P<userid>[^/]*)/(?P<id>.*?)/(?P<dispatch>[^/]*)$',
'courseware.module_render.xqueue_callback',
name='xqueue_callback'),
url(r'^change_setting$', 'student.views.change_setting'), url(r'^change_setting$', 'student.views.change_setting'),
# TODO: These views need to be updated before they work # TODO: These views need to be updated before they work
......
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