Skip to content

Commit

Permalink
refactor: move submission completed only after completion emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Oct 9, 2023
1 parent a896e3d commit 3539a91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h5pxblock/h5pxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def result_handler(self, data, suffix=''):
try:
self.emit_completion(1.0)
save_completion = True
self.submission_status = SubmissionStatus.COMPLETED.value
except BaseException as exp:
log.error("Error while marking completion %s", exp)

Expand All @@ -343,7 +344,6 @@ def result_handler(self, data, suffix=''):
if save_score:
self.raw_score = data['result']['score']['raw']
self.max_raw_score = data['result']['score']['max']
self.submission_status = SubmissionStatus.COMPLETED.value
return Response(
json.dumps({"result": {"save_completion": save_completion, "save_score": save_score}}),
content_type="application/json",
Expand Down

0 comments on commit 3539a91

Please sign in to comment.