@csrf_exempt
def xqueue_callback(request, course_id, userid, mod_id, dispatch):
 data = request.POST.copy()
 for key in ['xqueue_header', 'xqueue_body']:
  if (key not in data):
   raise Http404
 header = json.loads(data['xqueue_header'])
 if ((not isinstance(header, dict)) or ('lms_key' not in header)):
  raise Http404
 course_key = CourseKey.from_string(course_id)
 with modulestore().bulk_operations(course_key):
  course = modulestore().get_course(course_key, depth=0)
  instance = load_single_xblock(request, userid, course_id, mod_id, course=course)
  data.update({'queuekey': header['lms_key']})
  try:
   instance.handle_ajax(dispatch, data)
   instance.save()
  except:
   log.exception('error processing ajax call')
   raise
  return HttpResponse('')

@ csrf_exempt def xqueue_callback ( request , course_id , userid , mod_id , dispatch ) : data = request . POST . copy ( ) for key in [ 'xqueue_header' , 'xqueue_body' ] : if ( key not in data ) : raise Http404 header = json . loads ( data [ 'xqueue_header' ] ) if ( ( not isinstance ( header , dict ) ) or ( 'lms_key' not in header ) ) : raise Http404 course_key = CourseKey . from_string ( course_id ) with modulestore ( ) . bulk_operations ( course_key ) : course = modulestore ( ) . get_course ( course_key , depth = 0 ) instance = load_single_xblock ( request , userid , course_id , mod_id , course = course ) data . update ( { 'queuekey' : header [ 'lms_key' ] } ) try : instance . handle_ajax ( dispatch , data ) instance . save ( ) except : log . exception ( 'error processing ajax call' ) raise return HttpResponse ( '' )
entry point for graded results from the queueing system .