Johnathan has the better deal.
Johnathan has 5h homework to 3h playtime.
For Lucas, in 5h he will have earned 2h30min playtime, which is calculated by multiplying 30min playtime by 5, as well as 1h worktime by 5. The reason for doing this is to be able to compare the values with the deal Johnathan was given.