Interactive Addition and Subtraction Practice
2014-12-11 03:12
An interactive arithmetic practice tool for addition and subtraction. The system randomly generates math problems using the Random command, and students enter their answers in input boxes. Upon clicking a button, the tool automatically checks correctness. This example demonstrates how to build a self-grading math exercise using GeoGebra's interactive components including Random, Textfield, InputBo
Loading the GeoGebra board and drawing, please wait…
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.42.0" id="944df81b-f976-45d9-b253-53f8141dda0c" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="561" height="455" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.35650623885918004" orientation="1" />
</panes>
<views>
<view id="4097" visible="false" inframe="true" stylebar="true" location="1,1,1,1" size="400" window="89,239,700,550" />
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 | 551 550 11 , 22 , 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502" visible="false" inframe="false" stylebar="false" location="1,1,1" size="500" window="100,100,600,400" />
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="false" location="1,1" size="300" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="true" location="1" size="550" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="false" location="3" size="200" window="100,100,250,400" />
<view id="16" visible="false" inframe="false" stylebar="false" location="1" size="150" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="true" items="0 39 | 1 501 67 , 5 19 , 72 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 | 30 29 54 32 31 33 | 17 26 62 73 , 14 68 | 25 52 60 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />
<input show="true" cmd="true" top="false" />
<dockBar show="true" east="true" />
</perspective>
</perspectives>
<labelingStyle val="0"/>
<font size="12"/>
<graphicsSettings javaLatexFonts="false"/>
</gui>
<euclidianView>
<size width="550" height="318"/>
<coordSystem xZero="543.0000000000002" yZero="338.0000000000001" scale="49.999999999999986" yscale="50.00000000000003"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="1" grid="10"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<spreadsheetView>
</spreadsheetView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0"/>
<coordStyle val="0"/>
<angleFromInvTrig val="false"/>
</kernel>
<scripting blocked="false" disabled="false"/>
<construction title="Add and subtract" author="" date="">
<element type="button" label="button1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="48" y="85"/>
<labelMode val="0"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="a=Random[100,999] b=Random[100,a] new1=false new2=false "/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<caption val="下一題"/>
</element>
<command name="Random">
<input a0="100" a1="999"/>
<output a0="a"/>
</command>
<element type="numeric" label="a">
<value val="253.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Random">
<input a0="100" a1="a"/>
<output a0="b"/>
</command>
<element type="numeric" label="b">
<value val="185.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="c" exp="a + b" />
<element type="numeric" label="c">
<value val="438.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="d" exp="a - b" />
<element type="numeric" label="d">
<value val="68.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<element type="numeric" label="ans1">
<value val="0.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="0" max="2000" absoluteScreenLocation="true" width="200.0" x="30.0" y="50.0" fixed="true" horizontal="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<element type="numeric" label="ans2">
<value val="0.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="0" max="999" absoluteScreenLocation="true" width="200.0" x="30.0" y="50.0" fixed="true" horizontal="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<command name="Textfield">
<input a0="ans1"/>
<output a0="inputBox1"/>
</command>
<element type="textfield" label="inputBox1">
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="245" y="106"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript onUpdate="new1=true "/>
<linkedGeo exp="ans1"/>
<length val="4"/>
</element>
<command name="Textfield">
<input a0="ans2"/>
<output a0="inputBox2"/>
</command>
<element type="textfield" label="inputBox2">
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="386" y="105"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript onUpdate="new2=true "/>
<linkedGeo exp="ans2"/>
<length val="4"/>
</element>
<expression label="text3" exp=""答對了!""/>
<element type="text" label="text3">
<show object="true" label="true"/>
<condition showObject="correct1 ∧ new1"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="245" y="178"/>
</element>
<expression label="text3_1" exp=""答對了!""/>
<element type="text" label="text3_1">
<show object="true" label="true"/>
<condition showObject="correct2 ∧ new2"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="387" y="177"/>
</element>
<expression label="correct1" exp="c ≟ ans1" />
<element type="boolean" label="correct1">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<expression label="correct2" exp="d ≟ ans2" />
<element type="boolean" label="correct2">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<expression label="text4" exp=""答錯了! 答案是 " + c + """ />
<element type="text" label="text4">
<show object="true" label="true"/>
<condition showObject="(¬correct1) ∧ new1"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<startPoint x="-6.160000000000003" y="3.22" z="1.0"/>
</element>
<expression label="text5" exp=""答錯了! 答案是 " + d + """ />
<element type="text" label="text5">
<show object="true" label="true"/>
<condition showObject="(¬correct2) ∧ new2"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<startPoint x="-3.2200000000000015" y="3.2000000000000006" z="1.0"/>
</element>
<element type="boolean" label="new1">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<element type="boolean" label="new2">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<expression label="text1" exp="" " + a + " + " + b + " -----------"" />
<element type="text" label="text1">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="236" y="53"/>
</element>
<expression label="text2" exp="" " + a + " - " + b + " -----------"" />
<element type="text" label="text2">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<fixed val="true"/>
<font serif="false" sizeM="1.4" size="5" style="0"/>
<absoluteScreenLocation x="379" y="49"/>
</element>
</construction>
</geogebra>