Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Major <jmikem@bellsouth.net>2009-08-29 19:07:12 (GMT)
committer Mike Major <jmikem@bellsouth.net>2009-08-29 19:07:12 (GMT)
commit0c21edf60deb1019f46fb7a585943efe200512f2 (patch)
tree482c8d2a349dc6345693ebb6fec787db88ba052b
parent83e8e566fbc8f9e9ed5b13e632951a523ce9fec9 (diff)
Added the intro image; rearranged the main tabs; started some intro text.
-rw-r--r--activity/activity.info2
-rw-r--r--data.py35
-rw-r--r--hoparound.py3
-rw-r--r--hoppy-title.svg189
-rw-r--r--view.py59
5 files changed, 254 insertions, 34 deletions
diff --git a/activity/activity.info b/activity/activity.info
index 7abc7f6..3620eab 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,6 +3,6 @@ name = Hop-A-Round
bundle_id = org.laptop.HopaRound
class = hoparound.HopaRoundActivity
icon = hoparound-icon
-activity_version = 7
+activity_version = 8
host_version = 1
show_launcher = yes
diff --git a/data.py b/data.py
index f62468b..20f4244 100644
--- a/data.py
+++ b/data.py
@@ -1,20 +1,20 @@
import random, math
class LevelData():
- def __init__(self):
- self.digits = []
- self.min_level = 1
- self.max_level = 5
- self.thresh_up = 6
- self.thresh_down = 0
- self.current_level = 1
- self.level_change = 0
- self.level_score = 0
- self.question_max = 6
- self.question_count = 0
- self.thresh_slider = 0
- self.thresh_mult = 2
- self.thresh_entry = 4
+ def __init__(self):
+ self.question_max = 2 # number of questions in each section (slider, multiple choice & entry)
+ self.thresh_slider = 0 # if question count matches this number, change to this section
+ self.thresh_mult = self.question_max # if question count matches this number, change to this section
+ self.thresh_entry = 2 * self.question_max # if question count matches this number, change to this section
+ self.min_level = 1 # minimum levels in the activity; also the exponent of the current level
+ self.max_level = 5 # maximum levels in the activity; also the exponent of the current level
+ self.current_level = 1 # starting and current level indicator
+ self.question_count = 0 # number of questions asked on current level
+ self.level_score = 0 # number of questions correct on current level
+ self.thresh_up = 6 # level score at/above which the level will be increased
+ self.thresh_down = 0 # level score at/below which the level will be reduced
+ self.level_change = 0 # flag indicating a level change
+ self.digits = [] # collection of digits to create the question from
random.seed()
def check_answer(self, response):
@@ -22,7 +22,7 @@ class LevelData():
self.level_score += 1
else:
self.level_score -= 1
- if self.question_count == self.question_max:
+ if self.question_count == self.question_max * 3:
if self.level_score >= self.thresh_up and self.current_level < self.max_level:
self.level_change = 1
elif self.level_score <= self.thresh_down and self.current_level > self.min_level:
@@ -48,7 +48,8 @@ class LevelData():
elif self.level_change == -1:
self.decrease_level()
self.question_count += 1
- # generate a random number. don't use digits 0 or 9; they cause duplicates in the mult choice answer set.
+ # generate a random number. don't use digits 0 or 9;
+ # they cause duplicates in the mult choice answer set.
self.digits = range(1,9)
random.shuffle(self.digits)
str_num = ""
@@ -73,7 +74,7 @@ class LevelData():
self.mult.append(int(math.ceil(self.random_number/(self.answer_decade*factor)) * self.answer_decade * factor))
def get_game_data(self):
- temp = "\nLevel: " + str(self.current_level)
+ temp = "\n\nLevel: " + str(self.current_level)
#temp += "\nRandom Number: " + str(self.random_number)
#temp += "\nDecade: " + str(self.answer_decade)
#temp += "\nCorrect Answer: " + str(self.correct_answer)
diff --git a/hoparound.py b/hoparound.py
index a267452..041236f 100644
--- a/hoparound.py
+++ b/hoparound.py
@@ -12,7 +12,8 @@ class HopaRoundActivity(activity.Activity):
self.set_toolbox(toolbox)
toolbox.show()
self.data = LevelData()
- self.ui = Views()
+ self.ui = Views()
+ self.ui.clear(self.data)
self.ui.slider_click.connect("clicked", self.submit_answer, self.ui.slider_tool)
self.ui.mult_1.connect("clicked", self.submit_answer, self.ui.mult_1)
self.ui.mult_2.connect("clicked", self.submit_answer, self.ui.mult_2)
diff --git a/hoppy-title.svg b/hoppy-title.svg
new file mode 100644
index 0000000..6568016
--- /dev/null
+++ b/hoppy-title.svg
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="200"
+ height="500"
+ id="svg2387"
+ style="display:inline">
+ <defs
+ id="defs2389" />
+ <g
+ id="layer1"
+ style="display:inline">
+ <path
+ d="M 80.789066,172.84269 C 73.956195,175.60329 62.064222,186.74462 59.878197,195.90513 C 58.217149,202.86573 52.724904,209.82841 50.135922,216.42849 C 48.416106,220.81281 43.067743,234.41927 40.437301,240.15622 C 37.958504,245.56244 30.055299,265.1963 27.597108,271.76554 C 25.486099,277.40696 17.211744,306.4124 15.743342,314.04127 C 14.313149,321.47165 10.312659,338.42934 9.8256537,344.2993 C 9.3957945,349.48046 5.7653214,359.03324 8.4018695,365.60192 C 10.969247,371.99827 11.548434,371.53591 13.924253,371.98682 C 15.903664,372.3625 30.312864,358.13755 32.521886,352.20916 C 34.377131,347.23021 49.87389,337.29873 50.188185,331.92361 C 50.468569,327.12849 61.692093,315.28223 64.832745,308.29743 C 66.753632,304.02534 76.452514,302.02238 78.305513,295.23815 C 80.158743,288.45307 89.241703,287.13384 90.301982,281.65795 C 91.374769,276.11738 100.40691,276.60324 102.35999,270.47418 C 105.05379,262.02064 107.72494,261.71593 109.25576,258.19278 C 108.31726,253.9318 127.97548,217.96514 124.37662,212.61612"
+ id="path3186"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.99999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 107.69461,251.15048 C 105.40027,247.56093 101.35626,239.1713 98.761644,233.56378 C 94.321402,223.96747 92.848163,217.76498 90.126864,210.82797 C 87.651593,204.51812 85.868667,198.48772 84.598035,194.68181 C 82.536363,188.50651 80.035973,173.29194 80.448953,167.69725 C 81.054627,159.49209 84.42414,154.13537 88.32675,150.36448 C 91.15616,147.63054 96.798484,146.96463 100.61527,146.50702 C 106.46819,145.80532 110.06157,145.62075 115.31461,145.25891 C 119.15685,144.99424 125.68465,145.4765 130.24013,145.88148 C 133.63777,146.18351 141.05826,147.24598 143.89791,150.16043 C 146.03129,152.35002 149.82566,156.91341 151.09556,161.21623 C 152.33101,165.4023 152.82853,172.23918 152.32815,177.08276 C 151.69962,183.16663 150.28015,190.52416 149.0033,194.78551 C 147.72297,199.0585 146.38988,206.07937 144.73898,212.8981 C 143.11666,219.59881 140.57062,226.85837 139.28351,231.49376 C 137.7924,236.86387 134.40971,245.97392 130.16765,253.0391 C 127.83116,256.93055 124.13568,262.45342 119.79282,262.40863 C 115.2435,262.35982 110.32906,255.27212 107.69461,251.15048 z"
+ id="path3169"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4.29999924;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <g
+ transform="matrix(-0.6238945,0,0,0.3885596,311.27019,107.24737)"
+ id="g2610"
+ style="display:inline">
+ <path
+ d="M 375.35263,-44.302306 C 373.65518,-46.358256 368.99201,-54.610788 366.71428,-54.595589 C 361.23495,-54.559028 355.02303,-44.011041 348.00263,-30.159252 C 344.80897,-23.857908 340.15926,-12.463303 336.87536,0.88491814 C 333.06186,16.385786 328.48648,50.09658 326.13576,68.61391 C 323.78727,87.113672 321.38309,121.40382 321.38309,121.40382"
+ id="path2606"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:7.10859299;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ <g
+ transform="matrix(0.5759542,-0.3089199,0.2638021,0.6744589,11.218927,120.36705)"
+ id="g2609"
+ style="display:inline">
+ <path
+ d="M 109.87892,136.63004 C 107.5472,152.94618 98.437427,164.77217 89.529844,163.04645 C 80.622252,161.32074 75.288775,146.69657 77.616109,130.37958 C 79.943447,114.06257 89.05061,102.22941 97.959341,103.94711 C 106.86806,105.66481 112.20602,120.28316 109.88306,136.60101"
+ id="path3526"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3.0633235;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ d="M 93.326102,144.93326 C 92.842398,148.01726 91.118456,150.27624 89.475226,149.9793 C 87.832,149.68235 86.891515,146.94188 87.374415,143.85773 C 87.85731,140.77359 89.580788,138.51326 91.224255,138.80869 C 92.86772,139.10412 93.80905,141.84348 93.326958,144.92777"
+ id="path2395"
+ style="fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:10.37311172;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ transform="matrix(0.6494972,0.1299842,-8.8488156e-2,0.8574592,56.899738,42.389337)"
+ id="g2613"
+ style="display:inline">
+ <path
+ d="M 154.51288,144.624 C 152.39314,158.65241 143.927,167.93049 135.60154,165.34901 C 127.27608,162.76754 122.24283,149.30371 124.35847,135.27402 C 126.47412,121.24434 134.9378,111.95966 143.26431,114.53424 C 151.59079,117.1088 156.6282,130.56809 154.51664,144.59903"
+ id="path3528"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.78538156;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;display:inline" />
+ <path
+ d="M 143.03391,152.21216 C 142.55112,155.21405 140.74251,157.21751 138.99393,156.68742 C 137.24532,156.15733 136.21866,153.29434 136.70059,150.29219 C 137.18252,147.29004 138.99063,145.28517 140.73947,145.8138 C 142.48829,146.3424 143.51585,149.20441 143.03478,152.20683"
+ id="path2397"
+ style="fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:10.09263515;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ transform="matrix(0.7147379,0,0,0.3875857,-106.1807,106.38915)"
+ id="g3172"
+ style="display:inline">
+ <path
+ d="M 382.26238,-0.3743093 C 379.51875,-8.5896873 375.99835,-14.667938 372.00841,-19.918872 C 370.51515,-21.884066 365.35594,-18.799644 362.4225,-17.085182 C 357.852,-14.413927 352.46684,-1.3992246 350.59286,5.9923795 C 348.49544,14.265283 343.48539,27.963264 341.68074,39.467002 C 340.32044,48.138238 336.50952,66.615192 334.96923,85.210166 C 333.47991,103.18985 331.97799,123.72381 331.97799,123.72381"
+ id="path3174"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6.64983273;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ <path
+ d="M 59.894958,360.87273 C 53.087838,366.1739 50.013715,370.74486 46.612234,376.196 C 42.144716,383.35558 40.828354,386.85985 38.06626,392.17531 C 36.130654,395.90026 32.611674,404.08336 32.041142,407.00063 C 31.103288,411.79587 33.141909,412.19167 34.474755,412.30383 C 35.813967,412.41652 37.465928,412.38635 41.11756,408.45371 C 44.129329,405.21017 47.940332,401.57054 50.991138,398.05416 C 53.280647,395.41531 58.296536,389.15567 61.479129,385.22081 C 64.3694,381.64729 65.775187,378.36382 70.86551,370.25191 C 73.411438,366.19474 73.482502,362.33421 73.835138,360.483 C 74.30074,358.03881 73.058527,356.61041 71.536041,356.28231 C 69.177311,355.77404 64.861755,357.00476 59.894958,360.87273 z"
+ id="path3191"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 108.25276,362.45494 C 101.42455,368.38354 100.92764,371.63479 97.850981,377.06289 C 93.810067,384.19226 91.752469,388.19087 89.360543,393.38086 C 87.684313,397.01782 83.513464,403.1946 83.237103,405.86739 C 82.782859,410.26083 84.031307,411.23674 85.50595,411.08792 C 86.987621,410.93832 88.795055,410.60499 92.327692,406.46652 C 95.24132,403.05323 98.983751,399.14297 101.90754,395.48244 C 104.10171,392.73533 108.8515,386.29598 111.86966,382.2427 C 114.6106,378.56163 115.75878,375.41144 120.36848,367.32856 C 122.67402,363.28585 122.2899,359.87582 122.45494,358.18149 C 122.67285,355.94438 121.14006,354.91828 119.43168,354.9123 C 116.78497,354.90314 113.23498,358.12909 108.25276,362.45494 z"
+ id="path3201"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 86.815718,315.1662 C 89.276059,321.64787 94.887053,335.90557 97.852214,340.55358 C 102.93137,348.52569 107.32167,352.8443 110.75546,354.72287 C 113.70605,356.33707 120.318,359.89009 122.4202,360.18069 C 125.87572,360.65842 125.71128,355.82948 125.45315,353.24046 C 125.19377,350.63915 124.76019,347.47693 121.20511,341.55295 C 118.27293,336.66698 115.84046,330.57506 112.71531,325.68936 C 110.37,322.02287 104.92806,313.44533 101.48884,308.42216 C 98.365419,303.86036 95.522381,299.46532 88.800174,291.93248 C 85.438054,288.16495 83.088847,286.94474 81.913756,288.6913 C 80.674238,290.5336 80.815908,292.99026 81.523946,296.45687 C 82.466182,301.07003 84.618328,309.37717 86.815718,315.1662 z"
+ id="path3203"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999881;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 34.976922,409.75307 C 34.239569,413.21686 42.527135,414.61674 44.686649,414.94466 C 49.706685,415.70696 57.819466,416.72883 59.580232,417.27079 C 64.706793,418.84873 71.506708,423.88227 74.098565,424.66845"
+ id="path3193"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 31.970616,408.62736 C 29.58232,414.23837 39.511531,414.55113 41.296531,416.01172 C 44.475731,418.61315 58.457221,419.35465 59.934217,421.74296 C 61.907745,424.93417 68.070921,431.24851 71.174595,433.0336"
+ id="path3195"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 18.829086,344.80001 C 20.191295,346.56723 21.376749,347.4114 23.205981,348.49374 C 24.44406,349.2263 25.294,349.88528 26.636071,350.37609 C 27.578948,350.72091 28.496457,351.13296 29.455368,351.19786 C 29.788096,351.22038 29.59656,351.0261 29.719941,350.87602"
+ id="path3209"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999952;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 24.599404,322.39411 C 27.450411,325.64788 29.830845,327.23582 33.471979,329.29127 C 35.936477,330.68249 37.650951,331.91731 40.278401,332.88171 C 42.124325,333.55929 43.931685,334.35573 45.767518,334.5325 C 46.404533,334.59383 46.011525,334.23351 46.224725,333.97223"
+ id="path3211"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999976;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 32.335062,303.24947 C 35.623263,306.80594 38.381118,308.26724 42.603691,310.00336 C 45.461699,311.17845 46.533374,311.6358 49.509511,312.60846 C 51.754369,313.34214 53.171012,313.79893 55.222971,313.91228 C 55.968548,313.95345 56.605073,313.67757 57.764225,313.54779"
+ id="path3213"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999952;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 9.3617871,365.514 C 13.265376,348.8471 24.832912,318.71938 27.513046,309.86377 C 29.327045,303.86989 41.092304,271.23132 43.407118,265.36128 C 45.153146,260.9336 54.785792,242.53165 61.031748,232.36865 C 61.82675,231.07507 69.198459,205.93199 79.112792,195.28885"
+ id="path3217"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999928;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 43.834525,277.65294 C 47.914283,283.54866 51.573502,285.81483 57.254394,288.40213 C 61.099444,290.15335 62.538624,290.83944 66.581775,292.22119 C 69.631475,293.26344 71.556986,293.91026 74.431598,293.88186 C 75.476089,293.87153 76.416358,293.31517 78.070465,292.95795"
+ id="path3219"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999905;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 55.462717,251.75385 C 59.76124,259.40291 63.847059,262.59634 70.261228,266.42442 C 74.602611,269.01548 76.225208,270.02241 80.825303,272.18908 C 84.295075,273.82337 86.486694,274.84159 89.834344,275.15537 C 91.050723,275.26938 92.187426,274.7081 94.139728,274.47497"
+ id="path3221"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999928;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 66.919148,235.42103 C 71.443911,243.16511 75.539769,246.4139 81.910099,250.31874 C 86.221787,252.96174 87.835256,253.98843 92.374799,256.20519 C 95.798902,257.87724 97.960948,258.9192 101.20105,259.25861 C 102.37832,259.38192 103.44493,258.82359 105.31356,258.60185"
+ id="path3223"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.99999928;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 44.387897,308.16783 C 46.407358,320.70745 49.41666,326.87433 52.168713,333.26089 C 55.776003,341.63217 60.950737,347.17906 64.223801,351.2455 C 66.634538,354.24061 70.127806,358.88362 71.966998,359.96656 C 74.990175,361.74664 75.755383,359.93238 75.960329,357.84192 C 76.166235,355.7415 76.310305,353.13985 74.116567,347.14371 C 72.307206,342.19818 70.033073,336.54979 68.050314,331.52557 C 66.562358,327.75511 63.201854,319.60688 60.960186,314.34873 C 58.924376,309.57352 56.425069,305.10723 51.658051,296.58185 C 49.27381,292.3179 47.146412,290.12441 45.978386,289.45203 C 44.436194,288.56424 43.304538,289.9095 42.940488,292.2847 C 42.376497,295.96448 43.506244,302.69328 44.387897,308.16783 z"
+ id="path3189"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999881;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 111.68538,212.32804 L 113.20171,217.67562"
+ id="path3176"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 123.16503,212.08348 L 121.14447,217.58755"
+ id="path3178"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.99999976;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 79.860058,227.86785 C 76.031419,221.38992 74.752746,219.78467 70.610848,213.66898 C 66.665777,208.14641 65.115626,205.40048 61.04541,200.4115 C 58.876782,197.75336 56.261491,194.23292 53.590366,192.87655 C 49.199728,190.64703 47.456447,191.11964 46.541864,191.98085 C 45.622925,192.84617 44.664119,193.96992 46.537538,197.74163 C 48.082725,200.8525 50.183139,204.50264 51.98664,207.73066 C 53.340099,210.15315 56.499266,215.45609 58.656114,218.91237 C 60.614854,222.05124 63.40913,225.26548 68.736882,231.39922 C 71.401561,234.46703 74.178426,236.96908 75.879069,237.82344 C 78.124513,238.95148 80.379633,238.36266 81.630886,237.44554 C 83.569377,236.02466 81.730751,231.03298 79.860058,227.86785 z"
+ id="path3515"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 45.476917,186.7119 C 41.330553,183.82554 40.295345,183.25742 36.33916,180.94132 C 32.776346,178.85553 31.011661,177.65168 27.75371,176.15617 C 26.017861,175.35936 23.733712,174.13749 22.757836,174.74562 C 21.153732,175.74523 21.339712,177.26761 21.808935,178.57462 C 22.280396,179.88787 22.906178,181.44121 25.299875,183.3525 C 27.274152,184.92891 29.607236,186.59221 31.66739,188.09816 C 33.213467,189.22834 36.609202,191.57498 38.828055,193.041 C 40.843133,194.37238 42.95203,195.22436 46.976184,196.85315 C 48.988862,197.66779 50.363591,197.49168 50.979335,197.09686 C 51.792318,196.57557 51.866963,195.07396 51.383255,193.50225 C 50.633855,191.06726 47.502857,188.1222 45.476917,186.7119 z"
+ id="path3180"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 182.07183,242.39147 C 180.49309,247.32333 180.26893,248.60654 178.69801,253.16048 C 177.28329,257.26163 176.43331,259.26194 175.49965,263.08698 C 175.00221,265.12495 174.19608,267.77518 174.83968,269.11273 C 175.8976,271.31135 177.2072,271.35401 178.296,271.00139 C 179.38999,270.64709 180.1678,269.66799 182.07248,267.4796 C 182.96087,266.4589 185.40636,262.73696 186.48658,260.41997 C 187.29724,258.68116 188.90801,255.24767 189.7243,252.62045 C 190.54082,248.52636 194.3618,242.67586 192.13274,238.97304 C 190.88563,238.79035 186.65995,248.75061 184.90277,250.52068 C 184.32226,246.77787 185.78499,236.60016 184.22833,235.64656 C 182.37915,234.51373 182.87373,239.88635 182.07183,242.39147 z"
+ id="path2418"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 114.87747,270.35026 C 120.17836,273.35306 121.50539,273.95823 126.57334,276.40829 C 131.13741,278.61474 133.39405,279.86944 137.5772,281.4968 C 139.80596,282.36386 142.73472,283.6691 144.01237,283.15563 C 146.11252,282.31164 145.90725,280.85682 145.33026,279.58782 C 144.7505,278.31281 143.97656,276.8003 140.92207,274.83459 C 138.40278,273.21329 135.42098,271.48652 132.78886,269.92646 C 130.81355,268.7557 126.47188,266.31278 123.63337,264.78033 C 121.05557,263.38867 118.34505,262.44525 113.17303,260.6422 C 110.58625,259.7404 108.80229,259.81871 107.99588,260.15321 C 106.93114,260.59488 106.79946,262.01321 107.38904,263.53399 C 108.30246,265.89009 112.28741,268.88309 114.87747,270.35026 z"
+ id="path3184"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999857;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 169.50365,266.75949 C 164.13566,268.30913 162.85937,268.8066 157.9211,270.60261 C 153.47382,272.22007 151.19952,272.89741 147.30539,274.67504 C 145.2306,275.62218 142.42777,276.74276 141.70395,278.04096 C 140.51414,280.17485 141.33869,281.1153 142.35704,281.65078 C 143.38023,282.18878 144.65883,282.76531 147.86046,282.04837 C 150.50111,281.45702 153.53802,280.61351 156.23526,279.89565 C 158.25948,279.35694 162.64848,278.07539 165.48814,277.18916 C 168.067,276.38435 170.53907,275.14949 175.25747,272.79543 C 177.61737,271.61804 178.92226,270.2827 179.37432,269.45555 C 179.97116,268.36341 179.4167,267.20908 178.27289,266.49442 C 176.50083,265.38722 172.12652,266.00234 169.50365,266.75949 z"
+ id="path3182"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 21.105182,153.27485 C 22.205862,157.6511 22.3376,158.77284 23.447713,162.82397 C 24.447446,166.47231 25.067634,168.26625 25.680317,171.63401 C 26.006755,173.42836 26.563234,175.7762 25.973555,176.866 C 25.004266,178.65738 23.917195,178.57542 23.029737,178.17416 C 22.138041,177.77098 21.534685,176.86013 20.048385,174.80925 C 19.355144,173.85269 17.485223,170.43649 16.687605,168.34989 C 16.088999,166.78398 14.694524,163.40396 14.128658,161.07497 C 12.344911,157.82932 9.7768442,153.60192 11.824498,150.55933 C 12.865685,150.51546 17.03521,158.31778 18.41689,159.99622 C 19.055548,156.83617 18.317203,148.52431 19.647368,147.84674 C 21.227504,147.04183 20.546102,151.05196 21.105182,153.27485 z"
+ id="path2420"
+ style="fill:#00ff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 86.886199,411.59375 C 86.672732,415.36428 92.105712,414.75247 94.227509,415.32604 C 96.852803,416.0357 107.1957,416.78419 108.70252,417.98071 C 111.23594,419.99245 122.5416,423.21634 125.13344,424.00253"
+ id="path3397"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 83.921643,409.29742 C 83.105021,410.92073 83.3942,412.49209 84.195663,414.86311 C 84.78174,416.59693 103.81265,418.5375 109.08734,422.25515 C 113.47155,425.34516 117.86415,429.23228 120.96781,431.01737"
+ id="path3399"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.49999928;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 93.807718,220.39436 C 93.807718,220.39436 113.69602,249.16134 120.18727,249.37245 C 126.15373,249.56372 140.8143,226.32604 140.8143,226.32604"
+ id="path3410"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 118.2649,260.23287 C 117.23308,259.95673 116.03268,259.37747 115.0218,258.66793 C 112.06679,256.59381 107.51963,249.87517 105.0062,245.25575 C 104.12803,243.64179 97.660389,228.99876 97.738537,228.816 C 97.894605,228.45103 103.39271,235.57937 104.48136,236.89057 C 108.39623,241.60573 110.19389,243.99449 113.53037,246.85521 C 117.42331,250.19303 119.15206,250.88495 120.91293,251.20964 C 121.39764,251.29901 129.50539,244.86004 134.6086,237.9021 C 135.484,236.70854 137.28096,234.53289 137.30011,234.59169 C 137.34941,234.74306 134.74683,243.38833 133.65845,245.77494 C 131.95825,249.50313 130.00089,252.61167 128.48982,254.59477 C 126.68907,256.95809 124.52535,258.85437 122.55751,259.79386 C 121.59402,260.25386 121.22111,260.34978 120.23045,260.39242 C 119.53771,260.42224 118.72635,260.35638 118.2649,260.23288 L 118.2649,260.23287 z"
+ id="path3748"
+ style="fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:1.25;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ d="M 103.77001,235.68501 L 103.81569,244.06365"
+ id="path3418"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 120.0187,248.93756 L 120.06438,259.7311"
+ id="path3422"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 111.26894,244.5574 L 111.31462,255.27275"
+ id="path3424"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 127.66235,245.30246 L 127.70804,255.32763"
+ id="path3426"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ d="M 133.687,238.6081 L 133.73269,247.75361"
+ id="path3428"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ </g>
+</svg>
diff --git a/view.py b/view.py
index 01777e7..ea7d367 100644
--- a/view.py
+++ b/view.py
@@ -5,17 +5,45 @@ class Views():
def __init__(self):
locale.setlocale(locale.LC_ALL,"")
self.user_interaction = gtk.Notebook()
+ self.user_interaction.set_show_tabs(False)
+ #
+ # create the intro tab
+ self.intro_tab = gtk.VBox()
+ self.user_interaction.append_page(self.intro_tab)
+ # intro - heading
+ self.intro_heading = gtk.Label()
+ self.intro_heading.set_markup("<big>Let's round numbers with Hoppy the Grasshopper</big>")
+ self.intro_tab.pack_start(self.intro_heading, False, False, 10)
+ # intro - intro area
+ self.intro_area = gtk.HBox()
+ self.intro_tab.pack_start(self.intro_area, False, False, 10)
+ # intro - image
+ self.image_intro = gtk.Image()
+ self.intro_area.pack_start(self.image_intro, False, False, 10)
+ self.image_intro.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file("hoppy-title.svg"))
+ # intro - play button
+ self.play = gtk.Button("Play")
+ self.intro_tab.pack_start(self.play, False, False, 10)
+ self.play.connect("clicked", self.play_clicked)
+ # intro - text tabs
+ self.introduction = gtk.Notebook()
+ self.introduction.set_show_tabs(False)
+ self.intro_area.pack_start(self.introduction, False, False, 10)
+ self.intro_tab1 = gtk.Label("intro text")
+ self.introduction.append_page(self.intro_tab1)
+ #
+ # create the quiz tab
self.quiz_tab = gtk.HBox()
self.user_interaction.append_page(self.quiz_tab)
self.user_input = gtk.VBox()
self.quiz_tab.pack_start(self.user_input, False, False, 10)
self.rounding_phrase = gtk.Label("rounding phrase")
self.user_input.pack_start(self.rounding_phrase, False, False, 10)
- #create the notebook
+ # quiz - create the play notebook to show the widgets for playing
self.tabber = gtk.Notebook()
self.tabber.set_show_tabs(False)
self.user_input.pack_start(self.tabber, False, False, 10)
- #create the slider tab
+ # quiz - create the slider tab
self.slider_tab = gtk.VButtonBox()
self.slider_instruction = gtk.Label()
self.slider_instruction.set_markup("<big>Move the slider to choose the correct answer</big>")
@@ -27,7 +55,7 @@ class Views():
self.slider_click = gtk.Button("OK")
self.slider_tab.pack_start(self.slider_click, False, False, 10)
self.tabber.append_page(self.slider_tab)
- #create the multiple choice tab
+ # quiz - create the multiple choice tab
self.mult_tab = gtk.VBox()
self.mult_instruction = gtk.Label()
self.mult_instruction.set_markup("<big>Choose one of the answers below</big>")
@@ -41,7 +69,7 @@ class Views():
self.mult_4 = gtk.Button()
self.mult_tab.pack_start(self.mult_4, False, False, 10)
self.tabber.append_page(self.mult_tab)
- #create the entry tab
+ # quiz - create the entry tab
self.entry_tab = gtk.VButtonBox()
self.entry_instruction = gtk.Label()
self.entry_instruction.set_markup("<big>Type your answer below and click 'OK'</big>")
@@ -51,7 +79,7 @@ class Views():
self.entry_click = gtk.Button("OK")
self.entry_tab.pack_start(self.entry_click, False, False, 10)
self.tabber.append_page(self.entry_tab)
- #create the output
+ # quiz - create the output
self.user_output = gtk.VBox()
self.quiz_tab.pack_start(self.user_output, False, False, 10)
self.output = gtk.Label("")
@@ -61,14 +89,10 @@ class Views():
self.user_output.pack_start(self.image_output, False, False, 10)
self.image_correct_answer = gtk.gdk.pixbuf_new_from_file("hoppy-right.svg")
self.image_incorrect_answer = gtk.gdk.pixbuf_new_from_file("hoppy-wrong.svg")
- # intro tab
- self.intro_tab = gtk.VBox()
- self.intro_text = gtk.Label()
- self.intro_text.set_markup("<big>Let's round numbers with Hoppy the Grasshopper</big>")
- self.intro_tab.pack_start(self.intro_text, False, False, 10)
- self.introduction = gtk.Notebook()
- self.intro_tab.pack_start(self.introduction, False, False, 10)
- self.user_interaction.append_page(self.intro_tab)
+ # quiz - help
+ self.help = gtk.Button("Help")
+ self.help.connect("clicked", self.help_clicked)
+ self.user_input.pack_start(self.help, False, False, 10)
def get_user_interaction(self):
return self.user_interaction
@@ -109,10 +133,9 @@ class Views():
text += "</big>"
self.output.set_markup(text)
self.image_output.set_from_pixbuf(self.image_incorrect_answer)
- self.output.queue_draw()
def clear(self, data):
- self.output.set_markup(data.get_game_data())
+ self.output.set_markup("<big>" + data.get_game_data() + "</big>")
self.image_output.clear()
return False
@@ -129,6 +152,12 @@ class Views():
elif data.question_count > data.thresh_slider:
self.tabber.set_current_page(0)
self.slider_tool.grab_focus()
+
+ def play_clicked(self, widget):
+ self.user_interaction.set_current_page(1)
+
+ def help_clicked(self, widget):
+ self.user_interaction.set_current_page(0)
def locl(self, characters):
return str(locale.format("%d", characters, True))