Class: SelectQuestionType

Inherits:
Object
  • Object
show all
Includes:
PageObject
Defined in:
lib/sakai-oae-test-api/cle_frame_classes.rb

Overview

This page appears when adding a question to a pool

Instance Method Summary collapse

Methods included from PageObject

#method_missing, #name_li, #name_link

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageObject

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.



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 932

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