Commit 3b3482b3 by kimth

Skeleton for S3 upload by LMS

parent 688f8914
...@@ -285,12 +285,12 @@ def modx_dispatch(request, dispatch=None, id=None): ...@@ -285,12 +285,12 @@ def modx_dispatch(request, dispatch=None, id=None):
qsdict[key] = qsdict[key][0] # parse_qs returns { key: list } qsdict[key] = qsdict[key][0] # parse_qs returns { key: list }
post.update(qsdict) 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: if request.FILES:
print 'Got files!' for inputfile_id in request.FILES.keys():
s3_identifier = xqueue_interface.upload_files_to_s3(request.FILES[inputfile_id])
print post.keys() post.update({inputfile_id: s3_identifier})
print request.FILES.keys()
student_module_cache = StudentModuleCache(request.user, modulestore().get_item(id)) 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) instance, instance_module, shared_module, module_type = get_module(request.user, request, id, student_module_cache)
......
...@@ -8,8 +8,9 @@ import requests ...@@ -8,8 +8,9 @@ import requests
XQUEUE_LMS_AUTH = ('LMS','PaloAltoCA') # (username, password) XQUEUE_LMS_AUTH = ('LMS','PaloAltoCA') # (username, password)
XQUEUE_SUBMIT_URL = 'http://xqueue.edx.org' 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' print ' THK: xqueue_interface.upload_files_to_s3'
return ''
def make_xheader(lms_callback_url, lms_key, queue_name): def make_xheader(lms_callback_url, lms_key, queue_name):
......
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