Commit 3d8ee671 by kimth

Adjust comments

parent e4609f3a
...@@ -873,7 +873,7 @@ class CodeResponse(LoncapaResponse): ...@@ -873,7 +873,7 @@ class CodeResponse(LoncapaResponse):
queue_name=self.queue_name) queue_name=self.queue_name)
# Generate body # Generate body
# NOTE: Currently specialized to 6.00x's pyxservers, which follows the ExternalResponse interface # NOTE: Currently specialized to 6.00x's pyxserver, which follows the ExternalResponse interface
contents = {'xml': etree.tostring(self.xml, pretty_print=True), contents = {'xml': etree.tostring(self.xml, pretty_print=True),
'edX_cmd': 'get_score', 'edX_cmd': 'get_score',
'edX_tests': self.tests, 'edX_tests': self.tests,
......
...@@ -47,11 +47,11 @@ class @Problem ...@@ -47,11 +47,11 @@ class @Problem
$(placeholder).remove() $(placeholder).remove()
### ###
# 'check_fd' uses FormData to allow file submissions, in addition to simple, # 'check_fd' uses FormData to allow file submissions in the 'problem_check' dispatch,
# querystring-based answers, in the 'problem_check' dispatch. # in addition to simple querystring-based answers
# #
# NOTE: The dispatch 'problem_check' is being singled out for the use of FormData; # NOTE: The dispatch 'problem_check' is being singled out for the use of FormData;
# perhaps preferable to consolidate all dispatches to use FormData consistently # maybe preferable to consolidate all dispatches to use FormData
### ###
check_fd: => check_fd: =>
Logger.log 'problem_check', @answers Logger.log 'problem_check', @answers
...@@ -63,15 +63,14 @@ class @Problem ...@@ -63,15 +63,14 @@ class @Problem
fd = new FormData() fd = new FormData()
# For each file input, allow a single file submission, # For each file input, allow a single file submission,
# routed to Django 'request.FILES' # which is routed to Django 'request.FILES'
@$('input:file').each (index, element) -> @$('input:file').each (index, element) ->
if element.files[0] instanceof File if element.files[0] instanceof File
fd.append(element.id, element.files[0]) fd.append(element.id, element.files[0])
else else
fd.append(element.id, '') # Even if no file selected, need to include input id fd.append(element.id, '') # Even if no file selected, need to include input id
# Simple (non-file) answers, # Simple (non-file) answers, which is routed to Django 'request.POST'
# routed to Django 'request.POST'
fd.append('__answers_querystring', @answers) fd.append('__answers_querystring', @answers)
settings = settings =
......
...@@ -276,7 +276,7 @@ def modx_dispatch(request, dispatch=None, id=None): ...@@ -276,7 +276,7 @@ def modx_dispatch(request, dispatch=None, id=None):
post = request.POST.copy() post = request.POST.copy()
# Catch the use of FormData in xmodule frontend for 'problem_check'. After this block, # Catch the use of FormData in xmodule frontend for 'problem_check'. After this block,
# the 'post' dict is functionally equivalent before- and after- the use of FormData # the 'post' dict is functionally equivalent before and after the use of FormData
# TODO: A more elegant solution? # TODO: A more elegant solution?
if post.has_key('__answers_querystring'): if post.has_key('__answers_querystring'):
qs = post.pop('__answers_querystring')[0] qs = post.pop('__answers_querystring')[0]
......
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