This research deals with the effect of a computer-based learning environment (CBLE), co-designed with teachers, on the variation of students’ motivation to do mathematics, according to their gender, socioeconomic background, initial motivation level, and the teacher’s motivational style, while using this CBLE in the classroom. The main results, obtained from 163 students by using the Vallerand academic motivation scale (Vallerand et al., 1989) pre-test and post-test, highlight the positive effect of the CBLE, according to certain student characteristics, especially for those students who were initially the least motivated to do mathematics and vice versa. This effect is particularly true when the teacher promotes students’ autonomy.