Self-checking with simplified fractions from repeating decimals

I am trying to do a self check activity with answers in simplified fraction form. The students need to convert repeating decimals into fraction form and then simplify them. I have the code for if the fraction has a decimal equivalent but I don’t know how to write it so that it accepts, for example, 8/33 and doesn’t accept 24/99.

Looks like you’ll want to add a check that the GCF of the numerator and denominator is 1.

exp = this.latex        #Can be changed for table entries
gcf = simpleFunction(`\gcf(a,b)`,`a`,`b`)

p = patterns
pFrac = p.fraction(p.integer, p.integer)
numerator = numericValue(pFrac.parse(exp).numerator.latex)
denominator = numericValue(pFrac.parse(exp).denominator.latex)
isReducedFrac = gcf.evaluateAt(numerator, denominator) = 1

correct = isReducedFrac and #your other check here
correct: correct

In the future, it’s always helpful to have a link to your activity to try and work with what you’ve already done. You may have already been close in your own attempts, but needed some syntax changes or to correct a simple mistake.