Costs and quality of online learning