<P> The victor of this war was Liu Bang, who initiated four centuries of unification of China proper under the Han dynasty (202 BC--AD 220) In 165 BC, Emperor Wen introduced the first method of recruitment to civil service through examinations, while Emperor Wu (r . 141--87 BC), cemented the ideology of Confucius into mainstream governance installed a system of recommendation and nomination in government service known as xiaolian, and a national academy whereby officials would select candidates to take part in an examination of the Confucian classics, from which Emperor Wu would select officials . </P> <P> In the Sui dynasty (581--618) and the subsequent Tang dynasty (618--907) the shi class would begin to present itself by means of the fully standardized civil service examination system, of partial recruitment of those who passed standard exams and earned an official degree . Yet recruitment by recommendations to office was still prominent in both dynasties . It was not until the Song dynasty (960--1279) that the recruitment of those who passed the exams and earned degrees was given greater emphasis and significantly expanded . The shi class also became less aristocratic and more bureaucratic due to the highly competitive nature of the exams during the Song period . </P> <P> Beyond serving in the administration and the judiciary, scholar - officials also provided government - funded social services, such as prefectural or county schools, free - of - charge public hospitals, retirement homes and paupers' graveyards . Scholars such as Shen Kuo (1031--1095) and Su Song (1020--1101) dabbled in every known field of science, mathematics, music and statecraft, while others like Ouyang Xiu (1007--1072) or Zeng Gong (1019--1083) pioneered ideas in early epigraphy, archeology and philology . </P> <P> From the 11th to 13th centuries, the number of exam candidates participating in taking the exams increased dramatically from merely 30,000 to 400,000 by the dynasty's end . Widespread printing through woodblock and movable type enhanced the spread of knowledge amongst the literate in society, enabling more people to become candidates and competitors vying for a prestigious degree . With a dramatically expanding population matching a growing amount of gentry, while the number of official posts remained constant, the graduates who were not appointed to government would provide critical services in local communities, such as funding public works, running private schools, aiding in tax collection, maintaining order, or writing local gazetteers . </P>

Who made up the social class called artisans