Podmínky zobrazení objektu

Pražanová Lenka shared this question 2 years ago

Dobrý den, prosím o radu. Ráda bych nachystala žákům úlohu, kterou když správně narýsují, tak se jim zobrazí nápis OK. Situaci jsem zkusila popsat - viz příloha.

Děkuji moooc za pomoc. Pražanová Lenka (prazanova.lenka@seznam.cz)

Comments (5)


Dobrý den, nepomůžu, ale mám stejnou otázku. Nestudovala jsem důkladně Váš dokument, ale v podstatě jde o totéž - zobrazí se obrázek, když budou konkrétní body správně umístěné. Nemůžu přijít na syntaxi toho příkazu, který ten obrázek vyvolá. Pomohl Vám někdo a byla byste případně ochotná mně přeposlat řešení? Děkuji. :)


Go to the object properties of the image (or other object you want to show). Under "Advanced" you have a field "Condition to Show Object" ("Podmínky zobrazení objektu") where you can set the condition.

In case it's a more complex condition, it can be more convenient to define a boolean variable that holds the condition and just use this in the "Condition to Show Object" field. (This might also solve the problem of the original poster, although it's not clear why there was a problem in the first place because name changes of objects are automatically applied to the "Condition to Show Object" field.)


Hello, thank you for your answer. Here is the applet: https://www.geogebra.org/cl...

I don't think it's a complicated condition but I don't even know what a boolean variable is (I'm not really good at this) but I managed to create the Input Boxes using conditions for their visibility. They are visible only when the points A', B' and C' are in the predefined position (coordinates). At least something. But what I'd really like is, that if the points A', B', C' are in the right position (all of them at the same time), the thumb image appears. I'm not able to find the commands (the database of commands isn't working) and I don't know how to write them (like the "If" command - I even don't know, if this is the right one in this case).

I'd be very glad if you could look at it. Thank you :)


Simple variant: In the "object properties" of the image, "Advanced" tab, "Condition to Show Object" field, just enter

A' ≟ (-10, 4) ∧ B' ≟ (-8, 0) ∧ C' ≟ (-11, -2)

(You can write "==" instead of "≟" and "&&" instead of "∧", GeoGebra will automatically change it to the other symbols.)

"∧" just means "AND", so all three conditions must apply.

This works, but can be annoying to change if you make changes to the problem. For example, if you want to change the condition for point A', then you have to change the field for the InputBox and also for the Thumb image.

Generally, when the same condition is used for more than one object, it might be more convenient to set up some boolean variables (variables that have values TRUE or FALSE) to be used for the visibility options. For example, simply define them via the Input field:

isCorrectA: A' == (-10, 4)
isCorrectB: B' == (-8, 0)
isCorrectC: C' == (-11,-2)
isCorrectAll: isCorrectA && isCorrectB && isCorrectC

and use those variables as visibility conditions, i.e., in the "Condition to Show Object" field of the input field for A' just type "isCorrectA" (without the quotation marks), and in the one for the thumb image, just type "isCorrectAll", etc. (And of course you can also use other names for those variables.) And if you want to change condition, e.g., for the point A', just change the definition of isCorrectA accordingly, and isCorrectAll will automatically have the correct value as it depends on isCorrectA.

There is another thing you could do to make this better suited to changes in the problem. At the moment, your conditions contain specific values for A', B', C', so if you want to change the problem by moving A, B, C or the symmetry line, your conditions wouldn't work anymore, and you would have to change them accordingly. Instead, you could just let GeoGebra handle this automatically by having more dynamic conditions:

isCorrectA: A' == Reflect(A, o_1)
isCorrectB: B' == Reflect(B, o_1)
isCorrectC: C' == Reflect(C, o_1)

That way GeoGebra compares the position with the actual reflected points. Which means you can make any changes to A, B, C, o_1 without ever having to change the conditions.

Btw, why are you showing an InputBox when a point is correct? Do you want the student to change the correct point again via the InputBox? If you only want to show the coordinates, then maybe a Text field might be more appropriate than an InputBox.

See here for a full implementation: https://www.geogebra.org/m/xkdfjv9x

(I also included Text objects for the points in case you are not so familiar with their capabilities. Also used different frame styles to show some possibilities that are easy to achieve.)


Wow, thank you very much. For now I'm good with A' ≟ (-10, 4) ∧ B' ≟ (-8, 0) ∧ C' ≟ (-11, -2). I even tried to write something like this (I know the symbol ∧) but I put "If" at the beginning of the condition and that was obviously the problem.

© 2023 International GeoGebra Institute