The easiest way (for me) to count it is to find how much 1 percent is. We know that 31 is 100%, so 1% will be 100 / 31, which is (after rounding to the hundredths) 3,23.
At the first attempt he gave 21 correct answers, so he made 21 * 3,23 = 67,83%.
At the second attempt he gave 29 correct anserws, so he made 29 * 3,23 = 93,67%.
The difference between 97,67% and 67,83% is 25,84% - and that's his improvement :)