Tadpoles can learn associative stimulus avoidance in an automated assay. Tadpoles were placed individually into the behavior apparatus, and the automated software executed a training cycle. Animals were first tested for red or blue light preference in the absence of shock, followed by a training period where animals receive a shock when occupying the red half of the arena. Following training, all animals received a 90 min rest period in blue light before being tested for red and blue color preference in the absence of shock. Training, rest and testing sessions were repeated a total of six times across the trial (A). Prior to training, wild-type tadpoles demonstrated no preference for either red or blue halves of the dish. However, following two training sessions, a significant red light aversion was generated (Bi). In contrast, animals subjected to the same experiment in the absence of shock did not demonstrate red light aversion during testing (Bii). Furthermore, animals with eyes surgically removed at stage 45 were unable to learn red light avoidance in the presence of shock (Biii). During the training periods, when tadpoles are punished for occupying red halves of the arena, wild-type animals spent significantly less time in punishing areas compared with eyeless tadpoles (C). Error bars indicate ±1 s.e.m.; N=33, 36 and 36, for wild type, no shock and no eyes, respectively; *P<0.05, repeated-measures ANOVA (B), Student's t-test (C).