Refering to other components

Hello, there.

Is there a way of refering to other components?
e.g.:


Can I make ‘Note2’ say “Well done!” if ‘Maths1’ is correct?

Surely something like:
If ‘Maths1’ Correct, print “Well done!”
Otherwise, print " "

This seems to be a really user-unfriendly language to use!

You need to be specific about what makes Maths1 correct. You can’t access the correct sink in Maths1, but you can create a variable (I use “check=”) then refer to that.

content: when Maths1.script.check "Well done!" otherwise ""

Thanks, Daniel.

I think I’m having multiple conversations with you at the moment(!)

Please would you be able to let me know how to do the “check=”?
Do I type “check=” in the ‘Maths1’ box?
If so, how do I distinguish atwin different “check=” in different boxes?

All best,
Simon

Yes, define check in the math input. You can tell the difference between different checks because you have different input names.

Maths1.script.check” is saying “go to the Maths1 component’s script and grab the variable check .” You can have as many duplicate variable names as you want as long as they are not living in the same component’s CL.

Brilliant! Thanks, Daniel.

I have done this:

total1=when answer1.script.check1 1 otherwise 0

total2=when answer2.script.check2 1 otherwise 0

total3=when answer3.script.check3 1 otherwise 0

total4=when answer4.script.check4 1 otherwise 0

total5=when answer5.script.check5 1 otherwise 0

total6=when answer6.script.check6 1 otherwise 0

total7=when answer7.script.check7 1 otherwise 0

total8=when answer8.script.check8 1 otherwise 0

total9=when answer9.script.check9 1 otherwise 0

total10=when answer10.script.check10 1 otherwise 0

total=numericValue("{total1}+{total2}+{total3}+{total4}+{total5}+{total6}+{total7}+{total8}+{total9}+{total10}")
content:
“You have scored \frac${total}{10}.”

Very clunky; but it works!