# Referencing a Math Input correctness check

**URL:** <https://cl.desmos.com/t/referencing-a-math-input-correctness-check/2343>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [January 9, 2021, 10:15am UTC](https://cl.desmos.com/t/referencing-a-math-input-correctness-check/2343 "2021-01-09T10:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MissAtef](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@MissAtef](https://cl.desmos.com/u/MissAtef)\
**Post date:** [January 9, 2021, 10:15am UTC](https://cl.desmos.com/t/referencing-a-math-input-correctness-check/2343/1 "2021-01-09T10:15:12Z")

</div>

Hi,

when building more involved activities I noticed it would be nice to be able to reference the _correct_ expression (or its result) of a _Math Input_ in other Components.  
For example: I have a question where I like to give feedback based on the submitted answer. The feedback is shown via a _Note_.

So something like this in the _Note_ script would be nice:

```auto
content: when input1.isCorrect() "Correct Answer!" otherwise "Try Again."

```

Otherwise I have to (re-)write the correctness expression in multiple scripts.

Or is there some best practice for this use case?

---

<div class="post-metadata">

**Author:** ![Susan\_Lauer](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/susan_lauer/32/1832_2.png) [@Susan\_Lauer](https://cl.desmos.com/u/Susan_Lauer)\
**Post date:** [January 9, 2021, 2:53pm UTC](https://cl.desmos.com/t/referencing-a-math-input-correctness-check/2343/2 "2021-01-09T14:53:19Z")

</div>

In the **Note** CL, put this:

```auto
content: when not(input1.submitted) "" otherwise when input1.script.correct = input1.latex "correct" otherwise "try again"

```

In the **Math Input** CL, add a variable I called correct (You can see **correct=** ,which is not the same as the sink **correct:** ), then you can use it for the correct sink, too:

```auto
correct=`y=3x+5`
correct: this.latex= correct

```

I used the latex content, but you could have used the numeric values.

---

<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:** [January 9, 2021, 11:18pm UTC](https://cl.desmos.com/t/referencing-a-math-input-correctness-check/2343/3 "2021-01-09T23:18:23Z")

</div>

I like to use `check` for my variable, so there’s no confusion with the correct sink.

Also, (probably just an oversight, since you’ve done it other ways before), the first `otherwise` isn’t necessary.
