Class: EditAssessment
- Inherits:
-
AssessmentsBase
- Object
- PageMaker
- BasePage
- AssessmentsBase
- EditAssessment
- Defined in:
- lib/sakai-cle-test-api/page_objects/assessments.rb
Overview
The page that appears when you’re creating a new quiz or editing an existing one
Instance Method Summary collapse
-
#add_part ⇒ Object
Clicks the Add Part button, then instantiates the AddEditAssessmentPart page class.
-
#copy_part_to_pool(part_num) ⇒ Object
Allows copying an Assessment part to a Pool.
-
#edit_question(part_num, question_num) ⇒ Object
Allows editing of a question by specifying its part number and question number.
-
#get_question_text(part_number, question_number) ⇒ Object
Allows retrieval of a specified question’s text, by part and question number.
-
#insert_question_after(part_num, question_num, qtype) ⇒ Object
Allows insertion of a question at a specified point in the Assessment.
-
#preview ⇒ Object
Clicks the Preview button, then instantiates the PreviewOverview page class.
-
#publish ⇒ Object
Clicks the Publish button, then instantiates the PublishAssessment page class.
-
#question_pools ⇒ Object
Clicks the Question Pools button, then instantiates the QuestionPoolsList page class.
-
#remove_part(part_num) ⇒ Object
Allows removing a specified Assessment part number.
-
#remove_question(part_num, question_num) ⇒ Object
Allows removal of question by part number and question number.
-
#settings ⇒ Object
Clicks the Settings link, then instantiates the AssessmentSettings page class.
Methods inherited from AssessmentsBase
menu_bar_elements, pool_page_elements, question_page_elements
Methods inherited from BasePage
basic_page_elements, frame_element
Methods inherited from PageMaker
element, expected_element, expected_title, #initialize, #method_missing, page_url
Constructor Details
This class inherits a constructor from PageMaker
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PageMaker
Instance Method Details
#add_part ⇒ Object
Clicks the Add Part button, then instantiates the AddEditAssessmentPart page class.
349 350 351 352 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 349 def add_part frm.link(:text=>"Add Part").click AddEditAssessmentPart.new(@browser) end |
#copy_part_to_pool(part_num) ⇒ Object
Allows copying an Assessment part to a Pool.
336 337 338 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 336 def copy_part_to_pool(part_num) frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:copyToPool").click end |
#edit_question(part_num, question_num) ⇒ Object
Allows editing of a question by specifying its part number and question number.
330 331 332 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 330 def edit_question(part_num, question_num) frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:parts:#{question_num.to_i-1}:modify").click end |
#get_question_text(part_number, question_number) ⇒ Object
Allows retrieval of a specified question’s text, by part and question number.
390 391 392 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 390 def get_question_text(part_number, question_number) frm.table(:id=>"assesssmentForm:parts:#{part_number.to_i-1}:parts").div(:class=>"tier3", :index=>question_number.to_i-1).text end |
#insert_question_after(part_num, question_num, qtype) ⇒ Object
Allows insertion of a question at a specified point in the Assessment. Must include the part number, the question number, and the type of question. Question Type must match the Type value in the drop down.
311 312 313 314 315 316 317 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 311 def insert_question_after(part_num, question_num, qtype) if question_num.to_i == 0 frm.select(:id=>"assesssmentForm:parts:#{part_num.to_i - 1}:changeQType").select(qtype) else frm.select(:id=>"assesssmentForm:parts:#{part_num.to_i - 1}:parts:#{question_num.to_i - 1}:changeQType").select(qtype) end end |
#preview ⇒ Object
Clicks the Preview button, then instantiates the PreviewOverview page class.
360 361 362 363 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 360 def preview frm.link(:text=>"Preview").click PreviewOverview.new(@browser) end |
#publish ⇒ Object
Clicks the Publish button, then instantiates the PublishAssessment page class.
374 375 376 377 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 374 def publish frm.link(:text=>"Publish").click PublishAssessment.new(@browser) end |
#question_pools ⇒ Object
Clicks the Question Pools button, then instantiates the QuestionPoolsList page class.
381 382 383 384 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 381 def question_pools frm.link(:text=>"Question Pools").click QuestionPoolsList.new(@browser) end |
#remove_part(part_num) ⇒ Object
Allows removing a specified Assessment part number.
343 344 345 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 343 def remove_part(part_num) frm.link(:xpath, "//a[contains(@onclick, 'assesssmentForm:parts:#{part_num.to_i-1}:copyToPool')]").click end |
#remove_question(part_num, question_num) ⇒ Object
Allows removal of question by part number and question number.
322 323 324 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 322 def remove_question(part_num, question_num) frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:parts:#{question_num.to_i-1}:deleteitem").click end |
#settings ⇒ Object
Clicks the Settings link, then instantiates the AssessmentSettings page class.
367 368 369 370 |
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 367 def settings frm.link(:text=>"Settings").click AssessmentSettings.new(@browser) end |