Feedback for students

Hi Jay,

I tried using this and it looks something like this.

correct = “t^{2}-3t”

content:
when correct and studentinput1.submitted “You got it right!”
when studentinput1.submitted “You got it wrong.”
otherwise “prompt”

I says that theres a problem with string,boolean not boolean,boolean.

All I want to do is have a message pop up if the students enter the correct simplified form of a function with t plugged in. The original function was f(x)=x^2+3x.

Any help would be appreciated.

Thank you,
Mark

Currently, your correct variable has been set to the string “t^{2}-3t”. You need to direct desmos to check the student answer against the correct answer. Best not to try to compare latex. Better practice is to check a few solutions to the function. Here’s a function, f, in terms of t from student input. Then, I test three solutions to the function (I’m using the “original function was f(x)=x^2+3x” since there’s a conflict with “correct”).

f = simpleFunction(studentinput1.latex, "t")
correct = f.evaluateAt(0) = 0 and f.evaluateAt(1) = 4 
          and f.evaluateAt(-1) = -2

This would also accept x(x+3). Use countNumberUsage if you want a certain form.

1 Like

Thanks Dan!

My problem is I am also having my students plug in x+h and simplify. Would this still work with that? and how to I define the original function in the computational layer?

Why don’t you (publish and) share your activity link? Easier to take a look than keep getting descriptions. The code I used didn’t define the function. I just chose solutions based on what you said was the original function (I was just pointing out “correct” was not correct based on what you said was the original function).

Here is the desmos I am working on. I am working on showing the message of if they are correct. I found a way to do it with the latex layer. If there is a better way I would love to know how to do it. The slides I am trying to do this on are 2,3,5, and 6 then on 27 and 28 I want to check if their inverse equation is correct. Having trouble checking fractions there.

I edited slides 2 and 3. Slide 5 you can try matching latex, but that can be fragile. The added equality makes evaluating impossible though.

I assume you mean for students to expand it. If not, you’d need to alter the countNumberUsage parts of the CL.

I now edited Slide 27 and replaced the link above.

ok slowly understanding. Now if I have a different function lets say f(x)=x^2-3x what would I have to change for that to check now?

Okay. I edited Slide 2 to reflect this (revisit the link above). Basically, I made a variable in the note CL where you can change your function. Used that to dynamically change the note content (notice myFunction).

Then, in the input CL, changed to compare evaluations of f and g instead of a specific output for g.

Ok got the my function and the check its doing. Now I am looking at slide 3 and doing it there. The actual answer should be x^2+2xh+h^2-3x-3h but even on the original way you fixed it, it did not check.

Thanks again for all this help. Its really helping me understand the CL layer checks

Wait I think I got it!

An error on my part. Missed the -3h.

Also, I had to parseEquation and use the right hand side (rhs) within simpleFunction. Basically, simpleFunction works if you use basic function notation, an expression, or y=. The x+h kind of broke it.

1 Like

If I wanted to list multiple functions and do operations with them, then check if the final equation is correct or not how would you go about that? Another words like slide 5 with the table. Would you just make seperate slides and do what you did before?

First, I’d split f(x) and g(x) into separate columns. It’s a little confusing in one cell. Then, since you want them to substitute then simplify, I’d again use two columns. You can check the latter column similar to Slide 3
(e.g. simpleFunction(parseEquation(this.cellContent(1,5)).rhs) )

I’d essentially do the exact same thing for Slide 3, just number each one (i.e. myFunctionf1, myFunctiong1, f1, g1, h1, check1, etc.).

You’re getting into complicated territory, but it’s doable.

thanks so much. Of course I am getting into complicated territory its for my precalc honors class.

I am not sure what I am doing wrong with my code. I have students entering a function in math input. I have the initial latex to say P(t) and then they are to enter the rest of the function which is P_{0}e^(.29t)
and I want to give feedback. Where am I going wrong?
f = simpleFunction(ants1.latex, “t”)
correct = f.evaluateAt(0) = 100 and f.evaluateAt(1) = 133.64
and f.evaluateAt(2) = 178.6

feedback=
when ants1.submitted and ants1=correct “Great job!”
when ants1.submitted and not(ants1=correct) “Try again!”
otherwise “”

The error I get in the feedback is "equality checks only work for numbers, strings, and latex right now.

Your correct variable will output true or false, which is a Boolean, not a “number, string, or latex”; thus the error. (If ants1 is your math input, and this code is within the input component, you can use this instead of ants1.) Change your feedback variable:

feedback=when this.submitted and correct "Great Job!"
         when this.submitted and not(correct) "Try Again!"
         otherwise ""

You could also try nested when-otherwise to clean things up a little:

feedback=when this.submitted
           (when correct "Great Job!"
             otherwise "Try Again!")
         otherwise ""

Thanks! Question with this code… f = simpleFunction(ant1.latex, “t”)
correct = f.evaluateAt(0) = 100 and f.evaluateAt(1) = 133.64
and f.evaluateAt(2) = 178.6

Because this is an exponential function that they enter, 133.64 and 178.6 are rounded answers. How can I tell it to round so that these get recognized as correct.

numericValue("\round(${f.evaluateAt(1)},2)") = 133.64

You could also do something like this:
numericValue("\abs(${f.evaluateAt(1)}-133.64)") <0.01 or whatever tolerance you’ll accept.

You can also use tables/lists in a graph to check a whole range of values.

Ok. I give up. Here is a link to my activity. :frowning:


I am still getting errors.