Class: AssessmentsList

Inherits:
AssessmentsBase show all
Defined in:
lib/sakai-cle-test-api/page_objects/assessments.rb

Overview

The Course Tools “Tests and Quizzes” page for a given site. (Instructor view)

Instance Method Summary collapse

Methods inherited from AssessmentsBase

menu_bar_elements, pool_page_elements, question_page_elements

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

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

Instance Method Details

#inactive_assessment_titlesObject

Returns an Array of the inactive Assessment titles displayed in the list.



79
80
81
82
83
84
85
86
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 79

def inactive_assessment_titles
  titles =[]
  inactive_table = frm.div(:class=>"tier2", :index=>2).table(:id=>"authorIndexForm:inactivePublishedAssessments")
  1.upto(inactive_table.rows.size-1) do |x|
    titles << inactive_table[x][1].span(:id=>/inactivePublishedAssessmentTitle/).text
  end
  return titles
end

#pending_assessment_titlesObject

Collects the titles of the Assessments listed as “Pending” then returns them as an Array.



57
58
59
60
61
62
63
64
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 57

def pending_assessment_titles
  titles =[]
  pending_table = frm.table(:id=>"authorIndexForm:coreAssessments")
  1.upto(pending_table.rows.size-1) do |x|
    titles << pending_table[x][1].span(:id=>/assessmentTitle/).text
  end
  return titles
end

#published_assessment_titlesObject

Collects the titles of the Assessments listed as “Published” then returns them as an Array.



68
69
70
71
72
73
74
75
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 68

def published_assessment_titles
  titles =[]
  published_table = frm.div(:class=>"tier2", :index=>2).table(:class=>"listHier", :index=>0)
  1.upto(published_table.rows.size-1) do |x|
    titles << published_table[x][1].span(:id=>/publishedAssessmentTitle/).text
  end
  return titles
end

#score_test(test_title) ⇒ Object

Opens the selected test for scoring then instantiates the AssessmentTotalScores class.

Parameters:

  • test_title (String)

    the title of the test to be clicked.



91
92
93
94
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 91

def score_test(test_title)
  frm.tbody(:id=>"authorIndexForm:_id88:tbody_element").row(:text=>/#{Regexp.escape(test_title)}/).link(:id=>/authorIndexToScore/).click
  AssessmentTotalScores.new(@browser)
end