~replaceafill/schooltool.cando/cando_fixes

« back to all changes in this revision

Viewing changes to src/schooltool/cando/browser/stests/iep_scr.txt

  • Committer: Douglas Cerna
  • Date: 2013-01-14 22:39:26 UTC
  • Revision ID: douglascerna@yahoo.com-20130114223926-o1bm8rluv62br1hs
Showed IEP skills as not required in student competency report

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
IEP functionality for the Student Competency Report
 
2
===================================================
 
3
 
 
4
Helpers:
 
5
 
 
6
    >>> def print_report_skills(browser):
 
7
    ...     sel = '.student-scr tbody tr'
 
8
    ...     for row in browser.query_all.css(sel):
 
9
    ...         tds = row.query_all.tag('td')
 
10
    ...         if tds:
 
11
    ...             print '%s, %s, %s' % (tds[0].text, tds[1].text, tds[2].text)
 
12
 
 
13
Log in as manager:
 
14
 
 
15
    >>> manager = browsers.manager
 
16
    >>> manager.ui.login('manager', 'schooltool')
 
17
 
 
18
Set up persons:
 
19
 
 
20
    >>> manager.ui.person.add('Jeffrey', 'Elkner', 'jeffrey', 'pwd')
 
21
    >>> manager.ui.person.add('Camila', 'Cerna', 'camila', 'pwd')
 
22
    >>> camila_url = manager.url
 
23
    >>> manager.ui.person.add('Liliana', 'Vividor', 'liliana', 'pwd')
 
24
    >>> manager.ui.person.add('Mario', 'Tejada', 'mario', 'pwd')
 
25
 
 
26
Set up a section:
 
27
 
 
28
    >>> manager.ui.schoolyear.add('2012', '2012-01-01', '2012-12-31')
 
29
    >>> manager.ui.term.add('2012', '2012', '2012-01-01', '2012-12-31')
 
30
    >>> manager.ui.course.add('2012', 'Programming', course_id='PRO')
 
31
    >>> manager.ui.section.add('2012', '2012', 'Programming')
 
32
    >>> manager.ui.section.instructors.add('2012', '2012', 'Programming (1)',
 
33
    ...                                    ['jeffrey'])
 
34
    >>> manager.ui.section.students.add('2012', '2012', 'Programming (1)',
 
35
    ...                                 ['camila', 'liliana', 'mario'])
 
36
 
 
37
Set up skills:
 
38
 
 
39
    >>> manager.ui.layer.add('Course')
 
40
    >>> manager.ui.node.add('Programming', label='PRO')
 
41
 
 
42
    >>> manager.ui.skillset.add('Python Environment', '01')
 
43
    >>> manager.ui.skillset.add('Data Types, Statements, and Expressions', '02')
 
44
    >>> manager.ui.skillset.add('Errors', '03')
 
45
    >>> manager.ui.skillset.add('Strings', '04')
 
46
 
 
47
    >>> manager.ui.skill.add(
 
48
    ...     'Python Environment',
 
49
    ...     'Use the Python shell for interactive evaluation',
 
50
    ...     '01')
 
51
    >>> manager.ui.skill.add(
 
52
    ...     'Python Environment',
 
53
    ...     'Make Python scripts with a text editor',
 
54
    ...     '02',
 
55
    ...     required=False)
 
56
    >>> manager.ui.skill.add(
 
57
    ...     'Data Types, Statements, and Expressions',
 
58
    ...     'Recognize int, float, str, list, tuple, and dict.',
 
59
    ...     '03')
 
60
    >>> manager.ui.skill.add(
 
61
    ...     'Data Types, Statements, and Expressions',
 
62
    ...     'Use type(...) to determine the data type of a given value.',
 
63
    ...     '04')
 
64
    >>> manager.ui.skill.add(
 
65
    ...     'Data Types, Statements, and Expressions',
 
66
    ...     'Use assignment statements to assign names (variables) to values.',
 
67
    ...     '05')
 
68
    >>> manager.ui.skill.add(
 
69
    ...     'Data Types, Statements, and Expressions',
 
70
    ...     'Use the input function to read user input.',
 
71
    ...     '06')
 
72
    >>> manager.ui.skill.add(
 
73
    ...     'Data Types, Statements, and Expressions',
 
74
    ...     'Define keyword and recognize keywords in Python.',
 
75
    ...     '07')
 
76
    >>> manager.ui.skill.add(
 
77
    ...     'Data Types, Statements, and Expressions',
 
78
    ...     'Create legal variable names and recognize illegal ones.',
 
79
    ...     '08',
 
80
    ...     required=False)
 
81
    >>> manager.ui.skill.add(
 
82
    ...     'Errors',
 
83
    ...     'Recognize and differentiate among errors.',
 
84
    ...     '09')
 
85
    >>> manager.ui.skill.add(
 
86
    ...     'Errors',
 
87
    ...     'Read and interpret stack traceback messages.',
 
88
    ...     '10')
 
89
    >>> manager.ui.skill.add(
 
90
    ...     'Strings',
 
91
    ...     'Create string literals with single, double, and triple quotes.',
 
92
    ...     '11')
 
93
    >>> manager.ui.skill.add(
 
94
    ...     'Strings',
 
95
    ...     'Use the len() function to return the length of a string.',
 
96
    ...     '12')
 
97
    >>> manager.ui.skill.add(
 
98
    ...     'Strings',
 
99
    ...     'Use the find(...) method to locate substrings in a string.',
 
100
    ...     '13',
 
101
    ...     required=False)
 
102
    >>> manager.ui.skill.add(
 
103
    ...     'Strings',
 
104
    ...     'Use the split() method to break a string into a list.',
 
105
    ...     '14',
 
106
    ...     required=False)
 
107
 
 
108
    >>> manager.query.link('Search').click()
 
109
    >>> manager.query.button('Search').click()
 
110
    >>> manager.query.link('Programming').click()
 
111
 
 
112
    >>> sel = '//h2[contains(@class, "ui-accordion-header")]'
 
113
    >>> accordion_headers = manager.query_all.xpath(sel)
 
114
    >>> sel = 'div.ui-accordion-content'
 
115
    >>> accordion_contents = manager.query_all.css(sel)
 
116
    >>> information_accordion_content = accordion_contents[0]
 
117
    >>> skillsets_accordion_header = accordion_headers[4]
 
118
    >>> skillsets_accordion_header.click()
 
119
    >>> skillsets_accordion_content = accordion_contents[4]
 
120
    >>> manager.wait_no(information_accordion_content.is_displayed)
 
121
    >>> sel = '//a[@title="Edit skillsets"]'
 
122
    >>> manager.query.xpath(sel).click()
 
123
    >>> manager.query.id('form-buttons-add').click()
 
124
    >>> manager.query.link('Done').click()
 
125
 
 
126
    >>> sel = '//h2[contains(@class, "ui-accordion-header")]'
 
127
    >>> accordion_headers = manager.query_all.xpath(sel)
 
128
    >>> sel = 'div.ui-accordion-content'
 
129
    >>> accordion_contents = manager.query_all.css(sel)
 
130
    >>> information_accordion_content = accordion_contents[0]
 
131
    >>> layers_accordion_header = accordion_headers[3]
 
132
    >>> layers_accordion_header.click()
 
133
    >>> layers_accordion_content = accordion_contents[3]
 
134
    >>> manager.wait_no(information_accordion_content.is_displayed)
 
135
    >>> sel = '//a[@title="Edit layers"]'
 
136
    >>> manager.query.xpath(sel).click()
 
137
    >>> manager.query.id('form-buttons-add').click()
 
138
 
 
139
Assign the skills to the course:
 
140
 
 
141
    >>> manager.query.link('School').click()
 
142
    >>> manager.query.link('Courses').click()
 
143
    >>> manager.query.link('Batch Assign Skills').click()
 
144
    >>> manager.query.name('course_attr').ui.set_value('Course ID')
 
145
    >>> manager.query.name('layer').ui.set_value('Course')
 
146
    >>> manager.query.name('node_attr').ui.set_value('Label')
 
147
    >>> manager.query.name('SEARCH_BUTTON').click()
 
148
    >>> manager.query.name('ASSIGN_BUTTON').click()
 
149
 
 
150
Log in as instructor:
 
151
 
 
152
    >>> teacher = browsers.teacher
 
153
    >>> teacher.ui.login('jeffrey', 'pwd')
 
154
    >>> teacher.query.link('CanDo').click()
 
155
 
 
156
Check Camila's Student Competency Report and print its skills
 
157
information (label, required, title):
 
158
 
 
159
    >>> sel = '#students-part tbody ul.popup_menu'
 
160
    >>> camila_menu, mario_menu, liliana_menu = teacher.query_all.css(sel)
 
161
    >>> teacher.query.link('Cerna, Camila').click()
 
162
    >>> camila_menu.query.link('Report').click()
 
163
    >>> camila_report_url = teacher.url
 
164
 
 
165
    >>> print_report_skills(teacher)
 
166
    01, Yes, Use the Python shell for interactive evaluation
 
167
    02, No, Make Python scripts with a text editor
 
168
    03, Yes, Recognize int, float, str, list, tuple, and dict.
 
169
    04, Yes, Use type(...) to determine the data type of a given value.
 
170
    05, Yes, Use assignment statements to assign names (variables) to values.
 
171
    06, Yes, Use the input function to read user input.
 
172
    07, Yes, Define keyword and recognize keywords in Python.
 
173
    08, No, Create legal variable names and recognize illegal ones.
 
174
    09, Yes, Recognize and differentiate among errors.
 
175
    10, Yes, Read and interpret stack traceback messages.
 
176
    11, Yes, Create string literals with single, double, and triple quotes.
 
177
    12, Yes, Use the len() function to return the length of a string.
 
178
    13, No, Use the find(...) method to locate substrings in a string.
 
179
    14, No, Use the split() method to break a string into a list.
 
180
 
 
181
Let's activate IEP for Camila:
 
182
 
 
183
    >>> manager.open(camila_url)
 
184
    >>> manager.query.link('IEP').click()
 
185
    >>> sel = 'a[title="Edit this plan information"]'
 
186
    >>> manager.query.css(sel).click()
 
187
    >>> manager.query.id('form-widgets-active-0').click()
 
188
    >>> manager.query.id('form-buttons-add').click()
 
189
 
 
190
And customize some of the required skills:
 
191
 
 
192
    >>> manager.query.link('Programming (1)').click()
 
193
    >>> sel = '''a[title="Edit student's IEP skills"]'''
 
194
    >>> manager.query.css(sel).click()
 
195
    >>> sel = 'iep_section_skills.iep.Python E1.Use the 1'
 
196
    >>> manager.query.id(sel).click()
 
197
    >>> sel = 'iep_section_skills.iep.Data Typ2.Use the 4'
 
198
    >>> manager.query.id(sel).click()
 
199
    >>> sel = 'iep_section_skills.iep.Errors-3.Recogniz1'
 
200
    >>> manager.query.id(sel).click()
 
201
    >>> manager.query.name('SAVE').click()
 
202
 
 
203
And check her report again. The IEP skills should be shown as not
 
204
required now:
 
205
 
 
206
    >>> teacher.open(camila_report_url)
 
207
    >>> print_report_skills(teacher)
 
208
    01, No, Use the Python shell for interactive evaluation
 
209
    02, No, Make Python scripts with a text editor
 
210
    03, Yes, Recognize int, float, str, list, tuple, and dict.
 
211
    04, Yes, Use type(...) to determine the data type of a given value.
 
212
    05, Yes, Use assignment statements to assign names (variables) to values.
 
213
    06, No, Use the input function to read user input.
 
214
    07, Yes, Define keyword and recognize keywords in Python.
 
215
    08, No, Create legal variable names and recognize illegal ones.
 
216
    09, No, Recognize and differentiate among errors.
 
217
    10, Yes, Read and interpret stack traceback messages.
 
218
    11, Yes, Create string literals with single, double, and triple quotes.
 
219
    12, Yes, Use the len() function to return the length of a string.
 
220
    13, No, Use the find(...) method to locate substrings in a string.
 
221
    14, No, Use the split() method to break a string into a list.