kuali-sakai-common-lib 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/kuali-sakai-common-lib.gemspec +4 -5
- data/lib/kuali-sakai-common-lib.rb +3 -2
- data/lib/kuali-sakai-common-lib/add_files.rb +260 -0
- data/lib/kuali-sakai-common-lib/announcements.rb +301 -0
- data/lib/kuali-sakai-common-lib/assessments.rb +1183 -0
- data/lib/kuali-sakai-common-lib/assignments.rb +861 -0
- data/lib/kuali-sakai-common-lib/basic_lti.rb +13 -0
- data/lib/kuali-sakai-common-lib/blogs.rb +23 -0
- data/lib/kuali-sakai-common-lib/calendar.rb +466 -0
- data/lib/kuali-sakai-common-lib/calendar_summary.rb +0 -0
- data/lib/kuali-sakai-common-lib/chat_room.rb +0 -0
- data/lib/{core-ext.rb → kuali-sakai-common-lib/core-ext.rb} +0 -0
- data/lib/kuali-sakai-common-lib/drop_box.rb +0 -0
- data/lib/kuali-sakai-common-lib/email_archive.rb +28 -0
- data/lib/kuali-sakai-common-lib/forums.rb +326 -0
- data/lib/kuali-sakai-common-lib/gem_ext.rb +36 -0
- data/lib/kuali-sakai-common-lib/gradebook.rb +23 -0
- data/lib/kuali-sakai-common-lib/gradebook2.rb +24 -0
- data/lib/kuali-sakai-common-lib/messages.rb +639 -0
- data/lib/kuali-sakai-common-lib/news.rb +8 -0
- data/lib/kuali-sakai-common-lib/polls.rb +77 -0
- data/lib/kuali-sakai-common-lib/post_em.rb +0 -0
- data/lib/kuali-sakai-common-lib/profile.rb +46 -0
- data/lib/kuali-sakai-common-lib/profile2.rb +360 -0
- data/lib/kuali-sakai-common-lib/resources_roster.rb +0 -0
- data/lib/kuali-sakai-common-lib/rwiki.rb +0 -0
- data/lib/kuali-sakai-common-lib/sections.rb +237 -0
- data/lib/kuali-sakai-common-lib/single_user.rb +0 -0
- data/lib/kuali-sakai-common-lib/site_statistics.rb +0 -0
- data/lib/kuali-sakai-common-lib/syllabus.rb +182 -0
- data/lib/{utilities.rb → kuali-sakai-common-lib/utilities.rb} +13 -2
- metadata +51 -8
File without changes
|
File without changes
|
@@ -0,0 +1,237 @@
|
|
1
|
+
#================
|
2
|
+
# Sections Pages for a Site
|
3
|
+
#================
|
4
|
+
|
5
|
+
module SectionsMenu
|
6
|
+
include PageObject
|
7
|
+
# Clicks the Add Sections button/link and instantiates
|
8
|
+
# the AddEditSections Class.
|
9
|
+
def add_sections
|
10
|
+
frm.link(:text=>"Add Sections").click
|
11
|
+
AddEditSections.new(@browser)
|
12
|
+
end
|
13
|
+
|
14
|
+
def overview
|
15
|
+
frm.link(:text=>"Overview").click
|
16
|
+
Sections.new(@browser)
|
17
|
+
end
|
18
|
+
|
19
|
+
def student_memberships
|
20
|
+
frm.link(:text=>"Student Memberships").click
|
21
|
+
StudentMemberships.new(@browser)
|
22
|
+
end
|
23
|
+
|
24
|
+
def options
|
25
|
+
frm.link(:text=>"Options").click
|
26
|
+
SectionsOptions.new(@browser)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
# Topmost page for Sections in Site Management
|
32
|
+
module SectionsMethods
|
33
|
+
include PageObject
|
34
|
+
# Clicks the Edit link for the specified section.
|
35
|
+
# Then instantiates the AddEditSections class.
|
36
|
+
def edit(title)
|
37
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Edit/).click
|
38
|
+
AddEditSections.new(@browser)
|
39
|
+
end
|
40
|
+
|
41
|
+
def assign_tas(title)
|
42
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign TAs/).click
|
43
|
+
AssignTeachingAssistants.new(@browser)
|
44
|
+
end
|
45
|
+
|
46
|
+
def assign_students(title)
|
47
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign Students/).click
|
48
|
+
AssignStudents.new(@browser)
|
49
|
+
end
|
50
|
+
|
51
|
+
def check(title)
|
52
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>/remove/).set
|
53
|
+
end
|
54
|
+
|
55
|
+
def section_names
|
56
|
+
names = []
|
57
|
+
frm.table(:class=>/listHier/).rows.each do |row|
|
58
|
+
if row.td(:class=>"leftIndent").exist?
|
59
|
+
names << row.td(:class=>"leftIndent").div(:index=>0).text
|
60
|
+
end
|
61
|
+
end
|
62
|
+
return names
|
63
|
+
end
|
64
|
+
|
65
|
+
def remove_sections
|
66
|
+
frm.button(:value=>"Remove Sections").click
|
67
|
+
Sections.new(@browser)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns the text of the Teach Assistant cell for the specified
|
71
|
+
# Section.
|
72
|
+
def tas_for(title)
|
73
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[1].text
|
74
|
+
end
|
75
|
+
|
76
|
+
#
|
77
|
+
def days_for(title)
|
78
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[2].text
|
79
|
+
end
|
80
|
+
|
81
|
+
#
|
82
|
+
def time_for(title)
|
83
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[3].text
|
84
|
+
end
|
85
|
+
|
86
|
+
#
|
87
|
+
def location_for(title)
|
88
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[4].text
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
def current_size_for(title)
|
93
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[5].text
|
94
|
+
end
|
95
|
+
|
96
|
+
#
|
97
|
+
def availability_for(title)
|
98
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[6].text
|
99
|
+
end
|
100
|
+
|
101
|
+
def alert_text
|
102
|
+
frm.div(:class=>"validation").text
|
103
|
+
end
|
104
|
+
|
105
|
+
def success_text
|
106
|
+
frm.div(:class=>"success").text
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
# Methods in this class currently do not support
|
112
|
+
# adding multiple instances of sections simultaneously.
|
113
|
+
# That will be added at some future time.
|
114
|
+
# The same goes for adding days with different meeting times. This will hopefully
|
115
|
+
# be supported in the future.
|
116
|
+
module AddEditSectionsMethods
|
117
|
+
include PageObject
|
118
|
+
# Clicks the Add Sections button then instantiates the Sections Class,
|
119
|
+
# unless there's an Alert message, in which case it will reinstantiate
|
120
|
+
# the class.
|
121
|
+
def add_sections
|
122
|
+
frm.button(:value=>"Add Sections").click
|
123
|
+
if frm.div(:class=>"validation").exist?
|
124
|
+
AddEditSections.new(@browser)
|
125
|
+
else
|
126
|
+
Sections.new(@browser)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def alert_text
|
131
|
+
frm.div(:class=>"validation").text
|
132
|
+
end
|
133
|
+
|
134
|
+
# The Update button is only available when editing an existing Sections record.
|
135
|
+
def update
|
136
|
+
frm.button(:value=>"Update").click
|
137
|
+
if frm.div(:class=>"validation").exist?
|
138
|
+
AddEditSections.new(@browser)
|
139
|
+
else
|
140
|
+
Sections.new(@browser)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# This method takes an array object containing strings of the
|
145
|
+
# days of the week and then clicks the appropriate checkboxes, based
|
146
|
+
# on those strings.
|
147
|
+
def check_days(array)
|
148
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/).set if array.include?(/mon/i)
|
149
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/).set if array.include?(/tue/i)
|
150
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/).set if array.include?(/wed/i)
|
151
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/).set if array.include?(/thu/i)
|
152
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/).set if array.include?(/fri/i)
|
153
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/).set if array.include?(/sat/i)
|
154
|
+
frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/).set if array.include?(/sun/i)
|
155
|
+
end
|
156
|
+
|
157
|
+
def self.page_elements(identifier)
|
158
|
+
in_frame(identifier) do |frame|
|
159
|
+
select_list(:category, :id=>/SectionsForm:category/, :frame=>frame)
|
160
|
+
text_field(:name, :id=>/SectionsForm:sectionTable:0:titleInput/, :frame=>frame)
|
161
|
+
checkbox(:monday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/, :frame=>frame)
|
162
|
+
checkbox(:tuesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/, :frame=>frame)
|
163
|
+
checkbox(:wednesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/, :frame=>frame)
|
164
|
+
checkbox(:thursday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/, :frame=>frame)
|
165
|
+
checkbox(:friday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/, :frame=>frame)
|
166
|
+
checkbox(:saturday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/, :frame=>frame)
|
167
|
+
checkbox(:sunday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/, :frame=>frame)
|
168
|
+
text_field(:start_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:startTime/, :frame=>frame)
|
169
|
+
text_field(:end_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:endTime/, :frame=>frame)
|
170
|
+
text_field(:location, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:location/, :frame=>frame)
|
171
|
+
radio_button(:startAM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>0, :frame=>frame) }
|
172
|
+
radio_button(:startPM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>1, :frame=>frame) }
|
173
|
+
radio_button(:endAM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>0, :frame=>frame) }
|
174
|
+
radio_button(:endPM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>1, :frame=>frame) }
|
175
|
+
radio_button(:unlimited_students) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:limit/, :index=>0, :frame=>frame) }
|
176
|
+
radio_button(:limited_students) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:limit/, :index=>1, :frame=>frame) }
|
177
|
+
text_field(:max_students, :id=>/SectionsForm:sectionTable:0:maxEnrollmentInput/, :frame=>frame)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
#
|
183
|
+
module AssignTeachingAssistantsMethods
|
184
|
+
include PageObject
|
185
|
+
def assign_TAs
|
186
|
+
frm.button(:value=>"Assign TAs").click
|
187
|
+
Sections.new(@browser)
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.page_elements(identifier)
|
191
|
+
in_frame(identifier) do |frame|
|
192
|
+
select_list(:available_tas, :id=>"memberForm:availableUsers", :frame=>frame)
|
193
|
+
select_list(:assigned_tas, :id=>"memberForm:selectedUsers", :frame=>frame)
|
194
|
+
button(:assign, :value=>">", :frame=>frame)
|
195
|
+
button(:unassign, :value=>"<", :frame=>frame)
|
196
|
+
button(:assign_all, :value=>">>", :frame=>frame)
|
197
|
+
button(:unassign_all, :value=>"<<", :frame=>frame)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
#
|
203
|
+
module AssignStudentsMethods
|
204
|
+
include PageObject
|
205
|
+
def assign_students
|
206
|
+
frm.button(:value=>"Assign students").click
|
207
|
+
Sections.new(@browser)
|
208
|
+
end
|
209
|
+
|
210
|
+
def self.page_elements(identifier)
|
211
|
+
in_frame(identifier) do |frame|
|
212
|
+
select_list(:available_students, :id=>"memberForm:availableUsers", :frame=>frame)
|
213
|
+
select_list(:assigned_students, :id=>"memberForm:selectedUsers", :frame=>frame)
|
214
|
+
button(:assign, :value=>">", :frame=>frame)
|
215
|
+
button(:unassign, :value=>"<", :frame=>frame)
|
216
|
+
button(:assign_all, :value=>">>", :frame=>frame)
|
217
|
+
button(:unassign_all, :value=>"<<", :frame=>frame)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# The Options page for Sections.
|
223
|
+
module SectionsOptionsMethods
|
224
|
+
include PageObject
|
225
|
+
def update
|
226
|
+
frm().button(:value=>"Update").click
|
227
|
+
Sections.new(@browser)
|
228
|
+
end
|
229
|
+
|
230
|
+
def self.page_elements(identifier)
|
231
|
+
in_frame(identifier) do |frame|
|
232
|
+
checkbox(:students_can_sign_up, :id=>"optionsForm:selfRegister", :frame=>frame)
|
233
|
+
checkbox(:students_can_switch, :id=>"optionsForm:selfSwitch", :frame=>frame)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,182 @@
|
|
1
|
+
module SyllabusMethods
|
2
|
+
|
3
|
+
# Clicks the "Create/Edit" button on the page,
|
4
|
+
# then instantiates the SyllabusEdit class.
|
5
|
+
def create_edit
|
6
|
+
frm.link(:text=>"Create/Edit").click
|
7
|
+
SyllabusEdit.new(@browser)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Clicks the "Add" button, then
|
11
|
+
# instantiates the AddEditSyllabusItem Class.
|
12
|
+
def add
|
13
|
+
frm.link(:text=>"Add").click
|
14
|
+
AddEditSyllabusItem.new(@browser)
|
15
|
+
end
|
16
|
+
|
17
|
+
def attachments_list
|
18
|
+
list = []
|
19
|
+
frm.div(:class=>"portletBody").links.each { |link| list << link.text }
|
20
|
+
return list
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
module SyllabusEditMethods
|
26
|
+
|
27
|
+
# Clicks the "Add" button, then
|
28
|
+
# instantiates the AddEditSyllabusItem Class.
|
29
|
+
def add
|
30
|
+
frm.link(:text=>"Add").click
|
31
|
+
AddEditSyllabusItem.new(@browser)
|
32
|
+
end
|
33
|
+
|
34
|
+
def redirect
|
35
|
+
frm.link(:text=>"Redirect").click
|
36
|
+
SyllabusRedirect.new(@browser)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns the text of the page header
|
40
|
+
def header
|
41
|
+
frm.div(:class=>"portletBody").h3.text
|
42
|
+
end
|
43
|
+
|
44
|
+
# Clicks the checkbox for the item with the
|
45
|
+
# specified title.
|
46
|
+
def check_title(title)
|
47
|
+
index=syllabus_titles.index(title)
|
48
|
+
frm.checkbox(:index=>index).set
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
def move_title_up(title)
|
53
|
+
#FIXME
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
def move_title_down(title)
|
58
|
+
#FIXME
|
59
|
+
end
|
60
|
+
|
61
|
+
# Clicks the "Update" button and instantiates
|
62
|
+
# the DeleteSyllabusItems Class.
|
63
|
+
def update
|
64
|
+
frm.button(:value=>"Update").click
|
65
|
+
DeleteSyllabusItems.new(@browser)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Opens the specified item and instantiates the XXXX Class.
|
69
|
+
def open_item(title)
|
70
|
+
frm.link(:text=>title).click
|
71
|
+
Class.new(@browser)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Returns an array containing the titles of the syllabus items
|
75
|
+
# displayed on the page.
|
76
|
+
def syllabus_titles
|
77
|
+
titles = []
|
78
|
+
s_table = frm.table(:class=>"listHier lines nolines")
|
79
|
+
1.upto(s_table.rows.size-1) do |x|
|
80
|
+
titles << s_table[x][0].text
|
81
|
+
end
|
82
|
+
return titles
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
module AddEditSyllabusItemMethods
|
88
|
+
include PageObject
|
89
|
+
# Clicks the "Post" button and instantiates
|
90
|
+
# the Syllabus Class.
|
91
|
+
def post
|
92
|
+
frm.button(:value=>"Post").click
|
93
|
+
SyllabusEdit.new(@browser)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Defines the text area of the FCKEditor that appears on the page for
|
97
|
+
# the Syllabus content.
|
98
|
+
def editor
|
99
|
+
frm.frame(:id, /_textarea___Frame/).td(:id, "xEditingArea").frame(:index=>0)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Sends the specified string to the FCKEditor text area on the page.
|
103
|
+
def content=(text)
|
104
|
+
editor.send_keys(text)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Clicks the Add attachments button and instantiates the
|
108
|
+
# SyllabusAttach class.
|
109
|
+
def add_attachments
|
110
|
+
frm.button(:value=>"Add attachments").click
|
111
|
+
SyllabusAttach.new(@browser)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Returns an array of the filenames in the attachments
|
115
|
+
# table
|
116
|
+
def files_list
|
117
|
+
names = []
|
118
|
+
frm.table(:class=>"listHier lines nolines").rows.each do |row|
|
119
|
+
if row.td(:class=>"item").exist?
|
120
|
+
names << row.td(:class=>"item").h4.text
|
121
|
+
end
|
122
|
+
end
|
123
|
+
return names
|
124
|
+
end
|
125
|
+
|
126
|
+
# Clicks the preview button and
|
127
|
+
# instantiates the SyllabusPreview class
|
128
|
+
def preview
|
129
|
+
frm.button(:value=>"Preview").click
|
130
|
+
SyllabusPreview.new(@browser)
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.page_elements(identifier)
|
134
|
+
in_frame(identifier) do |frame|
|
135
|
+
text_field(:title, :id=>"_id4:title", :frame=>frame)
|
136
|
+
radio_button(:only_members_of_this_site) { |page| page.radio_button_element(:name=>/_id\d+:_id\d+/, :value=>"no", :frame=>frame) }
|
137
|
+
radio_button(:publicly_viewable) { |page| page.radio_button_element(:name=>/_id\d+:_id\d+/, :value=>"yes", :frame=>frame) }
|
138
|
+
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
module SyllabusPreviewMethods
|
144
|
+
include PageObject
|
145
|
+
def edit
|
146
|
+
frm.button(:value=>"Edit").click
|
147
|
+
AddEditSyllabusItem.new(@browser)
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.page_elements(identifier)
|
151
|
+
in_frame(identifier) do |frame|
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
module SyllabusRedirectMethods
|
157
|
+
include PageObject
|
158
|
+
def save
|
159
|
+
frm.button(:value=>"Save").click
|
160
|
+
SyllabusEdit.new(@browser)
|
161
|
+
end
|
162
|
+
|
163
|
+
def self.page_elements(identifier)
|
164
|
+
in_frame(identifier) do |frame|
|
165
|
+
text_field(:url, :id=>"redirectForm:urlValue", :frame=>frame)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
module DeleteSyllabusItemsMethods
|
171
|
+
# Clicks the Delete button, then
|
172
|
+
# instantiates the CreateEditSyllabus Class.
|
173
|
+
def delete
|
174
|
+
frm.button(:value=>"Delete").click
|
175
|
+
CreateEditSyllabus.new(@browser)
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
module CreateEditSyllabusMethods
|
181
|
+
|
182
|
+
end
|
@@ -259,5 +259,16 @@ module Utilities
|
|
259
259
|
:meridian =>t.strftime("%P")
|
260
260
|
}
|
261
261
|
end
|
262
|
-
|
263
|
-
end # Utilities
|
262
|
+
|
263
|
+
end # Utilities
|
264
|
+
|
265
|
+
module CLEElements
|
266
|
+
# Used to add configured modules to classes in OAE and CLE
|
267
|
+
# That share common page methods, like Assessments and Assignments
|
268
|
+
def self.modularize(module_name, identifier)
|
269
|
+
include module_name
|
270
|
+
module_name.page_elements(identifier)
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
274
|
+
|