Module: AssignmentAddMethods
- Includes:
- PageObject
- Defined in:
- lib/kuali-sakai-common-lib/assignments.rb
Overview
The page where you create a new assignment
Class Method Summary collapse
Instance Method Summary collapse
-
#add_attachments ⇒ Object
Clicks the Add Attachments button, then instantiates the AssignmentAttachments page class.
-
#alert_text ⇒ Object
Grabs the text contained in the alert box when it is present on the page (will throw an error if called when the box is not present).
-
#cancel ⇒ Object
Clicks the Cancel button, then instantiates the AssignmentsList page class.
-
#gradebook_warning ⇒ Object
This is the warning message that appears when you select to add an assignment to the gradebook.
-
#instructions=(instructions) ⇒ Object
Sends the specified text to the text box in the FCKEditor on the page.
-
#post ⇒ Object
Clicks the Post button, then instantiates the AssignmentsList page class.
-
#preview ⇒ Object
Clicks the Preview button, then instantiates the AssignmentsPreview page class.
-
#save_draft ⇒ Object
Clicks the Save Draft button, then instantiates the AssignmentsList page class.
Class Method Details
.page_elements(identifier) ⇒ Object
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 207 def self.page_elements(identifier) in_frame(identifier) do |frame| hidden_field(:assignment_id, :name=>"assignmentId", :frame=>frame) link(:assignment_list, :text=>"Assignment List", :frame=>frame) link(:grade_report, :text=>"Grade Report", :frame=>frame) link(:student_view, :text=>"Student View", :frame=>frame) link(:permissions, :text=>"Permissions", :frame=>frame) link(:options, :text=>"Options", :frame=>frame) text_field(:title, :id=>"new_assignment_title", :frame=>frame) select_list(:open_month, :id=>"new_assignment_openmonth", :frame=>frame) select_list(:open_day, :id=>"new_assignment_openday", :frame=>frame) select_list(:open_year, :id=>"new_assignment_openyear", :frame=>frame) select_list(:open_hour, :id=>"new_assignment_openhour", :frame=>frame) select_list(:open_minute, :id=>"new_assignment_openmin", :frame=>frame) select_list(:open_meridian, :id=>"new_assignment_openampm", :frame=>frame) select_list(:due_month, :id=>"new_assignment_duemonth", :frame=>frame) select_list(:due_day, :id=>"new_assignment_dueday", :frame=>frame) select_list(:due_year, :id=>"new_assignment_dueyear", :frame=>frame) select_list(:due_hour, :id=>"new_assignment_duehour", :frame=>frame) select_list(:due_minute, :id=>"new_assignment_duemin", :frame=>frame) select_list(:due_meridian, :id=>"new_assignment_dueampm", :frame=>frame) select_list(:accept_month, :id=>"new_assignment_closemonth", :frame=>frame) select_list(:accept_day, :id=>"new_assignment_closeday", :frame=>frame) select_list(:accept_year, :id=>"new_assignment_closeyear", :frame=>frame) select_list(:accept_hour, :id=>"new_assignment_closehour", :frame=>frame) select_list(:accept_minute, :id=>"new_assignment_closemin", :frame=>frame) select_list(:accept_meridian, :id=>"new_assignment_closeampm", :frame=>frame) select_list(:student_submissions, :id=>"subType", :frame=>frame) select_list(:grade_scale, :id=>"new_assignment_grade_type", :frame=>frame) checkbox(:allow_resubmission, :id=>"allowResToggle", :frame=>frame) select_list(:num_resubmissions, :id=>"allowResubmitNumber", :frame=>frame) select_list(:resub_until_month, :id=>"allow_resubmit_closeMonth", :frame=>frame) select_list(:resub_until_day, :id=>"allow_resubmit_closeDay", :frame=>frame) select_list(:resub_until_year, :id=>"allow_resubmit_closeYear", :frame=>frame) select_list(:resub_until_hour, :id=>"allow_resubmit_closeHour", :frame=>frame) select_list(:resub_until_minute, :id=>"allow_resubmit_closeMin", :frame=>frame) select_list(:resub_until_meridian, :id=>"allow_resubmit_closeAMPM", :frame=>frame) text_field(:max_points, :name=>"new_assignment_grade_points", :frame=>frame) checkbox(:add_due_date, :id=>"new_assignment_check_add_due_date", :frame=>frame) checkbox(:add_open_announcement, :id=>"new_assignment_check_auto_announce", :frame=>frame) checkbox(:add_honor_pledge, :id=>"new_assignment_check_add_honor_pledge", :frame=>frame) checkbox(:use_turnitin, :id=>"new_assignment_use_review_service", :frame=>frame) checkbox(:allow_students_to_view_report, :id=>"new_assignment_allow_student_view", :frame=>frame) (:do_not_add_to_gradebook, :id=>"no",:name=>"new_assignment_add_to_gradebook", :frame=>frame) (:add_to_gradebook, :id=>"add", :name=>"new_assignment_add_to_gradebook", :frame=>frame) (:do_not_send_notifications, :id=>"notsendnotif", :frame=>frame) (:send_notifications, :id=>"sendnotif", :frame=>frame) (:send_summary_email, :id=>"sendnotifsummary", :frame=>frame) (:do_not_send_grade_notif, :id=>"notsendreleasegradenotif", :frame=>frame) (:send_grade_notif, :id=>"sendreleasegradenotif", :frame=>frame) link(:add_model_answer, :id=>"modelanswer_add", :frame=>frame) link(:add_private_note, :id=>"note_add", :frame=>frame) link(:add_all_purpose_item, :id=>"allPurpose_add", :frame=>frame) text_area(:model_answer, :id=>"modelanswer_text", :frame=>frame) (:model_answer_attach, :name=>"modelAnswerAttach", :frame=>frame) select_list(:show_model_answer, :id=>"modelanswer_to", :frame=>frame) (:save_model_answer, :id=>"modelanswer_save", :frame=>frame) (:cancel_model_answer, :id=>"modelanswer_cancel", :frame=>frame) text_area(:private_note, :id=>"note_text", :frame=>frame) select_list(:share_note_with, :id=>"note_to", :frame=>frame) (:save_note, :id=>"note_save", :frame=>frame) (:cancel_note, :id=>"note_cancel", :frame=>frame) text_field(:all_purpose_title, :id=>"allPurpose_title", :frame=>frame) text_area(:all_purpose_text, :id=>"allPurpose_text", :frame=>frame) (:add_all_purpose_attachments, :id=>"allPurposeAttach", :frame=>frame) (:show_this_all_purpose_item, :id=>"allPurposeHide1", :frame=>frame) (:hide_this_all_purpose_item, :id=>"allPurposeHide2", :frame=>frame) checkbox(:show_from, :id=>"allPurposeShowFrom", :frame=>frame) checkbox(:show_until, :id=>"allPurposeShowTo", :frame=>frame) select_list(:show_from_month, :id=>"allPurpose_releaseMonth", :frame=>frame) select_list(:show_from_day, :id=>"allPurpose_releaseDay", :frame=>frame) select_list(:show_from_year, :id=>"allPurpose_releaseYear", :frame=>frame) select_list(:show_from_hour, :id=>"allPurpose_releaseHour", :frame=>frame) select_list(:show_from_minute, :id=>"allPurpose_releaseMin", :frame=>frame) select_list(:show_from_meridian, :id=>"allPurpose_releaseAMPM", :frame=>frame) select_list(:show_until_month, :id=>"allPurpose_retractMonth", :frame=>frame) select_list(:show_until_day, :id=>"allPurpose_retractDay", :frame=>frame) select_list(:show_until_year, :id=>"allPurpose_retractYear", :frame=>frame) select_list(:show_until_hour, :id=>"allPurpose_retractHour", :frame=>frame) select_list(:show_until_minute, :id=>"allPurpose_retractMin", :frame=>frame) select_list(:show_until_meridian, :id=>"allPurpose_retractAMPM", :frame=>frame) link(:expand_guest_list, :id=>"expand_1", :frame=>frame) link(:collapse_guest_list, :id=>"collapse_1", :frame=>frame) link(:expand_TA_list, :id=>"expand_2", :frame=>frame) link(:collapse_TA_list, :id=>"collapse_2", :frame=>frame) link(:expand_instructor_list, :id=>"expand_3", :frame=>frame) link(:collapse_instructor_list, :is=>"collapse_3", :frame=>frame) # Note that only the "All" checkboxes are defined, since other items may or may not be there checkbox(:all_guests, :id=>"allPurpose_Guest", :frame=>frame) checkbox(:all_TAs, :id=>"allPurpose_Teaching Assistant", :frame=>frame) checkbox(:all_instructors, :id=>"allPurpose_Instructor", :frame=>frame) end end |
Instance Method Details
#add_attachments ⇒ Object
Clicks the Add Attachments button, then instantiates the AssignmentAttachments page class.
202 203 204 205 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 202 def frm.(:value=>"Add Attachments").click AssignmentAttachments.new(@browser) end |
#alert_text ⇒ Object
Grabs the text contained in the alert box when it is present on the page (will throw an error if called when the box is not present).
176 177 178 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 176 def alert_text frm.div(:class=>"portletBody").div(:class=>"alertMessage").text end |
#cancel ⇒ Object
Clicks the Cancel button, then instantiates the AssignmentsList page class.
161 162 163 164 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 161 def cancel frm.(:value=>"Cancel", :index=>-1).click AssignmentsList.new(@browser) end |
#gradebook_warning ⇒ Object
This is the warning message that appears when you select to add an assignment to the gradebook.
196 197 198 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 196 def gradebook_warning frm.div(:class, "portletBody").span(:id, "gradebookListWarnAssoc") end |
#instructions=(instructions) ⇒ Object
Sends the specified text to the text box in the FCKEditor on the page.
182 183 184 185 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 182 def instructions=(instructions) frm.frame(:id, "new_assignment_instructions___Frame").td(:id, "xEditingArea").frame(:index=>0).wait_until_present frm.frame(:id, "new_assignment_instructions___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(instructions) end |
#post ⇒ Object
Clicks the Post button, then instantiates the AssignmentsList page class.
154 155 156 157 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 154 def post frm.(:value=>"Post").click AssignmentsList.new(@browser) end |
#preview ⇒ Object
Clicks the Preview button, then instantiates the AssignmentsPreview page class.
189 190 191 192 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 189 def preview frm.(:value=>"Preview").click AssignmentsPreview.new(@browser) end |
#save_draft ⇒ Object
Clicks the Save Draft button, then instantiates the AssignmentsList page class.
168 169 170 171 |
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 168 def save_draft frm.(:name=>"save").click AssignmentsList.new(@browser) end |