Merge lp:~aelkner/schooltool.gradebook/csv_view into lp:schooltool.gradebook/0.9

Proposed by Alan Elkner
Status: Merged
Merged at revision: 198
Proposed branch: lp:~aelkner/schooltool.gradebook/csv_view
Merge into: lp:schooltool.gradebook/0.9
Diff against target: 76 lines (+20/-3)
3 files modified
CHANGES.txt (+1/-0)
src/schooltool/gradebook/browser/README.txt (+16/-0)
src/schooltool/gradebook/browser/gradebook.py (+3/-3)
To merge this branch: bzr merge lp:~aelkner/schooltool.gradebook/csv_view
Reviewer Review Type Date Requested Status
SchoolTool Owners Pending
Review via email: mp+35982@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES.txt'
2--- CHANGES.txt 2010-09-16 14:54:02 +0000
3+++ CHANGES.txt 2010-09-20 04:14:47 +0000
4@@ -22,6 +22,7 @@
5
6 - CSV export of all sections' grades (requested by SLA)
7 - Custom Score Systems need min/max passing scores (https://launchpad.net/bugs/616451)
8+- Grades rounding mismatch (https://launchpad.net/bugs/585796)
9
10 Bug fixes
11 +++++++++
12
13=== modified file 'src/schooltool/gradebook/browser/README.txt'
14--- src/schooltool/gradebook/browser/README.txt 2010-09-13 08:39:53 +0000
15+++ src/schooltool/gradebook/browser/README.txt 2010-09-20 04:14:47 +0000
16@@ -1536,6 +1536,22 @@
17 'http://localhost/schoolyears/2007/winter/sections/1/activities/Worksheet/mygrades'
18
19
20+Average tests
21+-------------
22+
23+When we weren't using the same method to calculate the average in the gradebook
24+and the mygrades views, that led to the averages sometimes coming out differently.
25+Here we will test the the average is the same for Claudia in both views.
26+
27+ >>> stephan.open('http://localhost/schoolyears/2007/winter/sections/1/gradebook')
28+ >>> stephan.printQuery("id('content-body')//table[2]/tr[4]/td[3]/b")
29+ <b>69%</b>
30+
31+ >>> claudia.open('http://localhost/schoolyears/2007/winter/sections/1/mygrades')
32+ >>> claudia.printQuery("id('content-body')//table[2]/tr[1]/td[1]/div")
33+ <div> Ave.: 69%</div>
34+
35+
36 CSV test
37 --------
38
39
40=== modified file 'src/schooltool/gradebook/browser/gradebook.py'
41--- src/schooltool/gradebook/browser/gradebook.py 2010-09-14 22:05:14 +0000
42+++ src/schooltool/gradebook/browser/gradebook.py 2010-09-20 04:14:47 +0000
43@@ -710,6 +710,7 @@
44 def update(self):
45 self.person = IPerson(self.request.principal)
46 gradebook = proxy.removeSecurityProxy(self.context)
47+ worksheet = proxy.removeSecurityProxy(gradebook.context)
48
49 """Make sure the current worksheet matches the current url"""
50 worksheet = gradebook.context
51@@ -720,7 +721,6 @@
52 self.processColumnPreferences()
53
54 self.table = []
55- total = 0
56 count = 0
57 for activity in self.context.getCurrentActivities(self.person):
58 activity = proxy.removeSecurityProxy(activity)
59@@ -739,7 +739,6 @@
60 value = ss.getNumericalValue(value)
61 if value is None:
62 value = 0
63- total += value - s_min
64 count += s_max - s_min
65 grade = {
66 'comment': False,
67@@ -769,7 +768,8 @@
68 self.table.append(row)
69
70 if count:
71- average = int(round(Decimal(100 * total) / Decimal(count)))
72+ total, average = gradebook.getWorksheetTotalAverage(worksheet,
73+ self.person)
74 self.average = convertAverage(average, self.average_scoresystem)
75 else:
76 self.average = None

Subscribers

People subscribed via source and target branches