Skip to content

Commit 97c9bab

Browse files
author
BriaW
committed
Changes to corresponding voting files
1 parent fa9c81a commit 97c9bab

6 files changed

Lines changed: 66 additions & 38 deletions

File tree

api/API/voting.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ def getVotesByProject(proj):
1212
# .over(partition_by=[Voting.projectID]),
1313
fn.Avg(Voting.qualityOfResearch),
1414
# .over(partition_by=[Voting.projectID]),
15-
fn.Avg(Voting.studentDevelopment),
16-
# .over(partition_by=[Voting.projectID]),
17-
fn.Avg(Voting.facultyDevelopment),
15+
fn.Avg(Voting.development),
1816
# .over(partition_by=[Voting.projectID]),
1917
fn.Avg(Voting.collaborative),
20-
fn.Avg(Voting.interaction),
21-
fn.Avg(Voting.communication),
22-
fn.Avg(Voting.scholarlySignificance),
2318
fn.Avg(Voting.proposalQuality),
2419
fn.Avg(Voting.budget),
2520
fn.Avg(Voting.timeline)
@@ -36,24 +31,24 @@ def getVotesByProject(proj):
3631

3732

3833
def getVotes():
39-
34+
4035
paramsQ = (Voting.select())
41-
36+
4237
app.logger.info("Looking for votes with query:\n\n" + paramsQ + "\n\n")
43-
38+
4439
if paramsQ.exists():
4540
return paramsQ.get()
4641
else:
4742
return None
4843

4944
def getCommitteeVotes(committee):
50-
45+
5146
paramsQ = (Voting.select()
5247
.where(Voting.committeeID == committee)
5348
)
54-
49+
5550
app.logger.info("Looking for votes with query:\n\n" + paramsQ + "\n\n")
56-
51+
5752
if paramsQ.exists():
5853
return paramsQ.execute()
5954
else:
@@ -66,23 +61,22 @@ def getVote(username, pid):
6661
.where(Voting.projectID == pid)
6762
)
6863
app.logger.info("Looking for {0}'s votes for project {1}\n".format(username, pid))
69-
64+
7065
if paramsQ.exists():
7166
return paramsQ.get()
7267
else:
7368
return None
74-
69+
7570
# def getVote(committee, project):
76-
71+
7772
# paramsQ = (Voting.select()
7873
# .where(Voting.committeeID == committee and
7974
# Voting.projectID == project)
8075
# )
81-
76+
8277
# app.logger.info("Looking for votes with query:\n\n" + paramsQ + "\n\n")
83-
78+
8479
# if paramsQ.exists():
8580
# return paramsQ.get()
8681
# else:
8782
# return None
88-

api/committee/vote.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def vote_GET (username):
1818
programs = getAllPrograms()
1919
budget = getAllBudgets()
2020
# votes = getVotes()
21-
21+
2222
for p in project:
2323
if (Voting.select()
2424
.where(Voting.projectID == p.pID)
@@ -27,13 +27,13 @@ def vote_GET (username):
2727
votes = getVote(username, p)
2828
else:
2929
votes = Voting.create(committeeID = username, projectID = p.pID)
30-
30+
3131
theirVotes = getCommitteeVotes(username)
3232
outVotes = []
3333
if theirVotes is not None:
3434
for vote in theirVotes:
3535
outVotes.append(vote)
36-
36+
3737
return render_template ( "committee/vote.html",
3838
proj = project,
3939
username = username,
@@ -48,26 +48,26 @@ def vote_GET (username):
4848
def vote_POST (username):
4949
if username != authUser(request.environ):
5050
return { "response": cfg["response"]["badUsername"] }
51-
51+
5252
data = request.form
5353

5454
print "Data is: " + str(data)
55-
56-
# TODO: Need to test if row exists to update votes OR create a new row;
55+
56+
# TODO: Need to test if row exists to update votes OR create a new row;
5757
# currently always writes to the first row, and in random order (based on dictionary order)
5858
for key, value in data.iteritems():
5959
projectAndColumn = key.split("-")
6060
votes = getCommitteeVotes(username)
61-
62-
print projectAndColumn
63-
61+
62+
print projectAndColumn
63+
6464
if (Voting.select()
6565
.where(Voting.projectID == projectAndColumn[0]).exists()
6666
):
6767
votes = getVote(username, projectAndColumn[0])
6868
else:
6969
votes = Voting.create(committeeID = username, projectID = projectAndColumn[0])
70-
70+
7171
# print "Key " + key
7272
# print "Value " + value
7373
print votes.projectID
@@ -77,7 +77,7 @@ def vote_POST (username):
7777
votes.studentRoleVote = (value if projectAndColumn[1] == "studentRoleVote" else votes.studentRoleVote)
7878
votes.feasibilityVote = (value if projectAndColumn[1] == "feasibilityVote" else votes.feasibilityVote)
7979
votes.save()
80-
80+
8181
theirVotes = getCommitteeVotes(username)
8282
outVotes = []
8383
for vote in theirVotes:
@@ -91,4 +91,3 @@ def vote_POST (username):
9191
fac = faculty,
9292
votes = outVotes
9393
)
94-

api/config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,45 @@ voting:
203203
dbName: "timeline"
204204
longDescription: "There is a high probability that the proposed project will be completed within the time frame specified."
205205

206+
```
207+
- title: "Likelihood of Enhancing Student Learning"
208+
dbName: "studentLearning"
209+
longDescription: "Enhances students' learning by providing opportunities for the engagement of challenging, collaborative and directed projects in an apprentice-mentor relationship with faculty."
210+
- title: "Accessibility of Research to Students"
211+
dbName: "studentAccessibility"
212+
longDescription: "The project topic/material is accessible to students, allowing them to play a central role in carrying out, interpreting, and presenting the research."
213+
- title: "Professional Quality of Research"
214+
dbName: "qualityOfResearch"
215+
longDescription: "The project itself, not the work expected from students, should be at a level expected of faculty professionals, which allows the faculty mentor to provide a model for engaging research and creative activity."
216+
- title: "Potential for Career and Personal Development (Student)"
217+
dbName: "studentDevelopment"
218+
longDescription: "Offers experiences that allow students to build their self-confidence to pursue careers and make informed career and graduate school decisions for further study beyond Berea."
219+
- title: "Potential for Career and Personal Development (Faculty)"
220+
dbName: "facultyDevelopment"
221+
longDescription: "Offers experiences that allow faculty to strengthen their own professional development and growth."
222+
- title: "Collaborative Nature of Project"
223+
dbName: "collaborative"
224+
longDescription: "Helps students understand the critical interplay between collaboration and independent thought and action in any team effort to engage a complex, open-ended project."
225+
- title: "Level of Expected Student-Faculty Interaction"
226+
dbName: "interaction"
227+
longDescription: "Fosters significant student-faculty interaction in scholarly/creative work."
228+
- title: "Likelihood of Enhancing Communication Skills"
229+
dbName: "communication"
230+
longDescription: "Enhances students' communication skills by participating in a significant way in the writing of a final summary or paper reporting the methods used and interpreting the reults/conclusions of the study/project."
231+
- title: "Scholarly/Creative Significance"
232+
dbName: "scholarlySignificance"
233+
longDescription: "Proposal contains adequate background information establishing possible contributions of the faculty/student research to the current body of knowledge in the area of interest."
234+
- title: "Clarity/Quality of Proposal"
235+
dbName: "proposalQuality"
236+
longDescription: "Proposal is written in clear and concise language that is understandable by colleagues outside the discipline. Overall appearance of the proposal is professional and complete."
237+
- title: "Budget (Appropriateness and Justification)"
238+
dbName: "budget"
239+
longDescription: "Budget is realistic, as well as justified by and consistent with the scope of the proposed project."
240+
- title: "Timeline"
241+
dbName: "timeline"
242+
longDescription: "There is a high probability that the proposed project will be completed within the time frame specified."
243+
244+
```
206245

207246
# I think this should move to the Parameters table, so it can be more easily configured in the UI by the committee.
208247

api/models.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,8 @@ class Voting (DynamicModel):
162162
studentLearning = FloatField(null = True)
163163
studentAccessibility = FloatField(null = True)
164164
qualityOfResearch = FloatField(null = True)
165-
studentDevelopment = FloatField(null = True)
166-
facultyDevelopment = FloatField(null = True)
165+
development = FloatField(null = True)
167166
collaborative = FloatField(null = True)
168-
interaction = FloatField(null = True)
169-
communication = FloatField(null = True)
170-
scholarlySignificance = FloatField(null = True)
171167
proposalQuality = FloatField(null = True)
172168
budget = FloatField(null = True)
173169
timeline = FloatField(null = True)

api/static/js/pages/allVotes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ function recalculate () {
88
// console.log(parseFloat(this.innerHTML));
99
sum += (parseFloat(this.innerHTML));
1010
console.log("Sum " + sum);
11-
$("#average" + idx).html(parseFloat(sum/12).toFixed(2)); //Five
11+
$("#average" + idx).html(parseFloat(sum/7).toFixed(2)); //7 is the number of criteria in the rubric
1212
});
1313
};
1414
};
1515

1616
$(document).ready(function(){
17-
// $('[data-toggle="tooltip"]').tooltip();
17+
// $('[data-toggle="tooltip"]').tooltip();
1818
recalculate();
1919
});

api/static/js/pages/vote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function recalculate () {
66
var rows = $("#row" + idx).find("select.rowValue");
77
rows.each(function (value, i) {
88
sum += (this.options.selectedIndex);
9-
$("#average" + idx).html(sum/3); //Five
9+
$("#average" + idx).html(sum/3); //3 is the number of ratings that each criteria has (Exceptional, Good, Needs Improvement)
1010
});
1111
};
1212
};

0 commit comments

Comments
 (0)