We compared students' learning behavior when completing identical online calculus-based physics homework assignments organized in two ways. One was designed for mastery learning where content is divided into smaller units, and students are required to attempt the assessment once before accessing the content. Students can proceed to the next unit after passing the assessment either before or after studying the content. The second is a conventional design in which students first study a set of instructional materials equivalent to several mastery units then complete multiple assessment problems at once. Our major findings are: 1. in the mastery condition, students solved more problems correctly either immediately after studying the instructional content, or on attempts before accessing the instructional content; 2. for students who solved similar numbers of problems correctly, the mastery condition students spent significantly less time studying compared to the traditional condition students; and 3. students who did not pass mastery units on their initial assessment attempts spent similar amounts of time studying as traditional condition students.