/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/ftests/rml_gradebook.txt is in python-schooltool.gradebook 2.6.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | RML test for gradebook.pdf
--------------------------
Here we're going to test the rml generated for the gradebook.pdf view
of worksheets. Since we're going to test XML, let's extend the Browser
class:
>>> from schooltool.testing.analyze import etree, to_string
>>> class XMLBrowser(Browser):
... def queryXML(self, xpath):
... doc = etree.XML(self.contents)
... result = [to_string(node) for node in doc.xpath(xpath)]
... return result
... def printXMLQuery(self, xpath):
... for result in self.queryXML(xpath):
... print result
Log in as manager:
>>> manager = XMLBrowser('manager', 'schooltool')
Add a schoolyear:
>>> from schooltool.app.browser.ftests import setup
>>> setup.addSchoolYear('2011', '2011-01-01', '2011-12-31')
Add one term to the 2011 schoolyear:
>>> setup.addTerm('Single Term', '2011-01-01', '2011-12-31', '2011')
Set up two courses:
>>> setup.addCourse('Math', '2011')
>>> setup.addCourse('Chemistry', '2011')
Set up persons:
>>> from schooltool.basicperson.browser.ftests.setup import addPerson
>>> addPerson('Paul', 'Carduner', 'paul', 'pwd', browser=manager)
>>> addPerson('Tom', 'Hoffman', 'tom', 'pwd', browser=manager)
>>> addPerson('Claudia', 'Richter', 'claudia', 'pwd', browser=manager)
>>> addPerson('Stephan', 'Richter', 'stephan', 'pwd', browser=manager)
Set up a section for each course:
>>> setup.addSection('Math', '2011', 'Single Term',
... instructors=['Stephan'],
... members=['Tom', 'Claudia', 'Paul'])
>>> setup.addSection('Chemistry', '2011', 'Single Term',
... instructors=['Stephan'],
... members=['Tom', 'Claudia', 'Paul'])
Add a report sheet template with four activities:
>>> manager.getLink('Manage').click()
>>> manager.getLink('Report Sheet Templates').click()
>>> manager.getLink('New Report Sheet').click()
>>> manager.getControl('Title').value = 'Common Worksheet'
>>> manager.getControl('Add').click()
>>> manager.getLink('Common Worksheet').click()
>>> manager.getLink('New Report Activity').click()
>>> manager.getControl('Title').value = 'First Common Activity'
>>> manager.getControl('Add').click()
>>> manager.getLink('New Report Activity').click()
>>> manager.getControl('Title').value = 'Second Common Activity'
>>> manager.getControl('Score System').displayValue = ['Comment']
>>> manager.getControl('Add').click()
>>> manager.getLink('New Report Activity').click()
>>> manager.getControl('Title').value = 'Third Common Activity'
>>> manager.getControl('Score System').displayValue = ['Extended Letter Grade']
>>> manager.getControl('Add').click()
>>> manager.getLink('New Report Activity').click()
>>> manager.getControl('Title').value = 'Forth Common Activity'
>>> manager.getControl('Score System').displayValue = ['Pass/Fail']
>>> manager.getControl('Add').click()
Deploy the report sheet template in the 2011 schoolyear:
>>> manager.getLink('2011').click()
>>> manager.getLink('Deploy Report Sheet').click()
>>> manager.getControl('Template').displayValue = ['Common Worksheet']
>>> manager.getControl('Deploy').click()
Log in as teacher:
>>> teacher = XMLBrowser('stephan', 'pwd')
Set up two extra worksheets for the Math section, each with three
activities:
>>> teacher.getLink('Gradebook').click()
>>> teacher.printQuery('//select[@name="currentTerm"]/option[@selected="selected"]/text()')
2011 / Single Term
>>> teacher.printQuery('//select[@name="currentSection"]/option[@selected="selected"]/text()')
Math - Math (1)
>>> teacher.getLink('Worksheets').click()
>>> teacher.getLink('New Worksheet').click()
>>> teacher.getControl('Title').value = 'Second Worksheet'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('New Worksheet').click()
>>> teacher.getControl('Title').value = 'Third Worksheet'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('Second Worksheet').click()
>>> teacher.getLink('New Activity').click()
>>> teacher.getControl('Title').value = 'Geometry'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('New Activity').click()
>>> teacher.getControl('Title').value = 'Algebra'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('New Activity').click()
>>> teacher.getControl('Title').value = 'Logic'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('Worksheets').click()
>>> teacher.getLink('Third Worksheet').click()
>>> teacher.getLink('New Activity').click()
>>> teacher.getControl('Title').value = 'Polynomials'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('New External Activity').click()
>>> teacher.getControl('External Activity').displayValue = ['Sample Source - HTML']
>>> teacher.getControl('Points').value = '10'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('New Linked Column').click()
>>> teacher.getControl('Logic').click()
Let's go to the Common Worksheet and grade the students:
>>> teacher.getLink('Common Workshee').click()
>>> teacher.getLink('>', index=0).click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Paul Carduner
>>> teacher.printQuery('//label/span/text()')
First Common Activity (100)
Second Common Activity
Third Common Activity (A+)
Forth Common Activity (Pass)
>>> teacher.getControl('First Common Activity').value = '85'
>>> teacher.getControl('Second Common Activity').value = '<p>This is the comment grade for:</p><p> </p><p><strong>Paul <em>Carduner</em></strong></p>'
>>> teacher.getControl('Forth Common Activity').value = 'Fail'
>>> teacher.getControl('Next').click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Tom Hoffman
>>> teacher.getControl('First Common Activity').value = '90'
>>> teacher.getControl('Second Common Activity').value = '<p>This is the comment grade for:</p><p> </p><p><strong>Tom <em>Hoffman</em></strong></p><p> </p><p>This is his <a href="http://www.google.com">website</a></p>'
>>> teacher.getControl('Third Common Activity').value = 'C+'
>>> teacher.getControl('Next').click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Claudia Richter
>>> teacher.getControl('Third Common Activity').value = 'A-'
>>> teacher.getControl('Forth Common Activity').value = 'Pass'
>>> teacher.getControl('Apply').click()
Now, to the Second Worksheet and enter more grades:
>>> teacher.getLink('Second Workshee').click()
>>> teacher.getLink('>', index=0).click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Paul Carduner
>>> teacher.getControl('Geometry').value = '80'
>>> teacher.getControl('Algebra').value = ''
>>> teacher.getControl('Logic').value = '90'
>>> teacher.getControl('Next').click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Tom Hoffman
>>> teacher.getControl('Geometry').value = '90'
>>> teacher.getControl('Algebra').value = '83'
>>> teacher.getControl('Next').click()
>>> teacher.printQuery('//h3/text()')
Enter grades for Claudia Richter
>>> teacher.getControl('Geometry').value = '81'
>>> teacher.getControl('Algebra').value = '78'
>>> teacher.getControl('Logic').value = '85'
>>> teacher.getControl('Apply').click()
Now, let's get the rml generated for the gradebook.pdf view of
the Common Worksheet:
>>> teacher.getLink('Common Workshee').click()
>>> teacher.getLink('Download PDF').click()
Term, section and worksheet information:
>>> teacher.printXMLQuery('//blockTable[1]/tr[1]/td/para/text()')
Term
Single Term
Section
Math (1)
>>> teacher.printXMLQuery('//blockTable[1]/tr[2]/td/para/text()')
Worksheet
Common Worksheet
Table columns representing student names and grades:
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[1]/para/text()')
Student
Paul Carduner
Tom Hoffman
Claudia Richter
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[2]/para')
<para style="grid_heading">Total</para>
<para style="cell">85.0</para>
<para style="cell">92.3</para>
<para style="cell">4.7</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[3]/para')
<para style="grid_heading">Ave.</para>
<para style="cell">84.2%</para>
<para style="cell">88.8%</para>
<para style="cell">94.0%</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[4]/para')
<para style="grid_heading">First</para>
<para style="cell">85</para>
<para style="cell">90</para>
<para style="cell"/>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[5]/para')
<para style="grid_heading">Secon</para>
<para style="cell">...</para>
<para style="cell">...</para>
<para style="cell"/>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[6]/para')
<para style="grid_heading">Third</para>
<para style="cell"/>
<para style="cell">C+</para>
<para style="cell">A-</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[7]/para')
<para style="grid_heading">Forth</para>
<para style="cell">Fail</para>
<para style="cell"/>
<para style="cell">Pass</para>
Let's go back and get the gradebook.pdf rml for the Third Worksheet:
>>> teacher.goBack()
>>> teacher.getLink('Third Worksheet').click()
>>> teacher.getLink('Download PDF').click()
Term, section and worksheet information:
>>> teacher.printXMLQuery('//blockTable[1]/tr[1]/td/para/text()')
Term
Single Term
Section
Math (1)
>>> teacher.printXMLQuery('//blockTable[1]/tr[2]/td/para/text()')
Worksheet
Third Worksheet
Table columns representing student names, total, average and grades:
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[1]/para/text()')
Student
Paul Carduner
Tom Hoffman
Claudia Richter
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[2]/para')
<para style="grid_heading">Total</para>
<para style="cell">95.0</para>
<para style="cell">0.0</para>
<para style="cell">93.0</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[3]/para')
<para style="grid_heading">Ave.</para>
<para style="cell">86.4%</para>
<para style="cell">N/A</para>
<para style="cell">84.5%</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[4]/para')
<para style="grid_heading">Polyn</para>
<para style="cell"/>
<para style="cell"/>
<para style="cell"/>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[5]/para')
<para style="grid_heading">HTML</para>
<para style="cell">5.00</para>
<para style="cell"/>
<para style="cell">8.00</para>
>>> teacher.printXMLQuery('//blockTable[2]/tr/td[6]/para')
<para style="grid_heading">Logic</para>
<para style="cell">90</para>
<para style="cell"/>
<para style="cell">85</para>
|