The tutelage provided at the hyanggyo, seowon, and Seonggyungwan was aimed primarily at preparing students for the gwageo and their subsequent career in government service. Under Joseon law, high office was closed to those who were not children of officials of the second full rank or higher, unless the candidate had passed the gwageo. Those who passed the higher literary examination came to monopolize all of the dynasty's high positions of state.