How to convert a text-string to a function with out getting it reduced ?

Aritmometer shared this question 2 months ago
Answered

How to convert a text-string to a function with out getting it reduced ?

I have an input field where the students are going to be forced to enter a calculation (and not just the correct result) and I want to get GeoGebra to check if the whole calculation have been entered correctly.

To do that I would like to convert the text string (that is related to the input field) to a function to make sure that any space between its elements is eliminated and to compare it with another function which contain the right calculation.

I have tried to do so in three ways: By using the command ConvertToFunction/TranslateToFunction, Execute and by relating the input field directly with a function. But all of them ends up with a function that only contains the result of the calculation.

How can I convert the whole text-string to a function instead of only the reduced text-string ?

I’m using GeoGebra 5 Classic.

Comments (8)

photo
1

Link the Input Box directly to a function - no need to use strings

f(x)=sin(x)
InputBox(f)
SetValue(f,?)

photo
2

(then set Input Box to Symbolic)

photo
1

Thanks.

Here others may see how to do it: https://www.geogebra.org/m/tfhnauau

photo
1

I have tried to create first a function and then a input box, then create a relation with the function and then choose Symbolic under Algebra for the input box.

Afterwards I can’t seem to be able to enter the input box and write something in it. It seems locked.

What shall I do to also be able to enter it and write something in it ?

photo
1

I should probably mention that I use the Linux version of GeoGebra 5 Classic from February 2020.

photo
1

February 2020

Please upgrade

photo
1

Yes with the latest update the input box isn’t locked.

It seems that when entering a calculation with more than one * or one * and at least one + or -, then the multiplication gets calculated and reduced.

Could you change this so the multiplication isn’t reduced either ?

Also I would appreciate if it would be possible to get • shown between letters in the input box. So when for example the formula b^2 - 4 • a • c is shown in the input box, the students just have to substitute the letters with numbers without the need to also write • between the numbers.

If the students don’t do this, the program will stall.

As an alternative, you could make a error-message saying that there have to be placed some operation signs between the numbers so that the program won’t stall and the students become aware of the cause and what to change and remember next time.

But of cause it would be easier for the students with the first solution.

A third alternative would be to make it possible to convert a string to a function without the expression is reduced. That would also make it possible to use input boxes for this purpose without the students have to delete the content of the input box before writing a new input and without having a content that can misguide the students.

photo
1

When writing an expression that contain more than one “-“ or “+” in a symbolic input box the expression is also being reduced automatically.

© 2020 International GeoGebra Institute