This file is indexed.

/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/ftests/activity_categories.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
Activity Categories
-------------------

Log in as manager:

    >>> manager = Browser('manager', 'schooltool')

Administrator defines activity categories available for teachers:

    >>> manager.getLink('Manage').click()
    >>> manager.getLink('Activity Categories').click()
    >>> manager.printQuery('id("field.categories")/option/@value')
    assignment
    essay
    exam
    homework
    journal
    lab
    presentation
    project

As you can see, there are already several categories pre-defined. Often,
those categories do not work for a school. Either you do not need some and/or
others are missing. So let's start by deleting a couple of categories:

    >>> manager.getControl(name='field.categories:list').displayValue = [
    ...     'Essay', 'Journal', 'Homework', 'Presentation']
    >>> manager.getControl('Remove').click()
    >>> manager.printQuery('//div[@class="info"]/text()')
    Categories successfully deleted.
    >>> manager.printQuery('id("field.categories")/option/@value')
    assignment
    exam
    lab
    project

Next, we add a new category:

    >>> manager.getControl('New Category').value = 'Lab Report'
    >>> manager.getControl('Add').click()
    >>> manager.printQuery('//div[@class="info"]/text()')
    Category successfully added.

    >>> manager.printQuery('id("field.categories")/option/@value')
    Lab%20Report-
    assignment
    exam
    lab
    project

We can also add categories with non ASCII characters:

    >>> manager.getControl('New Category').value = 'Calificación'
    >>> manager.getControl('Add').click()

    >>> manager.printQuery('//div[@class="info"]/text()')
    Category successfully added.
    >>> manager.printQuery('id("field.categories")/option/@value')
    Calificacin-zeb
    Lab%20Report-
    assignment
    exam
    lab
    project

If we click on Add without entering a new category, nothing happens:

    >>> manager.queryHTML('id("field.newCategory")/@value')
    ['']
    >>> manager.getControl('Add').click()
    >>> manager.queryHTML('//div[@class="info"]')
    []

Also click Remove without nothing selected:

    >>> manager.queryHTML('id("field.categories")/@value')
    []
    >>> manager.getControl('Remove').click()
    >>> manager.queryHTML('//div[@class="info"]')
    []

We can also change the default category:

    >>> manager.getControl('Default Category').value
    ['assignment']
    >>> manager.getControl('Default Category').displayValue = ['Project']
    >>> manager.getControl('Change').click()
    >>> manager.getControl('Default Category').value
    ['project']

Now, set up a school year (2005-2006) with two terms (Fall and
Spring):

    >>> from schooltool.app.browser.ftests import setup
    >>> setup.setUpBasicSchool()

Set up a course:

    >>> setup.addCourse('Physics I', '2005-2006')

Set up persons:

    >>> from schooltool.basicperson.browser.ftests.setup import addPerson
    >>> addPerson('Paul', 'Cardune', '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 with instructor and students for the Fall:

    >>> setup.addSection('Physics I', '2005-2006', 'Fall',
    ...                  instructors=['Stephan'],
    ...                  members=['Tom', 'Claudia', 'Paul'])

Log in as teacher:

    >>> stephan = Browser('stephan', 'pwd')

Let's add an activity to the default worksheet:

    >>> stephan.getLink('Gradebook').click()
    >>> stephan.getLink('New Activity').click()

Check the categories available:

    >>> stephan.printQuery('id("form-widgets-category")/option/text()')
    Calificaci...n
    Lab Report
    Assignment
    Exam
    Lab
    Project

Check the default category is selected:

    >>> stephan.printQuery('id("form-widgets-category")/option[@selected="selected"]/text()')
    Project
    >>> stephan.getControl('Cancel').click()

Now, let's add an external activity:

    >>> stephan.getLink('New External Activity').click()

And check the categories available:

    >>> stephan.printQuery('id("form-widgets-category")/option/text()')
    Calificaci...n
    Lab Report
    Assignment
    Exam
    Lab
    Project

And check the default category is selected:

    >>> stephan.printQuery('id("form-widgets-category")/option[@selected="selected"]/text()')
    Project

Let's change the default category:

    >>> manager.getLink('Manage').click()
    >>> manager.getLink('Activity Categories').click()
    >>> manager.getControl('Default Category').value
    ['project']
    >>> manager.getControl('Default Category').displayValue = ['Lab Report']
    >>> manager.getControl('Change').click()
    >>> manager.getControl('Default Category').value
    ['Lab%20Report-']

Let's try adding a new activity:

    >>> stephan.getLink('Gradebook').click()
    >>> stephan.getLink('New Activity').click()

Check the default category has changed:

    >>> stephan.printQuery('id("form-widgets-category")/option[@selected="selected"]/text()')
    Lab Report
    >>> stephan.getControl('Cancel').click()

Now, let's add an external activity:

    >>> stephan.getLink('New External Activity').click()

And check the default category has also changed:

    >>> stephan.printQuery('id("form-widgets-category")/option[@selected="selected"]/text()')
    Lab Report