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
d0c8722d
Commit
d0c8722d
authored
Jan 24, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert reversed. Database insert vs. update bug fixed
parent
98efb8c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
courseware/module_render.py
+12
-11
No files found.
courseware/module_render.py
View file @
d0c8722d
...
@@ -107,17 +107,17 @@ def render_x_module(user, request, xml_module, module_object_preload):
...
@@ -107,17 +107,17 @@ def render_x_module(user, request, xml_module, module_object_preload):
module_id
=
xml_module
.
get
(
'id'
)
#module_class.id_attribute) or ""
module_id
=
xml_module
.
get
(
'id'
)
#module_class.id_attribute) or ""
# Grab state from database
# Grab state from database
#
s = object_cache(module_object_preload,
s
=
object_cache
(
module_object_preload
,
#
user,
user
,
#
module_type,
module_type
,
#
module_id)
module_id
)
s
=
StudentModule
.
objects
.
filter
(
student
=
request
.
user
,
#
s = StudentModule.objects.filter(student=request.user,
module_id
=
module_id
,
#
module_id=module_id,
module_type
=
module_type
)
#
module_type = module_type)
if
len
(
s
)
==
0
:
#
if len(s) == 0:
s
=
None
#
s=None
else
:
#
else:
s
=
s
[
0
]
#
s=s[0]
if
s
==
None
:
# If nothing in the database...
if
s
==
None
:
# If nothing in the database...
state
=
None
state
=
None
...
@@ -141,6 +141,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
...
@@ -141,6 +141,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
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
()
# This may be optional (at least in the case of no instance in the dB)
module_object_preload
.
append
(
smod
)
# Grab content
# Grab content
content
=
{
'content'
:
instance
.
get_html
(),
content
=
{
'content'
:
instance
.
get_html
(),
"destroy_js"
:
instance
.
get_destroy_js
(),
"destroy_js"
:
instance
.
get_destroy_js
(),
...
...
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