Department of Physics, United States Air Force Academy,USAF Academy, Colorado 80840, USA(Received 27 May 2014; revised manuscript received 29 October 2014; published 17 February 2015)We examine how student aptitudes impact how much students learn from doing graded online andwritten homework in an introductory electricity and magnetism course. Our analysis examines thecorrelation between successful homework completion rates and exam performance as well as howchanges in homework completion correlate with changes in exam scores for students with differentphysics aptitudes. On average, successfully completing many homework problems correlated tobetter exam scores only for students with high physics aptitude. On the other hand, all other studentsshowed zero or even a negative correlation between successful homework completion and examperformance. Low- and medium-aptitude students who did more homework did no better andsometimes scored lower on exams than their low- and medium-aptitude peers who did lesshomework. Our work also shows that long-term changes in homework completion correlated tolong-term changes in exam scores only for students with high physics aptitude, but not for studentswith medium or low aptitude. We offer several explanations for the disparity in homework learninggains, including cognitive load theory, ineffective homework strategies, and various mismatchesbetween homework and exams. Several solutions are proposed to address these possible deficienciesin graded online and written homework.