Code refactor
Wrap the new code in the function get_student_type in lib.php