I would like to write some activities where students need to enter fractions.
I would like to be able to extract the numerator and denominator separately.
Is there any way that I can do this with a function like parseEquation(…) and parseOrderedPair(…) but for fractions?
(I can see from the documentation that there seems to be a large parsing library in the works but I’m assured that it’s not ready for prime time; in the meanwhile could perhaps a parseFraction emerge?)
add a table , you can ask your students to enter numerator and denominator separately. you will be able to see a fraction generated from Num and denominator.
CL to add on Note: content:"\\frac{${table.cellContent(2,1)}}{${table.cellContent(2,2)}}"
Agree that for one off questions this is the best way.
The problem is that I want to have generalizable screens, where I can either randomly generate fractions or to specify the numerators and denominators in computation layer. But countNumberUsage only checks for constant numbers, so I don’t think you could code a general checker.
Just to bring this up again in the hope Desmos will offer it.
I’d like to play around with Dan Meyer’s ideas about interpreting students’ answers, in the context of fractions. But can’t really do that without being able to parse the fraction.
I extended the fraction parse, and added a screen with components to simplify radicals (pulling out perfect squares). I saw several questions about this in other posts, too.
Thanks for the heads up here! Now it feels very obvious.
Since I like to keep track of what’s in the graph component, I’ll start putting more comments in the graph CL about available variables when there’s no need to redefine.
Missed this a long time ago, but you can use variables in countNumberUsage(). So if you set “num” and “den”, you could use: countNumberUsage(input.latex, num)=1 and countNumberUsage(input.latex, den)=1
I don’t have a computer handy to check but I thought the second argument to countNumberUsage couldn’t be a variable. (I am imagining a scenario in which these are randomly generated, not something where I’ve hardcoded a specific value). Has this changed?
I am trying to take the numerator and denominator that students enter in the table t1 row 1 column 1 and place it into the first 3 options of the multiple choice question. I have set those choices to update with the fraction only when table 1 is correct. However, once table 1 is correct, you can only see the first choice in the multiple choice update with the proper numerator and denominator, while choices 2 and 3 become blank. Is there a way to get choices 2 and 3 to update properly with the correct numerator and denominator?
The problem has something to do with the formatting of the latex. I don’t really understand what’s causing the issue, but if you add a space between the backslash and the word marshmallows, it works. Same thing goes for choice 3, add a space between the backslash and the word units.