The effects of family background on the educational productivity and attainment of secondary school students