Assignment-correcting codes