randomize stim by trial; end trial on error; max rewards per trial