The impact of the COVID-19 pandemic on undergraduate and postgraduate students: A cross-sectional survey