Module: QuestionHelpers
- Includes:
- PageObject
- Included in:
- AudioRecordingMethods, FileUploadMethods, FillInBlankMethods, MatchingMethods, MultipleChoiceMethods, NumericResponseMethods, ShortAnswerMethods, SurveyMethods, TrueFalseMethods
- Defined in:
- lib/kuali-sakai-common-lib/assessments.rb
Overview
This is a module containing methods that are common to all the question pages inside the Assessment section of a Site.
Class Method Summary collapse
-
.menu_elements(identifier) ⇒ Object
Encapsulates all the PageObject code into a module method that can be called from the necessary class.
Instance Method Summary collapse
-
#save ⇒ Object
Saves the question by clicking the Save button, then makes the determination whether to instantiate the EditAssessment class, or the EditQuestionPool class.
Class Method Details
.menu_elements(identifier) ⇒ Object
Encapsulates all the PageObject code into a module method that can be called from the necessary class.
34 35 36 37 38 39 40 41 |
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 34 def self.(identifier) in_frame(identifier) do |frame| link(:assessments, :text=>"Assessments", :frame=>frame) link(:assessment_types, :text=>"Assessment Types", :frame=>frame) link(:question_pools, :text=>"Question Pools", :frame=>frame) link(:questions, :text=>/Questions:/, :frame=>frame) end end |
Instance Method Details
#save ⇒ Object
Saves the question by clicking the Save button, then makes the determination whether to instantiate the EditAssessment class, or the EditQuestionPool class.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 12 def save quiz = frm.div(:class=>"portletBody").div(:index=>0).text pool = frm.div(:class=>"portletBody").div(:index=>1).text frm.(:value=>"Save").click if quiz =~ /^Assessments/ EditAssessment.new(@browser) elsif pool =~ /^Question Pools/ EditQuestionPool.new(@browser) else puts "Unexpected text: " p pool p quiz end end |