No warning when renaming to a special name used by Geogebra

Stéphane_C shared this question 2 years ago
Answered

I think the title explains well the reason for the problem and how to fix it.

As for the possible outputs of this situation I can't be exhaustive.

In the first attached file a segment has been renamed "Line" and there is also a line called f whose definition is "Line(C, D)". If you try to change this definition to "Line (C, A) then f turns into a number with the definition "Line(C)".

Similar bugs can be triggered using different methods, in some cases once one line have already been turned into a number it can be enough to just select a line, display its settings, click in the definition field without changing anything and then click elsewhere to turn this line into a number.


I joined a second file to show similar bug with the command "Midpoint". To trigger the bug load the file "Rename bug 2" then try to change the definition of the point C from "Midpoint(A, B)" to "Midpoint(A, D)" and then C becomes an undefined object with the definition "Midpoint(A)".

I guess any command used by Geogebra can lead to similar bug.

As for a possible treatment for this problem as I suggested in the title maybe Geogebra should display a warning message when renaming to a special name with a special meaning for Geogebra. That's the idea that came to me from the point of view of a Geogebra user.

But that's just a suggestion, I am no programmer and furthermore I don't know the internal structure of Geogebra's functioning. Maybe that idea might be difficult to implement, maybe it might get the software slower, maybe there are other ways to prevent such bugs with a better pros/cons situation.

Comments (9)

photo
1

Here are also some explanations about the specific conditions which led me to this bug.


Firstly there is kind of a bug in the French language, the name "droite" can both means "on the right side" (not the left one) or "line". At some point I wanted to rename some objects and for one of them the thing that characterize it mainly was that the object was on the right side, so I just went for the name "Droite". Then it managed to trigger bugs because I wanted to change the definition of some lines and with Geogebra configured in french the command to define a line is also "Droite".

I guess there can be some similar traps in every language and Geogebra surely uses a lot of different names as commands so it increases the risks of such bugs.


Also I encountered this bug while trying to model a graphical shape. This shape include many small elements disposed according to patterns. In order to get my bearings I renamed all the objecs to names that makes sense for this graphical shape. And doing many renaming also increases risks of bugs related to renaming.

So those bugs might only occur on some rare cases, anyway maybe there can be a way to prevent them with a good pros/cons situation.

photo
1

Sorry, it works for me. Please say exactly what you did to get the error

photo
1

In his file Renam bug 2, create


Midpoint(A,C)
and see the bug

(also read my comments here...)

photo
1

Bonjour,


je confirme le problème, sans le cautionner, le segment [DE] a été nommé Midpoint (quelle drôle d'idée)

alors la validation de la commande Midpoint(A,C) retourne un nombre Midpoint(A) et pas du tout vu à quoi correspondait ce nombre ....


mais pourquoi utiliser des commandes en anglais (hors scripts) dans un fichier en français ? Utiliser MilieuCentre(A, C)

photo
1

Here are more detailed instructions


For the first file "Rename bug 1.ggb" :

  • Open Geogebra Classic 6, either on your computer or by launching it into your browser.
  • Make sure the language is set to English (US)
  • Open the file "Rename bug 1.ggb"
  • Open the settings for the object f
  • Change the definition from "Line(C, D)" to "Line(C, A)"
  • Press Enter, f should have been turned to a number with the definition "Line(C)"


For the second file "Rename bug 2.ggb" :


  • Open Geogebra Classic 6, either on your computer or by launching it into your browser.
  • Make sure the language is set to English (US)
  • Open the file "Rename bug 2.ggb"
  • Open the settings for the object C
  • Change the definition from "Midpoint(A, B)" to "Midpoint(A, D)"
  • Press Enter, C should now be a point with the definition "Midpoint(A)" and the value "undefined"

instructions given by jumera should trigger a bug too, when entering

Midpoint(A,C)

in the input bar then pressing Enter it gives a number named "a" with the definition "Midpoint(A)" and the value "6.62"

photo
1

mais pourquoi utiliser des commandes en anglais (hors scripts) dans un fichier en français ? Utiliser MilieuCentre(A, C)

I don't think the file is in french, from what I understand a Geogebra file is not tied to a specific language.

For example if you open the file "Rename bug 1" while Geogebra is set with language to be french then the object f will have the definition "Droite(C, D)" whereas if you open the same file while Geogebra is set with language to be english (US) then the object f will have the definition "Line(C, D)"

je confirme le problème, sans le cautionner, le segment [DE] a été nommé Midpoint (quelle drôle d'idée) 

As said above there can be bugs in languages, for example in french with the word "droite" which can both means "on the right side (as opposed to the left one)" or line. The second file "Rename bug 2.ggb" is just here to give another example of how to technically trigger a similar bug.

photo
photo
1

An answer about using captions to avoid this problem :

Indeed captions offer a way to show what you want on the graphic without having to change the name. But one may want to be able to easily identify objects in the Algebra panel. But in this panel it is not possible to identify or sort objects according to their captions, so for this purpose the best solution seems to change the name of objects.

Anyway captions might be a way to improve Geogebra for this problem, being able to identify and sort objects according to their caption would avoid the need for renaming therefore limit the risk of bugs related to renaming.

So thanks jumera for this idea and sorry I did not replied earlier about your captions idea.

photo
1

Thanks, I see - it's not a bug (as we can't disallow names for all commands in all (possible future) languages)


Once you've made eg MidPoint then MidPoint(...) is interpreted as MidPoint * (...)

photo
1

Another important aspect of this problem is that it can be sneaky.

When you rename an object to a name which is also a command used by Geogebra nothing special happens.

In the example of the file "Rename bug 1.ggb" you can even build new lines without problems if you use tools from the toolbar.

It might be only later that bugs happens.

My recent experience is that in a big file with many objects I carelessly renamed a segment "Droite". But there was no visible problem at the moment and I build maybe 30 more objects without any problem. It's only when I wanted to change the definition of some lines that something weird happened. I thought that changing the definition of an object was only possible in some conditions or maybe that the fact that there were many objects gave problems to Geogebra. I had hard times understanding the real source of those bugs, actually I tried many things to avoid this bug. Then I thought I might ask for help on Geogebra forums and I thought I should try to be as precise as possible about what was happening. So I kind of did some debugging and managed to find the real source of those problems myself. It was a relief for the file I was working on. And I thought maybe it should be possible to avoid this problem to happen to other people.

© 2023 International GeoGebra Institute