Foreign students who needed Japanese classes in primary and secondary public schools hit a record 29,198 last year, up 2,185 from two years ago, a government survey showed Friday.