Class: AssignmentStudentView

Inherits:
BasePage
  • Object
show all
Includes:
FCKEditor
Defined in:
lib/sambal-cle/page_objects/assignments.rb

Overview

A Student user’s page for editing/submitting/view an assignment.

Instance Method Summary collapse

Methods included from FCKEditor

#enter_source_text, #entity_picker, #get_source_text, #prepend, #select_all, #source, #source_field

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#assignment_text=(text) ⇒ Object

Enters the specified text into the Assignment Text FCKEditor.



370
371
372
373
# File 'lib/sambal-cle/page_objects/assignments.rb', line 370

def assignment_text=(text)
  remove_assignment_text
  editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
end

#attachmentsObject

Returns an array of strings. Each element in the array is the name of attached files.



407
408
409
410
411
# File 'lib/sambal-cle/page_objects/assignments.rb', line 407

def attachments
  names = []
  frm.ul(:class=>"attachList indnt1").links.each { |link| names << link.text }
  names
end

#remove_assignment_textObject

Clears out any existing text from the Assignment Text FCKEditor.



376
377
378
379
# File 'lib/sambal-cle/page_objects/assignments.rb', line 376

def remove_assignment_text
  select_all(editor)
  editor.td(:id, "xEditingArea").frame(:index=>0).send_keys :backspace
end

#select_file(file_name, file_path = "") ⇒ Object



381
382
383
# File 'lib/sambal-cle/page_objects/assignments.rb', line 381

def select_file(file_name, file_path="")
  frm.file_field(:id=>"clonableUpload", :name=>/upload/).set(file_path + file_name)
end

#summary_infoObject



358
359
360
361
362
363
364
365
# File 'lib/sambal-cle/page_objects/assignments.rb', line 358

def summary_info
  hash={}
  array = frm.table(:class=>"itemSummary").to_a
  array.each do |subarray|
    hash.store(subarray[0], subarray[1])
  end
  hash
end