This works fine, with one little issue…The second possible acceptable correct answer gives the message without having to submit. I tried adding " ans9.submitted and" after the ‘or’, but that created the wrong answer message for the first correct answer. Its a pretty minor thing, but my curiosity is getting the best of me.
content: “{message} {feedback}”
message = “When the second equation is solved for y, what’s the new equation?”
feedback = when ans9.submitted and ans9.latex=“y=1-3x” or ans9.latex=“y=-3x+1”
“\n\n\n✅ Way to go ! !”
when ans9.submitted "\n\n\n❌Wrong answer. Please try again. Remember Get y
alone on the left!! \n\n "
otherwise “”
You missed otherwise before second when.
It should look:
content: message
message = "When the second equation is solved for y, what’s the new equation?${feedback}"
feedback = when ans9.submitted and ans9.latex="y=1-3x" or ans9.latex="y=-3x+1"
"\n\n\n✅ Way to go ! !" otherwise
when ans9.submitted "\n\n\n❌Wrong answer. Please try again. Remember Get y
alone on the left!! \n\n "
otherwise ""```
btw, use slope and intercept function to avoid latex confusion. If there is an extra space in latex it cries and returns error.
@Mirko_Danilovic only the final otherwise is necessary for when-otherwise (i.e. when when when when … otherwise). It’s not like other coding languages that use "if and “else if”.