Tied first - assessment mark is the average of the top 2, 3, 4, … , n (depending on how many tied) external mark.
Same with last. It's the last however many that tied averaged.
All others are worked out by their distance from the mean of the external and the internal and standard deviation and shit like that.