~ubuntu-branches/ubuntu/raring/schooltool.intervention/raring

« back to all changes in this revision

Viewing changes to src/schooltool/intervention/browser/README.txt

  • Committer: Gediminas Paulauskas
  • Date: 2011-09-19 16:56:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: menesis@pov.lt-20110919165645-718diuud5tc4mjsx
Tags: 0.5.0-0ubuntu1
* New upstream release.
* debian/rules: move gradebook to Suggests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=====================
2
 
Student Interventions
3
 
=====================
4
 
 
5
 
These are the functional tests for the intervention package.
6
 
 
7
 
First we need to set up the school.
8
 
 
9
 
    >>> from schooltool.intervention.browser import ftests
10
 
    >>> from schooltool.app.browser.ftests import setup
11
 
    >>> setup.setUpBasicSchool()
12
 
    >>> manager = setup.logIn('manager', 'schooltool')
13
 
 
14
 
 
15
 
Interventions
16
 
-------------
17
 
 
18
 
Now we come to the main intervention center that gives us access to all of the
19
 
intervention data associated with a given student for a given school year.
20
 
We'll create some teachers and students and put them in some sections.
21
 
We will also create a principal and guidance counselor and put them in the
22
 
adminstators group.  These users will show up as part of the list of persons
23
 
responsible for any student and will also have permission to work with the
24
 
intervention of any student.
25
 
 
26
 
    >>> from schooltool.intervention.browser.ftests import (
27
 
    ...     addPerson, addCourseSectionMembers, fillInContactInfo)
28
 
 
29
 
    >>> manager.getLink('Home').click()
30
 
    >>> fillInContactInfo('manager', email='manager@example.com')
31
 
 
32
 
    >>> addPerson('Teacher1', 'Teacher1', 'teacher1', 'pwd', groups=['teachers'])
33
 
    >>> addPerson('Teacher2', 'Teacher2', 'teacher2', 'pwd', groups=['teachers'])
34
 
    >>> addPerson('Student1', 'Student1', 'student1', 'pwd', groups=['students'])
35
 
    >>> addPerson('Student2', 'Student2', 'student2', 'pwd', groups=['students'])
36
 
    >>> addPerson('Student3', 'Student3', 'student3', 'pwd', groups=['students'])
37
 
    >>> addCourseSectionMembers('course1', 'section1', ['Teacher1'],
38
 
    ...     ['Student1', 'Student3'])
39
 
    >>> addCourseSectionMembers('course2', 'section2', ['Teacher2'],
40
 
    ...     ['Student2'])
41
 
    >>> addPerson('Counselor', 'Counselor', 'counselor', 'pwd', groups=['administrators'])
42
 
    >>> addPerson('Principal', 'Principal', 'principal', 'pwd', groups=['administrators'])
43
 
    >>> addPerson('Search Person', 'Person Search', 'sperson', 'pwd')
44
 
 
45
 
Let's add a parent contact and an advisor which will show up when adding goals
46
 
and messages.
47
 
 
48
 
    >>> manager.getLink('Manage').click()
49
 
    >>> manager.getLink('Persons').click()
50
 
    >>> manager.getLink('Student1').click()
51
 
    >>> manager.getLink('Contacts').click()
52
 
    >>> manager.getLink('Manage Contacts').click()
53
 
    >>> manager.getLink('Create new contact').click()
54
 
    >>> manager.getControl('First name').value = 'Parent1'
55
 
    >>> manager.getControl('Last name').value = 'Parent1'
56
 
    >>> manager.getControl('Email').value = 'parent@somewhere.com'
57
 
    >>> manager.getControl('Relationship').value = ['parent']
58
 
    >>> manager.getControl('Add').click()
59
 
 
60
 
    >>> manager.getLink('Advisors').click()
61
 
    >>> manager.getControl(name='add_item.teacher2').value = 'checked'
62
 
    >>> manager.getControl('Add').click()
63
 
 
64
 
To navigate to a student's intervention, a manager can navigate to the student
65
 
and click on the 'Intervention Center' action link.
66
 
 
67
 
    >>> manager.getLink('Manage').click()
68
 
    >>> manager.getLink('Persons').click()
69
 
    >>> manager.getLink('Student1').click()
70
 
    >>> manager.getLink('Intervention Center').click()
71
 
    >>> print manager.contents
72
 
    <BLANKLINE>
73
 
    ...Student Intervention Center...
74
 
    ...Student1 Student1...
75
 
    ...Messages and Observations...
76
 
    ...There are none...
77
 
    ...New Message...
78
 
    ...Goals and Interventions...
79
 
    ...There are none...
80
 
    ...New Goal...
81
 
    ...Change of Status Messages...
82
 
    ...There are none...
83
 
    ...New Status Message...
84
 
 
85
 
 
86
 
Intervention Messages
87
 
---------------------
88
 
 
89
 
The first thing we'll add is a new message.  Calling up the add view, we'll
90
 
note that the list of possible recipients will include, in order, the student's
91
 
advisors, the school administrators, the student's teachers, the student,
92
 
and the student's parents.  Advisors and parents will have all caps prefixes
93
 
before their names to make it easier for the user to pick them out.  Also,
94
 
the advisors will be pre-checked.
95
 
 
96
 
    >>> manager.getLink('New Message').click()
97
 
    >>> print manager.contents
98
 
    <BLANKLINE>
99
 
    ...Recipients...
100
 
    ...checked="checked"...
101
 
    ...Teacher2 Teacher2 (advisor)...
102
 
    ...Counselor...
103
 
    ...Principal...
104
 
    ...Teacher1...
105
 
    ...Student1...
106
 
    ...Parent1 Parent1 (parent)...
107
 
 
108
 
We'll test how the add view handles missing input.  We'll need to uncheck the
109
 
advisor to make the recipients input cause the error.
110
 
 
111
 
    >>> manager.getControl(name='person.teacher2').value = False
112
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
113
 
    >>> print manager.contents
114
 
    <BLANKLINE>
115
 
    ...There are <strong>2</strong> input errors...
116
 
    ...Required data was not supplied...
117
 
    ...Required input is missing...
118
 
 
119
 
We'll fill in the required fields and hit the Add button.  Note that upon
120
 
successfully adding the message, an email will appear in the output.  This
121
 
is the result of the dummy mail sender that we use during testing that prints
122
 
emails that would otherwise be sent to the smtp mail server that a live
123
 
environment would have configured.  Also note that the parent's email address
124
 
will be picked up from the student's demos.
125
 
 
126
 
    >>> manager.getControl(name='person.teacher1').value = True
127
 
    >>> manager.getControl(name='person.student1:1').value = True
128
 
    >>> manager.getControl(name='field.body').value = 'hi\nthere'
129
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
130
 
    From: manager@example.com
131
 
    To: parent@somewhere.com, teacher1@example.com
132
 
    Subject: INTERVENTION MESSAGE: Student1 Student1
133
 
    SchoolTool Administrator writes:
134
 
    <BLANKLINE>
135
 
    hi
136
 
    there
137
 
 
138
 
Note that the successfully added message appears in the Intervention Center
139
 
with the username of the sender, in this case, manager.
140
 
 
141
 
    >>> print manager.contents
142
 
    <BLANKLINE>
143
 
    ...Messages and Observations...
144
 
    ...Message from SchoolTool Administrator...
145
 
    ...New Message...
146
 
 
147
 
Let's make sure we can view the message that we just added.  Note that the
148
 
message body will be broken into <p> tags, one for each line.
149
 
 
150
 
    >>> manager.getLink('Message from SchoolTool Administrator').click()
151
 
    >>> analyze.printQuery("id('content-body')//div//span", manager.contents)
152
 
    <span>Parent1 Parent1, Teacher1 Teacher1</span>
153
 
    >>> analyze.printQuery("id('content-body')//p", manager.contents)
154
 
    <p>hi</p>
155
 
    <p>there</p>
156
 
 
157
 
We should be able to return to the Intervention Center with a link.
158
 
 
159
 
    >>> manager.getLink('Intervention Center').click()
160
 
    >>> print manager.contents
161
 
    <BLANKLINE>
162
 
    ...Messages and Observations...
163
 
    ...Message from SchoolTool Administrator...
164
 
    ...New Message...
165
 
 
166
 
We'll add a second message to test the system's handling of multiple
167
 
messages.  Messages are sorted by date.
168
 
 
169
 
    >>> manager.getLink('New Message').click()
170
 
    >>> manager.getControl(name='person.teacher1').value = True
171
 
    >>> manager.getControl(name='field.body').value = 'hello again'
172
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
173
 
    From: manager@example.com
174
 
    To: teacher1@example.com, teacher2@example.com
175
 
    Subject: INTERVENTION MESSAGE: Student1 Student1
176
 
    SchoolTool Administrator writes:
177
 
    <BLANKLINE>
178
 
    hello again
179
 
    >>> print manager.contents
180
 
    <BLANKLINE>
181
 
    ...Messages and Observations...
182
 
    ...student1/messages/2...Message from SchoolTool Administrator...
183
 
    ...student1/messages/1...Message from SchoolTool Administrator...
184
 
    ...New Message...
185
 
 
186
 
There is a button that allows us to call up the report that presents all of
187
 
the messages together.  The messages are sorted by creation date.
188
 
 
189
 
    >>> manager.getLink('View All Messages').click()
190
 
    >>> analyze.printQuery("id('content-body')//span", manager.contents)
191
 
    <span>Message sent by SchoolTool Administrator on ...</span>
192
 
    <span>Teacher1 Teacher1, Teacher2 Teacher2</span>
193
 
    <span>Message sent by SchoolTool Administrator on ...</span>
194
 
    <span>Parent1 Parent1, Teacher1 Teacher1</span>
195
 
    >>> analyze.printQuery("id('content-body')//p", manager.contents)
196
 
    <p>hello again</p>
197
 
    <p>hi</p>
198
 
    <p>there</p>
199
 
 
200
 
We'll return the the Intervention Center.
201
 
 
202
 
    >>> manager.getLink('Intervention Center').click()
203
 
    >>> print manager.contents
204
 
    <BLANKLINE>
205
 
    ...Messages and Observations...
206
 
    ...Message from SchoolTool Administrator...
207
 
    ...Message from SchoolTool Administrator...
208
 
    ...New Message...
209
 
 
210
 
 
211
 
Intervention Goals
212
 
------------------
213
 
 
214
 
The next thing to start adding is Goals.  We'll test how the add view
215
 
handles missing input while we're at it.  To make the persons responsible
216
 
field have missing data, we'll need to uncheck the advisor that comes
217
 
pre-checked.
218
 
 
219
 
    >>> from datetime import date
220
 
    >>> manager.getLink('New Goal').click()
221
 
    >>> manager.getControl(name='person.teacher2').value = False
222
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
223
 
    >>> print manager.contents
224
 
    <BLANKLINE>
225
 
    ...There are <strong>7</strong> input errors...
226
 
    ...Persons responsible...
227
 
    ...Required data was not supplied...
228
 
    ...Presenting concerns...
229
 
    ...Required input is missing...
230
 
    ...Goal...
231
 
    ...Required input is missing...
232
 
    ...Strengths...
233
 
    ...Required input is missing...
234
 
    ...Indicators...
235
 
    ...Required input is missing...
236
 
    ...Intervention...
237
 
    ...Required input is missing...
238
 
    ...Timeline...
239
 
    ...Required input is missing...
240
 
    ...checked="checked"...
241
 
    ...Goal not met...
242
 
    ...Goal met...
243
 
 
244
 
Now we'll fill in the required fields.  We'll include the student and the
245
 
parent in the persons responsible list to demostrate how adding the goal
246
 
will split the email by staff and students/parents.  Students and parents
247
 
will not get a link back to the intervention center in their email.
248
 
 
249
 
    >>> manager.getControl('Presenting concerns').value = 'Poor attendence'
250
 
    >>> manager.getControl(name='field.goal').value = 'Get student to come in more often'
251
 
    >>> manager.getControl('Strengths').value = 'Attentive when there'
252
 
    >>> manager.getControl('Indicators').value = 'Student appears at least 4 time a week'
253
 
    >>> manager.getControl('Intervention').value = 'Call parents to arrange better attendence'
254
 
    >>> manager.getControl('Timeline').value = str(date.today())
255
 
    >>> manager.getControl(name='person.teacher1').value = True
256
 
    >>> manager.getControl(name='person.student1').value = True
257
 
    >>> manager.getControl(name='person.student1:1').value = True
258
 
    >>> manager.getControl(name='goal_met').value = ['Yes']
259
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
260
 
    From: manager@example.com
261
 
    To: teacher1@example.com
262
 
    Subject: INTERVENTION GOAL ADDED: Student1 Student1
263
 
    The following goal was added for Student1 Student1:
264
 
    <BLANKLINE>
265
 
    Presenting concerns
266
 
    -------------------
267
 
    <BLANKLINE>
268
 
    Poor attendence
269
 
    <BLANKLINE>
270
 
    Goal
271
 
    ----
272
 
    <BLANKLINE>
273
 
    Get student to come in more often
274
 
    <BLANKLINE>
275
 
    Strengths
276
 
    ---------
277
 
    <BLANKLINE>
278
 
    Attentive when there
279
 
    <BLANKLINE>
280
 
    Indicators
281
 
    ----------
282
 
    <BLANKLINE>
283
 
    Student appears at least 4 time a week
284
 
    <BLANKLINE>
285
 
    Intervention
286
 
    ------------
287
 
    <BLANKLINE>
288
 
    Call parents to arrange better attendence
289
 
    <BLANKLINE>
290
 
    Timeline
291
 
    --------
292
 
    <BLANKLINE>
293
 
    ...
294
 
    <BLANKLINE>
295
 
    Persons responsible
296
 
    -------------------
297
 
    <BLANKLINE>
298
 
    Parent1 Parent1
299
 
    Student1 Student1
300
 
    Teacher1 Teacher1
301
 
    <BLANKLINE>
302
 
    Intervention Center
303
 
    -------------------
304
 
    <BLANKLINE>
305
 
    http://localhost/schooltool.interventions/2005-2006/student1
306
 
    <BLANKLINE>
307
 
    From: manager@example.com
308
 
    To: parent@somewhere.com, student1@example.com
309
 
    Subject: INTERVENTION GOAL ADDED: Student1 Student1
310
 
    The following goal was added for Student1 Student1:
311
 
    <BLANKLINE>
312
 
    Presenting concerns
313
 
    -------------------
314
 
    <BLANKLINE>
315
 
    Poor attendence
316
 
    <BLANKLINE>
317
 
    Goal
318
 
    ----
319
 
    <BLANKLINE>
320
 
    Get student to come in more often
321
 
    <BLANKLINE>
322
 
    Strengths
323
 
    ---------
324
 
    <BLANKLINE>
325
 
    Attentive when there
326
 
    <BLANKLINE>
327
 
    Indicators
328
 
    ----------
329
 
    <BLANKLINE>
330
 
    Student appears at least 4 time a week
331
 
    <BLANKLINE>
332
 
    Intervention
333
 
    ------------
334
 
    <BLANKLINE>
335
 
    Call parents to arrange better attendence
336
 
    <BLANKLINE>
337
 
    Timeline
338
 
    --------
339
 
    <BLANKLINE>
340
 
    ...
341
 
    <BLANKLINE>
342
 
    Persons responsible
343
 
    -------------------
344
 
    <BLANKLINE>
345
 
    Parent1 Parent1
346
 
    Student1 Student1
347
 
    Teacher1 Teacher1
348
 
 
349
 
Note that the successfully added goal appears in the Intervention Center as
350
 
'Goal 1'.
351
 
 
352
 
    >>> print manager.contents
353
 
    <BLANKLINE>
354
 
    ...Goals and Interventions...
355
 
    ...Goal 1...
356
 
    ...New Goal...
357
 
 
358
 
Let's make sure we can view the message that we just added.
359
 
 
360
 
    >>> manager.getLink('Goal 1').click()
361
 
    >>> print manager.contents
362
 
    <BLANKLINE>
363
 
    ...Persons responsible...
364
 
    ...Parent1 Parent1...
365
 
    ...Student1 Student1...
366
 
    ...Teacher1 Teacher1...
367
 
    ...Presenting concerns...
368
 
    ...Poor attendence...
369
 
    ...Goal...
370
 
    ...Get student to come in more often...
371
 
    ...Strengths...
372
 
    ...Attentive when there...
373
 
    ...Indicators...
374
 
    ...Student appears at least 4 time a week...
375
 
    ...Intervention...
376
 
    ...Call parents to arrange better attendence...
377
 
    ...Timeline...
378
 
    ...Goal met...
379
 
    ...Yes...
380
 
    ...Follow up notes...
381
 
 
382
 
Now that we've added a goal, let's edit it's strengths attribute and see that
383
 
the change is reflected in the goal's view.
384
 
 
385
 
    >>> manager.getLink('Edit').click()
386
 
    >>> print manager.contents
387
 
    <BLANKLINE>
388
 
    ...Goal not met...
389
 
    ...checked="checked"...
390
 
    ...Goal met...
391
 
    >>> manager.getControl('Strengths').value = 'Good listener'
392
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
393
 
    >>> print manager.contents
394
 
    <BLANKLINE>
395
 
    ...Strengths...
396
 
    ...Good listener...
397
 
    ...Indicators...
398
 
 
399
 
We should be able to return to the Intervention Center with a link.
400
 
 
401
 
    >>> manager.getLink('Intervention Center').click()
402
 
    >>> print manager.contents
403
 
    <BLANKLINE>
404
 
    ...Goals and Interventions...
405
 
    ...Goal 1...
406
 
    ...New Goal...
407
 
 
408
 
Let's add a second goal to test our handling of multiple goals both in the
409
 
notification view and the goals report.
410
 
 
411
 
    >>> manager.getLink('New Goal').click()
412
 
    >>> manager.getControl('Presenting concerns').value = 'Rude behavior'
413
 
    >>> manager.getControl(name='field.goal').value = 'Get student to be more polite'
414
 
    >>> manager.getControl('Strengths').value = 'Good grades'
415
 
    >>> manager.getControl('Indicators').value = 'Student no longer offends classmates'
416
 
    >>> manager.getControl('Intervention').value = 'Call parents to alert them to bad manners'
417
 
    >>> manager.getControl('Timeline').value = str(date.today())
418
 
    >>> manager.getControl(name='person.teacher2').value = False
419
 
    >>> manager.getControl(name='person.teacher1').value = True
420
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
421
 
    From: manager@example.com
422
 
    To: teacher1@example.com
423
 
    Subject: INTERVENTION GOAL ADDED: Student1 Student1
424
 
    The following goal was added for Student1 Student1:
425
 
    <BLANKLINE>
426
 
    Presenting concerns
427
 
    -------------------
428
 
    <BLANKLINE>
429
 
    Rude behavior
430
 
    <BLANKLINE>
431
 
    Goal
432
 
    ----
433
 
    <BLANKLINE>
434
 
    Get student to be more polite
435
 
    <BLANKLINE>
436
 
    Strengths
437
 
    ---------
438
 
    <BLANKLINE>
439
 
    Good grades
440
 
    <BLANKLINE>
441
 
    Indicators
442
 
    ----------
443
 
    <BLANKLINE>
444
 
    Student no longer offends classmates
445
 
    <BLANKLINE>
446
 
    Intervention
447
 
    ------------
448
 
    <BLANKLINE>
449
 
    Call parents to alert them to bad manners
450
 
    <BLANKLINE>
451
 
    Timeline
452
 
    --------
453
 
    <BLANKLINE>
454
 
    ...
455
 
    <BLANKLINE>
456
 
    Persons responsible
457
 
    -------------------
458
 
    <BLANKLINE>
459
 
    Teacher1 Teacher1
460
 
    <BLANKLINE>
461
 
    Intervention Center
462
 
    -------------------
463
 
    <BLANKLINE>
464
 
    http://localhost/schooltool.interventions/2005-2006/student1
465
 
    >>> print manager.contents
466
 
    <BLANKLINE>
467
 
    ...Goals and Interventions...
468
 
    ...Goal 1...
469
 
    ...Goal 2...
470
 
    ...New Goal...
471
 
 
472
 
There is a button that allows us to call up the report that presents all of
473
 
the goals together.  Its output is a concatonation of what the view of goal 1
474
 
and the view of goal 2 would present.
475
 
 
476
 
    >>> manager.getLink('View All Goals').click()
477
 
    >>> print manager.contents
478
 
    <BLANKLINE>
479
 
    ...Presenting concerns...
480
 
    ...Poor attendence...
481
 
    ...Goal...
482
 
    ...Get student to come in more often...
483
 
    ...Strengths...
484
 
    ...Good listener...
485
 
    ...Indicators...
486
 
    ...Student appears at least 4 time a week...
487
 
    ...Intervention...
488
 
    ...Call parents to arrange better attendence...
489
 
    ...Timeline...
490
 
    ...Persons responsible...
491
 
    ...Parent1 Parent1...
492
 
    ...Student1 Student1...
493
 
    ...Teacher1 Teacher1...
494
 
    ...Goal met...
495
 
    ...Yes...
496
 
    ...Follow up notes...
497
 
    ...Presenting concerns...
498
 
    ...Rude behavior...
499
 
    ...Goal...
500
 
    ...Get student to be more polite...
501
 
    ...Strengths...
502
 
    ...Good grades...
503
 
    ...Indicators...
504
 
    ...Student no longer offends classmates...
505
 
    ...Intervention...
506
 
    ...Call parents to alert them to bad manners...
507
 
    ...Timeline...
508
 
    ...Persons responsible...
509
 
    ...Teacher1 Teacher1...
510
 
    ...Goal met...
511
 
    ...No...
512
 
    ...Follow up notes...
513
 
 
514
 
We have a view that can be called up at any time that will send emails for
515
 
goals that have come due today (we set up our goals to be due today).  This
516
 
view will best be called automatically from a cron job making it a completely
517
 
automated system.  Note that student and parent entered in the first goal will
518
 
not receive this email.
519
 
 
520
 
    >>> manager.open('http://localhost/schooltool.interventions/notifyGoals.html')
521
 
    From: manager@example.com
522
 
    To: teacher1@example.com
523
 
    Subject: INTERVENTION GOAL DUE: Student1 Student1
524
 
    Please follow the link below to update the follow up notes and, if
525
 
    appropriate, the goal met status of the intervention goal for Student1 Student1.
526
 
    <BLANKLINE>
527
 
    http://localhost/schooltool.interventions/2005-2006/student1/goals/1/@@editGoal.html
528
 
    From: manager@example.com
529
 
    To: teacher1@example.com
530
 
    Subject: INTERVENTION GOAL DUE: Student1 Student1
531
 
    Please follow the link below to update the follow up notes and, if
532
 
    appropriate, the goal met status of the intervention goal for Student1 Student1.
533
 
    <BLANKLINE>
534
 
    http://localhost/schooltool.interventions/2005-2006/student1/goals/2/@@editGoal.html
535
 
 
536
 
    >>> print manager.contents
537
 
    <BLANKLINE>
538
 
    ...The following goals had notifications sent to the persons responsible:...
539
 
    ...Student1 Student1 goal 1...
540
 
    ...Student1 Student1 goal 2...
541
 
 
542
 
Now that the goals have been marked as notified, calling up the view again will
543
 
yield nothing.
544
 
 
545
 
    >>> manager.open('http://localhost/schooltool.interventions/notifyGoals.html')
546
 
    >>> print manager.contents
547
 
    <BLANKLINE>
548
 
    ...There are no goals that need notification...
549
 
 
550
 
 
551
 
Change of Status Messages
552
 
-------------------------
553
 
 
554
 
There is a need for special change of status messages that would rarely be
555
 
sent and should be organized at the bottom part of the Intervention Center.
556
 
The most extreme example of changing a student's status would be to expel
557
 
the student from school.  Messages of that nature and less extreme can be
558
 
added using the separate 'Change of Status Messages' section of the student's
559
 
Intervention Center.
560
 
 
561
 
    >>> manager.getLink('Manage').click()
562
 
    >>> manager.getLink('Persons').click()
563
 
    >>> manager.getLink('Student1').click()
564
 
    >>> manager.getLink('Intervention Center').click()
565
 
 
566
 
    >>> manager.getLink('New Status Message').click()
567
 
    >>> manager.getControl(name='person.teacher2').value = False
568
 
    >>> manager.getControl(name='person.teacher1').value = True
569
 
    >>> manager.getControl(name='field.body').value = 'hello'
570
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
571
 
    From: manager@example.com
572
 
    To: teacher1@example.com
573
 
    Subject: INTERVENTION STATUS CHANGE: Student1 Student1
574
 
    SchoolTool Administrator writes:
575
 
    <BLANKLINE>
576
 
    hello
577
 
    >>> print manager.contents
578
 
    <BLANKLINE>
579
 
    ...Messages and Observations...
580
 
    ...Message from SchoolTool Administrator...
581
 
    ...Message from SchoolTool Administrator...
582
 
    ...New Message...
583
 
    ...Change of Status Messages...
584
 
    ...Change of Status Message from SchoolTool Administrator...
585
 
    ...New Status Message...
586
 
 
587
 
Let's make sure we can view the message that we just added.
588
 
 
589
 
    >>> manager.getLink('Change of Status Message from SchoolTool Administrator').click()
590
 
    >>> print manager.contents
591
 
    <BLANKLINE>
592
 
    ...Change of Status Message from: SchoolTool Administrator...
593
 
    ...To:...
594
 
    ...Teacher1 Teacher1...
595
 
    ...hello...
596
 
 
597
 
There is a view for viewing all change of status messages together as there
598
 
is with normal messages.
599
 
 
600
 
    >>> manager.getLink('Intervention Center').click()
601
 
    >>> manager.getLink('View All Status Messages').click()
602
 
    >>> print manager.contents
603
 
    <BLANKLINE>
604
 
    ...Change of Status Messages regarding Student1 Student1...
605
 
    ...Message sent by SchoolTool Administrator...
606
 
    ...To:...
607
 
    ...Teacher1 Teacher1...
608
 
    ...hello...
609
 
 
610
 
 
611
 
Section intervention view
612
 
-------------------------
613
 
 
614
 
The section intervention view gives quick access to various
615
 
intervention views for students in the section.
616
 
 
617
 
    >>> manager.getLink('Manage').click()
618
 
    >>> manager.getLink('School Years').click()
619
 
    >>> manager.getLink('2005-2006').click()
620
 
    >>> manager.getLink('Spring').click()
621
 
    >>> manager.getLink('Sections').click()
622
 
    >>> manager.getLink('section1').click()
623
 
    >>> manager.getLink('Interventions').click()
624
 
 
625
 
The Messages tab is the default.  The provided links allow the teacher to
626
 
preview existing and compose new messages.  Note that status messages are
627
 
ignored when displaying message count for the student.
628
 
 
629
 
    >>> print manager.contents
630
 
    <BLANKLINE>
631
 
    ...course1 - section1's Student Interventions...
632
 
    <p>Messages</p> ...
633
 
    <a ...Goals</a> ...
634
 
    ...Student1 Student1...
635
 
    ...View Messages (2)...
636
 
    ...Write New...
637
 
    ...Student3 Student3...
638
 
    ...View Messages (0)...
639
 
    ...Write New...
640
 
 
641
 
We can add a new message from here by clicking on the 'Write New' link.  We'll
642
 
do this for Student3 to help set up dashboard tests.
643
 
 
644
 
    >>> manager.getLink('Write New', index=1).click()
645
 
    >>> manager.getControl(name='person.teacher1').value = True
646
 
    >>> manager.getControl(name='field.body').value = 'Message for Student3'
647
 
    >>> manager.getControl(name='UPDATE_SUBMIT').click()
648
 
    From: manager@example.com
649
 
    To: teacher1@example.com
650
 
    Subject: INTERVENTION MESSAGE: Student3 Student3
651
 
    SchoolTool Administrator writes:
652
 
    <BLANKLINE>
653
 
    Message for Student3
654
 
 
655
 
The Goals tab provides shortcuts to viewing student goals.
656
 
 
657
 
    >>> manager.getLink('Goals').click()
658
 
    >>> print manager.contents
659
 
    <BLANKLINE>
660
 
    ...course1 - section1's Student Interventions...
661
 
    <a ...Messages</a> ...
662
 
    <p>Goals</p> ...
663
 
    ...Student1 Student1...
664
 
    ...View Goals (2)...
665
 
    ...Student3 Student3...
666
 
    ...View Goals (0)...
667
 
 
668
 
 
669
 
Intervention Dashboard
670
 
----------------------
671
 
 
672
 
We provide an Intervention tab that takes the user to a kind of dashboard with
673
 
two fieldsets.  The first serves as a launch point for the search student
674
 
intervention view where the user can find a student to which they have access.
675
 
The second fieldset functions similar to an email inbox, listing all messages
676
 
and goals that the user is responsible for, most recently created first.
677
 
 
678
 
We'll test the Inbox first as it resides on the Intervention tab view itself.
679
 
 
680
 
    >>> teacher1 = setup.logIn('teacher1', 'pwd')
681
 
    >>> ftests.addAdvisors('Student2', ['teacher1'])
682
 
 
683
 
    >>> teacher1.getLink('Intervention').click()
684
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a", teacher1.contents)
685
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/messages/1">Message for Student3</a>
686
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/3">hello</a>
687
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/2">Rude behavior</a>
688
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/1">Poor attendence</a>
689
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">hello again</a>
690
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">hi there</a>
691
 
 
692
 
There is a name filter that can limit the list to students whose name contains
693
 
a search string.
694
 
 
695
 
    >>> teacher1.getControl(name='SEARCH_NAME').value = 'student3'
696
 
    >>> teacher1.getControl(name='SEARCH_BUTTON').click()
697
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a", teacher1.contents)
698
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/messages/1">Message for Student3</a>
699
 
 
700
 
Hitting the 'Clear' button clears the filter and returns the original list.
701
 
 
702
 
    >>> teacher1.getControl(name='CLEAR_SEARCH').click()
703
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a", teacher1.contents)
704
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/messages/1">Message for Student3</a>
705
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/3">hello</a>
706
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/2">Rude behavior</a>
707
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/1">Poor attendence</a>
708
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">hello again</a>
709
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">hi there</a>
710
 
 
711
 
There is also a goals only checkbox to filter the list to only student with
712
 
goals or only the goals in your inbox.
713
 
 
714
 
    >>> teacher1.getControl(name='GOALS_ONLY').value = 'checked'
715
 
    >>> teacher1.getControl(name='SEARCH_BUTTON').click()
716
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a", teacher1.contents)
717
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/2">Rude behavior</a>
718
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/1">Poor attendence</a>
719
 
 
720
 
Again, hitting the 'Clear' button clears the filter and returns the original list.
721
 
 
722
 
    >>> teacher1.getControl(name='CLEAR_SEARCH').click()
723
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a", teacher1.contents)
724
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/messages/1">Message for Student3</a>
725
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/3">hello</a>
726
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/2">Rude behavior</a>
727
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/goals/1">Poor attendence</a>
728
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">hello again</a>
729
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">hi there</a>
730
 
 
731
 
Now we'll test the lauch point that is the first fieldset.  We'll just hit the 
732
 
search student button to see that it takes us to the search student view.  It
733
 
lists all the students that the user is responsible for as there was no filter
734
 
specified.
735
 
 
736
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
737
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
738
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
739
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
740
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
741
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
742
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
743
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
744
 
 
745
 
We'll apply the student name filter.
746
 
 
747
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_NAME').value = 'student3'
748
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
749
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
750
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
751
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
752
 
 
753
 
We'll clear the student filter and set the goals only filter.
754
 
 
755
 
    >>> teacher1.getControl(name='CLEAR_STUDENT_SEARCH').click()
756
 
    >>> teacher1.getControl(name='WITH_GOALS_ONLY').value = 'checked'
757
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
758
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
759
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
760
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
761
 
 
762
 
Finally clearing the filter restores the list to the original.
763
 
 
764
 
    >>> teacher1.getControl(name='CLEAR_STUDENT_SEARCH').click()
765
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
766
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
767
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
768
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
769
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
770
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
771
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
772
 
 
773
 
A final test for the launch point is to show that the filter the user chooses
774
 
there gets immediately applied to the search student view, saving the user
775
 
a mouse click.
776
 
 
777
 
    >>> teacher1.getLink('Intervention').click()
778
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_NAME').value = 'student3'
779
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
780
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
781
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
782
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
783
 
 
784
 
    >>> teacher1.getLink('Intervention').click()
785
 
    >>> teacher1.getControl(name='WITH_GOALS_ONLY').value = 'checked'
786
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
787
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", teacher1.contents)
788
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
789
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
790
 
 
791
 
If we are to present the user with intervention student links, we have to be
792
 
sure that when they vist one of them, it doesn't say Not Found.  That can be
793
 
prevented by auto-vivifying the intervention student object before we present
794
 
it as a link.  We'll test that each student that we present as a link can be
795
 
visited.
796
 
 
797
 
    >>> teacher1.getLink('Intervention').click()
798
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
799
 
    >>> teacher1.getLink('Student1').click()
800
 
    >>> teacher1.url
801
 
    'http://localhost/schooltool.interventions/2005-2006/student1'
802
 
 
803
 
    >>> teacher1.getLink('Intervention').click()
804
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
805
 
    >>> teacher1.getLink('Student2').click()
806
 
    >>> teacher1.url
807
 
    'http://localhost/schooltool.interventions/2005-2006/student2'
808
 
 
809
 
    >>> teacher1.getLink('Intervention').click()
810
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
811
 
    >>> teacher1.getLink('Student3').click()
812
 
    >>> teacher1.url
813
 
    'http://localhost/schooltool.interventions/2005-2006/student3'
814
 
 
815
 
We will provide a button for the user to return from the search student view
816
 
back to the inbox in case it is not obvious to use the Intervention tab.
817
 
 
818
 
    >>> teacher1.getLink('Intervention').click()
819
 
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
820
 
    >>> teacher1.getLink('Return to Inbox').click()
821
 
    >>> teacher1.url
822
 
    'http://localhost/persons/teacher1/intervention_tab'
823
 
 
824
 
Users that are in the admin group will see all persons when they search.
825
 
 
826
 
    >>> manager.getLink('Intervention').click()
827
 
    >>> manager.getControl(name='SEARCH_STUDENT_BUTTON').click()
828
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", manager.contents)
829
 
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">SchoolTool</a>
830
 
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">Administrator</a>
831
 
    <a href="http://localhost/schooltool.interventions/2005-2006/counselor">Counselor</a>
832
 
    <a href="http://localhost/schooltool.interventions/2005-2006/counselor">Counselor</a>
833
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Search Person</a>
834
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Person Search</a>
835
 
    <a href="http://localhost/schooltool.interventions/2005-2006/principal">Principal</a>
836
 
    <a href="http://localhost/schooltool.interventions/2005-2006/principal">Principal</a>
837
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
838
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
839
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
840
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
841
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
842
 
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
843
 
    <a href="http://localhost/schooltool.interventions/2005-2006/teacher1">Teacher1</a>
844
 
    <a href="http://localhost/schooltool.interventions/2005-2006/teacher1">Teacher1</a>
845
 
    <a href="http://localhost/schooltool.interventions/2005-2006/teacher2">Teacher2</a>
846
 
    <a href="http://localhost/schooltool.interventions/2005-2006/teacher2">Teacher2</a>
847
 
 
848
 
We will show here how usernames can be searched as well.  The only person who's
849
 
name is different than the userid is 'sperson', so we'll prove this point using
850
 
that person.
851
 
 
852
 
    >>> manager.getControl(name='SEARCH_STUDENT_NAME').value = 'sperson'
853
 
    >>> manager.getControl(name='SEARCH_STUDENT_BUTTON').click()
854
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", manager.contents)
855
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Search Person</a>
856
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Person Search</a>
857
 
 
858
 
    >>> manager.getControl(name='SEARCH_STUDENT_NAME').value = 's person'
859
 
    >>> manager.getControl(name='SEARCH_STUDENT_BUTTON').click()
860
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", manager.contents)
861
 
 
862
 
    >>> manager.getControl(name='SEARCH_STUDENT_NAME').value = 'search person'
863
 
    >>> manager.getControl(name='SEARCH_STUDENT_BUTTON').click()
864
 
    >>> analyze.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a", manager.contents)
865
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Search Person</a>
866
 
    <a href="http://localhost/schooltool.interventions/2005-2006/sperson">Person Search</a>
867
 
 
868
 
 
869
 
At One Time Responsible
870
 
-----------------------
871
 
 
872
 
We have a special case in the user interface for editing goals where one of
873
 
the persons_responsible is no longer either a teacher, advisor or administrator
874
 
of the student.  The security issues regarding this scenario are tested in
875
 
security.txt, but here we need to test the way it is handled in the UI.
876
 
 
877
 
First of all, we already have created a goal where teacher1 is responsible.
878
 
When we call up the edit view for the goal, we note that teacher1 appears
879
 
in the staff section of the person list, not the student section.  We also
880
 
note that he is checked.
881
 
 
882
 
    >>> manager.open('http://localhost/schooltool.interventions/2005-2006/student1/goals/2/editGoal.html')
883
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//span', manager.contents)
884
 
    <span>
885
 
      <b>Teacher2 Teacher2 (advisor)</b>
886
 
    </span>
887
 
    <span>
888
 
      <b>Counselor Counselor</b>
889
 
    </span>
890
 
    <span>
891
 
      <b>Principal Principal</b>
892
 
    </span>
893
 
    <span>
894
 
      <b>Teacher1 Teacher1</b>
895
 
    </span>
896
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//input[@type="checkbox"]', manager.contents)
897
 
    <input type="checkbox" class="person_list" name="person.teacher2" />
898
 
    <input type="checkbox" class="person_list" name="person.counselor" />
899
 
    <input type="checkbox" class="person_list" name="person.principal" />
900
 
    <input type="checkbox" class="person_list" checked="checked" name="person.teacher1" />
901
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//span', manager.contents)
902
 
    <span>
903
 
      <b>Student1 Student1</b>
904
 
    </span>
905
 
    <span>
906
 
      <b>Parent1 Parent1 (parent)</b>
907
 
    </span>
908
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//input[@type="checkbox"]', manager.contents)
909
 
    <input type="checkbox" name="person.student1" />
910
 
    <input type="checkbox" name="person.student1:1" />
911
 
 
912
 
We want to remove him from the section that gave him access to the student.
913
 
 
914
 
    >>> manager.getLink('2005-2006').click()
915
 
    >>> manager.getLink('Spring').click()
916
 
    >>> manager.getLink('Sections').click()
917
 
    >>> manager.getLink('section1').click()
918
 
    >>> manager.getLink('edit instructors').click()
919
 
    >>> manager.getControl(name='remove_item.teacher1').value = 'checked'
920
 
    >>> manager.getControl('Remove').click()
921
 
 
922
 
Now, let's edit the goal and note that there is a new section in the person
923
 
list labeled 'Changed Status' and that teacher1 is listed there and is still
924
 
checked.
925
 
 
926
 
    >>> manager.open('http://localhost/schooltool.interventions/2005-2006/student1/goals/2/editGoal.html')
927
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//span', manager.contents)
928
 
    <span>
929
 
      <b>Teacher2 Teacher2 (advisor)</b>
930
 
    </span>
931
 
    <span>
932
 
      <b>Counselor Counselor</b>
933
 
    </span>
934
 
    <span>
935
 
      <b>Principal Principal</b>
936
 
    </span>
937
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//input[@type="checkbox"]', manager.contents)
938
 
    <input type="checkbox" class="person_list" name="person.teacher2" />
939
 
    <input type="checkbox" class="person_list" name="person.counselor" />
940
 
    <input type="checkbox" class="person_list" name="person.principal" />
941
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//span', manager.contents)
942
 
    <span>
943
 
      <b>Student1 Student1</b>
944
 
    </span>
945
 
    <span>
946
 
      <b>Parent1 Parent1 (parent)</b>
947
 
    </span>
948
 
    <span>Changed Status</span>
949
 
    <span>
950
 
      <b>Teacher1 Teacher1</b>
951
 
    </span>
952
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//input[@type="checkbox"]', manager.contents)
953
 
    <input type="checkbox" name="person.student1" />
954
 
    <input type="checkbox" name="person.student1:1" />
955
 
    <input type="checkbox" checked="checked" name="person.teacher1" />
956
 
 
957
 
We'll go ahead and uncheck him, or course, checking another person in order
958
 
to successfully submit.
959
 
 
960
 
    >>> manager.getControl(name='person.teacher1').value = False
961
 
    >>> manager.getControl(name='person.teacher2').value = True
962
 
    >>> manager.getControl('Apply').click()
963
 
 
964
 
Now we see that the teacher is still in the 'Changed Status' section but not
965
 
checked.  This represents the scenario where the teacher no longer can
966
 
add goals for the student, nor can he even view this goal anymore.  However,
967
 
we keep him around in the goal.at_one_time_responsible list, and thus, he
968
 
will continue to appear in the person list in the special section.  Maybe we'll
969
 
want to put him back in the persons_responsible list at a later date.
970
 
 
971
 
    >>> manager.open('http://localhost/schooltool.interventions/2005-2006/student1/goals/2/editGoal.html')
972
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//span', manager.contents)
973
 
    <span>
974
 
      <b>Teacher2 Teacher2 (advisor)</b>
975
 
    </span>
976
 
    <span>
977
 
      <b>Counselor Counselor</b>
978
 
    </span>
979
 
    <span>
980
 
      <b>Principal Principal</b>
981
 
    </span>
982
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//input[@type="checkbox"]', manager.contents)
983
 
    <input type="checkbox" class="person_list" checked="checked" name="person.teacher2" />
984
 
    <input type="checkbox" class="person_list" name="person.counselor" />
985
 
    <input type="checkbox" class="person_list" name="person.principal" />
986
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//span', manager.contents)
987
 
    <span>
988
 
      <b>Student1 Student1</b>
989
 
    </span>
990
 
    <span>
991
 
      <b>Parent1 Parent1 (parent)</b>
992
 
    </span>
993
 
    <span>Changed Status</span>
994
 
    <span>
995
 
      <b>Teacher1 Teacher1</b>
996
 
    </span>
997
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//input[@type="checkbox"]', manager.contents)
998
 
    <input type="checkbox" name="person.student1" />
999
 
    <input type="checkbox" name="person.student1:1" />
1000
 
    <input type="checkbox" name="person.teacher1" />
1001
 
 
1002
 
Finally, we'd like to make sure that when we make teacher1 again the teacher
1003
 
of one of student1's sections, he will appear back in the original section
1004
 
of the person list.
1005
 
 
1006
 
    >>> manager.getLink('2005-2006').click()
1007
 
    >>> manager.getLink('Spring').click()
1008
 
    >>> manager.getLink('Sections').click()
1009
 
    >>> manager.getLink('section1').click()
1010
 
    >>> manager.getLink('edit instructors').click()
1011
 
    >>> manager.getControl(name='add_item.teacher1').value = 'checked'
1012
 
    >>> manager.getControl('Add').click()
1013
 
 
1014
 
So now when we go back to edit the goal, teacher1 appears back in the original
1015
 
section, unchecked.  Also, the 'Changed Status' section disappears.  It's like
1016
 
he was never gone.
1017
 
 
1018
 
    >>> manager.open('http://localhost/schooltool.interventions/2005-2006/student1/goals/2/editGoal.html')
1019
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//span', manager.contents)
1020
 
    <span>
1021
 
      <b>Teacher2 Teacher2 (advisor)</b>
1022
 
    </span>
1023
 
    <span>
1024
 
      <b>Counselor Counselor</b>
1025
 
    </span>
1026
 
    <span>
1027
 
      <b>Principal Principal</b>
1028
 
    </span>
1029
 
    <span>
1030
 
      <b>Teacher1 Teacher1</b>
1031
 
    </span>
1032
 
    >>> analyze.printQuery('//table//tr[2]//td[1]//input[@type="checkbox"]', manager.contents)
1033
 
    <input type="checkbox" class="person_list" checked="checked" name="person.teacher2" />
1034
 
    <input type="checkbox" class="person_list" name="person.counselor" />
1035
 
    <input type="checkbox" class="person_list" name="person.principal" />
1036
 
    <input type="checkbox" class="person_list" name="person.teacher1" />
1037
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//span', manager.contents)
1038
 
    <span>
1039
 
      <b>Student1 Student1</b>
1040
 
    </span>
1041
 
    <span>
1042
 
      <b>Parent1 Parent1 (parent)</b>
1043
 
    </span>
1044
 
    >>> analyze.printQuery('//table//tr[2]//td[2]//input[@type="checkbox"]', manager.contents)
1045
 
    <input type="checkbox" name="person.student1" />
1046
 
    <input type="checkbox" name="person.student1:1" />
1047
 
 
1048
 
 
1049
 
Intervention CSV views
1050
 
----------------------
1051
 
 
1052
 
We supply CSV views for extracting the messages and goals from a schooltool
1053
 
instance.
1054
 
 
1055
 
    >>> manager.open('http://localhost/messages.csv')
1056
 
    >>> print manager.contents
1057
 
    "year","student","date","sender","recipients","body"
1058
 
    "2005-2006","student1","...","manager","parent@somewhere.com, teacher1@example.com","hi\nthere"
1059
 
    "2005-2006","student1","...","manager","teacher1@example.com, teacher2@example.com","hello again"
1060
 
    "2005-2006","student1","...","manager","teacher1@example.com","hello"
1061
 
    "2005-2006","student3","...","manager","teacher1@example.com","Message for Student3"
1062
 
 
1063
 
    >>> manager.open('http://localhost/goals.csv')
1064
 
    >>> print manager.contents
1065
 
    "year","student","created","creator","presenting_concerns","goal","strengths","indicators","intervention","timeline","persons_responsible","goal_met","follow_up_notes","notified"
1066
 
    "2005-2006","student1","...","manager","Poor attendence","Get student to come in more often","Good listener","Student appears at least 4 time a week","Call parents to arrange better attendence","...","parent@somewhere.com, student1@example.com, teacher1@example.com","True","","True"
1067
 
    "2005-2006","student1","...","manager","Rude behavior","Get student to be more polite","Good grades","Student no longer offends classmates","Call parents to alert them to bad manners","...","teacher2@example.com","False","","True"
1068