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
=== modified file 'src/schooltool/gradebook/browser/README.txt'
--- src/schooltool/gradebook/browser/README.txt 2009-07-07 11:13:56 +0000
+++ src/schooltool/gradebook/browser/README.txt 2009-07-08 19:30:04 +0000
@@ -796,12 +796,19 @@
796schooltool.gradebook package where they belong, so here is where they will796schooltool.gradebook package where they belong, so here is where they will
797be.797be.
798798
799The first test will be for the unauthenticated user. They should not be able799The first test will be for the unauthenticated user. If they hit the
800to see a gradebook and certainly don't have a mygrades view.800'Gradebook' link at the top, they should be redirected to the login view.
801801
802 >>> from zope.testbrowser.testing import Browser802 >>> from zope.testbrowser.testing import Browser
803 >>> unauth = Browser()803 >>> unauth = Browser()
804 >>> unauth.handleErrors = False804 >>> unauth.handleErrors = False
805 >>> unauth.open('http://localhost/gradebook.html')
806 >>> unauth.url
807 'http://localhost/auth/@@login.html?nexturl=http://localhost/gradebook.html'
808
809They should not be able to see a gradebook and certainly don't have a mygrades
810view.
811
805 >>> unauth.open('http://localhost/schoolyears/2007/winter/sections/1/gradebook')812 >>> unauth.open('http://localhost/schoolyears/2007/winter/sections/1/gradebook')
806 Traceback (most recent call last):813 Traceback (most recent call last):
807 ...814 ...
808815
=== modified file 'src/schooltool/gradebook/browser/gradebook.py'
--- src/schooltool/gradebook/browser/gradebook.py 2009-07-06 14:41:36 +0000
+++ src/schooltool/gradebook/browser/gradebook.py 2009-07-08 19:30:04 +0000
@@ -96,6 +96,15 @@
96class GradebookStartup(object):96class GradebookStartup(object):
97 """A view for entry into into the gradebook or mygrades views."""97 """A view for entry into into the gradebook or mygrades views."""
9898
99 def __call__(self):
100 if IPerson(self.request.principal, None) is None:
101 url = absoluteURL(ISchoolToolApplication(None), self.request)
102 url = '%s/auth/@@login.html?nexturl=%s' % (url, self.request.URL)
103 self.request.response.redirect(url)
104 return ''
105 template = ViewPageTemplateFile('gradebook_startup.pt')
106 return template(self)
107
99 def update(self):108 def update(self):
100 self.person = IPerson(self.request.principal)109 self.person = IPerson(self.request.principal)
101 self.sectionsTaught = list(IInstructor(self.person).sections())110 self.sectionsTaught = list(IInstructor(self.person).sections())
102111
=== modified file 'src/schooltool/gradebook/browser/gradebook_overview.js.pt'
--- src/schooltool/gradebook/browser/gradebook_overview.js.pt 2009-07-06 00:18:14 +0000
+++ src/schooltool/gradebook/browser/gradebook_overview.js.pt 2009-07-08 22:10:04 +0000
@@ -169,10 +169,11 @@
169 var elementCell = document.getElementById(name+'_cell');169 var elementCell = document.getElementById(name+'_cell');
170 var value = element.value;170 var value = element.value;
171171
172172 return setBackgroundColor(name, activity, value);
173173}
174174
175175function setBackgroundColor(name, activity, value)
176{
176 changeBackgroundColor(name+'_cell', 'default_bg');177 changeBackgroundColor(name+'_cell', 'default_bg');
177178
178 if (value == '')179 if (value == '')
@@ -223,12 +224,14 @@
223 return false;224 return false;
224 }225 }
225 for(j=0;j!=numstudents;j++) {226 for(j=0;j!=numstudents;j++) {
226 document.getElementById(activity+'_'+students[j]).value=fd.value;227 name = activity+'_'+students[j];
227 checkValid(null,activity+'_'+students[j]);228 document.getElementById(name).value = fd.value;
229 setBackgroundColor(name, activity, fd.value);
228 }230 }
229 document.getElementById('fd_'+activity).value = '';231 document.getElementById('fd_'+activity).value = '';
230 document.getElementById('fdbtn_'+activity).style.display = 'none';232 document.getElementById('fdbtn_'+activity).style.display = 'none';
231 changeBackgroundColor('fd_'+activity+'_cell', 'default_bg');233 changeBackgroundColor('fd_'+activity+'_cell', 'default_bg');
234 edited = true;
232}235}
233236
234function checkFillDown(activity)237function checkFillDown(activity)
235238
=== modified file 'src/schooltool/gradebook/browser/gradebook_overview.pt'
--- src/schooltool/gradebook/browser/gradebook_overview.pt 2009-07-07 11:13:56 +0000
+++ src/schooltool/gradebook/browser/gradebook_overview.pt 2009-07-08 19:39:38 +0000
@@ -130,14 +130,14 @@
130 <div tal:content="view/average_label" />130 <div tal:content="view/average_label" />
131 <a tal:condition="nothing" href="?sort_by=average" i18n:translate="">(sort)</a>131 <a tal:condition="nothing" href="?sort_by=average" i18n:translate="">(sort)</a>
132 </th>132 </th>
133 <th class="cell title header" tal:repeat="activity view/activities">133 <th class="cell title header" tal:repeat="activity view/activities"
134 tal:attributes="onmouseover string:tempDescription('${activity/hash}');
135 onmouseout string:restoreDescription()">
134 <div class="padded">136 <div class="padded">
135 <a href=""137 <a href=""
136 tal:attributes="href 138 tal:attributes="href
137 string:gradeActivity.html?activity=${activity/hash};139 string:gradeActivity.html?activity=${activity/hash};
138 title activity/longTitle;140 title activity/longTitle;"
139 onmouseover string:tempDescription('${activity/hash}');
140 onmouseout string:restoreDescription()"
141 tal:content="activity/shortTitle">141 tal:content="activity/shortTitle">
142 HW 1142 HW 1
143 </a>143 </a>
144144
=== modified file 'src/schooltool/requirement/browser/README.txt'
--- src/schooltool/requirement/browser/README.txt 2009-07-06 02:39:56 +0000
+++ src/schooltool/requirement/browser/README.txt 2009-07-08 20:23:33 +0000
@@ -130,3 +130,9 @@
130 <span>0</span>130 <span>0</span>
131 <span>0</span>131 <span>0</span>
132132
133There's an 'OK' button that takes the user back to the score systems overview.
134
135 >>> manager.getLink('OK').click()
136 >>> manager.url
137 'http://localhost/scoresystems'
138
133139
=== modified file 'src/schooltool/requirement/browser/scoresystem.py'
--- src/schooltool/requirement/browser/scoresystem.py 2009-07-06 02:39:56 +0000
+++ src/schooltool/requirement/browser/scoresystem.py 2009-07-08 20:23:33 +0000
@@ -230,6 +230,10 @@
230 return removeSecurityProxy(ss)230 return removeSecurityProxy(ss)
231 raise KeyError231 raise KeyError
232232
233 @property
234 def nextURL(self):
235 return absoluteURL(self.context, self.request)
236
233237
234class IWidgetData(interfaces.IRangedValuesScoreSystem):238class IWidgetData(interfaces.IRangedValuesScoreSystem):
235 """A schema used to generate the score system widget."""239 """A schema used to generate the score system widget."""
236240
=== modified file 'src/schooltool/requirement/browser/scoresystem_view.pt'
--- src/schooltool/requirement/browser/scoresystem_view.pt 2009-06-05 00:11:04 +0000
+++ src/schooltool/requirement/browser/scoresystem_view.pt 2009-07-08 20:23:33 +0000
@@ -36,6 +36,11 @@
3636
37 </table>37 </table>
3838
39 <div class="controls" style="padding: 1em 0">
40 <a class="button-ok"
41 tal:attributes="href view/nextURL">OK</a>
42 </div>
43
39</metal:block>44</metal:block>
40</body>45</body>
41</html>46</html>

Subscribers

People subscribed via source and target branches