Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/js/lesson.js
blob: 906a344b00e3af29e75fd4e2300f206defe74b4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
$(document).ready(
    function(){

	
    //preloads assets into karma 'collections'
    var k = Karma({
		audio: [{'name':'correct','file':'correct.ogg'},
			{'name':'incorrect','file':'incorrect.ogg'}
		]});

    //this command will scale down the lesson if the user's browser window
    //is smaller than 950px X 600px
    k.scaleWindow();

    //sets locale, otherwise defaults to English
    $.i18n.setLocale('en');

    k.ready(
	function(){ 	      
	    //put your main lesson code inside this callback

	    //This attaches the Karma Header widget to the div w/ the id #kHeader
	    //and initializes it w/ values
	    $('#kHeader').kHeader({'title': 'My First Karma Lesson',
				   lessonPlan: true, teachersNote: true});

	    

	    //set up the footer and initialize it with a winning score
	    var kFooter = $('#kFooter').kFooter({'winningScore': 6,
						pauseButton: true, startButton: true});

	    //Set up feedback widget, this shows the user a correct or incorrect
	    //icon and sound when triggered programmatically
	    var $feedback = $('#feedback').feedback();

	    /*  Here are examples of using the feedback widget

	    $feedback.feedback('correct');
	    $feedback.feedback('incorrect');
	    $feedback.feedback('win');
	    $feedback.feedback('lose');

	    */

	    //here are examples of binding behavior to events
	    /*
	    kFooter.bind('kFooterWinGame', 
		function(){
		    $('.optImg').hide();
		    $('.imageBox').hide();
		    $('#gameOver').show();
		});  
	    kFooter.bind('kFooterRestart',
		function() {
		    object_counter = 1;
		    imgNameRand = [];
		    optPosition = [];
		    optOtherPos = [];
		    imageObject = [];
		    score = 0;
		    wrong_selected = 0;  //wrong option selected so don't score up
		    
		     load_images();  
		     game();     
	
		}
	    );
	     */


	}); //end of games
});  //end of DOM