Help with Check Mark in Factoring Activity

I am creating an activity that checks the input of students’ factoring ax^2+bx+c

I have the code for immediate feedback after submission in a separate note. For example:
When asked to

Factor out the GCF, then factor the remaining polynomial for
2c^{2}-14c-36.

A note on that slide is coded as follows:

content: when input1.submitted and (input1.latex = “2\left(c+2\right)\left(c-9\right)” or input1.latex = “2\left(c-9\right)\left(c+2\right)”)
“Great!”
when input1.submitted and not(input1.latex = “2\left(c+2\right)\left(c-9\right)” or input1.latex = “2\left(c-9\right)\left(c+2\right)”)
“Please check your work and try again!”
otherwise
“”

I labelled the math input as input 1.

It works just fine for students to see the accuracy of their responses, however I need help with creating the ability for the summary screen to display a check mark instead of a dot when a student answers the question correctly. Is that possible with the way I wrote the screen?

You can turn this into a correctness check pretty easily. Sticking with LaTeX checking it’d be:

ans1= `2\left(c+2\right)\left(c-9\right)`
ans2= `2\left(c-9\right)\left(c+2\right)`

test =
when this.latex=ans1 or this.latex=ans2 true
otherwise false

correct: test

Note, you do have to include both solutions here, and it’s still vulnerable to false negatives when the kids type too many parentheses.

It could also be made more robust with simpleFunction() and using some test points with attribute(?) .evaluateAt():

# answer function to test against
ansfn= simpleFunction(`2\left(c+2\right)\left(c-9\right)`, "c")

# function from student input
testfn= simpleFunction(this.latex, "c")

#test values
val1=-3.5
val2=9.8

test =
when testfn.evaluateAt(val1)=ansfn.evaluateAt(val1) and testfn.evaluateAt(val2)=ansfn.evaluateAt(val2) true
otherwise false

correct: test
1 Like