# Input box entry updates whole construction

Mihaela Kelava shared this question 3 years ago

Hi,

when I enter solution in textbox for the first time, whole construcion gets updated making possibly correct answer wrong (since it changed).Also, I cannot make my variable "unos" defined as imlicit function on the start (which would solve the problem) because then I will not have empty textbox, but "?=?" and I need it to be empty.

Also tried to enter equation solution as text (not as implicit function) but then it says it's incorrect when I compare it to solution converted to tekst.

Does anyone have suggestion how to fix this?

Thanks!

2

Maybe with this possibility:

• A text field is assigned to the InputField.
• When updating the text field, a script is started that converts the text into an equation using Execute.

Attached a sample.

1

Thank you so much! That's it!

1

a variant (with SetValue() instead of ":=" )

But maby less robust.

2

and if you enter 2=2..?

and if you enter y=x, the line is created in graphics (not sure that Kelava want this...)

1

HI

put 0=0 in unos at start

Edit : very strange sometimes works at start, sometimes not :(

1

Well, I don't want any of the things jumera said but I did it with some extra code - it's not nice and it looks very complicated but it works as I want :-) You cannot enter anything except equation.

Thanks for help!

1

The equation (or anything except equation) you enter is deleted :

• if you valid your equation

• if you clic on the button provjeri

If you want this... it is nice...

1

There are some improvements for this coming in v563. To take advantage you'll need to make sure your random numbers are in their own objects so change

```m = If(b ≟ 2, RandomElement({-4, -3, -2, -1, 1, 2, 3, 4}), If(b ≤ 4, RandomElement({-2, -1, 1, 2}), RandomElement({-1, 1})))
n = If(a ≟ 2, RandomBetween(1, 4), If(a ≤ 4, RandomBetween(1, 2), 1))```

to

```m1=RandomElement({-4, -3, -2, -1, 1, 2, 3, 4})
m2=RandomElement({-2, -1, 1, 2})
m3=RandomElement({-1, 1})
m =If(b ≟ 2, m1, If(b ≤ 4, m2, m3))

n1 = RandomBetween(1, 4)
n2 = RandomBetween(1, 2)
n=If(a ≟ 2, n1, If(a ≤ 4, n2, 1))```