This exercise type allows you to use a GeoGebra applet as a sort of input field.

You can create an applet with predefined objects that have to be manipulated to get to the correct answer, or draw hidden target objects that have to be matched by the user.

# Answer Evaluation

## In the applet

If you set the evaluation type of the solution to `ggb in applet`

the correctness of an answer is determined completely within GeoGebra.

To do this you have to define the variable `swCorrect`

inside your applet. An answer is considered correct if the value of this variable is set to true and incorrect otherwise. By making the value of `swCorrect`

dependent on other objects inside the applet you can create exercises where existing objects have to be manipulated in order to get to the right answer.

## Using target objects

If you set the evaluation type of the solution to `ggb targets`

the correctness of an answer is determined by the objects that exist in your applet. These objects can be created by the user.

In this case you set the solution to the minimum number of target objects that have to be matched for a correct answer. A target object is an object inside of the applet whose name is `swTarget`

followed by a subscript number, for example: `swTarget_1`

. Note that you cannot see the `_`

in GeoGebra, it is used to make the number a subscript. A target object is matched when there is another object in the applet that is equal to that target object. GeoGebra is used to determine if two objects are equal (`swTarget_1 == f`

) and objects that start with `sw`

are ignored for this check.

Note that GeoGebra compares Polygons and Line Segments by their surface area and length. That means that these two Segments are equal, even though they are not on the same position: `Segment((0,0), (0,1)) == Segment((1,0), (1,1))`

. To make sure the student created the correct Polygon or Line Segment, you can also add the points that define them as target objects.

# Feedback

## In the applet

Set the evaluation type to `fb_ggb_in_applet`

. What feedback should be given is determined by the variable `swFeedbackNumber`

inside the GeoGebra applet. If this number is equal to the number in the definition of the feedback rule that feedback rule will be triggered.

You can also give feedback inside the applet itself, using the variables `swShowFeedback`

and `swShowCorrect`

that should be defined in the applet. You can then only show an object if a variable is true, for example. In the applet, `swShowFeedback`

is set to true when the given answer is incorrect and it is set to false otherwise. And, also in the applet, `swShowCorrect`

is set to true when the exercise is answered correctly and it is set to false otherwise.

## Missing target objects

Set the evaluation type to `fb_ggb_missing_target`

. This feedback is triggered if no object is found that is equal to the target object with the number in the definition of the feedback. For example the objects `swTarget_1`

(target object 1) or `swTarget_{12}`

(target object 12) for numbers with more than one digit. Note that you cannot see the `_`

or `{}`

in GeoGebra, these are used to make the number a subscript.

You can use this to give feedback on what still has to be done for a correct answer.

## Found extra objects

Set the evaluation type to `fb_ggb_extra_object`

. This feedback is triggered if an object is found that is equal to the extra object with the number in the definition of the feedback. For example the objects `swExtra_1`

(extra object 1) or `swExtra_{12}`

(extra object 12) for numbers with more than one digit. Note that you cannot see the `_`

or `{}`

in GeoGebra, these are used to make the number a subscript.

You can use this to give feedback on an incorrect approach.

# Preparing and inserting an applet

## Screen size

The screen you're creating the applet in will be bigger than how it's shown in the exercise. Right before saving or exporting you can make the geogebra window smaller and drag everything to the right place, so that it will also look good inside the exercise.

**Toolbar**

You can customize the toolbar in GeoGebra and remove tools that aren't necessary for the exercise. The toolbar can also be hidden entirely inside the text editor.

## Hosting on GeoGebra or uploading

If the applet is uploaded on GeoGebra you can use the applet's material id (for example `pbf4tmab`

). You can also download the .ggb file and upload this to the exercise.

## Insert into exercise

GeoGebra applets can be inserted in the texts of an exercise, GeoGebra can be found in the insert menu. You will at least need to insert one into the question text. While inserting an applet, you can set the source, size, image for exporting, several properties like allowing zoom and showing the toolbar, and pass exercise variables to the applet.

## Passing variables

You can pass variables to the applet in the geogebra edit window in the text editor (right click on an applet or select an applet and choose the GeoGebra applet in the insert menu). An example is `a = $a`

, this will set the variable `a`

in the GeoGebra applet to the value of the variable `$a`

in the exercise.

If the solution of your exercise depends on the exercise variables you can also pass a variable to a separate GeoGebra applet that shows the solution in the solution text.

## Client side evaluation

Unlike other exercises this exercise type is evaluated client side. Please note that a user could manipulate the GeoGebra applet using JavaScript to get a correct answer without actually doing the exercise.