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