I have a sketch component and I want students to draw a single line on it. I would like it so they can also erase/reset the line and re-draw it if they are unhappy.
I have disabled drawing tools other than the line tool for the sketch. I can only think of two options and neither of them really does what I want.
Can anyone suggest a way to achieve what I’m looking for?
resetOnChange: when this.sketch.strokeCount < 2 "0" otherwise "1"
This has the downside that a student needs can draw two lines but then the sketch is cleared once the second line is drawn (counterintuitive interface, implying that they can successfully draw two lines).
disableSketch: this.sketch.strokeCount = 1
This has the correct behaviour in terms of not allowing a second line to be drawn, but there is no way for the student to erase the line or reset the sketch because it is completely disabled. (I could possibly make a separate button on the page to reset, but that is not a great interface when we already have a reset sketch button.)