Check Fraction only in Math Input

How can I just check for fraction form only in a math input? (No decimal)
Here’s what I have so far for the fraction of 1/6:

answer=input1
correct=numericValue("\abs(${answer.latex}-(1/6))")<=0.001

In general, some form of countNumberUsage should work… I believe you would add this to the correct statement:

and countNumberUsage(answer,1)=1 and countNumberUsage(answer,6)=1

1 Like