diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index 18ff2d8305..b0bb760753 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -285,12 +285,12 @@ def modx_dispatch(request, dispatch=None, id=None): qsdict[key] = qsdict[key][0] # parse_qs returns { key: list } post.update(qsdict) - # Check for submitted files + # Check for submitted files, send it to S3 immediately. LMS/xqueue manipulates only the + # pointer, which is saved as the student "submission" if request.FILES: - print 'Got files!' - - print post.keys() - print request.FILES.keys() + for inputfile_id in request.FILES.keys(): + s3_identifier = xqueue_interface.upload_files_to_s3(request.FILES[inputfile_id]) + post.update({inputfile_id: s3_identifier}) student_module_cache = StudentModuleCache(request.user, modulestore().get_item(id)) instance, instance_module, shared_module, module_type = get_module(request.user, request, id, student_module_cache) diff --git a/lms/djangoapps/courseware/xqueue_interface.py b/lms/djangoapps/courseware/xqueue_interface.py index c9042c3f1e..f21c4ad9bb 100644 --- a/lms/djangoapps/courseware/xqueue_interface.py +++ b/lms/djangoapps/courseware/xqueue_interface.py @@ -8,8 +8,9 @@ import requests XQUEUE_LMS_AUTH = ('LMS','PaloAltoCA') # (username, password) XQUEUE_SUBMIT_URL = 'http://xqueue.edx.org' -def upload_files_to_s3(): +def upload_files_to_s3(submission_file): print ' THK: xqueue_interface.upload_files_to_s3' + return '' def make_xheader(lms_callback_url, lms_key, queue_name):