Costs and Quality of Online Learning