Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6004aa73
Commit
6004aa73
authored
Aug 03, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modx_dispatch combines file and non-file submission into single answer dict
parent
75e7693c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
lms/djangoapps/courseware/module_render.py
+13
-14
No files found.
lms/djangoapps/courseware/module_render.py
View file @
6004aa73
...
@@ -273,24 +273,23 @@ def modx_dispatch(request, dispatch=None, id=None):
...
@@ -273,24 +273,23 @@ def modx_dispatch(request, dispatch=None, id=None):
'''
'''
# ''' (fix emacs broken parsing)
# ''' (fix emacs broken parsing)
post
=
request
.
POST
.
copy
()
# Check for submitted files
post
=
dict
()
if
request
.
FILES
:
for
inputfile_id
in
request
.
FILES
.
keys
():
post
[
inputfile_id
]
=
request
.
FILES
[
inputfile_id
]
# 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'
):
for
key
in
request
.
POST
.
keys
():
qs
=
post
.
pop
(
'__answers_querystring'
)[
0
]
if
key
==
'__answers_querystring'
:
qsdict
=
parse_qs
(
qs
,
keep_blank_values
=
True
)
qs
=
request
.
POST
.
get
(
key
)
for
key
in
qsdict
.
keys
():
qsdict
=
parse_qs
(
qs
,
keep_blank_values
=
True
)
qsdict
[
key
]
=
qsdict
[
key
][
0
]
# parse_qs returns { key: list }
for
qskey
in
qsdict
.
keys
():
post
.
update
(
qsdict
)
post
[
qskey
]
=
qsdict
[
qskey
][
0
]
# parse_qs returns {key: list}
else
:
# Check for submitted files, send it to S3 immediately. LMS/xqueue manipulates only the
post
[
key
]
=
request
.
POST
.
get
(
key
)
# pointer, which is saved as the student "submission"
if
request
.
FILES
:
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
))
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment