Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Anderson <tony@traveler.(none)>2011-01-05 13:20:56 (GMT)
committer Tony Anderson <tony@traveler.(none)>2011-01-05 13:20:56 (GMT)
commite732b77a96156a4cc657ceffee86ae1377a81519 (patch)
treec91f9bd64b4a77da64e359c8655292afd9b1fb70
parent286bfda91318d301c4a40c29040d65993119f161 (diff)
fix misc errors
-rwxr-xr-xcgi-bin/fetch_milestone.py2
-rwxr-xr-xcgi-bin/results.py8
-rwxr-xr-xcgi-bin/set_up_main_menu.py1
-rwxr-xr-xcontent/js/global.js6
4 files changed, 8 insertions, 9 deletions
diff --git a/cgi-bin/fetch_milestone.py b/cgi-bin/fetch_milestone.py
index 3bd1692..f256679 100755
--- a/cgi-bin/fetch_milestone.py
+++ b/cgi-bin/fetch_milestone.py
@@ -243,7 +243,7 @@ def get_student_record(student, classe):
student_record = {}
student_record['grade'] = grade
student_record['milestones'] = ['1.1','1.1']
- student_record['progress'] = {}
+ student_record['progress'] = []
txtout = str(student_record)
fout = open(DATAPATH / student,'w')
fout.write(txtout)
diff --git a/cgi-bin/results.py b/cgi-bin/results.py
index cd3a82e..8508d5c 100755
--- a/cgi-bin/results.py
+++ b/cgi-bin/results.py
@@ -8,7 +8,7 @@ from path import path
DATAPATH = path(activity.get_activity_root())/ 'data'
log = open('/tmp/logr','w')
-retval = '0'
+retval = 0
cgitb.enable(display=True)
print 'Content-type:text/html\n\n'
#parameters are activity, score
@@ -97,7 +97,7 @@ if len(activity)==10 and int(result) >= 70:
line = line + '\n'
if activity in line:
nxtflag=True
- retval = '1'
+ retval = 1
txtout=txtout+line.replace('red','green')
elif nxtflag and line.find('blue')>-1:
nxtflag=False
@@ -151,7 +151,7 @@ if len(activity)==10 and int(result) >= 70:
line = line + '\n'
if milestone in line:
nxtmsflag = True
- retval = '2'
+ retval = 2
txtout = txtout + line.replace('red','green')
elif nxtmsflag == True:
if line.find('blue')>0:
@@ -169,7 +169,7 @@ if len(activity)==10 and int(result) >= 70:
if nxtmsflag:
#what do we do now - this learner is done!
print >> log, 'learner is done!'
- retval = '3'
+ retval = 3
#update first activity in next milestone
print >> log, 'first activity in next milestone', milestone
nxt = str(int(milestone[5:7])+1)
diff --git a/cgi-bin/set_up_main_menu.py b/cgi-bin/set_up_main_menu.py
index b04075c..84b718f 100755
--- a/cgi-bin/set_up_main_menu.py
+++ b/cgi-bin/set_up_main_menu.py
@@ -256,7 +256,6 @@ else:
delta = 1
print >> log, 'mode', mode, 'subject', subject, 'grades', grades, 'terms',terms
milestones = get_installed(subject)
- milestones.remove('karma')
print >> log, 'create_activities_list', subject, milestones
create_activities_list(subject, milestones)
print >> log, 'created activities_list', subject
diff --git a/content/js/global.js b/content/js/global.js
index 62281af..851e541 100755
--- a/content/js/global.js
+++ b/content/js/global.js
@@ -21,9 +21,9 @@ function apply(){
$('#content').load('http://localhost:8008/cgi-bin/results.py',{
'score':'70',
},function(responseText, status, xhr){
- if (responseText=='1'){ goback();
- } else if (responseText=='2'){ gobackOne();
- } else if (responseText=='3'){ gobackTwo();
+ if (responseText==1){ goback();
+ } else if (responseText==2){ gobackOne();
+ } else if (responseText==3){ gobackTwo();
};
});
}