update achievement gain date to submission date(not grading date)

1. It makes the leaderboard more fair.
2. Tested properly, it works.
please adapt the first point as well, you have 4 inner joins. Very bad for debugging.