Class: TakeAssessment

Inherits:
AssessmentsBase show all
Defined in:
lib/sambal-cle/page_objects/assessments.rb

Overview

Pages student sees when taking an assessment Note that this class will only work when the Assessment being taken is set up to only display one question per page.

Instance Method Summary collapse

Methods inherited from AssessmentsBase

menu_bar_elements, pool_page_elements, question_page_elements

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#file_answer(file_name, file_path = "") ⇒ Object

Enters the specified file name in the file field. You can include the path to the file as an optional second parameter.



793
794
795
796
# File 'lib/sambal-cle/page_objects/assessments.rb', line 793

def file_answer(file_name, file_path="")
  frm.file_field(:name=>/deliverFileUpload/).set(file_path + file_name)
  frm.button(:value=>"Upload").click
end

#true_false_answer(answer) ⇒ Object

Clicks either the True or the False radio button, as specified.



777
778
779
780
# File 'lib/sambal-cle/page_objects/assessments.rb', line 777

def true_false_answer(answer)
  answer.upcase=~/t/i ? index = 0 : index = 1
  frm.radio(:name=>/deliverTrueFalse/, :index=>index).set
end

#true_false_rationale(text) ⇒ Object

Enters the specified string into the Rationale text box.



783
784
785
# File 'lib/sambal-cle/page_objects/assessments.rb', line 783

def true_false_rationale(text)
  frm.text_field(:name=>/:deliverTrueFalse:rationale/).value=text
end