The standard way to do this sort of thing is to use a MultiAnswer problem. See https://webwork.maa.org/wiki/MultiAnswerProblems.
The standard way to do this sort of thing is to use a MultiAnswer problem. See https://webwork.maa.org/wiki/MultiAnswerProblems.