Class: S2SQuestionnaireObject
- Inherits:
-
Object
- Object
- S2SQuestionnaireObject
- Includes:
- DataFactory, Foundry, Navigation, StringFactory, Utilities
- Defined in:
- lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb
Constant Summary collapse
- YN_QUESTIONS =
Convenient gathering of all Yes/No questions. Makes it possible to do simple iterations through them.
[:civil_service, :total_ftes, :potential_effects, :international_support, :pi_in_govt, :pi_foreign_employee, :change_in_pi, :change_in_institution, :renewal_application, :inventions_conceived, :previously_reported, :disclose_title, :clinical_trial, :phase_3_trial, :human_stem_cells, :specific_cell_line, :pi_new_investigator, :proprietary_info, :environmental_impact, :authorized_exemption, :site_historic, :international_activities, :other_agencies, :subject_to_review, :novice_applicants]
Instance Attribute Summary collapse
-
#application_date ⇒ Object
Returns the value of attribute application_date.
-
#authorized_exemption ⇒ Object
Returns the value of attribute authorized_exemption.
-
#change_in_institution ⇒ Object
Returns the value of attribute change_in_institution.
-
#change_in_pi ⇒ Object
Returns the value of attribute change_in_pi.
-
#civil_service ⇒ Object
Returns the value of attribute civil_service.
-
#clinical_trial ⇒ Object
Returns the value of attribute clinical_trial.
-
#disclose_title ⇒ Object
Returns the value of attribute disclose_title.
-
#document_id ⇒ Object
Returns the value of attribute document_id.
-
#environmental_impact ⇒ Object
Returns the value of attribute environmental_impact.
-
#explain_environmental_impact ⇒ Object
Returns the value of attribute explain_environmental_impact.
-
#explain_exemption ⇒ Object
Returns the value of attribute explain_exemption.
-
#explain_historic_designation ⇒ Object
Returns the value of attribute explain_historic_designation.
-
#explain_international_activities ⇒ Object
Returns the value of attribute explain_international_activities.
-
#explain_potential_effects ⇒ Object
Returns the value of attribute explain_potential_effects.
-
#explain_support ⇒ Object
Returns the value of attribute explain_support.
-
#former_institution ⇒ Object
Returns the value of attribute former_institution.
-
#former_pi ⇒ Object
Returns the value of attribute former_pi.
-
#human_stem_cells ⇒ Object
Returns the value of attribute human_stem_cells.
-
#identify_countries ⇒ Object
Returns the value of attribute identify_countries.
-
#international_activities ⇒ Object
Returns the value of attribute international_activities.
-
#international_support ⇒ Object
Returns the value of attribute international_support.
-
#inventions_conceived ⇒ Object
Returns the value of attribute inventions_conceived.
-
#novice_applicants ⇒ Object
Returns the value of attribute novice_applicants.
-
#other_agencies ⇒ Object
Returns the value of attribute other_agencies.
-
#phase_3_trial ⇒ Object
Returns the value of attribute phase_3_trial.
-
#pi_foreign_employee ⇒ Object
Returns the value of attribute pi_foreign_employee.
-
#pi_in_govt ⇒ Object
Returns the value of attribute pi_in_govt.
-
#pi_new_investigator ⇒ Object
Returns the value of attribute pi_new_investigator.
-
#pis_us_govt_agency ⇒ Object
Returns the value of attribute pis_us_govt_agency.
-
#potential_effects ⇒ Object
Returns the value of attribute potential_effects.
-
#previously_reported ⇒ Object
Returns the value of attribute previously_reported.
-
#program ⇒ Object
Returns the value of attribute program.
-
#proprietary_info ⇒ Object
Returns the value of attribute proprietary_info.
-
#renewal_application ⇒ Object
Returns the value of attribute renewal_application.
-
#site_historic ⇒ Object
Returns the value of attribute site_historic.
-
#specific_cell_line ⇒ Object
Returns the value of attribute specific_cell_line.
-
#subject_to_review ⇒ Object
Returns the value of attribute subject_to_review.
-
#submitted_to_govt_agency ⇒ Object
Returns the value of attribute submitted_to_govt_agency.
-
#total_amount_requested ⇒ Object
Returns the value of attribute total_amount_requested.
-
#total_ftes ⇒ Object
Returns the value of attribute total_ftes.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ S2SQuestionnaireObject
constructor
A new instance of S2SQuestionnaireObject.
Methods included from Utilities
#get, #make_role, #make_user, #random_percentage, #set, #snake_case
Methods included from Navigation
#doc_search, #fill_out, #fill_out_item, #on_document?, #on_page?, #open_document, #window_cleanup
Constructor Details
#initialize(browser, opts = {}) ⇒ S2SQuestionnaireObject
Returns a new instance of S2SQuestionnaireObject.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 43 def initialize(browser, opts={}) @browser = browser # PLEASE NOTE: # This is a unique data object class in that # it breaks the typical model for radio button # methods and their associated class instance variables # # In general, it's not workable to set up radio button elements # to use "Y" and "N" as the instance variables associated with them. defaults = { civil_service: 'N', potential_effects: 'N', international_support: 'N', pi_in_govt: 'N', pi_foreign_employee: 'N', change_in_pi: 'N', change_in_institution: 'N', renewal_application: 'N', disclose_title: 'N', clinical_trial: 'N', human_stem_cells: 'N', pi_new_investigator: 'N', proprietary_info: 'N', environmental_impact: 'N', site_historic: 'N', international_activities: 'N', other_agencies: 'N', subject_to_review: 'N', program: 'Program not covered by EO 12372', novice_applicants: 'X' # Note the X, here. That's for the "N/A" option. } (defaults.merge(opts)) requires :document_id, :doc_type end |
Instance Attribute Details
#application_date ⇒ Object
Returns the value of attribute application_date.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def application_date @application_date end |
#authorized_exemption ⇒ Object
Returns the value of attribute authorized_exemption.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def @authorized_exemption end |
#change_in_institution ⇒ Object
Returns the value of attribute change_in_institution.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def change_in_institution @change_in_institution end |
#change_in_pi ⇒ Object
Returns the value of attribute change_in_pi.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def change_in_pi @change_in_pi end |
#civil_service ⇒ Object
Returns the value of attribute civil_service.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def civil_service @civil_service end |
#clinical_trial ⇒ Object
Returns the value of attribute clinical_trial.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def clinical_trial @clinical_trial end |
#disclose_title ⇒ Object
Returns the value of attribute disclose_title.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def disclose_title @disclose_title end |
#document_id ⇒ Object
Returns the value of attribute document_id.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def document_id @document_id end |
#environmental_impact ⇒ Object
Returns the value of attribute environmental_impact.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def environmental_impact @environmental_impact end |
#explain_environmental_impact ⇒ Object
Returns the value of attribute explain_environmental_impact.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_environmental_impact @explain_environmental_impact end |
#explain_exemption ⇒ Object
Returns the value of attribute explain_exemption.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_exemption @explain_exemption end |
#explain_historic_designation ⇒ Object
Returns the value of attribute explain_historic_designation.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_historic_designation @explain_historic_designation end |
#explain_international_activities ⇒ Object
Returns the value of attribute explain_international_activities.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_international_activities @explain_international_activities end |
#explain_potential_effects ⇒ Object
Returns the value of attribute explain_potential_effects.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_potential_effects @explain_potential_effects end |
#explain_support ⇒ Object
Returns the value of attribute explain_support.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def explain_support @explain_support end |
#former_institution ⇒ Object
Returns the value of attribute former_institution.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def former_institution @former_institution end |
#former_pi ⇒ Object
Returns the value of attribute former_pi.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def former_pi @former_pi end |
#human_stem_cells ⇒ Object
Returns the value of attribute human_stem_cells.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def human_stem_cells @human_stem_cells end |
#identify_countries ⇒ Object
Returns the value of attribute identify_countries.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def identify_countries @identify_countries end |
#international_activities ⇒ Object
Returns the value of attribute international_activities.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def international_activities @international_activities end |
#international_support ⇒ Object
Returns the value of attribute international_support.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def international_support @international_support end |
#inventions_conceived ⇒ Object
Returns the value of attribute inventions_conceived.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def inventions_conceived @inventions_conceived end |
#novice_applicants ⇒ Object
Returns the value of attribute novice_applicants.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def novice_applicants @novice_applicants end |
#other_agencies ⇒ Object
Returns the value of attribute other_agencies.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def other_agencies @other_agencies end |
#phase_3_trial ⇒ Object
Returns the value of attribute phase_3_trial.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def phase_3_trial @phase_3_trial end |
#pi_foreign_employee ⇒ Object
Returns the value of attribute pi_foreign_employee.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def pi_foreign_employee @pi_foreign_employee end |
#pi_in_govt ⇒ Object
Returns the value of attribute pi_in_govt.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def pi_in_govt @pi_in_govt end |
#pi_new_investigator ⇒ Object
Returns the value of attribute pi_new_investigator.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def pi_new_investigator @pi_new_investigator end |
#pis_us_govt_agency ⇒ Object
Returns the value of attribute pis_us_govt_agency.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def pis_us_govt_agency @pis_us_govt_agency end |
#potential_effects ⇒ Object
Returns the value of attribute potential_effects.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def potential_effects @potential_effects end |
#previously_reported ⇒ Object
Returns the value of attribute previously_reported.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def previously_reported @previously_reported end |
#program ⇒ Object
Returns the value of attribute program.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def program @program end |
#proprietary_info ⇒ Object
Returns the value of attribute proprietary_info.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def proprietary_info @proprietary_info end |
#renewal_application ⇒ Object
Returns the value of attribute renewal_application.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def renewal_application @renewal_application end |
#site_historic ⇒ Object
Returns the value of attribute site_historic.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def site_historic @site_historic end |
#specific_cell_line ⇒ Object
Returns the value of attribute specific_cell_line.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def specific_cell_line @specific_cell_line end |
#subject_to_review ⇒ Object
Returns the value of attribute subject_to_review.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def subject_to_review @subject_to_review end |
#submitted_to_govt_agency ⇒ Object
Returns the value of attribute submitted_to_govt_agency.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def submitted_to_govt_agency @submitted_to_govt_agency end |
#total_amount_requested ⇒ Object
Returns the value of attribute total_amount_requested.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def total_amount_requested @total_amount_requested end |
#total_ftes ⇒ Object
Returns the value of attribute total_ftes.
20 21 22 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 20 def total_ftes @total_ftes end |
Instance Method Details
#create ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb', line 80 def create navigate on Questions do |s2s| s2s. # Answers all of the Yes/No questions first (in random order) YN_QUESTIONS.shuffle.each do |q| var = get(q) s2s.send(q, var) if var != nil && s2s.send("#{q}_element".to_sym, var).present? end # Next we answer the questions that are conditional, based on the above answers... 1.upto(6) do |n| fy = "fiscal_year_#{n}" s2s.send(fy).pick!(get(fy)) ftes = "ftes_for_fy_#{n}" s2s.send(ftes).fit get(ftes) yr = "year_#{n+1}" var = get(yr) s2s.send(yr, var) unless var==nil end 1.upto(5) do |n| sp = "support_provided_#{n}" s2s.send(sp).pick! get(sp) end 1.upto(20) do |n| scl = "stem_cell_line_#{n}" s2s.send(scl).fit get(scl) end fill_out s2s, :explain_potential_effects, :explain_support, :pis_us_govt_agency, :total_amount_requested, :former_pi, :former_institution, :explain_environmental_impact, :explain_exemption, :explain_historic_designation, :identify_countries, :explain_international_activities, :submitted_to_govt_agency, :application_date, :program s2s.save end end |