Google Classroom
GeoGebraGeoGebra Classroom

Radio buttons

Introduction

As an alternative for checkboxes you can use Points as radio buttons. In following applet Points A, B and C are used as Radio buttons to select one out of three equal options. Points D, E and F are Radio buttons to answer a question. While using dynamic coloring, you don't need additional text to provide feedback.

How do you do this?

  • PointStyle: You can define different Pont styles with the command SetPointStyle(). Use - SetPointStyle( , 0 ) for a full dot - SetPointStyle( , 2 ) for an empty dot
  • Selecting a Point: When selecting a point we make sure that the other options are deselected. We do this in the tab Scripting of the Properties with the option Onclick. So for the points A, B and C we use following commands:
    Point APoint BPoint C
    SetPointStyle(A,0) SetPointStyle(B,2) SetPointStyle(C,2)SetPointStyle(A,2) SetPointStyle(B,0) SetPointStyle(C,2)SetPointStyle(A,2) SetPointStyle(B,2) SetPointStyle(C,0)
  • Coloring for feedback: f(x) is a rational function. Using dynamic colors we can ensure that E colors green when selected, while D and F will color red. Selecting and deselecting of D, E and F is done the same way as A, B and C. We add the command SetColor( , "color") to give feedback on the answer:
    Point DPoint EPoint F
    SetPointStyle(D,0) SetPointStyle(E,2) SetPointStyle(F,2) SetColor(D,"red") SetColor(E,"blue") SetColor(F,"blue")SetPointStyle(D,2) SetPointStyle(E,0) SetPointStyle(F,2) SetColor(D,"blue") SetColor(E,"green") SetColor(F,"blue")SetPointStyle(D,2) SetPointStyle(E,2) SetPointStyle(F,0) SetColor(D,"blue") SetColor(E,"blue") SetColor(F,"red")
  • Deselecting all: The easiest way to deselect all points is a button with the command SetPointStyle( , 0 ) for all points.