First and last get pinned with the highest and lowest HSC exam marks. These are now their moderated assessment marks. Then everyone in between is moderated based on their school mark. Closer school marks to first, then closer moderated marks to first. It has nothing to do with your rank, unless you are first or last. There are other factors such as the mean of the marks, but it's not a major concern.