@desmos two questions

Slide 3: How can I get the simpleFunction to use \theta as an input variable? I currently have to use T.

Slide 2: How can I get the simpleFunction to use the latex of choiceContent(n)?
Thank you!
@desmos two questions
Slide 3: How can I get the simpleFunction to use \theta as an input variable? I currently have to use T.
Slide 2: How can I get the simpleFunction to use the latex of choiceContent(n)?
Thank you!
These are great questions. I’m not sure about the theta problem but I know that you can’t retrieve the latex from choiceContent (I’ve had that issue before). I think it’s because the choice content can be both latex and/or text.
f=simpleFunction(`${multChoice.choiceContent(n)}`,"T")
I can’t seem to get this code example to work when trying to define a function in a graph using the content of MC answers. My hope is to create a screen where one only need edit the MC answers and have the graphs of those answers follow suit. Have you been able to create a working example of taking the string and converting it to latex?
You’d need to replace n with a specific choice number. You could use a whenotherwise to define the latex and use that in the function:
exp= when multChoice.isSelected(1) `${multChoice.choiceContent(1)}`
when multChoice.isSelected(2) `${multChoice.choiceContent(2)}`
etc.
otherwise `1/0` #to have an undefined function when there's no selection
f=simpleFunction(exp,"T")
Thanks for the tip! I gave it a shot but am still seeing an error. Any ideas on what’s wrong?
I removed the `${ }`
from each one and that fixed the error message, but the graph still wasn’t working (i.e. it wouldn’t recognize the latex). However, if you define the choices in the multiple choice CL with backticks, it works:
choiceContent(1): `y=x+3`
choiceContent(2): `y=2x+3`
etc.
Thanks for taking a look! Perhaps it’s because defining choices in the CL means it’s solely latex, whereas defining them in the builder leaves it a mix of string and latex. Appreciate the help!