diff options
author | Tony Anderson <tony@traveler.(none)> | 2011-02-08 06:20:44 (GMT) |
---|---|---|
committer | Tony Anderson <tony@traveler.(none)> | 2011-02-08 06:20:44 (GMT) |
commit | 37b0037b69a969f1f53346ac443f864997d328af (patch) | |
tree | 4296209828f6e7d320e94053afae3de1447d5e11 | |
parent | b8e67d0ea510559565aa1e74bb85da02b89791d7 (diff) |
version 11.15
-rwxr-xr-x | activity/activity.info | 2 | ||||
-rwxr-xr-x | cgi-bin/fetchFile.py | 5 | ||||
-rwxr-xr-x | cgi-bin/launch.py | 30 | ||||
-rwxr-xr-x | cgi-bin/saveFile.py | 34 | ||||
-rwxr-xr-x | content/Explore/index.html | 21 | ||||
-rw-r--r-- | content/assets/image/audio-pause.png | bin | 0 -> 2026 bytes | |||
-rw-r--r-- | content/assets/image/audio-play.png | bin | 0 -> 2905 bytes | |||
-rw-r--r-- | content/assets/image/audio-record.png | bin | 0 -> 3266 bytes | |||
-rw-r--r-- | content/assets/image/audio-stop.png | bin | 0 -> 1865 bytes | |||
-rw-r--r-- | content/assets/image/btn_back_explore.png | bin | 0 -> 5777 bytes | |||
-rw-r--r-- | content/assets/image/spiral.svg | 23 | ||||
-rwxr-xr-x | content/css/global.css | 183 | ||||
-rwxr-xr-x | content/js/global.js | 4 | ||||
-rwxr-xr-x | content/js/menu.js | 5 | ||||
-rwxr-xr-x | content/js/navigation.js | 3 | ||||
-rw-r--r-- | content/karma/css/global.css | 9 | ||||
-rwxr-xr-x | contentedit.html | 10 |
17 files changed, 146 insertions, 183 deletions
diff --git a/activity/activity.info b/activity/activity.info index 460cf54..939ed63 100755 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,5 +1,5 @@ [Activity] -#version = 11.14 +#version = 11.15 name = Learn service_name = org.olerwanda.Learn icon = activity-learn diff --git a/cgi-bin/fetchFile.py b/cgi-bin/fetchFile.py index 295d427..8c9a771 100755 --- a/cgi-bin/fetchFile.py +++ b/cgi-bin/fetchFile.py @@ -18,11 +18,6 @@ print >> log, 'f=',fpth, srcpth, fpth fin = open(fpth, 'r') txt = fin.read() fin.close() -print >> log, 'copy images' -#copy images to local store -dst = 'imgs' -shutil.rmtree(dst) -shutil.copytree(srcpth, dst) print >> log, 'make soup', len(txt) soup = BeautifulSoup(txt) print soup.prettify() diff --git a/cgi-bin/launch.py b/cgi-bin/launch.py index 38d3b10..f0c8ef7 100755 --- a/cgi-bin/launch.py +++ b/cgi-bin/launch.py @@ -7,20 +7,34 @@ temp.close() import sys import cgi, cgitb import subprocess +from sugar.activity import activity sys.stderr = sys.stdout cgitb.enable(display=True) print 'Content-Type:text/html\n\n' -subprocess.call('rm -rf /tmp/logl',shell=True) log = open('/tmp/logl','w') -print >>log,'launch log opened' -form = cgi.FieldStorage() -activity = form.getfirst('activity', default='Wordsearch') -print >>log,'launch', activity try: - subprocess.call('sugar-launch '+activity,shell=True) + print >>log,'launch log opened' + bundle_dir = activity.get_bundle_path() + bundle_dir = activity.get_bundle_path() + form = cgi.FieldStorage() + activity = form.getfirst('activity', default='') + print >> log, 'activity', len(activity), activity + if len(activity)>0: + bundle = form.getfirst('bundle', default='') + bundle_pth = bundle_dir + '/' + bundle + print >>log,'launch', activity, bundle_dir, bundle, bundle_pth + fout = open('/tmp/'+activity,'w') + fout.write(bundle_pth) + fout.close() + try: + subprocess.call('sugar-launch '+activity,shell=True) + except: + print >> log, 'sugar launch failed',sys.exc_info()[:2] + else: + print >> log, 'no activity' + print >>log,'sugar activity launched', activity except: - print >> log, 'sugar launch failed',sys.exc_info()[:2] -print >>log,'sugar activity done' + print >>log, 'launch.py failed', sys.exc_info()[:2] log.close() diff --git a/cgi-bin/saveFile.py b/cgi-bin/saveFile.py index d26419a..77daede 100755 --- a/cgi-bin/saveFile.py +++ b/cgi-bin/saveFile.py @@ -141,7 +141,7 @@ def generate_image(imagelist): lessontxt = lessontxt + " .append(karma.createImg('" + img + "'))\n" return lessontxt -def generate_audio(audiolist, src, tgt): +def generate_audio(audiolist): lessontxt = '' for clip in audiolist: #parse string @@ -150,17 +150,6 @@ def generate_audio(audiolist, src, tgt): imgn = clip[pos:pos1] pos2 = clip[pos:].find('.') clp = clip[pos1+1:pos1+pos2] - #copy clip from source to assets - tpth = path(tgt) / 'assets' / 'audio' - subprocess.call('mkdir -p ' + tpth,shell=True) - if not (tpth / 'noclip.ogg').exists(): - pth = 'content/assets/audio/noclip.ogg' - cmd = 'cp ' + pth + ' ' + tpth - subprocess.call(cmd, shell=True) - if not (tpth / clp).exists(): - if (spth / clp).exists(): - spth = path(src) / 'source' / clp - subprocess.call('cp ' + spth + ' ' + tpth, shell=True) #create lessontxt if (tpth / clp).exists(): lessontxt = "Karma.audio." + clp + '.play(' + clp + ')\n' @@ -195,12 +184,17 @@ if len(screens) < 2: nscreen = 0 else: nscreen = 1 +print >> log, 'number of screens', len(screens),'nscreen',nscreen subprocess.call('rm -rf ' + fpth / 'a*.txt', shell = True) +imagelists = [] +audiolists = [] for screen in screens: screen, imagelist = process_images(screen) + imagelists.append(imagelist) for image in imagelist: masterimagelist.append(image) audiolist = process_audio(screen) + audiolists.append(audiolist) for clip in audiolist: masteraudiolist.append(clip) questionstrings = scanquiz(screen) @@ -237,8 +231,7 @@ if nscreen < 1: lessontxt = lessontxt + " function(){\n" lessontxt = lessontxt + generate_image(imagelist) lessontxt = lessontxt + " });\n};\n" - for audio in audiolist: - lessontxt = lessontxt + generate_audio(audiolist) + lessontxt = lessontxt + generate_audio(audiolist) lessontxt = lessontxt + "function startGame(karma) {\n" if len(quiztxt) > 0: lessontxt = lessontxt + " $('#quizArea')\n" @@ -252,14 +245,15 @@ else: screen = screens[s] lessontxt = lessontxt + "function generateScreen" + str(s+1) + "(karma) {\n" lessontxt = lessontxt + "currentScreen = " + str(s+1) + '\n' - for image in imagelist: - lessontxt = lessontxt + generate_image(imagelist) lessontxt = lessontxt + " $('<div id = " + '"txtMain"/>' + "')\n" + lessontxt = lessontxt + " .appendTo('#content')\n" lessontxt = lessontxt + " .load('http://localhost:8008/cgi-bin/getFile.py',\n" - lessontxt = lessontxt + " {'filename':'" + fpth + "/a" + str(s+1) + ".txt'})\n" - lessontxt = lessontxt + " .appendTo('#content')\n};\n\n" - for audio in audiolist: - lessontxt = lessontxt + generate_audio(audiolist) + lessontxt = lessontxt + " {'filename':'" + fpth + "/a" + str(s+1) + ".txt'},\n" + lessontxt = lessontxt + " function(){\n" + lessontxt = lessontxt + generate_image(imagelists[s]) + lessontxt = lessontxt + " })\n" + lessontxt = lessontxt + "};\n" + lessontxt = lessontxt + generate_audio(audiolists[s]) lessontxt = lessontxt + "function initialize() {};\n" lessontxt = lessontxt + "function start_game(karma){\n};\n\n" lessontxt = lessontxt + "setUpMultiScreenLesson([\n" diff --git a/content/Explore/index.html b/content/Explore/index.html index 3562195..36238d8 100755 --- a/content/Explore/index.html +++ b/content/Explore/index.html @@ -17,17 +17,18 @@ </head> <body> <div id="header"> - <div id="topbtn_left"><div title="home" id="linkBack" class="linkHome" /></div></div> - <div id="lesson_title"> - <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" /> - Explore - <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" /> - </div> - <div id="topbtn_right"> + <div id="topbtn_left"> + <div title="home" id="linkHome" class="linkHome" /></div> + </div> + <div id="lesson_title"> + <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" /> + Sample Milestones + <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" /> + </div> + <div id="topbtn_right"> <div title="Quit" id="linkQuit" class="linkQuit"></div> - </div> + </div> </div> - <canvas id="ladder"/> - This page will show the lands available to explore. + <canvas id="ladder"/> </body> </html> diff --git a/content/assets/image/audio-pause.png b/content/assets/image/audio-pause.png Binary files differnew file mode 100644 index 0000000..51a8e65 --- /dev/null +++ b/content/assets/image/audio-pause.png diff --git a/content/assets/image/audio-play.png b/content/assets/image/audio-play.png Binary files differnew file mode 100644 index 0000000..de5b1e6 --- /dev/null +++ b/content/assets/image/audio-play.png diff --git a/content/assets/image/audio-record.png b/content/assets/image/audio-record.png Binary files differnew file mode 100644 index 0000000..386f1b7 --- /dev/null +++ b/content/assets/image/audio-record.png diff --git a/content/assets/image/audio-stop.png b/content/assets/image/audio-stop.png Binary files differnew file mode 100644 index 0000000..273d42a --- /dev/null +++ b/content/assets/image/audio-stop.png diff --git a/content/assets/image/btn_back_explore.png b/content/assets/image/btn_back_explore.png Binary files differnew file mode 100644 index 0000000..dfc9e38 --- /dev/null +++ b/content/assets/image/btn_back_explore.png diff --git a/content/assets/image/spiral.svg b/content/assets/image/spiral.svg new file mode 100644 index 0000000..9ec5be1 --- /dev/null +++ b/content/assets/image/spiral.svg @@ -0,0 +1,23 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> + +<svg width="100%" height="100%" version="1.1" +xmlns="http://www.w3.org/2000/svg"> + +<path d="M153 334 +C153 334 151 334 151 334 +C151 339 153 344 156 344 +C164 344 171 339 171 334 +C171 322 164 314 156 314 +C142 314 131 322 131 334 +C131 350 142 364 156 364 +C175 364 191 350 191 334 +C191 311 175 294 156 294 +C131 294 111 311 111 334 +C111 361 131 384 156 384 +C186 384 211 361 211 334 +C211 300 186 274 156 274" +style="fill:white;stroke:red;stroke-width:2"/> + +</svg> diff --git a/content/css/global.css b/content/css/global.css index c65a74d..75dcd65 100755 --- a/content/css/global.css +++ b/content/css/global.css @@ -28,15 +28,20 @@ body { margin-top: 75px;
background-color: #FFFFCC;
width: 1200px;
- height: 798px;
+ height: 748px;
overflow-y:scroll;
overflow-x:hidden;
z-index: 0;
}
#cntnt{
position:relative;
+ margin: 0 auto;
+ margin-top: 75px;
+ background-color: #FFFFCC;
width:1200px;
- height:748px;
+ height:4000px;
+ overflow-y:scroll;
+ overflow-x:hidden;
}
#editfs{
position:relative;
@@ -50,7 +55,7 @@ body { border: none !important;
float: left;
}
-#topbtn_left {
+.topbtn_left {
float: left;
height: 60px;
width: 60px;
@@ -73,6 +78,11 @@ body { width: 60px; height: 59px;
background:url(../assets/image/btn_back_mathematics.png);
}
+ .linkExplore{
+ cursor:pointer;
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back_explore.png);
+ }
.linkBegin{
cursor:pointer;
width: 60px; height: 59px;
@@ -96,45 +106,45 @@ body { margin-left: 10px;
background-image: url(../assets/image/bg_title_block.png);
}
-#topbtn_right {
+.topbtn_right {
float: right;
height: 60px;
width: 60px;
padding-top: 6px;
padding-right: 15px;
-}
- .linkQuit{
+ }
+ .linkQuit{
width: 60px; height: 60px;
background:url(../assets/image/activity-stop.png);
cursor:pointer;
}
- .linkApply{
+ .linkApply{
width: 60px; height: 60px;
background:url(../assets/image/apply.png);
cursor:pointer;
}
- .linkEdit{
+ .linkEdit{
width: 55px; height: 55px;
background:url(../assets/image/edit.png);
cursor:pointer;
}
- .linkHelp{
+ .linkHelp{
width: 60px; height: 60px;
background:url(../assets/image/btn_help.png);
cursor:pointer;
}
- .linkHelp:hover{
+ .linkHelp:hover{
background:url(../assets/image/btn_help_hover.png);
}
- .linkNext{
+ .linkNext{
cursor:pointer;
width: 60px; height: 60px;
background:url(../assets/image/btn_next.png);
}
- .linkNext:hover{
+ .linkNext:hover{
background:url(../assets/image/btn_next_hover.png);
}
- .linkPrev{
+ .linkPrev{
cursor:pointer;
width: 60px; height: 60px;
background:url(../assets/image/btn_help.png);
@@ -144,7 +154,7 @@ body { height:75px;
width:100%;
left:0px;
- top:75px;
+ top:0px;
background-color: #00FFFF;
}
#footer {
@@ -165,55 +175,58 @@ body { font-size: 16pt;
font-weight: bold;
}
-#botbtn_right {
+.botbtn_right {
float: right;
- height: 55px;
+ height: 60px;
padding-right: 5px;
padding-top: 10px;
-}
- #linkCheck{
+ }
+ .linkCheck{
margin: 1em 3em 0 0;
width: 187px; height: 55px;
background-image: url(../assets/image/check.png);
- }
-
- #linkStart{
+ }
+ .linkStart{
cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_start.png);
+ width: 187px; height: 55px;
+ background:url(../assets/image/start.png);
}
- #linkStart:hover{
- background:url(../assets/image/btn_start_hover.png);
+ .linkStart:hover{
+ background:url(../assets/image/start.png);
}
- #linkStart:active{
- background:url(../assets/image/btn_start_mouse_down.png);
+ .linkStart:active{
+ background:url(../assets/image/start.png);
}
- #linkPlayAgain{
+ .linkPlayAgain{
cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_play_again.png);
+ width: 187px; height: 55px;
+ background:url(../assets/image/restart.png);
}
- #linkPlayAgain:hover{
- background:url(../assets/image/btn_play_again_hover.png);
+ .linkPlayAgain:hover{
+ background:url(../assets/image/restart.png);
}
- #linkPlayAgain:active{
- background:url(../assets/image/btn_play_again_mouse_down.png);
+ .linkPlayAgain:active{
+ background:url(../assets/image/restart.png);
}
- #linkNextScreen{
+ .linkNextScreen{
width:64px; height: 55px;
background:url(../assets/image/btn_next.png);
}
-#botbtn_left {
+.botbtn_left {
float: left;
- height: 55px;
+ height: 60px;
padding-right: 5px;
padding-top: 10px;
-}
- #linkPrevScreen{
+ }
+ .linkPrevScreen{
width: 60px; height: 55px;
background:url(../assets/image/btn_back.png);
- }
+ }
+ .linkPlay{
+ width: 60px; height: 60px;
+ background:url(../assets/image/audio-play.png);
+ }
#timerBar {
position: absolute;
@@ -286,94 +299,4 @@ td { text-align:left !important;
}
-table.t1 {
- width: 100%;
- }
-
-table.t2 {
- width: 100%;
- height: 386px;
- table-layout: fixed;
- }
-
-table.t3 {
- width: 100%;
- }
-
-table.t4 {
- border: none !important;
- }
-
-table.t5 {
- width: 100%;
- table-layout: fixed;
- }
-
-table.t6 {
- border: none;
- }
-
-td.t6 {
- border: none;
- }
-
-table.t7 {
- border:none;
- width: 100%;
- height: 300px;
- table-layout:fixed;
- text-align: center;
- }
-
-td.t7 {
- border:none;
- width:25%;
- }
-
-th.t4, td.t4 {
- border: none !important;
- }
-
-th.t5, td.t5 {
- width: 10%;
- }
-
-th.t2 {
- width: 50%;
- border: 1px solid black;
- }
-
-td.t2 {
- width: 50%;
- border: 1px solid black;
- }
-
-li.st {
- font-weight: bold;
- font-size: 16px;
- color: black;
- }
-
-li.t6 {
- font-weight: bold;
- font-size: 16px;
- color:black;
- }
-
-span.bold {
- font-weight: bold;
- font-size: 16px;
- color:black;
- }
-
-p {
- font-family: Arial Rounded MT Bold, Calibri, sans-serif;
- font-size: 24px;
- color: black;
- }
-
-p.red {
- color: red;
- }
-
/**** End of the Activity style ****/
diff --git a/content/js/global.js b/content/js/global.js index ab61e63..b19e821 100755 --- a/content/js/global.js +++ b/content/js/global.js @@ -35,6 +35,10 @@ function linkMathematics(){ window.location = tpth;
}
};
+function linkExplore(){
+ pth = 'http://localhost:8008/content/Explore/index.html';
+ window.location = pth;
+};
function goback(){
url = window.location+"";
levels = url.split('/');
diff --git a/content/js/menu.js b/content/js/menu.js index fa7153e..9c0b0c4 100755 --- a/content/js/menu.js +++ b/content/js/menu.js @@ -53,15 +53,14 @@ $(document).ready( if (xy[3] == "EPaath"){ pth = "../../../src/FrameWork.html#" + xy[4]; }; - if (xy[3] == "Karma"){ + if (xy[3] == "NKarma"){ pth = xy[4] + '/index.html'; }; if (xy[3] == "Siyavula"){ pth = xy[4] + '.html'; }; if (xy[3] == 'Sugar'){ - url = 'http://localhost:8008/cgi-bin/'; - pth = url + 'launch.py?activity='+xy[4]; + pth = xy[4] + '/index.html'; }; window.location = pth; }; diff --git a/content/js/navigation.js b/content/js/navigation.js index 50f9cd2..6d1ea70 100755 --- a/content/js/navigation.js +++ b/content/js/navigation.js @@ -9,6 +9,9 @@ $(document).ready(function(){ $('#linkMathematics').click(function(){ linkMathematics(); }); + $('#linkExplore').click(function(){ + linkExplore(); + }); $('#linkBack').click(function(){ goback(); }); diff --git a/content/karma/css/global.css b/content/karma/css/global.css index 3d647d5..c6875e4 100644 --- a/content/karma/css/global.css +++ b/content/karma/css/global.css @@ -115,7 +115,7 @@ body { margin: 0 auto; margin-top: 74px; width: 1198px; - height: 750px; + height: 748px; overflow: hidden; text-align:center; } @@ -147,6 +147,13 @@ body { padding-top: 10px; } +.botbtn_left { + float:left; + height: 55px; + padding-left: 5px; + padding-top: 10px; +} + #linkCheck { margin:0 40px 0 0; background-image:url("../image/btn_check.png"); diff --git a/contentedit.html b/contentedit.html index bf86435..5eb4616 100755 --- a/contentedit.html +++ b/contentedit.html @@ -23,7 +23,7 @@ tinyMCE.init({ document_base_url : 'http://localhost:8008/imgs', content_css: "http://localhost:8008/content/css/global.css", width: "1200", - height: "1200" + height: "4000" }); $(document).ready(function(){ @@ -61,9 +61,9 @@ function toggleEditor(id) { </script> </head> -<body> +<body style='height: 4000'> <div id="header"> - <div id="topbtn_left"> + <div class="topbtn_left"> <div title="linkBack" id="editreturn" class="linkBack" /></div> </div> <div id="lesson_title"> @@ -77,11 +77,11 @@ function toggleEditor(id) { <a href="javascript:toggleEditor('cntnt');">web/html</a> </fieldset> </div> - <div id="topbtn_right"> + <div class="topbtn_right"> <div title="Quit" id="linkQuit" class="linkQuit"></div> </div> </div> -<div id="content"> +<div id='content'> <textarea id="cntnt" name='cntnt' class='mceAdvanced' |