Random Number Check if Correct

I’m trying to learn CL and challenged myself to create a question where two random integers are added together, then the activity checks to see if it’s correct and gives the checkmark. But it seems as though CL can’t read variables from one component to another??? Here is my code so far:

Note Component:
r=randomGenerator()

a = r.int(-10,10)
b = r.int(-10,10)

eq = “{a} + {b}”

content: “Evaluate ${eq}”

Math Input Component:
correct: ans6.numericValue = numericValue("{a}+{b}")

To access variables from other components:
componentName.script.variableName

1 Like