Merge lp:~aelkner/schooltool/schooltool.gradebook_july_fixes into lp:~schooltool-owners/schooltool/schooltool.gradebook

Proposed by Alan Elkner
Status: Merged
Merge reported by: Justas Sadzevičius
Merged at revision: not available
Proposed branch: lp:~aelkner/schooltool/schooltool.gradebook_july_fixes
Merge into: lp:~schooltool-owners/schooltool/schooltool.gradebook
Diff against target: None lines
To merge this branch: bzr merge lp:~aelkner/schooltool/schooltool.gradebook_july_fixes
Reviewer Review Type Date Requested Status
Justas Sadzevičius (community) Approve
Review via email: mp+8429@code.launchpad.net
To post a comment you must log in.
80. By Alan Elkner

returning invalid scores are now higlighted in red, bug #391305

81. By Alan Elkner

added call to setUpGradebookRoot to evolve1 script

82. By Alan Elkner

changed invalid score error messages to be only one message

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/schooltool/gradebook/browser/README.txt'
2--- src/schooltool/gradebook/browser/README.txt 2009-07-07 11:13:56 +0000
3+++ src/schooltool/gradebook/browser/README.txt 2009-07-08 19:30:04 +0000
4@@ -796,12 +796,19 @@
5 schooltool.gradebook package where they belong, so here is where they will
6 be.
7
8-The first test will be for the unauthenticated user. They should not be able
9-to see a gradebook and certainly don't have a mygrades view.
10+The first test will be for the unauthenticated user. If they hit the
11+'Gradebook' link at the top, they should be redirected to the login view.
12
13 >>> from zope.testbrowser.testing import Browser
14 >>> unauth = Browser()
15 >>> unauth.handleErrors = False
16+ >>> unauth.open('http://localhost/gradebook.html')
17+ >>> unauth.url
18+ 'http://localhost/auth/@@login.html?nexturl=http://localhost/gradebook.html'
19+
20+They should not be able to see a gradebook and certainly don't have a mygrades
21+view.
22+
23 >>> unauth.open('http://localhost/schoolyears/2007/winter/sections/1/gradebook')
24 Traceback (most recent call last):
25 ...
26
27=== modified file 'src/schooltool/gradebook/browser/gradebook.py'
28--- src/schooltool/gradebook/browser/gradebook.py 2009-07-06 14:41:36 +0000
29+++ src/schooltool/gradebook/browser/gradebook.py 2009-07-08 19:30:04 +0000
30@@ -96,6 +96,15 @@
31 class GradebookStartup(object):
32 """A view for entry into into the gradebook or mygrades views."""
33
34+ def __call__(self):
35+ if IPerson(self.request.principal, None) is None:
36+ url = absoluteURL(ISchoolToolApplication(None), self.request)
37+ url = '%s/auth/@@login.html?nexturl=%s' % (url, self.request.URL)
38+ self.request.response.redirect(url)
39+ return ''
40+ template = ViewPageTemplateFile('gradebook_startup.pt')
41+ return template(self)
42+
43 def update(self):
44 self.person = IPerson(self.request.principal)
45 self.sectionsTaught = list(IInstructor(self.person).sections())
46
47=== modified file 'src/schooltool/gradebook/browser/gradebook_overview.js.pt'
48--- src/schooltool/gradebook/browser/gradebook_overview.js.pt 2009-07-06 00:18:14 +0000
49+++ src/schooltool/gradebook/browser/gradebook_overview.js.pt 2009-07-08 22:10:04 +0000
50@@ -169,10 +169,11 @@
51 var elementCell = document.getElementById(name+'_cell');
52 var value = element.value;
53
54-
55-
56-
57-
58+ return setBackgroundColor(name, activity, value);
59+}
60+
61+function setBackgroundColor(name, activity, value)
62+{
63 changeBackgroundColor(name+'_cell', 'default_bg');
64
65 if (value == '')
66@@ -223,12 +224,14 @@
67 return false;
68 }
69 for(j=0;j!=numstudents;j++) {
70- document.getElementById(activity+'_'+students[j]).value=fd.value;
71- checkValid(null,activity+'_'+students[j]);
72+ name = activity+'_'+students[j];
73+ document.getElementById(name).value = fd.value;
74+ setBackgroundColor(name, activity, fd.value);
75 }
76 document.getElementById('fd_'+activity).value = '';
77 document.getElementById('fdbtn_'+activity).style.display = 'none';
78 changeBackgroundColor('fd_'+activity+'_cell', 'default_bg');
79+ edited = true;
80 }
81
82 function checkFillDown(activity)
83
84=== modified file 'src/schooltool/gradebook/browser/gradebook_overview.pt'
85--- src/schooltool/gradebook/browser/gradebook_overview.pt 2009-07-07 11:13:56 +0000
86+++ src/schooltool/gradebook/browser/gradebook_overview.pt 2009-07-08 19:39:38 +0000
87@@ -130,14 +130,14 @@
88 <div tal:content="view/average_label" />
89 <a tal:condition="nothing" href="?sort_by=average" i18n:translate="">(sort)</a>
90 </th>
91- <th class="cell title header" tal:repeat="activity view/activities">
92+ <th class="cell title header" tal:repeat="activity view/activities"
93+ tal:attributes="onmouseover string:tempDescription('${activity/hash}');
94+ onmouseout string:restoreDescription()">
95 <div class="padded">
96 <a href=""
97 tal:attributes="href
98 string:gradeActivity.html?activity=${activity/hash};
99- title activity/longTitle;
100- onmouseover string:tempDescription('${activity/hash}');
101- onmouseout string:restoreDescription()"
102+ title activity/longTitle;"
103 tal:content="activity/shortTitle">
104 HW 1
105 </a>
106
107=== modified file 'src/schooltool/requirement/browser/README.txt'
108--- src/schooltool/requirement/browser/README.txt 2009-07-06 02:39:56 +0000
109+++ src/schooltool/requirement/browser/README.txt 2009-07-08 20:23:33 +0000
110@@ -130,3 +130,9 @@
111 <span>0</span>
112 <span>0</span>
113
114+There's an 'OK' button that takes the user back to the score systems overview.
115+
116+ >>> manager.getLink('OK').click()
117+ >>> manager.url
118+ 'http://localhost/scoresystems'
119+
120
121=== modified file 'src/schooltool/requirement/browser/scoresystem.py'
122--- src/schooltool/requirement/browser/scoresystem.py 2009-07-06 02:39:56 +0000
123+++ src/schooltool/requirement/browser/scoresystem.py 2009-07-08 20:23:33 +0000
124@@ -230,6 +230,10 @@
125 return removeSecurityProxy(ss)
126 raise KeyError
127
128+ @property
129+ def nextURL(self):
130+ return absoluteURL(self.context, self.request)
131+
132
133 class IWidgetData(interfaces.IRangedValuesScoreSystem):
134 """A schema used to generate the score system widget."""
135
136=== modified file 'src/schooltool/requirement/browser/scoresystem_view.pt'
137--- src/schooltool/requirement/browser/scoresystem_view.pt 2009-06-05 00:11:04 +0000
138+++ src/schooltool/requirement/browser/scoresystem_view.pt 2009-07-08 20:23:33 +0000
139@@ -36,6 +36,11 @@
140
141 </table>
142
143+ <div class="controls" style="padding: 1em 0">
144+ <a class="button-ok"
145+ tal:attributes="href view/nextURL">OK</a>
146+ </div>
147+
148 </metal:block>
149 </body>
150 </html>

Subscribers

People subscribed via source and target branches