How do I create/verify an inequality in the math input box

Thanks in advance. I’m very new to computational layer, but I do have extensive programming experience (although it is outdated).

Possible answers are
3240<50s
64.8<s
65<=s
or the reverse i.e. 50s>3240

I’m only using the math input box for student input on this question. Their answer is based on a specific scenario given in the notes box and a table. I’m trying to use parseInequality, but I’m getting undefined when I put an inequality in the math input box.

I have the following in the CL of the math input box
studentInput=parseInequality(this.latex)
lhs = studentInput.lhs
rhs = studentInput.rhs
strict = studentInput.isStrict
leftGreater = studentInput.isLeftGreater

In a notes box I am trying to display lhs and rhs just so I can figure out what to do next, but I’m just getting “Undefined”

Any help is greatly appreciated.

Can you give a link to what you have so far?

I don’t see any reason why what you have so far shouldn’t work. I’ve just used the following:

T=parseInequality(ans.latex)

lhs=T.lhs
rhs=T.rhs
strict=when T.isStrict "TRUE" otherwise "FALSE"

which is broadly the same as yours (note that if you want the note to display the strictness status, you have to give it options as above).

It performs as expected:
Recording 2025-01-17 at 15.22.42

Can you confirm exactly what you’ve put in the notes section to reference the studentInput variables? It should look something like [name of input box].script.lhs

content: "lhs: {r4.script.lhs}; rhs: {r4.script.rhs}; "

You responded to another question of mine and requested the project. This is the same project and it is for slide 5 of that project. Here is the link again.

The copy of the activity you have linked shows the following definition in component r4:

studentInput=parseInequality(r3.latex)

If you change it to what you have written above it should parse as intended:

studentInput=parseInequality(this.latex)

Thanks. It worked. I must have changed the component name and didn’t realize it. Or it was just a typo and I didn’t catch it.