Class: AssessmentTotalScores

Inherits:
BasePage
  • Object
show all
Defined in:
lib/sambal-cle/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

Instance Method Details

#assessmentsObject

Clicks the Assessments link on the page then instantiates the AssessmentsList class. action(:



344
345
346
347
# File 'lib/sambal-cle/page_objects/assessments.rb', line 344

def assessments
  frm.link(:text=>"Assessments").click
  AssessmentsList.new(@browser)
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



331
332
333
# File 'lib/sambal-cle/page_objects/assessments.rb', line 331

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.



322
323
324
# File 'lib/sambal-cle/page_objects/assessments.rb', line 322

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.



301
302
303
304
305
306
307
# File 'lib/sambal-cle/page_objects/assessments.rb', line 301

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] }
  ids
end

#updateObject

Clicks the Update button, then instantiates the AssessmentTotalScores class.



337
338
339
340
# File 'lib/sambal-cle/page_objects/assessments.rb', line 337

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