medicine. In 1845 Sultan Abd al-Rahman carried out further reforms, but it is unclear if this had any significant long-term effects. Between 1830 and 1906 the number of faculty decreased from 425 to 266 (of which, among the latter, only 101 were still teaching). By the 19th century, the mosque's library also suffered from decline and neglect. A significant portion of its collection was lost over time, most likely due to lax supervision and to books that were not returned. By the beginning of the 20th century, the collection had been reduced to around 1,600 manuscripts and 400 printed books, though many valuable historic items were retained. 20th century and transformation into state university At the time Morocco became a French protectorate in 1912, al-Qarawiyyin worsened as a religious center of learning from its medieval prime, though it retained some significance as an educational venue for the sultan's administration. The student body was rigidly divided along social strata: ethnicity (Arab or Berber), social status, personal wealth, and geographic background (rural or urban) determined the group membership of the students who were segregated by the teaching facility, as well as in their personal quarters. The French administration implemented a number of structural reforms between 1914 and 1947, including the institution of calendars, appointment of teachers, salaries, schedules, general administration, and the replacement of the ijazah with the shahada alamiyha, but did not modernize the contents of teaching likewise which were still dominated by the traditional worldviews of the ulama. At the same time, the student numbers at al-Qarawiyyin decreased to 300 in 1922 as the Moroccan elite sent their children to the newly founded Western-style colleges and institutes elsewhere in the country. In 1931 and 1933, on the orders of Muhammad V, al-Qarawiyyin's teaching was reorganized into elementary, secondary, and higher education. Al-Qarawiyyin also played a role in the Moroccan nationalist movement and in protests against the French colonial regime. Many Moroccan nationalists had received their education here and some of their informal political networks were established due to the shared educational background. In July 1930, al-Qarawiyyin strongly participated in the propagation of Ya Latif, a communal prayer recited in times of calamity, to raise awareness and opposition to the Berber Dahir decreed by the French authorities two months earlier. In 1937 the mosque was one of the rallying points (along with the nearby R'cif mosque) for demonstrations in response to