Module: SelectQuestionTypeMethods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/assessments.rb

Overview

This page appears when adding a question to a pool

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.page_elements(identifier) ⇒ Object

Encapsulates all the PageObject code into a module method that can be called from the necessary class.



1013
1014
1015
1016
1017
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 1013

def self.page_elements(identifier)
  in_frame(identifier) do |frame|
    button(:cancel, :value=>"Cancel", :frame=>frame)
  end
end

Instance Method Details

#select_question_type(qtype) ⇒ Object

Selects the specified question type from the drop-down list, then instantiates the appropriate page class, based on the question type selected.

Parameters:

  • qtype (String)

    the text of the question type you want to select from the drop down list.



989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 989

def select_question_type(qtype)
  frm.select(:id=>"_id1:selType").select(qtype)
  frm.button(:value=>"Save").click

  page = case(qtype)
           when "Multiple Choice" then MultipleChoice.new(@browser)
           when "True False" then TrueFalse.new(@browser)
           when "Survey" then Survey.new(@browser)
           when "Short Answer/Essay" then ShortAnswer.new(@browser)
           when "Fill in the Blank" then FillInBlank.new(@browser)
           when "Numeric Response" then NumericResponse.new(@browser)
           when "Matching" then Matching.new(@browser)
           when "Audio Recording" then AudioRecording.new(@browser)
           when "File Upload" then FileUpload.new(@browser)
           else puts "nothing selected"
         end

  return page

end