Module: MultipleChoiceMethods
- Includes:
- PageObject, QuestionHelpers
- Defined in:
- lib/kuali-sakai-common-lib/assessments.rb
Overview
The page for setting up a multiple choice question
Class Method Summary collapse
-
.page_elements(identifier) ⇒ Object
Encapsulates all the PageObject code into a module method that can be called from the necessary class.
Methods included from QuestionHelpers
Class Method Details
.page_elements(identifier) ⇒ Object
Encapsulates all the PageObject code into a module method that can be called from the necessary class.
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/kuali-sakai-common-lib/assessments.rb', line 549 def self.page_elements(identifier) QuestionHelpers.(identifier) in_frame(identifier) do |frame| (:cancel, :value=>"Cancel", :frame=>frame) text_field(:answer_point_value, :id=>"itemForm:answerptr", :frame=>frame) link(:whats_this, :text=>"(What's This?)", :frame=>frame) (:single_correct) { |page| page.(:name=>"itemForm:chooseAnswerTypeForMC", :index=>0, :frame=>frame) } (:enable_negative_marking) { |page| page.(:name=>"itemForm:partialCreadit_NegativeMarking", :index=>0, :frame=>frame) } # Element present when negative marking selected: text_field(:negative_point_value, :id=>"itemForm:answerdsc", :frame=>frame) (:enable_partial_credit) { |page| page.(:name=>"itemForm:partialCreadit_NegativeMarking", :index=>1, :frame=>frame) } link(:reset_to_default, :text=>"Reset to Default Grading Logic", :frame=>frame) (:multi_single) {|page| page.(:name=>"itemForm:chooseAnswerTypeForMC", :index=>1, :frame=>frame) } (:multi_multi) {|page| page.(:name=>"itemForm:chooseAnswerTypeForMC", :index=>2, :frame=>frame) } text_area(:question_text, :id=>"itemForm:_id82_textinput", :frame=>frame) (:add_attachments, :name=>"itemForm:_id126", :frame=>frame) text_area(:answer_a, :id=>"itemForm:mcchoices:0:_id140_textinput", :frame=>frame) link(:remove_a, :id=>"itemForm:mcchoices:0:removelinkSingle", :frame=>frame) text_area(:answer_b, :id=>"itemForm:mcchoices:1:_id140_textinput", :frame=>frame) link(:remove_b, :id=>"itemForm:mcchoices:1:removelinkSingle", :frame=>frame) text_area(:answer_c, :id=>"itemForm:mcchoices:2:_id140_textinput", :frame=>frame) link(:remove_c, :id=>"itemForm:mcchoices:2:removelinkSingle", :frame=>frame) text_area(:answer_d, :id=>"itemForm:mcchoices:3:_id140_textinput", :frame=>frame) link(:remove_d, :id=>"itemForm:mcchoices:3:removelinkSingle", :frame=>frame) # Radio buttons that appear when "single correct" is selected (:a_correct, :name=>"itemForm:mcchoices:0:mcradiobtn", :frame=>frame) (:b_correct, :name=>"itemForm:mcchoices:1:mcradiobtn", :frame=>frame) (:c_correct, :name=>"itemForm:mcchoices:2:mcradiobtn", :frame=>frame) (:d_correct, :name=>"itemForm:mcchoices:3:mcradiobtn", :frame=>frame) # % Value fields that appear when "single correct" and "partial credit" selected text_field(:a_value, :id=>"itemForm:mcchoices:0:partialCredit", :frame=>frame) text_field(:b_value, :id=>"itemForm:mcchoices:1:partialCredit", :frame=>frame) text_field(:c_value, :id=>"itemForm:mcchoices:2:partialCredit", :frame=>frame) text_field(:d_value, :id=>"itemForm:mcchoices:3:partialCredit", :frame=>frame) link(:reset_score_values, :text=>"Reset Score Values", :frame=>frame) # Checkboxes that appear when "multiple correct" is selected checkbox(:a_correct, :name=>"itemForm:mcchoices:0:mccheckboxes", :frame=>frame) checkbox(:b_correct, :name=>"itemForm:mcchoices:1:mccheckboxes", :frame=>frame) checkbox(:c_correct, :name=>"itemForm:mcchoices:2:mccheckboxes", :frame=>frame) checkbox(:d_correct, :name=>"itemForm:mcchoices:3:mccheckboxes", :frame=>frame) select_list(:insert_additional_answers, :id=>"itemForm:insertAdditionalAnswerSelectMenu", :frame=>frame) (:randomize_answers_yes) {|page| page.(:index=>0, :name=>"itemForm:_id162", :frame=>frame) } (:randomize_answers_no) {|page| page.(:index=>1, :name=>"itemForm:_id162", :frame=>frame) } (:require_rationale_yes) {|page| page.(:index=>0, :name=>"itemForm:_id166", :frame=>frame) } (:require_rationale_no) {|page| page.(:index=>1, :name=>"itemForm:_id166", :frame=>frame) } select_list(:assign_to_part, :id=>"itemForm:assignToPart", :frame=>frame) select_list(:assign_to_pool, :id=>"itemForm:assignToPool", :frame=>frame) text_area(:feedback_for_correct, :id=>"itemForm:_id186_textinput", :frame=>frame) text_area(:feedback_for_incorrect, :id=>"itemForm:_id190_textinput", :frame=>frame) end end |