Permalink
Browse files

Merge branch 'master' of github.com:stuycs-ml7/project1-pd7

  • Loading branch information...
2 parents f28972d + ec8dcac commit 0d4fad38774a12ee04b4899e6d605d34b78ef8a5 @Oneman2feet Oneman2feet committed Oct 11, 2012
Showing with 30 additions and 8 deletions.
  1. +1 −1 7UP/apple.py
  2. +2 −2 GROUP_1/app.py
  3. +2 −2 GROUP_1/app.py~
  4. +24 −2 GROUP_2/feedbackerator.py
  5. +1 −1 GROUP_2/templates/results.html
View
@@ -99,4 +99,4 @@ def logout():
if __name__=="__main__":
app.debug=True # remove this line to turn off debugging
- app.run() # connect to localhost:5000 or http://127.0.0.1:5000
+ app.run(port=7007) # connect to localhost:5000 or http://127.0.0.1:5000
View
@@ -7,7 +7,7 @@
app.secret_key="nothing"
#UserEmail=""
-#logged_in = false
+#logged_in = False
@app.route("/",methods=['GET','POST'])
def login():
@@ -21,7 +21,7 @@ def login():
UserEmail = request.form["user"]
UserCode = request.form["idnum"]
if data.checkLogin (UserEmail, UserCode):
- logged_in = true
+ logged_in = True
return redirect(url_for('home'))
else:
error = "Member name and password were not found. Please try again."
View
@@ -7,7 +7,7 @@ app = Flask(__name__)
app.secret_key="nothing"
#UserEmail=""
-#logged_in = false
+#logged_in = False
@app.route("/",methods=['GET','POST'])
def login():
@@ -21,7 +21,7 @@ def login():
UserEmail = request.form["user"]
UserCode = request.form["idnum"]
if data.checkLogin (UserEmail, UserCode):
- logged_in = true
+ logged_in = True
return redirect(url_for('home'))
else:
error = "Member name and password were not found. Please try again."
View
@@ -61,8 +61,10 @@ def rate_page(name=None):
return redirect(url_for('login'))
groupnum = util.get_group(name)
periodnum = util.get_period(name)
+ #print groupnum, periodnum
names,emails = util.get_groupMembers(str(groupnum),str(periodnum),str(name))
if request.method == "GET":
+ #print names, emails
return render_template("rate_page.html",qlist=qlist,names=names, emails=emails)
else:
for email in emails:
@@ -91,9 +93,29 @@ def view_results(name=None):
if name == None:
return redirect(url_for('login'))
A,S = util2.get_rating(str(name))
- return render_template("results.html", name=name,A=A,S=S,qlist=qlist)
+
+ #tempScores = S
+ #scoreSum = 0
+ #scoreLength = S.len
+ #for score in S:
+
+ tempScores = S
+ #print tempScores
+ sums = []
+ for scoreList in tempScores:
+ tmpInt = 0
+ for rating in scoreList:
+ tmpInt = tmpInt + int(rating)
+ sums.append(tmpInt)
+ #print sums
+ lengths = [len(x) for x in S]
+ #print lengths
+ means = [int(sums[x]/lengths[x]) for x in range(len(S))]
+ #print means
+
+ return render_template("results.html", name=name,A=A,S=S,qlist=qlist, means=means)
if __name__ == "__main__":
app.debug = True
- app.run()
+ app.run(port=7010)
@@ -21,7 +21,7 @@
,
{% endif %}
{% endfor %}
-
+ ; mean score: {{means[x]}}
<br>
{% set x = x + 1 %}
{% endfor %}

0 comments on commit 0d4fad3

Please sign in to comment.