diff options
Diffstat (limited to 'examples/Math_Money_Identification')
29 files changed, 0 insertions, 331 deletions
diff --git a/examples/Math_Money_Identification/assets/audio/correct.ogg b/examples/Math_Money_Identification/assets/audio/correct.ogg Binary files differdeleted file mode 100755 index a0d9e3a..0000000 --- a/examples/Math_Money_Identification/assets/audio/correct.ogg +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/audio/incorrect.ogg b/examples/Math_Money_Identification/assets/audio/incorrect.ogg Binary files differdeleted file mode 100755 index 4805e55..0000000 --- a/examples/Math_Money_Identification/assets/audio/incorrect.ogg +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/audio/trigger.ogg b/examples/Math_Money_Identification/assets/audio/trigger.ogg Binary files differdeleted file mode 100755 index f22512a..0000000 --- a/examples/Math_Money_Identification/assets/audio/trigger.ogg +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/1.png b/examples/Math_Money_Identification/assets/image/1.png Binary files differdeleted file mode 100755 index 22f359f..0000000 --- a/examples/Math_Money_Identification/assets/image/1.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/10.png b/examples/Math_Money_Identification/assets/image/10.png Binary files differdeleted file mode 100755 index bce11f0..0000000 --- a/examples/Math_Money_Identification/assets/image/10.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/2.png b/examples/Math_Money_Identification/assets/image/2.png Binary files differdeleted file mode 100755 index 39c8e32..0000000 --- a/examples/Math_Money_Identification/assets/image/2.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/3.png b/examples/Math_Money_Identification/assets/image/3.png Binary files differdeleted file mode 100755 index 328755e..0000000 --- a/examples/Math_Money_Identification/assets/image/3.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/4.png b/examples/Math_Money_Identification/assets/image/4.png Binary files differdeleted file mode 100755 index 682a321..0000000 --- a/examples/Math_Money_Identification/assets/image/4.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/5.png b/examples/Math_Money_Identification/assets/image/5.png Binary files differdeleted file mode 100755 index c626399..0000000 --- a/examples/Math_Money_Identification/assets/image/5.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/6.png b/examples/Math_Money_Identification/assets/image/6.png Binary files differdeleted file mode 100755 index 32a6080..0000000 --- a/examples/Math_Money_Identification/assets/image/6.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/7.png b/examples/Math_Money_Identification/assets/image/7.png Binary files differdeleted file mode 100755 index f2fdfe8..0000000 --- a/examples/Math_Money_Identification/assets/image/7.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/8.png b/examples/Math_Money_Identification/assets/image/8.png Binary files differdeleted file mode 100755 index d5567f2..0000000 --- a/examples/Math_Money_Identification/assets/image/8.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/9.png b/examples/Math_Money_Identification/assets/image/9.png Binary files differdeleted file mode 100755 index 50b289d..0000000 --- a/examples/Math_Money_Identification/assets/image/9.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/correct.png b/examples/Math_Money_Identification/assets/image/correct.png Binary files differdeleted file mode 100755 index d6e54a8..0000000 --- a/examples/Math_Money_Identification/assets/image/correct.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/1.png b/examples/Math_Money_Identification/assets/image/image_name/1.png Binary files differdeleted file mode 100755 index 713a668..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/1.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/10.png b/examples/Math_Money_Identification/assets/image/image_name/10.png Binary files differdeleted file mode 100755 index 8d9a506..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/10.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/2.png b/examples/Math_Money_Identification/assets/image/image_name/2.png Binary files differdeleted file mode 100755 index 55fc4a7..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/2.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/3.png b/examples/Math_Money_Identification/assets/image/image_name/3.png Binary files differdeleted file mode 100755 index c1b404c..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/3.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/4.png b/examples/Math_Money_Identification/assets/image/image_name/4.png Binary files differdeleted file mode 100755 index c9283f8..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/4.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/5.png b/examples/Math_Money_Identification/assets/image/image_name/5.png Binary files differdeleted file mode 100755 index 7c30b90..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/5.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/6.png b/examples/Math_Money_Identification/assets/image/image_name/6.png Binary files differdeleted file mode 100755 index 11d3a50..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/6.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/7.png b/examples/Math_Money_Identification/assets/image/image_name/7.png Binary files differdeleted file mode 100755 index 92c500d..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/7.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/8.png b/examples/Math_Money_Identification/assets/image/image_name/8.png Binary files differdeleted file mode 100755 index 9dbf94b..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/8.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/image_name/9.png b/examples/Math_Money_Identification/assets/image/image_name/9.png Binary files differdeleted file mode 100755 index dc771ea..0000000 --- a/examples/Math_Money_Identification/assets/image/image_name/9.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/incorrect.png b/examples/Math_Money_Identification/assets/image/incorrect.png Binary files differdeleted file mode 100755 index 789db87..0000000 --- a/examples/Math_Money_Identification/assets/image/incorrect.png +++ /dev/null diff --git a/examples/Math_Money_Identification/assets/image/play_again.jpg b/examples/Math_Money_Identification/assets/image/play_again.jpg Binary files differdeleted file mode 100755 index db3ae56..0000000 --- a/examples/Math_Money_Identification/assets/image/play_again.jpg +++ /dev/null diff --git a/examples/Math_Money_Identification/css/lesson.css b/examples/Math_Money_Identification/css/lesson.css deleted file mode 100755 index d306784..0000000 --- a/examples/Math_Money_Identification/css/lesson.css +++ /dev/null @@ -1,91 +0,0 @@ -@CHARSET "UTF-8"; -body { - background-color: #ccc; -} - - -#gameArea{ - margin-top:5%; - margin-left: 10%; - float: left; - width: 60% - padding:10px; - -} - - -#questionBox{ - color: red; - border: 3px outset #0AF9dd; - width: 150px; - padding: 5px; - background: #2EFEF7; - font: 20px "Helvetica", Verdana, Geneva, Arial, sans-serif; - font-weight: bold; - -} -.imageBox{ - margin-left: 25%; - margin-top: 25px; - padding: 10px; -} - -.checkedOption{ - position: absolute; - float:right; - right: 20%; - top: 25%; - - width:120px; - height:120px; - padding: 5px; -} - -#options{ - position: absolute; - margin-left:50px; - top:80%; - width:800px; - height:80px; - padding: 10px; -} - -.optImg{ - padding:5px; -} - -#scoreArea{ - margin-left: 10%; - margin-right: 10%; - color: red; - - padding: 5px;; - background: #FFFFFF; - border: 2px solid red; - background: black; - padding: 10px; - font: 18px "Lucida Sans Typewriter",Verdana,Times New Roman; -} -.playAgain{ - position:absolute; - top: 10px; - margin-left:60%; - width:115px; - height: 30px; - padding: 2px 2px 2px 2px; - } - -input{ - color:green; - -} -#gameOver{ - display: none; - margin-left:300px; - width: 180px; - height: 20px; - font: 25px "Rockwell Extra Bold", Geneva, Arial, Helvetica, sans-serif,Times New Roman; - font-weight: bold; - background-color: #ccc; - padding: 10px; -} diff --git a/examples/Math_Money_Identification/index.html b/examples/Math_Money_Identification/index.html deleted file mode 100755 index 0c349ec..0000000 --- a/examples/Math_Money_Identification/index.html +++ /dev/null @@ -1,43 +0,0 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>Math_Money Identification</title>
- <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal,Money identification" />
- <link type="text/css" rel="stylesheet" href="css/lesson.css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
- <link type="text/css" rel="stylesheet" href="css/lesson.css" />
- <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="../../js/karma.js"></script>
- <script type="text/javascript" src="js/lesson.js"></script>
-</head>
-<body>
- <div id ="scoreArea">
- <form name="scoreDisplay">
- <b>Score:</b> <input type="text" size="1" name="score"/>
- <b>Total:</b> <input type="text" size="1" name="total"/>
- |Identify Money |
- </form>
-
- <a href="#" id="anchorPlayAgain"><img class="playAgain" src="assets/image/play_again.jpg" alt=""/></a>
- </div>
- <div id="gameArea">
- <!--
- <div id="questionBox">How Many Rupees is This?</div>
- -->
- <img class="imageBox" id="imgObject" src="" alt=""/>
- <img class="checkedOption" id="check" src="" alt=""/>
-
- <div id="options">
- <a href="#" id="anchorOpt0"><img class="optImg" id="option0" src="" alt=""/></a>
- <a href="#" id="anchorOpt1"><img class="optImg" id="option1" src="" alt=""/></a>
- <a href="#" id="anchorOpt2"><img class="optImg" id="option2" src="" alt=""/></a>
- <a href="#" id="anchorOpt3"><img class="optImg" id="option3" src="" alt=""/></a>
- </div>
-
- <div id="gameOver">
- Game Over
- </div>
- </div>
-</body>
-</html>
\ No newline at end of file diff --git a/examples/Math_Money_Identification/js/lesson.js b/examples/Math_Money_Identification/js/lesson.js deleted file mode 100755 index 9012805..0000000 --- a/examples/Math_Money_Identification/js/lesson.js +++ /dev/null @@ -1,197 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.ogg'}, - {'name':'incorrect','file':'incorrect.ogg'}, - {'name':'trigger', 'file':'trigger.ogg'} - ]}); - - k.ready(function(){ - - var flag, i ,j; - var object_counter = 1; - var imgNameRand = []; - var optPosition = []; - var optOtherPos = []; - var imageObject = []; - var correctPosition; - var selectedOption; - var score = 0; - var wrong_selected = 0; //wrong option selected so don't score up - var pos; - var t; - var current_image; - - - load_images(); //load the image numbers for random display - display_score(); - game(); //let the game begin - - - function display_score(){ - document.scoreDisplay.score.value = score; - if(object_counter > 10) - document.scoreDisplay.total.value = 10; - else - document.scoreDisplay.total.value = object_counter; - } - - function checkDisplay(){ //Displays the correct and incorrect info - if(wrong_selected == 1){ - $('.checkedOption').show(); - k.audio.incorrect.play(); - document.getElementById("check").src = "assets/image/incorrect.png"; - $('.checkedOption').fadeOut(1000); - } - else{ - $('.checkedOption').hide(); - k.audio.correct.play(); - document.getElementById("check").src = "assets/image/correct.png"; - $('.checkedOption').fadeOut(2000); - //needs timer for holding on for abt a sec - } - } - - $("#anchorPlayAgain").click(function(){ - $('#gameOver').hide(); - $('.optImg').show(); - $('.imageBox').show(); - load_images(); - score = 0; - object_counter = 1; - wrong_selected = 0; - display_score(); - - game(); - - }); - $("#anchorOpt0").click(function(){ - selected_Option_Process('0'); - }); - $("#anchorOpt1").click(function(){ - selected_Option_Process('1'); - }); - $("#anchorOpt2").click(function(){ - selected_Option_Process('2'); - }); - $("#anchorOpt3").click(function(){ - selected_Option_Process('3'); - }); - - function generate_random_no(no_limit) { //generate random number - var rand_no = Math.ceil(no_limit*Math.random()); - return rand_no; - } - - function get_random_position(){ //generate random number between 0-3 - var rand_pos = Math.floor(Math.random()*4); - return rand_pos; - } - - function load_images(){ - - imageObject[0] = generate_random_no("10"); - for(i=1; i<10; i++){ - do{ - flag = 0; - imageObject[i] = generate_random_no("10"); - for(j=0; j<i; j++){ - if(imageObject[i]===imageObject[j]){ - flag++; - } - } - }while(flag != 0 ); //end of do while loop - } - - - } - function selected_Option_Process(selectedOption){ - - if(selectedOption == correctPosition){ - object_counter++; - if(wrong_selected == 0){ - score++; - } - wrong_selected = 0; - display_score(); - checkDisplay(); - //t=setTimeout('game()',1000); - game(); - } - else { - wrong_selected = 1; - checkDisplay(); - } - - } - function game(){ - - - //clearTimeout(t); - wrong_selected = 0; - current_image = object_counter-1; - document.getElementById("imgObject").src = "assets/image/"+imageObject[current_image]+".png"; - - //find correct answer and apply it to the position - currentImage = imageObject[current_image]; - imgNameRand[0] = currentImage; - //generate choices - - for(i=1; i<4; i++){ - do{ - flag = 0; - imgNameRand[i] = generate_random_no("10"); - for(j=0; j<i; j++){ - if(imgNameRand[i]===imgNameRand[j]){ - flag++; - } - } - }while(flag != 0 ); //end of do while loop - } - - - correctPosition = get_random_position(); - - optOtherPos[0] = correctPosition; - - for(i=1; i<4; i++){ - do{ - flag = 0; - optOtherPos[i] = get_random_position(); - for(j=0; j<i; j++){ //chek repeat within optOtherPos array - if(optOtherPos[i] === optOtherPos[j]){ - flag++; - } - } - - }while(flag != 0); - - } - - for(i=0; i<4; i++){ - pos = optOtherPos[i]; - optPosition[pos] = imgNameRand[i]; - } - - - //random positions are stored in optOtherPos array. Great - - - for(i=0; i<4; i++){ - document.getElementById("option"+i+"").src = "assets/image/image_name/"+optPosition[i]+".png"; - } - - //check for the correctness - if(object_counter > 10){ - - $('.optImg').hide(); - $('.imageBox').hide(); - $('#gameOver').show(); - - - } - - //else - //no change - } //end of game -}); -}); //end of DOM
\ No newline at end of file |