There is an underexploited potential in enhancing massive online learning courses through small-group learning activities. Size and diversity allow for optimizing group composition in small-group tasks. The purpose of this paper was to investigate how groups formed based on learner behavior affect productivity of students in a small-group task. Students classified as high, average and low were randomly assigned to homogeneous or heterogeneous groups. Results indicate that overall, heterogeneous groups were either similarly or a bit more productive than homogeneous groups. Yet, we found that homogeneous groups classified as high-level were as or more than heterogeneous groups. However, heterogeneous groups were still more productive than homogeneous-average and homogeneous-low groups suggesting heterogeneous groups are the best choice for the entire community. Students classified as low-level were more productive in homogeneous groups, suggesting that grouping less active students together, makes social loafing more difficult and students participate more.