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.



313
314
315
316
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 313

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



285
286
287
288
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 285

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



300
301
302
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 300

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.



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

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.



270
271
272
273
274
275
276
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 270

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.



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

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