Division Code boundries(?) and script(?)

I’m trying to adapt an integers practice game by Mr. Chow for a division practice. How can I adapt the code so that the problems are all integer answers?
If that works, can I change the text students see so that it looks like a fraction instead of using a forward slash?

This division:
r = randomGenerator(in.submitCount)
r1 = r.int(-100,100)
r2 = r.int(-10,10)
value = numericValue("{r1}/{r2}")

and making this look like a fraction?

Instead, of setting the numerator and denominator, r1 and r2, set r2and the value:


fracLatex=`\frac{ ${num} }{ ${den} }`

We have a tendency to think about our problems in how we’d solve them, which isn’t always useful when coding. :slight_smile:

That totally made sense thank you! Is there a way to make it so the denominator can’t be zero?

Might need to play with it a little, but something like this:

den=numericValue("${r.int(1,10)}*(-1)^{ ${r.int(0,1)} }")