Checking whether or not a student’s ratio is correct can be as simple as a latex check, but this requires predicting student answers and you eventually are going to stop somewhere. Knowing that kids come up with crazy but correct answers sometimes, I wanted a way for my activities to check practically any form or a ratio. For example, if the ratio is 3 to 4, I still want the activity to recognize 333 : 444 as a correct answer even if it is silly.
Desmos calculator uses colons in syntax when defining conditionals and can do so when defining a function. I took advantage of this feature and some integration to come up with the following solution. I feel like there has to be a better way to figure out what the first number in the ratio is without finding area under the function, and if anybody can think of something, please share!
I do like it! There was a reason for my silliness with identifying the power of ten within which the discontinuity happens, though. If Desmos runs that integral over too large an interval, it misses small numbers. I also wanted to mark an answer like 0.03 : 0.04 as correct.