Correct sink using random generated problems

I have copied some CLD from other activities to get random generated equations but I am trying to figure out how to set the correct sink in the math text to be able to see the check mark on the teacher dashboard. Can someone help me with slide 2 and 3 for: TQR - Solving Systems of Equation Exam • Activity Builder by Desmos

Thank you!

a and b from component, q2, are Booleans, not the actual coordinates. This should work for your input instead:

a = q2.script.a
b = q2.script.b

correct: a and b
1 Like

I have a new problem but it is sort of similar to the previous question. I am using a random generator to randomly choose between different problems. Based on which problem the student gets will determine which answer is correct. I have the note screen programmed but can’t figure out how to get the Math Text box to check for correct and get a check mark on the teacher dashboard. Here’s the coding for my Notes box:

r = randomGenerator()
d1 = r.int(1,5)

q6 = f\left(x\right)=\frac{4x^{4}-5}{4x^{4}+3}
q7 = f\left(x\right)=\frac{5x^{5}+3x^{4}}{5x^{2}+4}
q8 = f\left(x\right)=\frac{4x^{5}+3x^{2}}{x^{2}-5}
q9 = f\left(x\right)=\frac{5x^{5}+4x^{4}}{x^{4}-4}
q10 = f\left(x\right)=\frac{4x^{4}+x^{2}}{x^{2}+4}

equation = when d1 = 1 ${q6} when d1 = 2 ${q7} when d1 = 3 ${q8} when d1 = 4 ${q9} when d1 = 5 ${q10} otherwise “”

content:
"Differentiate: ${equation}

"

hidden: timer15.timeSincePress(10)=0

a6 = f'\left(x\right)=\frac{128x^{3}}{16x^{8}+24x^{4}+9}
a7 = f'\left(x\right)=\frac{75x^{6}+30x^{5}+100x^{4}+48x^{3}}{25x^{4}+40x^{2}+16}
a8 = f'\left(x\right)=\frac{12x^{6}-100x^{4}-30x}{x^{4}-10x^{2}+25}
a9 = f'\left(x\right)=\frac{5x^{8}-100x^{4}-64x^{3}}{x^{8}-8x^{4}+16}
a10 = f'\left(x\right)=\frac{8x^{5}+64x^{3}+8x}{x^{4}+8x^{2}+16}

correct = when d1 = 1 ${a6} when d1 = 2 ${a7} when d1 = 3 ${a8} when d1 = 4 ${a9} when d1 = 5 ${a10} otherwise “”

As long as your variable correct is functioning, you just a correct sink in your math input. If that variable was defined in the math input:

correct: correct

If it’s defined in a different component:

correct: componentName.script.correct

Thank you, Daniel for such a quick response!!

I tried that (correct: Q15.script.correct) but I get an error message: Sink “correct” expects a boolean but got a string. I don’t know how to correct this.

It’s slide 10: IB Differentiation Exam • Activity Builder by Desmos

I haven’t fine tuned the other slides yet.

Sorry, looks like you are probably intending to latex match equation and correct, so:

correct: Q15.script.equation=Q15.script.correct

Ok, I guess I have a bigger problem. I think it is randomizing my answers rather than sinking my answers to the random questions. I’m not sure how to fix this.

Wait sorry. Try this:

correct: this.latex=Q15.script.correct
1 Like

YES! That worked!!

Thank you again!!!

1 Like