Math Response with Chemical Formula - Correct Check

I am trying to figure out how to check for correctness using the Math Response box for chemical formula inputs (ex: H2O with the 2 as a subscript). How would I get it to read the input and provide feedback to the student (and on dashboard)?

Thank you!

I think that recognizing H_2 O could be a problem because subscripts are considered part of the name of the variable. Subscripting is not considered as an operation … so H_2 would just be the name of a variable.

@Daniel_Grubbs ?

Is there a way for it to check correctness of H2O without considering subscripting? I can work with that too.

here’s how to do it:

https://teacher.desmos.com/activitybuilder/custom/673e2b252a61bec0968fe2e6

@Daniel_Wekselgreene : is there a way to match subscripts?

There’s likely nothing evaluative you can do to check. This is probably an instance where latex matching is your only real option.

isWater = this.latex = `H_{2}O` or this.latex = `H2O`

I included the second part if you wanted to allow without the 2 as subscript as well.

I would add to Daniel’s solution there, that this is one instance where exactness matters.

H₂O≠OH₂ in Chemistry nomenclature so H_{2}O would be the only correct solution(pun intended).

I think I’m still a little confused.

When I try to add H2O to the math response box, the submit button is greyed out. It seems to not allow H2O with or without CL.

I added this CL to the math response box (mr6).

isWater = this.latex = H_{2}O or this.latex = H2O
errorMessage: when not(isWater) “Enter the correct molecule.” otherwise “”

Do I also need another note box?

I would like for students to get a check or X if they’re correct or incorrect.

Thank you!

I updated the link above including Daniel’s suggestions … I hope it’s more clear now:

https://teacher.desmos.com/activitybuilder/custom/673e2b252a61bec0968fe2e6