Module: AssessmentTotalScoresMethods

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

Overview

Instructor’s view of Students’ assessment scores

Instance Method Summary collapse

Instance Method Details

#assessmentsObject

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



333
334
335
336
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 333

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



305
306
307
308
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 305

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



320
321
322
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 320

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.



311
312
313
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 311

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.



290
291
292
293
294
295
296
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 290

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.



326
327
328
329
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 326

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