# This providing feedback on variable equations when both the input and output are variable equations like literal equations?

**URL:** <https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292>\
**Category:** Questions\
**Tags:** patterns\
**Created:** [May 12, 2022, 6:44pm UTC](https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292 "2022-05-12T18:44:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Math\_Teacher](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/math_teacher/32/3599_2.png) [@Math\_Teacher](https://cl.desmos.com/u/Math_Teacher)\
**Post date:** [May 12, 2022, 6:44pm UTC](https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292/1 "2022-05-12T18:44:22Z")

</div>

How do I create literal equation with feedback in CL?

---

<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:** [May 12, 2022, 11:26pm UTC](https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292/2 "2022-05-12T23:26:36Z")

</div>

I don’t entirely understand your question. An example would be helpful.

If you mean something like the equation of a circle, then what you’re looking for is probably parseEquation( ).differenceFunction( ). Slide 2 of this activity uses it (and parseInequality) to handle both equations and inequalities, as well as a method of correction to match a target inequality or equation (change the variable “target” in the graph CL).

If you want variables other than x and y, you’ll need to change the x and y in a number of places in the CL and in the graph.

> **[Templates and Emoji • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5df133cc9d323b0c7c284ff0)**
>
> by Daniel Grubbs

---

<div class="post-metadata">

**Author:** ![Math\_Teacher](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/math_teacher/32/3599_2.png) [@Math\_Teacher](https://cl.desmos.com/u/Math_Teacher)\
**Post date:** [May 13, 2022, 12:27pm UTC](https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292/3 "2022-05-13T12:27:55Z")

</div>

An example of the type of problem I want to give is  
“Solve for t in D = rt and I want the student to give me t = D/r.” (Actually, the prettier form of the fraction.)

---

<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:** [May 13, 2022, 2:36pm UTC](https://cl.desmos.com/t/this-providing-feedback-on-variable-equations-when-both-the-input-and-output-are-variable-equations-like-literal-equations/4292/4 "2022-05-13T14:36:14Z")

</div>

I’d probably use pattern matching for this.  
In a math input’s CL:

```auto
p=patterns
eq=parseEquation(this.latex)
check= p.literal(`t`).matches(eq.lhs) and p.fraction(p.literal(`D`),p.literal(`r`)).matches(eq.rhs)
correct: check
#if you want student feedback:
suffix: when not(this.submitted) "" 
        when check "✅"
        otherwise "❌"

```
