Apple supplier Foxconn has stopped students from working illegal overtime at a factory in China.