Module: AssessmentsListMethods

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#createObject

This method reads the type of assessment selected for creation, then clicks the Create button and instantiates the proper class.

If the assessment is going to be made in the builder, then EditAssessment is called. If from Markup text…



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 49

def create
  builder_or_text = frm.radio(:value=>"1", :name=>"authorIndexForm:_id29").set?

  frm.button(:value=>"Create").click

  if builder_or_text == true
    EditAssessment.new(@browser)
  else
    # Need to add Markup page class, then add the reference here.
  end

end

#inactive_assessment_titlesObject

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



93
94
95
96
97
98
99
100
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 93

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.



71
72
73
74
75
76
77
78
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 71

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.



82
83
84
85
86
87
88
89
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 82

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

#question_poolsObject

Clicks the Question Pools link, then instantiates the QuestionPoolsList class.



64
65
66
67
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 64

def question_pools
  frm.link(:text=>"Question Pools").click
  QuestionPoolsList.new(@browser)
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.



105
106
107
108
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 105

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