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
1c823b37
Commit
1c823b37
authored
Sep 30, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #790 from MITx/feature/bridger/max_grade_cache_fix
Fix to update the max_grade cache on StudentModule
parents
af6dd84a
fd43e943
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
lms/djangoapps/courseware/module_render.py
+8
-1
No files found.
lms/djangoapps/courseware/module_render.py
View file @
1c823b37
...
...
@@ -435,6 +435,10 @@ def modx_dispatch(request, dispatch, location, course_id):
# Don't track state for anonymous users (who don't have student modules)
if
instance_module
is
not
None
:
oldgrade
=
instance_module
.
grade
# The max grade shouldn't change under normal circumstances, but
# sometimes the problem changes with the same name but a new max grade.
# This updates the module if that happens.
old_instance_max_grade
=
instance_module
.
max_grade
old_instance_state
=
instance_module
.
state
old_shared_state
=
shared_module
.
state
if
shared_module
is
not
None
else
None
...
...
@@ -452,9 +456,12 @@ def modx_dispatch(request, dispatch, location, course_id):
# Don't track state for anonymous users (who don't have student modules)
if
instance_module
is
not
None
:
instance_module
.
state
=
instance
.
get_instance_state
()
instance_module
.
max_grade
=
instance
.
max_score
()
if
instance
.
get_score
():
instance_module
.
grade
=
instance
.
get_score
()[
'score'
]
if
instance_module
.
grade
!=
oldgrade
or
instance_module
.
state
!=
old_instance_state
:
if
(
instance_module
.
grade
!=
oldgrade
or
instance_module
.
state
!=
old_instance_state
or
instance_module
.
max_grade
!=
old_instance_max_grade
):
instance_module
.
save
()
if
shared_module
is
not
None
:
...
...
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