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
be69bc3f
Commit
be69bc3f
authored
Feb 24, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
merged pmitros_cut_writes
parents
3deaf6ff
05aad235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
courseware/module_render.py
+7
-4
track/views.py
+2
-1
No files found.
courseware/module_render.py
View file @
be69bc3f
...
@@ -55,6 +55,8 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
...
@@ -55,6 +55,8 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
raise
Http404
raise
Http404
s
=
s
[
0
]
s
=
s
[
0
]
oldgrade
=
s
.
grade
oldstate
=
s
.
state
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
...
@@ -65,9 +67,9 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
...
@@ -65,9 +67,9 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
# Create the module
# Create the module
instance
=
courseware
.
modules
.
get_module_class
(
module
)(
xml
,
instance
=
courseware
.
modules
.
get_module_class
(
module
)(
xml
,
s
.
module_
id
,
id
,
ajax_url
=
ajax_url
,
ajax_url
=
ajax_url
,
state
=
s
.
state
,
state
=
old
state
,
track_function
=
make_track_function
(
request
),
track_function
=
make_track_function
(
request
),
render_function
=
None
)
render_function
=
None
)
# Let the module handle the AJAX
# Let the module handle the AJAX
...
@@ -76,7 +78,8 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
...
@@ -76,7 +78,8 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
s
.
state
=
instance
.
get_state
()
s
.
state
=
instance
.
get_state
()
if
instance
.
get_score
():
if
instance
.
get_score
():
s
.
grade
=
instance
.
get_score
()[
'score'
]
s
.
grade
=
instance
.
get_score
()[
'score'
]
s
.
save
()
if
s
.
grade
!=
oldgrade
or
s
.
state
!=
oldstate
:
s
.
save
()
# Return whatever the module wanted to return to the client/caller
# Return whatever the module wanted to return to the client/caller
return
HttpResponse
(
ajax_return
)
return
HttpResponse
(
ajax_return
)
...
@@ -113,7 +116,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
...
@@ -113,7 +116,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
module_type
=
module_type
,
module_type
=
module_type
,
module_id
=
module_id
,
module_id
=
module_id
,
state
=
instance
.
get_state
())
state
=
instance
.
get_state
())
smod
.
save
()
# This may be optional (at least in the case of no instance in the dB)
smod
.
save
()
module_object_preload
.
append
(
smod
)
module_object_preload
.
append
(
smod
)
# Grab content
# Grab content
content
=
instance
.
get_html
()
content
=
instance
.
get_html
()
...
...
track/views.py
View file @
be69bc3f
...
@@ -21,7 +21,8 @@ def user_track(request):
...
@@ -21,7 +21,8 @@ def user_track(request):
username
=
"anonymous"
username
=
"anonymous"
try
:
try
:
scookie
=
request
.
META
[
'HTTP_COOKIE'
]
scookie
=
request
.
META
[
'HTTP_COOKIE'
]
# Get cookies
scookie
=
";"
.
join
([
c
.
split
(
'='
)[
1
]
for
c
in
scookie
.
split
(
";"
)
if
"sessionid"
in
c
])
.
strip
()
# Extract session ID
except
:
except
:
scookie
=
""
scookie
=
""
...
...
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