# Feedback for students

**URL:** <https://cl.desmos.com/t/feedback-for-students/559>\
**Category:** Questions\
**Created:** [September 13, 2019, 11:05pm UTC](https://cl.desmos.com/t/feedback-for-students/559 "2019-09-13T23:05:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 13, 2019, 11:05pm UTC](https://cl.desmos.com/t/feedback-for-students/559/1 "2019-09-13T23:05:44Z")

</div>

How can I program a slide to show the correct answer on a task once a student has submitted their answer?

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 13, 2019, 11:16pm UTC](https://cl.desmos.com/t/feedback-for-students/559/2 "2019-09-13T23:16:37Z")

</div>

You can display a correct answer as the content of a note when input.submitted, is that what you wanted?

Or were you looking to display whether the answer was correct or incorrect?

---

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 13, 2019, 11:20pm UTC](https://cl.desmos.com/t/feedback-for-students/559/3 "2019-09-13T23:20:19Z")

</div>

The first one…I want to show them the answer no matter what they enter.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 13, 2019, 11:30pm UTC](https://cl.desmos.com/t/feedback-for-students/559/4 "2019-09-13T23:30:45Z")

</div>

Awesome. In the script for the note component:

`content: when input.submitted “correct answer” otherwise “prompt”`

Where “input” is the name of your input component and the correct answer and prompt strings are what you want to display in the note.

---

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 14, 2019, 12:05am UTC](https://cl.desmos.com/t/feedback-for-students/559/5 "2019-09-14T00:05:28Z")

</div>

> [@JayChow](#):
>
> content: when input.submitted “correct answer” otherwise “prompt”

I want them to get the answer only after they have entered something first. When I used the command, it displayed the answer on the preview screen. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 14, 2019, 12:21am UTC](https://cl.desmos.com/t/feedback-for-students/559/6 "2019-09-14T00:21:47Z")

</div>

You can put `submitDisabled: isBlank(this.latex)` in the script for the input component to block the submit button on blank answers. If it’s a text input you’ll use .content instead of .latex

Did you copy/paste the text directly into the scripting window? That might be causing an error. Safari is giving me different quotation marks, you might want to delete and re-enter.

---

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 14, 2019, 12:24am UTC](https://cl.desmos.com/t/feedback-for-students/559/7 "2019-09-14T00:24:20Z")

</div>

I had to retype the quotes…

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 14, 2019, 12:37am UTC](https://cl.desmos.com/t/feedback-for-students/559/8 "2019-09-14T00:37:53Z")

</div>

That makes sense. My bad.

Come to think of it, submit should be disabled on blank entries anyway, so that last bit is unnecessary.

---

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 14, 2019, 12:40am UTC](https://cl.desmos.com/t/feedback-for-students/559/9 "2019-09-14T00:40:24Z")

</div>

> [@JayChow](#):
>
> content: when input.submitted “correct answer” otherwise “prompt”

Is there a command that replies after submit?

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 14, 2019, 1:15am UTC](https://cl.desmos.com/t/feedback-for-students/559/10 "2019-09-14T01:15:07Z")

</div>

It depends what you mean by reply. If you mean from teacher to student, then unfortunately, no.

If otherwise, conditional or automatic responses can be coded. Differing based on the specific type of feedback you’d like to give.

---

<div class="post-metadata">

**Author:** ![Jennifer\_Gustafson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_gustafson/32/366_2.png) [@Jennifer\_Gustafson](https://cl.desmos.com/u/Jennifer_Gustafson)\
**Post date:** [September 16, 2019, 3:08pm UTC](https://cl.desmos.com/t/feedback-for-students/559/11 "2019-09-16T15:08:55Z")

</div>

I believe I want an automatic response…

---

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [October 15, 2019, 5:31pm UTC](https://cl.desmos.com/t/feedback-for-students/559/12 "2019-10-15T17:31:54Z")

</div>

How can you do the later? have desmos assess if a non numerical input, like writing a function (ex: the input was "f(x)=3x+5) is correct or not?

I would like to have students be able to know if they are right or wrong but not give them the answer. I know numerically i can do that but didnt know if non numeric answers can do the same.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [October 16, 2019, 6:57pm UTC](https://cl.desmos.com/t/feedback-for-students/559/13 "2019-10-16T18:57:15Z")

</div>

Easiest way (for me) is to make a correctness variable in your CL then control the note content conditionally based on that variable

so something like

```auto
correct = (stuff that makes it correct)

content: 
when correct and input.submitted "You got it right!"
when input.submitted "You got it wrong."
otherwise "prompt"

```

the `correct` variable not needed but useful if you plan on reusing this interaction

---

<div class="post-metadata">

**Author:** ![Natasha\_M](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/natasha_m/32/550_2.png) [@Natasha\_M](https://cl.desmos.com/u/Natasha_M)\
**Post date:** [March 26, 2020, 2:42pm UTC](https://cl.desmos.com/t/feedback-for-students/559/14 "2020-03-26T14:42:09Z")

</div>

I tried this, but it says “Syntax Error: unterminated string”.

I figured out that I need to do the following to add a “Submit” button:  
submitLabel: when choice1.submitted “Move to the next slide.”  
otherwise “Submit”

But now, after clicking Submit, you can just see “edit my response”. I want the students to be told whether they are right or wrong and be told what the answer is. How do I do this? I’m new to coding, so this is quite challenging for me.

---

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [June 15, 2020, 7:45pm UTC](https://cl.desmos.com/t/feedback-for-students/559/15 "2020-06-15T19:45:02Z")

</div>

Dont know if you ever got an answer, but this is the general format I use

f = simpleFunction(“f\left(x\right)=-x^{3}+4x^{2}+2x”)

value = simpleFunction(input1.latex).evaluateAt(9)

correct = when f.evaluateAt(9)=value “Correct” otherwise “Not there yet, keep working”

content: "Add or Subtract the following polynomials and write the answer below

`(7x^{3}+4x^{2}-2x)+(-8x^{3}+4x)`

Your answer: ${correct}."

---

<div class="post-metadata">

**Author:** ![Allyson\_Klovekorn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/allyson_klovekorn/32/1066_2.png) [@Allyson\_Klovekorn](https://cl.desmos.com/u/Allyson_Klovekorn)\
**Post date:** [September 2, 2020, 9:26pm UTC](https://cl.desmos.com/t/feedback-for-students/559/16 "2020-09-02T21:26:08Z")

</div>

Hi so I am trying to do feedback students where the correct answer is a single number or possibly DNE… I’ve tried looking at the code shared by others above and tried two options and can’t get either to work. Here is what I have tried:

correct = (0)

content:  
when correct and input1.submitted “You got it right!”  
when input1.submitted “You got it wrong.”  
otherwise "Find: `lim_{x→0} \left(\frac{g\left(x\right)}{f\left(x\right)}\right)=`"

and

correct = (0)

co = when correct=0 “Correct, good work!” otherwise "Not there yet, keep working "

content: "Find: `lim_{x→-1} \left[\f\left(x\right)\cdot g\left(x\right)\right]=`

Your answer: ${co}"

If anyone can help fix my code that would be awesome.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [September 2, 2020, 11:02pm UTC](https://cl.desmos.com/t/feedback-for-students/559/17 "2020-09-02T23:02:04Z")

</div>

Take out the parentheses around 0?

---

<div class="post-metadata">

**Author:** ![Allyson\_Klovekorn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/allyson_klovekorn/32/1066_2.png) [@Allyson\_Klovekorn](https://cl.desmos.com/u/Allyson_Klovekorn)\
**Post date:** [September 2, 2020, 11:15pm UTC](https://cl.desmos.com/t/feedback-for-students/559/18 "2020-09-02T23:15:41Z")

</div>

Thanks for the reply! I ended up going down a different route after exploring some more code!! This is what I came up with and it seems to have worked. Here is the activity I created - [AP Calc Problem Set 1.5 â¢ Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5f4fd0270d4e1f0674203bbf)

Here is the code:

answer = numericValue(input1.latex)

content: when input1.submitted and numericValue(input1.latex)=0 “Great job!”  
when input1.submitted and (not(numericValue(input1.latex)=0)) “Uh oh, not quite. Check your work to see if you can find your mistake & try again.”  
otherwise "Find: `lim_{x→0} \left(\frac{g\left(x\right)}{f\left(x\right)}\right)=`"

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [September 2, 2020, 11:46pm UTC](https://cl.desmos.com/t/feedback-for-students/559/19 "2020-09-02T23:46:06Z")

</div>

Oh! Just noticed for future, there is a difference between `correct:` and `correct=`.

The first outputs a `true` or `false` based on a condition like an answer that should be 0.  
`correct: numericValue(input1.latex) = 0`  
Edit: This (or `readOnly`) is needed for the teacher dashboard to display a check.

The second is a variable `correct` that equals something, 0 in your original code. So, when you had:  
`when correct and input1.submitted`  
Desmos got confused because it looks for “true” statements. `correct`, the variable, was not `true`, it was zero; thus it was `false`.

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryn/32/40_2.png) [@Bryn](https://cl.desmos.com/u/Bryn)\
**Post date:** [September 4, 2020, 1:21am UTC](https://cl.desmos.com/t/feedback-for-students/559/20 "2020-09-04T01:21:46Z")

</div>

I like to use is\_correct for the variable and correct for the sink, to reduce the chance of making the mistake.

Side note: imagine if you could just use the sink and refer to it elsewhere in CL, rather than using an additional variable each time.

[Next page](https://cl.desmos.com/t/feedback-for-students/559.md?page=2)
