The z-score can be calculated by the following formula:

Where m is the mean, σ is the standard deviation and x is the actual score.
By replacing John's result (83) for x, 79 for m and 3.5 for σ, we get:

Similarly, for Jane's result on test B:

John's z-score was 1.14 and Jane's z-score was 1.2, then, Jane did better than John