/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/stests/weighting_categories_not_hundred.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 | Category Weighting when weights don't add up to 100
---------------------------------------------------
We'll test that the Category Weights view doesn't need the weights to
add up to 100 anymore.
Log in as manager:
>>> manager = browsers.manager
>>> manager.ui.login('manager', 'schooltool')
Now, set up a school year (2005-2006) with a single term (Year):
>>> manager.ui.schoolyear.add('2005-2006', '2005-09-01', '2006-07-15')
>>> manager.ui.term.add('2005-2006', 'Year', '2005-09-01', '2006-07-15')
Set up a course:
>>> manager.ui.course.add('2005-2006', 'Physics I')
Set up persons:
>>> manager.ui.person.add('Paul', 'Carduner', 'paul', 'pwd')
>>> manager.ui.person.add('Tom', 'Hoffman', 'tom', 'pwd')
>>> manager.ui.person.add('Claudia', 'Richter', 'claudia', 'pwd')
>>> manager.ui.person.add('Stephan', 'Richter', 'stephan', 'pwd')
Set up a section with instructor and students:
>>> manager.ui.section.add('2005-2006', 'Year', 'Physics I')
>>> manager.ui.section.instructors.add('2005-2006', 'Year', 'Physics I (1)',
... ['stephan'])
>>> manager.ui.section.students.add('2005-2006', 'Year', 'Physics I (1)',
... ['tom', 'claudia', 'paul'])
Log in as teacher and go to his gradebook:
>>> stephan = browsers.stephan
>>> stephan.ui.login('stephan', 'pwd')
>>> stephan.query.link('Gradebook').click()
Add some activities to the default worksheet:
>>> stephan.query.link('Activity').click()
>>> stephan.query.id('form-widgets-title').ui.set_value('HW 1')
>>> stephan.query.id('form-widgets-category').ui.set_value('Homework')
>>> stephan.query.id('form-widgets-max').clear()
>>> stephan.query.id('form-widgets-max').ui.set_value('50')
>>> stephan.query.id('form-buttons-add').click()
>>> stephan.query.link('Activity').click()
>>> stephan.query.id('form-widgets-title').ui.set_value('Quiz 1')
>>> stephan.query.id('form-widgets-category').ui.set_value('Exam')
>>> stephan.query.id('form-buttons-add').click()
>>> stephan.query.link('Activity').click()
>>> stephan.query.id('form-widgets-title').ui.set_value('HW 2')
>>> stephan.query.id('form-widgets-category').ui.set_value('Homework')
>>> stephan.query.id('form-widgets-max').clear()
>>> stephan.query.id('form-widgets-max').ui.set_value('50')
>>> stephan.query.id('form-buttons-add').click()
>>> stephan.query.link('Activity').click()
>>> stephan.query.id('form-widgets-title').ui.set_value('Quiz 2')
>>> stephan.query.id('form-widgets-category').ui.set_value('Exam')
>>> stephan.query.id('form-buttons-add').click()
Add grades for the first three activities for Paul:
>>> stephan.ui.gradebook.worksheet.score('Paul Carduner', 'HW1', '40')
>>> stephan.ui.gradebook.worksheet.score('Paul Carduner', 'Quiz1', '90')
>>> stephan.ui.gradebook.worksheet.score('Paul Carduner', 'HW2', '45')
Add grades for the first three activities for Tom:
>>> stephan.ui.gradebook.worksheet.score('Tom Hoffman', 'HW1', '45')
>>> stephan.ui.gradebook.worksheet.score('Tom Hoffman', 'Quiz1', '80')
>>> stephan.ui.gradebook.worksheet.score('Tom Hoffman', 'HW2', '50')
Add grades for the first three activities for Claudia:
>>> stephan.ui.gradebook.worksheet.score('Claudia Richter', 'HW1', '50')
>>> stephan.ui.gradebook.worksheet.score('Claudia Richter', 'Quiz1', '95')
>>> stephan.ui.gradebook.worksheet.score('Claudia Richter', 'HW2', '50')
>>> stephan.query.name('UPDATE_SUBMIT').click()
By default the Average column is calculated normally:
>>> stephan.ui.gradebook.worksheet.pprint()
+----------+
| *Sheet1* |
+----------+
+-----------+------------+-----+-------+-----+-------+-------+-------+
| Last Name | First Name | HW1 | Quiz1 | HW2 | Quiz2 | Total | Ave. |
| | | 50 | 100 | 50 | 100 | | |
+-----------+------------+-----+-------+-----+-------+-------+-------+
| Carduner | Paul | 40 | 90 | 45 | | 175.0 | 87.5% |
| Hoffman | Tom | 45 | 80 | 50 | | 175.0 | 87.5% |
| Richter | Claudia | 50 | 95 | 50 | | 195.0 | 97.5% |
+-----------+------------+-----+-------+-----+-------+-------+-------+
Let's create some category weights for the current worksheet. We'll
fill in valid values for Assignment, Homework and Exam, even though
they don't add up to 100, hitting 'Submit' will succeed and return us
to the gradebook. There we will note the effect of the weighting in
the Average column.
>>> stephan.query.link('Category Weights').click()
>>> stephan.query.id('assignment').clear()
>>> stephan.query.id('assignment').ui.set_value('10')
>>> stephan.query.id('exam').clear()
>>> stephan.query.id('exam').ui.set_value('25')
>>> stephan.query.id('homework').clear()
>>> stephan.query.id('homework').ui.set_value('15')
>>> stephan.query.name('UPDATE_SUBMIT').click()
>>> stephan.ui.gradebook.worksheet.pprint()
+----------+
| *Sheet1* |
+----------+
+-----------+------------+-----+-------+-----+-------+-------+-------+
| Last Name | First Name | HW1 | Quiz1 | HW2 | Quiz2 | Total | Ave. |
| | | 50 | 100 | 50 | 100 | | |
+-----------+------------+-----+-------+-----+-------+-------+-------+
| Carduner | Paul | 40 | 90 | 45 | | 175.0 | 88.1% |
| Hoffman | Tom | 45 | 80 | 50 | | 175.0 | 85.6% |
| Richter | Claudia | 50 | 95 | 50 | | 195.0 | 96.9% |
+-----------+------------+-----+-------+-----+-------+-------+-------+
Let's add a new Assignment activity:
>>> stephan.query.link('Activity').click()
>>> stephan.query.id('form-widgets-title').ui.set_value('Experiment')
>>> stephan.query.id('form-widgets-category').ui.set_value('Assignment')
>>> stephan.query.id('form-widgets-max').clear()
>>> stephan.query.id('form-widgets-max').ui.set_value('10')
>>> stephan.query.id('form-buttons-add').click()
Let's grade the new assignment for Paul and Tom:
>>> stephan.ui.gradebook.worksheet.score('Paul Carduner', 'Exper', '9')
>>> stephan.ui.gradebook.worksheet.score('Tom Hoffman', 'Exper', '7')
>>> stephan.query.name('UPDATE_SUBMIT').click()
Note how the Average changed for Paul and Tom, but not for Claudia:
>>> stephan.ui.gradebook.worksheet.pprint()
+----------+
| *Sheet1* |
+----------+
+-----------+------------+-----+-------+-----+-------+-------+-------+-------+
| Last Name | First Name | HW1 | Quiz1 | HW2 | Quiz2 | Exper | Total | Ave. |
| | | 50 | 100 | 50 | 100 | 10 | | |
+-----------+------------+-----+-------+-----+-------+-------+-------+-------+
| Carduner | Paul | 40 | 90 | 45 | | 9 | 184.0 | 88.5% |
| Hoffman | Tom | 45 | 80 | 50 | | 7 | 182.0 | 82.5% |
| Richter | Claudia | 50 | 95 | 50 | | | 195.0 | 96.9% |
+-----------+------------+-----+-------+-----+-------+-------+-------+-------+
Now, let's only give Homeworks some weight:
>>> stephan.query.link('Category Weights').click()
>>> stephan.query.id('assignment').clear()
>>> stephan.query.id('exam').clear()
>>> stephan.query.id('homework').clear()
>>> stephan.query.id('homework').ui.set_value('1')
>>> stephan.query.name('UPDATE_SUBMIT').click()
The Averages have changed:
>>> stephan.ui.gradebook.worksheet.pprint()
+----------+
| *Sheet1* |
+----------+
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
| Last Name | First Name | HW1 | Quiz1 | HW2 | Quiz2 | Exper | Total | Ave. |
| | | 50 | 100 | 50 | 100 | 10 | | |
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
| Carduner | Paul | 40 | 90 | 45 | | 9 | 184.0 | 85.0% |
| Hoffman | Tom | 45 | 80 | 50 | | 7 | 182.0 | 95.0% |
| Richter | Claudia | 50 | 95 | 50 | | | 195.0 | 100.0% |
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
Let's test that explicit zeros are saved:
>>> stephan.query.link('Category Weights').click()
>>> stephan.query.id('assignment').clear()
>>> stephan.query.id('assignment').ui.set_value('0.0')
>>> stephan.query.id('essay').clear()
>>> stephan.query.id('essay').ui.set_value('0.0')
>>> stephan.query.id('exam').clear()
>>> stephan.query.id('lab').clear()
>>> stephan.query.id('lab').ui.set_value('0.0')
>>> stephan.query.id('project').clear()
>>> stephan.query.id('project').ui.set_value('0.0')
>>> stephan.query.name('UPDATE_SUBMIT').click()
Since all these weights are zero, they shouldn't affect the averages:
>>> stephan.ui.gradebook.worksheet.pprint()
+----------+
| *Sheet1* |
+----------+
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
| Last Name | First Name | HW1 | Quiz1 | HW2 | Quiz2 | Exper | Total | Ave. |
| | | 50 | 100 | 50 | 100 | 10 | | |
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
| Carduner | Paul | 40 | 90 | 45 | | 9 | 184.0 | 85.0% |
| Hoffman | Tom | 45 | 80 | 50 | | 7 | 182.0 | 95.0% |
| Richter | Claudia | 50 | 95 | 50 | | | 195.0 | 100.0% |
+-----------+------------+-----+-------+-----+-------+-------+-------+--------+
|