Input box show variable name instead of its value

Morten Eyrich shared this problem 2 years ago
Not a Problem

f(x) = 3x

a = 3

b = 4

I insert a button with the Click-script: "f(x) = a + b"

When I click on the button, "f(x) = 3 + 4" is shown in the Algebra window.

If I then insert an input box and choose to relate it to the function f, "a + b" is shown in the input box. If I then set it to "Symbolic", "a + b" is still shown in the input box, but in LaTex style.

This is a very nice feature when using an input box in relation to algebra. I would therefore very much like to preserve this option.

But when it comes to use an input box to show a calculation with numbers, it's a bit annoying that it show variable names instead.


Therefore I'll suggest that the value of the used variables are shown as standard, and the name of the used variables only is shown when "Symbolic" is checked.


But of cause there may also be a third usage where the teacher would like to show an expression in an input box that both contain numbers and the name of some variables. For example: "3a + 7b". In that case you would probably need to think of a third option to make this possible. Or the teacher would need to create a text-string that shows this instead of getting it shown in a input box. But of cause, when creating a lot of input boxes, it would be a bit easier and faster just to get the correct answer to be shown in each input box.

Comments (6)

photo
1

I don't think any changes are needed. If you have a specific things you can't do (and actually need) then please ask

photo
1

Well, I ask because I'm working on an applet with quite many input boxes, and by pressing a button I would like GeoGebra to show the right answer in every shown/visible input box.

Some of the input boxes is only for entering a single integer and its easy to get GeoGebra to show the right answer in those.

But in the input boxes where I would like the students to enter a calculation (to check if the students insert the integers correctly in a given formula), I can't get GeoGebra to show the correct answer as GeoGebra just show the name of the variables instead of their value.

And that's the reason why I have posted the comment above.

So yes, I have specific things I can't do and actually need. :)

photo
1

by pressing a button I would like GeoGebra to show the right answer
Use "Condition to Show Object" to hide the Input Box and show a text


https://wiki.geogebra.org/e...

photo
1

Yes, this is an option. As I also mentioned in my first post above.

And as I haven't got any other useful alternatives, I got to do it this way.

But it is MUCH more time consuming to do it this way when you got more input boxes to the right of it and when you also have to create if-sentences in the text for several parts of the output to get brackets shown around every negative factor or in case + or - should be shifted according to the positive or negative values of the variables.

So I will highly recommend that the value of the used variables are shown as standard, and the name of the used variables only is shown when "Symbolic" is checked. And think of a way to be able to also show a combination of numbers and variable names as for example: "3a + 7b".

photo
1

create if-sentences in the text for several parts of the output to get brackets shown around every negative factor or in case + or - should be shifted according to the positive or negative values of the variables.

That's not necessary, use the FormulaText() command

photo
1

And think of a way to be able to also show a combination of numbers and variable names as for example: "3a + 7b".

That's possible. Please post your .ggb file and explain what you want in a new thread.

Comments have been locked on this page!

© 2023 International GeoGebra Institute