Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
8ae20e38
Commit
8ae20e38
authored
8 years ago
by
Nimisha Asthagiri
Browse files
Options
Downloads
Patches
Plain Diff
Add grades feature check to subsection task handler.
parent
f03e2ce6
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/grades/tasks.py
+3
-1
3 additions, 1 deletion
lms/djangoapps/grades/tasks.py
lms/djangoapps/grades/tests/test_tasks.py
+1
-1
1 addition, 1 deletion
lms/djangoapps/grades/tests/test_tasks.py
with
4 additions
and
2 deletions
lms/djangoapps/grades/tasks.py
+
3
−
1
View file @
8ae20e38
...
...
@@ -32,8 +32,10 @@ def recalculate_subsection_grade(user_id, course_id, usage_id, only_if_higher):
be updated only if the new grade is higher than the previous
value.
"""
course_key
=
CourseLocator
.
from_string
(
course_id
)
if
not
PersistentGradesEnabledFlag
.
feature_enabled
(
course_id
):
return
course_key
=
CourseLocator
.
from_string
(
course_id
)
student
=
User
.
objects
.
get
(
id
=
user_id
)
scored_block_usage_key
=
UsageKey
.
from_string
(
usage_id
).
replace
(
course_key
=
course_key
)
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/grades/tests/test_tasks.py
+
1
−
1
View file @
8ae20e38
...
...
@@ -178,7 +178,7 @@ class RecalculateSubsectionGradeTest(ModuleStoreTestCase):
with
self
.
store
.
default_store
(
default_store
):
self
.
set_up_course
(
enable_subsection_grades
=
False
)
self
.
assertFalse
(
PersistentGradesEnabledFlag
.
feature_enabled
(
self
.
course
.
id
))
with
check_mongo_calls
(
2
)
and
self
.
assertNumQueries
(
2
):
with
check_mongo_calls
(
2
)
and
self
.
assertNumQueries
(
0
):
recalculate_subsection_grade
.
apply
(
args
=
tuple
(
self
.
score_changed_kwargs
.
values
()))
@skip
(
"
Pending completion of TNL-5089
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment