Class: AssessmentTotalScores

Inherits:
Object
  • Object
show all
Includes:
PageObject
Defined in:
lib/sakai-oae-test-api/cle_frame_classes.rb

Overview

Instructor’s view of Students’ assessment scores

Instance Method Summary collapse

Methods included from PageObject

#method_missing, #name_li, #name_link

Dynamic Method Handling

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

Instance Method Details

#assessmentsObject

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



328
329
330
331
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 328

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.



301
302
303
304
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 301

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.



315
316
317
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 315

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.



307
308
309
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 307

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.



288
289
290
291
292
293
294
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 288

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.



321
322
323
324
# File 'lib/sakai-oae-test-api/cle_frame_classes.rb', line 321

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