Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/content/js/global.js
diff options
context:
space:
mode:
Diffstat (limited to 'content/js/global.js')
-rwxr-xr-xcontent/js/global.js130
1 files changed, 0 insertions, 130 deletions
diff --git a/content/js/global.js b/content/js/global.js
deleted file mode 100755
index b19e821..0000000
--- a/content/js/global.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-
-function linkHome(){
- pth = 'http://localhost:8008/content/index.html';
- window.location = pth;
-};
-function linkEnglish(){
- url = window.location+"";
- grade = url.charAt(url.length-1);
- last = url.charAt(url.length-3)+url.charAt(url.length-2)+grade;
- pth = 'http://localhost:8008/content/English';
- pos = url.indexOf('?F');
- if (pos<0){
- window.location = pth + '/index.html';
- }else{
- tpth = pth + '/p'+grade+'.html'+last;
- window.location = tpth;
- }
-};
-function linkMathematics(){
- url = window.location+"";
- grade = url.charAt(url.length-1);
- last = url.charAt(url.length-3)+url.charAt(url.length-2)+grade;
- pth = 'http://localhost:8008/content/Mathematics';
- pos = url.indexOf('?F');
- if (pos<0){
- window.location = 'content/Mathematics/index.html'
- }else{
- tpth = pth + '/p'+grade+'.html'+last;
- window.location = tpth;
- }
-};
-function linkExplore(){
- pth = 'http://localhost:8008/content/Explore/index.html';
- window.location = pth;
-};
-function goback(){
- url = window.location+"";
- levels = url.split('/');
- last = levels.pop();
- levels.pop()
- levels.push(last);
- newurl = levels.join('/');
- window.location = newurl
-}
-function apply(){
- items = (window.location+"").split('/');
- score = '70';
- subject = items[4];
- milestone = items[5];
- activity = items[6];
- $('#content').load('http://localhost:8008/cgi-bin/results.py',{
- 'score':score,
- 'subject':subject,
- 'milestone':milestone,
- 'activity':activity
- },function(responseText, status, xhr){
- if (responseText==1){ goback();
- } else if (responseText==2){ gobackOne();
- } else if (responseText==3){ gobackTwo();
- };
- });
-}
-function quit(){
- window.close();
-}
-
-function edit(){
-
- url = window.location+"";
- items = url.split('/');
- items.shift();
- items.shift();
- items.shift();
- newurl = items.join('/');
- pth = 'http://localhost:8008/contentedit.html?'+newurl;
- window.location = pth;
-}
-
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-