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
0d824c6c
Commit
0d824c6c
authored
Aug 08, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move modx_dispatch URL calls into the course
parent
ecbb0ee3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
common/lib/xmodule/xmodule/modulestore/__init__.py
+7
-0
lms/djangoapps/courseware/module_render.py
+11
-3
lms/urls.py
+3
-2
No files found.
common/lib/xmodule/xmodule/modulestore/__init__.py
View file @
0d824c6c
...
...
@@ -190,6 +190,13 @@ class Location(_LocationBase):
return
"Location
%
s"
%
repr
(
tuple
(
self
))
@property
def
course_id
(
self
):
"""Return the ID of the Course that this item belongs to by looking
at the location URL hierachy"""
return
"/"
.
join
([
self
.
org
,
self
.
course
,
self
.
name
])
class
ModuleStore
(
object
):
"""
An abstract interface for a database backend that stores XModuleDescriptor
...
...
lms/djangoapps/courseware/module_render.py
View file @
0d824c6c
...
...
@@ -2,6 +2,7 @@ import json
import
logging
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.http
import
Http404
from
django.http
import
HttpResponse
from
django.views.decorators.csrf
import
csrf_exempt
...
...
@@ -125,7 +126,7 @@ def get_module(user, request, location, student_module_cache, position=None):
'''
descriptor
=
modulestore
()
.
get_item
(
location
)
#TODO Only check the cache if this module can possibly have state
instance_module
=
None
shared_module
=
None
...
...
@@ -146,7 +147,14 @@ def get_module(user, request, location, student_module_cache, position=None):
# TODO (vshnayder): fix hardcoded urls (use reverse)
# Setup system context for module instance
ajax_url
=
settings
.
MITX_ROOT_URL
+
'/modx/'
+
descriptor
.
location
.
url
()
+
'/'
ajax_url
=
reverse
(
'modx_dispatch'
,
kwargs
=
dict
(
course_id
=
descriptor
.
location
.
course_id
,
id
=
descriptor
.
location
.
url
(),
dispatch
=
''
),
)
# ajax_url = settings.MITX_ROOT_URL + '/modx/' + descriptor.location.url() + '/'
# Fully qualified callback URL for external queueing system
xqueue_callback_url
=
(
request
.
build_absolute_uri
(
'/'
)
+
settings
.
MITX_ROOT_URL
+
...
...
@@ -308,7 +316,7 @@ def xqueue_callback(request, userid, id, dispatch):
return
HttpResponse
(
""
)
def
modx_dispatch
(
request
,
dispatch
=
None
,
id
=
None
):
def
modx_dispatch
(
request
,
dispatch
=
None
,
id
=
None
,
course_id
=
None
):
''' Generic view for extensions. This is where AJAX calls go.
Arguments:
...
...
lms/urls.py
View file @
0d824c6c
...
...
@@ -2,7 +2,6 @@ from django.conf import settings
from
django.conf.urls
import
patterns
,
include
,
url
from
django.contrib
import
admin
from
django.conf.urls.static
import
static
import
django.contrib.auth.views
# Uncomment the next two lines to enable the admin:
...
...
@@ -101,7 +100,9 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^masquerade/'
,
include
(
'masquerade.urls'
)),
url
(
r'^jump_to/(?P<location>.*)$'
,
'courseware.views.jump_to'
,
name
=
"jump_to"
),
url
(
r'^modx/(?P<id>.*?)/(?P<dispatch>[^/]*)$'
,
'courseware.module_render.modx_dispatch'
),
#reset_problem'),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/modx/(?P<id>.*?)/(?P<dispatch>[^/]*)$'
,
'courseware.module_render.modx_dispatch'
,
name
=
'modx_dispatch'
),
url
(
r'^xqueue/(?P<userid>[^/]*)/(?P<id>.*?)/(?P<dispatch>[^/]*)$'
,
'courseware.module_render.xqueue_callback'
),
url
(
r'^change_setting$'
,
'student.views.change_setting'
),
...
...
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