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
459c1dab
Commit
459c1dab
authored
Dec 12, 2011
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using Ajax URL
parent
b6808c39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
courseware/capa_module.py
+1
-0
courseware/views.py
+6
-1
No files found.
courseware/capa_module.py
View file @
459c1dab
...
...
@@ -43,6 +43,7 @@ class LoncapaModule(XModule):
{
'problem'
:
content
,
'id'
:
self
.
filename
,
'check_button'
:
check_button
,
'ajax_url'
:
self
.
ajax_url
,
})
if
encapsulate
:
html
=
'<div id="main_{id}">'
.
format
(
id
=
self
.
item_id
)
+
html
+
"</div>"
...
...
courseware/views.py
View file @
459c1dab
...
...
@@ -173,8 +173,10 @@ def render_x_module(request, xml_module):
state
=
smod
.
state
# Create a new instance
ajax_url
=
'/modx/'
+
module_type
+
'/'
+
module_id
+
'/'
instance
=
module_class
(
xml_module
.
toxml
(),
module_id
,
ajax_url
=
ajax_url
,
state
=
state
)
# If instance wasn't already in the database, create it
...
...
@@ -201,7 +203,10 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
s
=
s
[
0
]
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
instance
=
modx_modules
[
module
](
s
.
xml
,
s
.
module_id
,
state
=
s
.
state
)
ajax_url
=
'/modx/'
+
module
+
'/'
+
id
+
'/'
instance
=
modx_modules
[
module
](
s
.
xml
,
s
.
module_id
,
ajax_url
=
ajax_url
,
state
=
s
.
state
)
html
=
instance
.
handle_ajax
(
dispatch
,
request
.
GET
)
s
.
state
=
instance
.
get_state
()
s
.
grade
=
instance
.
get_score
()[
'score'
]
...
...
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