Class: EditAssessment

Inherits:
AssessmentsBase show all
Defined in:
lib/sambal-cle/page_objects/assessments.rb

Overview

The page that appears when you’re creating a new quiz or editing an existing one

Instance Method Summary collapse

Methods inherited from AssessmentsBase

menu_bar_elements, pool_page_elements, question_page_elements

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#copy_part_to_pool(part_num) ⇒ Object

Allows copying an Assessment part to a Pool.

Parameters:

  • part_num (String)

    the part number of the assessment you want



374
375
376
# File 'lib/sambal-cle/page_objects/assessments.rb', line 374

def copy_part_to_pool(part_num)
  frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:copyToPool").click
end

#edit_question(part_num, question_num) ⇒ Object

Allows editing of a question by specifying its part number and question number.

Parameters:

  • part_num (String)

    the Part number containing the question you want

  • question_num (String)

    the number of the question you want



368
369
370
# File 'lib/sambal-cle/page_objects/assessments.rb', line 368

def edit_question(part_num, question_num)
  frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:parts:#{question_num.to_i-1}:modify").click
end

#insert_question_after(part_num, question_num, qtype) ⇒ Object

Allows insertion of a question at a specified point in the Assessment. Must include the part number, the question number, and the type of question. Question Type must match the Type value in the drop down.



349
350
351
352
353
354
355
# File 'lib/sambal-cle/page_objects/assessments.rb', line 349

def insert_question_after(part_num, question_num, qtype)
  if question_num.to_i == 0
    frm.select(:id=>"assesssmentForm:parts:#{part_num.to_i - 1}:changeQType").select(qtype)
  else
    frm.select(:id=>"assesssmentForm:parts:#{part_num.to_i - 1}:parts:#{question_num.to_i - 1}:changeQType").select(qtype)
  end
end

#remove_question(part_num, question_num) ⇒ Object

Allows removal of question by part number and question number.

Parameters:

  • part_num (String)

    the Part number containing the question you want to remove

  • question_num (String)

    the number of the question you want to remove



360
361
362
# File 'lib/sambal-cle/page_objects/assessments.rb', line 360

def remove_question(part_num, question_num)
  frm.link(:id=>"assesssmentForm:parts:#{part_num.to_i-1}:parts:#{question_num.to_i-1}:deleteitem").click
end