The very last courtyard - Thai Hoc - was the site of the Imperial Academy called Quoc Tu Giam. From the 11th century till the beginning of the 19th century, Quoc Tu Giam served as a civil service college for Vietnam's growing bureaucracy.
Students at the Quoc Tu Giam studied Confucian literature and philosophy to prepare for the grueling triennial exams that qualified examinees to enter the lucrative ranks of the mandarins.
When the Nguyen Dynasty of the 19th century took power, they moved the seat of government to Hue in Central Vietnam, taking the Quoc Tu Giam with them. In place of the school, a shrine dedicated to Confucius' parents was built here, called Khai Thanh shrine.