Class: AssessmentTotalScores

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

Overview

Instructor’s view of Students’ assessment scores

Instance Method Summary collapse

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

#assessmentsObject

Clicks the Assessments link on the page then instantiates the AssessmentsList class.



293
294
295
296
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 293

def assessments
  frm.link(:text=>"Assessments").click
  AssessmentsList.new(@browser)
end

#comment_for_student(student_id, comment) ⇒ Object

Adds a comment to the specified student’s comment box.

Note that this method assumes that the student identities are not being obscured on this page. If they are, then this method will not work for selecting the appropriate comment box.

Parameters:

  • student_id (String)

    the target student id

  • comment (String)

    the text of the comment being made to the student



265
266
267
268
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 265

def comment_for_student(student_id, comment)
  index_val = student_ids.index(student_id)
  frm.text_field(:name=>"editTotalResults:totalScoreTable:#{index_val}:_id345").value=comment
end

#comment_in_first_box=(comment) ⇒ Object

Enters the specified string into the topmost box listed on the page.

This method is especially useful when the student identities are obscured, since in that situation you can’t target a specific student’s comment box, obviously.

Parameters:

  • comment (String)

    the text to be entered into the Comment box



280
281
282
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 280

def comment_in_first_box=(comment)
  frm.text_field(:name=>"editTotalResults:totalScoreTable:0:_id345").value=comment
end

#sort_by_submit_dateObject

Clicks the Submit Date link in the table header to sort/reverse sort the list.



271
272
273
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 271

def sort_by_submit_date
  frm.link(:text=>"Submit Date").click
end

#student_idsObject

Gets the user ids listed in the scores table, returns them as an Array object.

Note that this method is only appropriate when student identities are not being obscured on this page. If student submissions are set to be anonymous then this method will fail to return any ids.



250
251
252
253
254
255
256
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 250

def student_ids
  ids = []
  scores_table = frm.table(:id=>"editTotalResults:totalScoreTable").to_a
  scores_table.delete_at(0)
  scores_table.each { |row| ids << row[1] }
  return ids
end

#updateObject

Clicks the Update button, then instantiates the AssessmentTotalScores class.



286
287
288
289
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 286

def update
  frm.button(:value=>"Update").click
  AssessmentTotalScores.new(@browser)
end