Input box entry updates whole construction

Mihaela Kelava shared this question 1 month ago
Needs Answer

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!

Comments (8)

photo
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.

photo
1

Thank you so much! That's it!

photo
1

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

But maby less robust.

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

photo
photo
1

HI

put 0=0 in unos at start

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

photo
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.

https://www.geogebra.org/m/tmzq9bkw


Thanks for help!

photo
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...

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

© 2019 International GeoGebra Institute