The role of the task and reward structure in cooperative learning