Enter fraction and square root in CL

I do not how to set up the CL for Note 1 and table 4 in Slide 2 so after the students solve 3x^2 -2x-13=0, enter x=(1+2sqrt{10})(3) and x=(1-2sqrt{10})(3) in table4, and hit the submit button , they will receive the “Good work” feedback. If they enter other thing, they will receive the “Please try again” feedback.

I am thinking two things could go wrong in my current setup:

  1. I didn’t know the correct command for fraction and square root
  2. I think it is said in the CL that whenever table 4 submitted, it will give the “Please try again” no matter what.
    I really have no idea.

I attach my activity below. Can anyone help me with this? Thank you very much.

Try this for the answer variable in the note component.

answer=
when t.submitted  and t.cellContent(1,1) = `x=\frac{1+2\sqrt{10}}{3}` and t.cellContent(2,1) = `x=\frac{1-2\sqrt{10}}{3}`  "\n\nGood work! 🤩🤩"
when t.submitted  and t.cellContent(2,1) = `x=\frac{1+2\sqrt{10}}{3}`  and t.cellContent(1,1) = `x=\frac{1-2\sqrt{10}}{3}`  "\n\nGood work! 🤩🤩"
when t.submitted  "\nOops. Please try again. :) " 
otherwise ""

Since you want a specific format, I just used a latex match. To do this, use the backticks instead of the quotation marks. Also just a helpful tip on the formatting, I just typed in the solution on the Desmos calculator and then copied/pasted it into the code. Works like a charm! :slight_smile:

Thank you very much. I really like the tip on formatting :heart_eyes:

I am trying to check fractions that repeat decimals and irrational solutions in a math entry box, this code will work when my fraction converts nicely to a decimal, but is not working for thirds or my irrational solutions
disableEvaluation: true
check= tan.latex"\frac{4}{3}"
correct: check
suffix: when not(this.submitted) “”
when check “:white_check_mark:
otherwise “:x:

how can I change it for thirds and irrational solutions?

@Catherine_Kraus You may find this thread useful. If you are still having issues, could you start a new thread and include a link to your activity? Thanks!

That is what I am looking for, thanks!

1 Like