Skip to content

Commit

Permalink
refactor!: add condition to update grade only if it's higher
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Oct 11, 2023
1 parent 84560f6 commit e3bf413
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion h5pxblock/h5pxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ def result_handler(self, data, suffix=''):
save_score = True
except BaseException as exp:
log.error("Error while publishing score %s", exp)
if save_score:

if save_score and data['result']['score']['raw'] > self.raw_score:
self.raw_score = data['result']['score']['raw']
self.max_raw_score = data['result']['score']['max']
return Response(
Expand Down

0 comments on commit e3bf413

Please sign in to comment.