I agree, this is the right way to compensate for work that can potentially be used in production as a means of interviewing the candidate.
I faced something similar to the OP and posted the results on Workplace https://workplace.stackexchange.com/questions/88138/working-...