New sinks for expression inputs!

We just added some new sinks to expressions. Give 'em a whirl.

errorMessage: shows an error icon with a tooltip. Recommended anytime that you can’t correctly parse / interpret the student’s input. Note: this is different from “warning”. Warning shows up for teachers in the Summary tab, “errorMessage” shows up just to the student. You may want to use both for syntax errors, but prioritize errorMessage, to give the most actionable feedback to students.

suffix: adds a string to the end of an expression input that shows up when the input is focused and when the input has content. Recommended for units (e.g. “ft”) or for percents ("%").

submitLabel: override “Submit to teacher” and “Submit to class” with custom button text (e.g. “Try it!”)

resetLabel: override the default reset text (e.g. to “Try again”)

5 Likes

I’m really excited to see these sinks – thanks!

I tried the errorMessage one and found that it displayed the “error” icon within one second of the screen showing to the student. I feel as though a better default behaviour would be to only display the message when not(isBlank(exp.latex)) – I realise I can add this to all my tests, but I can’t imagine a situation where it would be a good UI to display an error before a user has interacted with the screen. (Especially because students cannot submit on blank anyway.)

Maybe another good default would be to submitDisabled: true when the error message is non-blank? But that might have other repercussions that I haven’t considered.

Is there a way to put LaTeX in the suffix? I tried backticks but that didn’t help…

Good call – I’ll add support for latex in the suffix

1 Like

Awesome, we’ll be able to translate the buttons in French now! Thanks

1 Like

Could we also have a prefix? I’m thinking x= or something else. We can tell it to include the x= at the start, but they can backspace it out.

4 Likes

You can do that with the initialText sink

I think ASmith was saying that it’d be nice to have a prefix that the students couldn’t delete. When you use initialLatex to write “x=”, the students can delete it. Then if your CL code is expecting to see x= at the front, it’ll get marked wrong.

I was hoping for something similar to lock in the square root sign in Screen 36 of this activity:

primarily because if students delete the square root sign, the won’t know how to get it back (there’s no symbol menu in expression input, so they have to know to type sqrt().

1 Like

Understood, thanks! I misinterpreted the request.

When a student struggled after backspacing the x= from the front of the input box, I started looking for a command to fill the latex on reset. It doesn’t exist at this point, but Eric replied to another thread: https://cl.desmos.com/t/set-latex-on-reset/390
I can see power in both a prefix and a reset command. I also see the power in them being able to backspace out the initial latex to “correct” a statement or something.
in other words, we are very excited about the potential of desmos and “we want it all!” :wink:

1 Like

How do you get the error message to go away?

errorMessage: when input1.numericValue<0 or input1.numericValue>1 “Number must be between 0 and 1”
otherwise " "

But when I put a number between 0 and 1, it won’t let me submit my answer, an error symbol shows up, but not the error message.

Is your input box set to math?

Can you share your activity?

The error message should show up if you hover over the error symbol. Does that work?

I noticed there is a space between your otherwise statement. Try using “” rather than " ". I think the error message is showing a space which is why we cannot see it.

2 Likes

I am sorry. Since some conversations are deleted from this thread I did not know if you want ME to share one of my activities or if this was meant for someone else in this thread.

Sorry, that reply was for Eileen.

Yes, it was the space between the " "

Is there an example of latex being used in cellSuffix? I’m wanting cm².

1 Like

Personally I’d recommend not using latex for cellSuffix even if it exists, because of semantic reasons.

Better to use native html elements such as:

² and ³ etc.

Like so:

3 Likes