New sinks for expression inputs!


#1

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”)


#2

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.


#3

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


#4

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


#5

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


#6

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.


#7

You can do that with the initialText sink


#8

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().


#9

Understood, thanks! I misinterpreted the request.


#10

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:


Set Latex on Reset?