Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
4e0b3d3b
Commit
4e0b3d3b
authored
6 years ago
by
Albert St. Aubin
Browse files
Options
Downloads
Patches
Plain Diff
Correctly passing course key in the JSON object to async
[LEARNER-5123]
parent
879ba582
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/grades/signals/handlers.py
+7
-6
7 additions, 6 deletions
lms/djangoapps/grades/signals/handlers.py
lms/djangoapps/grades/tasks.py
+5
-3
5 additions, 3 deletions
lms/djangoapps/grades/tasks.py
with
12 additions
and
9 deletions
lms/djangoapps/grades/signals/handlers.py
+
7
−
6
View file @
4e0b3d3b
...
...
@@ -4,17 +4,18 @@ Grades related signals.
from
contextlib
import
contextmanager
from
logging
import
getLogger
import
six
from
courseware.model_data
import
get_score
,
set_score
from
django.dispatch
import
receiver
from
submissions.models
import
score_reset
,
score_set
from
xblock.scorable
import
ScorableXBlockMixin
,
Score
from
openedx.core.djangoapps.course_groups.signals.signals
import
COHORT_MEMBERSHIP_UPDATED
from
openedx.core.lib.grade_utils
import
is_score_higher_or_equal
from
student.models
import
user_by_anonymous_id
from
student.signals
import
ENROLLMENT_TRACK_UPDATED
from
submissions.models
import
score_reset
,
score_set
from
track.event_transaction_utils
import
get_event_transaction_id
,
get_event_transaction_type
from
util.date_utils
import
to_timestamp
from
xblock.scorable
import
ScorableXBlockMixin
,
Score
from
.signals
import
(
PROBLEM_RAW_SCORE_CHANGED
,
PROBLEM_WEIGHTED_SCORE_CHANGED
,
...
...
@@ -22,9 +23,9 @@ from .signals import (
SUBSECTION_SCORE_CHANGED
,
SUBSECTION_OVERRIDE_CHANGED
,
)
from
..
import
events
from
..constants
import
ScoreDatabaseTableEnum
from
..course_grade_factory
import
CourseGradeFactory
from
..
import
events
from
..scores
import
weighted_score
from
..tasks
import
(
RECALCULATE_GRADE_DELAY_SECONDS
,
...
...
@@ -247,7 +248,7 @@ def recalculate_course_and_subsection_grades(sender, user, course_key, **kwargs)
"""
recalculate_course_and_subsection_grades_for_user
.
apply_async
(
kwargs
=
dict
(
user
=
user
,
course_key
=
course_key
user
_id
=
user
.
id
,
course_key
=
six
.
text_type
(
course_key
)
)
)
This diff is collapsed.
Click to expand it.
lms/djangoapps/grades/tasks.py
+
5
−
3
View file @
4e0b3d3b
...
...
@@ -127,13 +127,15 @@ def recalculate_course_and_subsection_grades_for_user(self, **kwargs): # pylint
Recalculates the course grade and all subsection grades
for the given ``user`` and ``course_key`` keyword arguments.
"""
user
=
kwargs
.
get
(
'
user
'
)
course_key
=
kwargs
.
get
(
'
course_key
'
)
user
_id
=
kwargs
.
get
(
'
user
_id
'
)
course_key
_str
=
kwargs
.
get
(
'
course_key
'
)
if
not
user
or
course_key
:
if
not
user
_id
or
course_key
_str
:
message
=
'
recalculate_course_and_subsection_grades_for_user missing
"
user
"
or
"
course_key
"
kwargs from {}
'
log
.
error
(
message
.
format
(
kwargs
))
user
=
User
.
objects
.
get
(
id
=
user_id
)
course_key
=
CourseKey
.
from_string
(
course_key_str
)
previous_course_grade
=
CourseGradeFactory
().
read
(
user
,
course_key
=
course_key
)
if
previous_course_grade
and
previous_course_grade
.
attempted
:
CourseGradeFactory
().
update
(
...
...
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