Skip to content

Commit

Permalink
Merge pull request #54 from edx/efischer/swallow_reset_signal
Browse files Browse the repository at this point in the history
Allow reset signal to be ignored
  • Loading branch information
Eric Fischer authored Mar 29, 2017
2 parents 8ded4b8 + b0b7651 commit 067d778
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions submissions/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def get_latest_score_for_submission(submission_uuid, read_replica=False):
return ScoreSerializer(score).data


def reset_score(student_id, course_id, item_id, clear_state=False):
def reset_score(student_id, course_id, item_id, clear_state=False, emit_signal=True):
"""
Reset scores for a specific student on a specific problem.
Expand Down Expand Up @@ -738,14 +738,15 @@ def reset_score(student_id, course_id, item_id, clear_state=False):
# Create a "reset" score
try:
score = Score.create_reset_score(student_item)
# Send a signal out to any listeners who are waiting for scoring events.
score_reset.send(
sender=None,
anonymous_user_id=student_id,
course_id=course_id,
item_id=item_id,
created_at=score.created_at,
)
if emit_signal:
# Send a signal out to any listeners who are waiting for scoring events.
score_reset.send(
sender=None,
anonymous_user_id=student_id,
course_id=course_id,
item_id=item_id,
created_at=score.created_at,
)

if clear_state:
for sub in student_item.submission_set.all():
Expand Down

0 comments on commit 067d778

Please sign in to comment.