Module: SelectQuestionTypeMethods

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

Overview

This page appears when adding a question to a pool

Instance Method Summary collapse

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.



879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 879

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