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
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2010-09-16 14:54:02 +0000
+++ CHANGES.txt 2010-09-20 04:14:47 +0000
@@ -22,6 +22,7 @@
2222
23- CSV export of all sections' grades (requested by SLA)23- CSV export of all sections' grades (requested by SLA)
24- Custom Score Systems need min/max passing scores (https://launchpad.net/bugs/616451)24- Custom Score Systems need min/max passing scores (https://launchpad.net/bugs/616451)
25- Grades rounding mismatch (https://launchpad.net/bugs/585796)
2526
26Bug fixes27Bug fixes
27+++++++++28+++++++++
2829
=== modified file 'src/schooltool/gradebook/browser/README.txt'
--- src/schooltool/gradebook/browser/README.txt 2010-09-13 08:39:53 +0000
+++ src/schooltool/gradebook/browser/README.txt 2010-09-20 04:14:47 +0000
@@ -1536,6 +1536,22 @@
1536 'http://localhost/schoolyears/2007/winter/sections/1/activities/Worksheet/mygrades'1536 'http://localhost/schoolyears/2007/winter/sections/1/activities/Worksheet/mygrades'
15371537
15381538
1539Average tests
1540-------------
1541
1542When we weren't using the same method to calculate the average in the gradebook
1543and the mygrades views, that led to the averages sometimes coming out differently.
1544Here we will test the the average is the same for Claudia in both views.
1545
1546 >>> stephan.open('http://localhost/schoolyears/2007/winter/sections/1/gradebook')
1547 >>> stephan.printQuery("id('content-body')//table[2]/tr[4]/td[3]/b")
1548 <b>69%</b>
1549
1550 >>> claudia.open('http://localhost/schoolyears/2007/winter/sections/1/mygrades')
1551 >>> claudia.printQuery("id('content-body')//table[2]/tr[1]/td[1]/div")
1552 <div> Ave.: 69%</div>
1553
1554
1539CSV test1555CSV test
1540--------1556--------
15411557
15421558
=== modified file 'src/schooltool/gradebook/browser/gradebook.py'
--- src/schooltool/gradebook/browser/gradebook.py 2010-09-14 22:05:14 +0000
+++ src/schooltool/gradebook/browser/gradebook.py 2010-09-20 04:14:47 +0000
@@ -710,6 +710,7 @@
710 def update(self):710 def update(self):
711 self.person = IPerson(self.request.principal)711 self.person = IPerson(self.request.principal)
712 gradebook = proxy.removeSecurityProxy(self.context)712 gradebook = proxy.removeSecurityProxy(self.context)
713 worksheet = proxy.removeSecurityProxy(gradebook.context)
713714
714 """Make sure the current worksheet matches the current url"""715 """Make sure the current worksheet matches the current url"""
715 worksheet = gradebook.context716 worksheet = gradebook.context
@@ -720,7 +721,6 @@
720 self.processColumnPreferences()721 self.processColumnPreferences()
721722
722 self.table = []723 self.table = []
723 total = 0
724 count = 0724 count = 0
725 for activity in self.context.getCurrentActivities(self.person):725 for activity in self.context.getCurrentActivities(self.person):
726 activity = proxy.removeSecurityProxy(activity)726 activity = proxy.removeSecurityProxy(activity)
@@ -739,7 +739,6 @@
739 value = ss.getNumericalValue(value)739 value = ss.getNumericalValue(value)
740 if value is None:740 if value is None:
741 value = 0741 value = 0
742 total += value - s_min
743 count += s_max - s_min742 count += s_max - s_min
744 grade = {743 grade = {
745 'comment': False,744 'comment': False,
@@ -769,7 +768,8 @@
769 self.table.append(row)768 self.table.append(row)
770769
771 if count:770 if count:
772 average = int(round(Decimal(100 * total) / Decimal(count)))771 total, average = gradebook.getWorksheetTotalAverage(worksheet,
772 self.person)
773 self.average = convertAverage(average, self.average_scoresystem)773 self.average = convertAverage(average, self.average_scoresystem)
774 else:774 else:
775 self.average = None775 self.average = None

Subscribers

People subscribed via source and target branches