There are probably more issues with your code, but on line 40 of test2.jsp you're trying to insert a new record for student even if it already exists in the database. It seems syntactically incorrect to me, but maybe your database can accept it. If it is the case, you then have more than one record per student here, which would allow for same scenarios corresponding to the symptoms you've described above.
You should use UPDATE instead of INSERT there. Moreover, you should define primary key on your STUDENT table so that inserting a duplicate record would fail immediately (this would provide you more clues as to where the problem actually is).
There are other potential issues.
I don't do JSP, but seasoned JSP programmers would probably advice you not to include database code in JSP pages.
The STUDENT table has fields named SCORE and TOTAL. Is the requirement really to keep total of the score and the last score assigned to the student? Should not all individual scores be recorded for every student, not just the last one?