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
4e464ec6
Commit
4e464ec6
authored
Feb 22, 2017
by
Eric Fischer
Committed by
GitHub
Feb 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14550 from edx/efischer/tnl-6559
Short-term fix for TNL-6559 task failures
parents
c9f17428
06c34456
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
lms/djangoapps/grades/signals/handlers.py
+4
-0
lms/djangoapps/grades/tests/test_signals.py
+13
-0
No files found.
lms/djangoapps/grades/signals/handlers.py
View file @
4e464ec6
...
@@ -57,6 +57,9 @@ def submissions_score_set_handler(sender, **kwargs): # pylint: disable=unused-a
...
@@ -57,6 +57,9 @@ def submissions_score_set_handler(sender, **kwargs): # pylint: disable=unused-a
user
=
user_by_anonymous_id
(
kwargs
[
'anonymous_user_id'
])
user
=
user_by_anonymous_id
(
kwargs
[
'anonymous_user_id'
])
if
user
is
None
:
if
user
is
None
:
return
return
if
points_possible
==
0
:
# This scenario is known to not succeed, see TNL-6559 for details.
return
PROBLEM_WEIGHTED_SCORE_CHANGED
.
send
(
PROBLEM_WEIGHTED_SCORE_CHANGED
.
send
(
sender
=
None
,
sender
=
None
,
...
@@ -100,6 +103,7 @@ def submissions_score_reset_handler(sender, **kwargs): # pylint: disable=unused
...
@@ -100,6 +103,7 @@ def submissions_score_reset_handler(sender, **kwargs): # pylint: disable=unused
course_id
=
course_id
,
course_id
=
course_id
,
usage_id
=
usage_id
,
usage_id
=
usage_id
,
modified
=
kwargs
[
'created_at'
],
modified
=
kwargs
[
'created_at'
],
score_deleted
=
True
,
score_db_table
=
ScoreDatabaseTableEnum
.
submissions
,
score_db_table
=
ScoreDatabaseTableEnum
.
submissions
,
)
)
...
...
lms/djangoapps/grades/tests/test_signals.py
View file @
4e464ec6
...
@@ -130,9 +130,22 @@ class ScoreChangedSignalRelayTest(TestCase):
...
@@ -130,9 +130,22 @@ class ScoreChangedSignalRelayTest(TestCase):
'modified'
:
FROZEN_NOW_TIMESTAMP
,
'modified'
:
FROZEN_NOW_TIMESTAMP
,
'score_db_table'
:
'submissions'
,
'score_db_table'
:
'submissions'
,
}
}
if
handler
==
submissions_score_reset_handler
:
expected_set_kwargs
[
'score_deleted'
]
=
True
self
.
signal_mock
.
assert_called_once_with
(
**
expected_set_kwargs
)
self
.
signal_mock
.
assert_called_once_with
(
**
expected_set_kwargs
)
self
.
get_user_mock
.
assert_called_once_with
(
kwargs
[
'anonymous_user_id'
])
self
.
get_user_mock
.
assert_called_once_with
(
kwargs
[
'anonymous_user_id'
])
def
test_tnl_6599_zero_possible_bug
(
self
):
"""
Ensure that, if coming from the submissions API, signals indicating a
a possible score of 0 are swallowed for reasons outlined in TNL-6559.
"""
local_kwargs
=
SUBMISSION_SET_KWARGS
.
copy
()
local_kwargs
[
'points_earned'
]
=
0
local_kwargs
[
'points_possible'
]
=
0
submissions_score_set_handler
(
None
,
**
local_kwargs
)
self
.
signal_mock
.
assert_not_called
()
@ddt.data
(
@ddt.data
(
[
submissions_score_set_handler
,
SUBMISSION_SET_KWARGS
],
[
submissions_score_set_handler
,
SUBMISSION_SET_KWARGS
],
[
submissions_score_reset_handler
,
SUBMISSION_RESET_KWARGS
]
[
submissions_score_reset_handler
,
SUBMISSION_RESET_KWARGS
]
...
...
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