update achievement after grade changed

Style/Blocks: Avoid using {...} for multi-line blocks.