Checking student answer as a coordinate point

Hello, I am new to computation layer.
I understand how to get it to check a student numerical input, but how can I get it to check a student numerical point?
I am trying to use it for the solution to a system of equation.

Could you provide a link to your activity or copy the code?

correct: this.numericValue= (-4,1)
correct: correct

I have a feeling it’s because of the coordinate not being a “numeric” value, so what option should I use?

I figured it out. I ended up using a table to check their coordinate point.
However, when I change the table format to “math input,” it does not show students whether they are correct or not. (I left it as a text)

Here is the code on the table:
correct: table1.cellContent(1,1)=“(-4,1)”

cellContent(1,2):when table1.cellContent(1,1)=“(-4,1)”
:white_check_mark:
otherwise " "

For coordinate pairs, you need to use parseOrderedPair - for example, something like

correct: parseOrderedPair(this.latex).x=-4 and parseOrderedPair(this.latex).y=1

should do the trick. You could also have something like coord=parseOrderedPair(this.latex) and then just use coord.x=-4 and coord.y=1

@pirsquared @tarnold
Can you check this code for inp4?
I am also expecting a coordinate as their answer, and on the teacher dashboard it is marking it correct, but the feedback is not giving them as a correct answer.

@pirsquared @tarnold actually, any point they enter is being marked correctly.

coord=parseOrderedPair(this.latex)

correct: numericValue(coord.x)=3 and numericValue(coord.y)=8


1 Like

I keep getting an error message saying "Component “undefined: had no source “latex”. It actually doesn’t have any sources at all. Sorry about that.”

Where are you getting this error message? Can you share your updated activity?

I have it in the last “note box” but can you check inp4? Maybe I’m missing something

Put this in your note box:

coord=parseOrderedPair(inp4.latex) 
correct = numericValue(coord.x)=3 and numericValue(coord.y)=8

content:"${feedback}"

feedback= when inp4.submitted and correct "✅ Good work!" when inp4.submitted "🤔 Keep thinking" otherwise " "

You can also have

coord=parseOrderedPair(inp4.latex) 
correct: numericValue(coord.x)=3 and numericValue(coord.y)=8

in inp4, if you want the dashboard checks to work as well.

THANK YOU SO MUCH!
It’s working :slight_smile: