A university student needed metal screws to fix his broken face after a teenager attacked and knocked him unconscious, a court heard.