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
236c3dc5
Commit
236c3dc5
authored
Aug 02, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modx_dispatch handles new/old problem_check ajax
parent
51fc69da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-0
lms/djangoapps/courseware/module_render.py
+13
-11
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
236c3dc5
...
...
@@ -14,6 +14,7 @@ class @Problem
window
.
update_schematics
()
@
$
(
'section.action input:button'
).
click
@
refreshAnswers
@
$
(
'section.action input.check'
).
click
@
check_fd
#@$('section.action input.check').click @check
@
$
(
'section.action input.reset'
).
click
@
reset
@
$
(
'section.action input.show'
).
click
@
show
@
$
(
'section.action input.save'
).
click
@
save
...
...
lms/djangoapps/courseware/module_render.py
View file @
236c3dc5
import
json
import
logging
from
urlparse
import
parse_qs
from
django.conf
import
settings
from
django.http
import
Http404
...
...
@@ -14,6 +15,7 @@ from static_replace import replace_urls
from
xmodule.exceptions
import
NotFoundError
from
xmodule.x_module
import
ModuleSystem
from
xmodule_modifiers
import
replace_static_urls
,
add_histogram
,
wrap_xmodule
import
xqueue_interface
log
=
logging
.
getLogger
(
"mitx.courseware"
)
...
...
@@ -270,16 +272,16 @@ def modx_dispatch(request, dispatch=None, id=None):
- id -- the module id. Used to look up the XModule instance
'''
# ''' (fix emacs broken parsing)
p
rint
' THK: module_render.modx_dispatch'
print
dispatch
print
request
.
POST
.
keys
()
print
request
.
FILES
.
keys
()
if
request
.
POST
.
has_key
(
'answers'
):
print
request
.
POST
[
'answers'
]
for
filename
in
request
.
FILES
.
keys
():
uploadedFile
=
request
.
FILES
.
get
(
filename
)
print
uploadedFile
.
read
()
p
ost
=
request
.
POST
.
copy
()
# Catch the use of FormData in xmodule frontend. After this block, the 'post' dict
# is functionally equivalent before- and after- the use of FormData
# TODO: A more elegant solution?
if
request
.
POST
.
has_key
(
'_answers_querystring'
):
post
=
parse_qs
(
request
.
POST
.
get
(
'_answers_querystring'
))
for
key
in
post
.
keys
():
post
[
key
]
=
post
[
key
][
0
]
# parse_qs returns { key: list }
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
)
...
...
@@ -292,7 +294,7 @@ def modx_dispatch(request, dispatch=None, id=None):
# Let the module handle the AJAX
try
:
ajax_return
=
instance
.
handle_ajax
(
dispatch
,
request
.
POST
)
ajax_return
=
instance
.
handle_ajax
(
dispatch
,
post
)
except
NotFoundError
:
log
.
exception
(
"Module indicating to user that request doesn't exist"
)
raise
Http404
...
...
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