afterInsert doesn't work

Have this function written in the page where people complete the quiz. It does not calculate anything.


As you can see, for the first few items, the sdresult, afresult, agresult and afresult are empty. The answers from 1 to 32 are complete. (The later few columns data are all manually inputted.)

The live data show the exactly the same problem.