upgrade_surveyor_gui 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +44 -0
- data/.travis.yml +17 -0
- data/CHANGELOG.md +46 -0
- data/Gemfile +8 -0
- data/LICENSE +21 -0
- data/MIT-LICENSE +20 -0
- data/README.md +244 -0
- data/Rakefile +66 -0
- data/app/controllers/surveyor_controller.rb +89 -0
- data/app/controllers/surveyor_gui/answers_controller.rb +3 -0
- data/app/controllers/surveyor_gui/application_controller.rb +3 -0
- data/app/controllers/surveyor_gui/dependencys_controller.rb +286 -0
- data/app/controllers/surveyor_gui/question_groups_controller.rb +90 -0
- data/app/controllers/surveyor_gui/questions_controller.rb +187 -0
- data/app/controllers/surveyor_gui/reports_controller.rb +339 -0
- data/app/controllers/surveyor_gui/responses_controller.rb +41 -0
- data/app/controllers/surveyor_gui/survey_controller.rb +16 -0
- data/app/controllers/surveyor_gui/survey_sections_controller.rb +80 -0
- data/app/controllers/surveyor_gui/surveyforms_controller.rb +4 -0
- data/app/facades/report_formatter.rb +46 -0
- data/app/facades/report_preview_wrapper.rb +11 -0
- data/app/facades/report_response_generator.rb +147 -0
- data/app/helpers/surveyor_gui/application_helper.rb +2 -0
- data/app/helpers/surveyor_gui/dependencys_helper.rb +5 -0
- data/app/helpers/surveyor_gui/question_groups_helper.rb +3 -0
- data/app/helpers/surveyor_gui/questions_helper.rb +22 -0
- data/app/helpers/surveyor_gui/reports_helper.rb +19 -0
- data/app/helpers/surveyor_gui/surveyforms_helper.rb +164 -0
- data/app/helpers/surveyor_helper.rb +4 -0
- data/app/inputs/currency_input.rb +5 -0
- data/app/inputs/date_picker_input.rb +7 -0
- data/app/inputs/datetime_picker_input.rb +5 -0
- data/app/inputs/percent_input.rb +5 -0
- data/app/inputs/time_picker_input.rb +5 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/answer.rb +4 -0
- data/app/models/column.rb +3 -0
- data/app/models/dependency.rb +4 -0
- data/app/models/dependency_condition.rb +4 -0
- data/app/models/permitted_params_decorator.rb +80 -0
- data/app/models/question.rb +4 -0
- data/app/models/question_group.rb +4 -0
- data/app/models/question_group_tracker.rb +19 -0
- data/app/models/question_type.rb +7 -0
- data/app/models/response.rb +4 -0
- data/app/models/response_set.rb +4 -0
- data/app/models/row.rb +3 -0
- data/app/models/survey.rb +4 -0
- data/app/models/survey_section.rb +4 -0
- data/app/models/surveyform.rb +103 -0
- data/app/uploaders/blob_uploader.rb +48 -0
- data/app/views/layouts/surveyor_gui/application.html.erb +14 -0
- data/app/views/layouts/surveyor_gui/surveyor_gui_blank.html.erb +13 -0
- data/app/views/layouts/surveyor_gui/surveyor_gui_default.html.erb +17 -0
- data/app/views/layouts/surveyor_gui/surveyor_modified.html.erb +14 -0
- data/app/views/partials/_answer.html.haml +33 -0
- data/app/views/partials/_question.html.haml +33 -0
- data/app/views/partials/_question_group.html.haml +73 -0
- data/app/views/partials/_section.html.haml +13 -0
- data/app/views/surveyor/edit.html.haml +21 -0
- data/app/views/surveyor_gui/dependencys/_column.html.erb +1 -0
- data/app/views/surveyor_gui/dependencys/_dependency.html.erb +22 -0
- data/app/views/surveyor_gui/dependencys/_dependency_condition_fields.html.erb +48 -0
- data/app/views/surveyor_gui/dependencys/_form.html.erb +20 -0
- data/app/views/surveyor_gui/dependencys/blank.html.erb +0 -0
- data/app/views/surveyor_gui/dependencys/edit.html.erb +1 -0
- data/app/views/surveyor_gui/dependencys/new.html.erb +1 -0
- data/app/views/surveyor_gui/partials/_url_helpers.html.erb +5 -0
- data/app/views/surveyor_gui/question_groups/_form.html.erb +57 -0
- data/app/views/surveyor_gui/question_groups/_group_inline_field.html.erb +21 -0
- data/app/views/surveyor_gui/question_groups/_group_inline_fields.html.erb +25 -0
- data/app/views/surveyor_gui/question_groups/blank.html.erb +0 -0
- data/app/views/surveyor_gui/question_groups/edit.html.erb +1 -0
- data/app/views/surveyor_gui/question_groups/new.html.erb +1 -0
- data/app/views/surveyor_gui/questions/_answer_fields.html.erb +23 -0
- data/app/views/surveyor_gui/questions/_answer_options.html.erb +28 -0
- data/app/views/surveyor_gui/questions/_form.html.erb +66 -0
- data/app/views/surveyor_gui/questions/_grid_dropdown_columns.html.erb +10 -0
- data/app/views/surveyor_gui/questions/_grid_dropdown_fields.html.erb +42 -0
- data/app/views/surveyor_gui/questions/_grid_fields.html.erb +9 -0
- data/app/views/surveyor_gui/questions/_no_picks.html.erb +29 -0
- data/app/views/surveyor_gui/questions/_pick.html +21 -0
- data/app/views/surveyor_gui/questions/_picks.html.erb +12 -0
- data/app/views/surveyor_gui/questions/blank.html.erb +0 -0
- data/app/views/surveyor_gui/questions/edit.html.erb +1 -0
- data/app/views/surveyor_gui/questions/new.html.erb +1 -0
- data/app/views/surveyor_gui/reports/_graphs.html.haml +21 -0
- data/app/views/surveyor_gui/reports/_grid.html.haml +42 -0
- data/app/views/surveyor_gui/reports/_grid_dropdown.html.haml +56 -0
- data/app/views/surveyor_gui/reports/_repeater.html.haml +27 -0
- data/app/views/surveyor_gui/reports/_show_report.html.haml +33 -0
- data/app/views/surveyor_gui/reports/_single_question.html.haml +70 -0
- data/app/views/surveyor_gui/reports/show.html.erb +14 -0
- data/app/views/surveyor_gui/responses/_grid.html.haml +20 -0
- data/app/views/surveyor_gui/responses/_grid_dropdown.html.haml +20 -0
- data/app/views/surveyor_gui/responses/_repeater.html.haml +22 -0
- data/app/views/surveyor_gui/responses/_survey_results.html.haml +40 -0
- data/app/views/surveyor_gui/responses/index.html.haml +24 -0
- data/app/views/surveyor_gui/responses/show.html.haml +42 -0
- data/app/views/surveyor_gui/shared/_grid_comments.html.haml +10 -0
- data/app/views/surveyor_gui/shared/_new_line.html.haml +2 -0
- data/app/views/surveyor_gui/shared/_pick_comments.html.haml +15 -0
- data/app/views/surveyor_gui/shared/_question_number.html.haml +11 -0
- data/app/views/surveyor_gui/shared/_report_data.html.haml +27 -0
- data/app/views/surveyor_gui/shared/_stars_report_data.html.haml +14 -0
- data/app/views/surveyor_gui/survey_sections/_form.html.erb +13 -0
- data/app/views/surveyor_gui/survey_sections/blank.html.erb +0 -0
- data/app/views/surveyor_gui/survey_sections/edit.html.erb +1 -0
- data/app/views/surveyor_gui/survey_sections/new.html.erb +1 -0
- data/app/views/surveyor_gui/surveyforms/_form.html.erb +50 -0
- data/app/views/surveyor_gui/surveyforms/_question_field.html.erb +148 -0
- data/app/views/surveyor_gui/surveyforms/_question_group.html.erb +116 -0
- data/app/views/surveyor_gui/surveyforms/_question_group_fields.html.erb +3 -0
- data/app/views/surveyor_gui/surveyforms/_question_name_and_number.html.erb +6 -0
- data/app/views/surveyor_gui/surveyforms/_question_section.html.erb +15 -0
- data/app/views/surveyor_gui/surveyforms/_question_wrapper.html.erb +108 -0
- data/app/views/surveyor_gui/surveyforms/_survey_section_fields.html.erb +137 -0
- data/app/views/surveyor_gui/surveyforms/clone_survey.html.erb +13 -0
- data/app/views/surveyor_gui/surveyforms/edit.html.erb +5 -0
- data/app/views/surveyor_gui/surveyforms/index.html.erb +40 -0
- data/app/views/surveyor_gui/surveyforms/new.html.erb +1 -0
- data/app/views/surveyor_gui/surveyforms/show.html.erb +5 -0
- data/config/environment.rb +0 -0
- data/config/routes.rb +71 -0
- data/config.ru +4 -0
- data/db/migrate/20140307204049_add_template_to_surveys.rb +5 -0
- data/db/migrate/20140307235607_add_test_data_to_response_sets.rb +5 -0
- data/db/migrate/20140308171947_add_original_choice_to_answers.rb +5 -0
- data/db/migrate/20140308172118_add_blob_to_responses.rb +5 -0
- data/db/migrate/20140308172417_add_modifiable_to_survey_section.rb +5 -0
- data/db/migrate/20140308174532_add_modifiable_to_question.rb +5 -0
- data/db/migrate/20140308175305_add_dynamically_generate_to_questions.rb +5 -0
- data/db/migrate/20140311032923_add_dummy_blob_to_questions.rb +5 -0
- data/db/migrate/20140311160609_add_dynamic_source_to_questions.rb +5 -0
- data/db/migrate/20140311161714_add_report_code_to_questions.rb +5 -0
- data/db/migrate/20140530181134_add_is_comment_to_questions.rb +5 -0
- data/db/migrate/20140531012006_add_is_comment_to_answers.rb +5 -0
- data/db/migrate/20140531225529_create_rows.rb +9 -0
- data/db/migrate/20140601011151_create_columns.rb +11 -0
- data/db/migrate/20140602030330_add_column_id_to_answers.rb +5 -0
- data/db/migrate/20140603155606_add_column_id_to_responses.rb +5 -0
- data/db/migrate/20140606023527_add_column_id_to_dependency_conditions.rb +5 -0
- data/db/migrate/20140815165307_add_user_id_to_survey.rb +5 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/assets/images/addicon.png +0 -0
- data/lib/assets/images/datepicker.gif +0 -0
- data/lib/assets/images/delete.gif +0 -0
- data/lib/assets/images/delete.png +0 -0
- data/lib/assets/images/images/border.png +0 -0
- data/lib/assets/images/images/controls.png +0 -0
- data/lib/assets/images/images/loading.gif +0 -0
- data/lib/assets/images/images/loading_background.png +0 -0
- data/lib/assets/images/images/overlay.png +0 -0
- data/lib/assets/images/rails.png +0 -0
- data/lib/assets/images/star.gif +0 -0
- data/lib/assets/javascripts/.gitkeep +0 -0
- data/lib/assets/javascripts/surveyor_gui/jquery.MetaData.js +121 -0
- data/lib/assets/javascripts/surveyor_gui/jquery.blockUI.js +619 -0
- data/lib/assets/javascripts/surveyor_gui/jquery.rating.js +377 -0
- data/lib/assets/javascripts/surveyor_gui/jquery.validate.js +1188 -0
- data/lib/assets/javascripts/surveyor_gui/surveyor_add_ons.js +10 -0
- data/lib/assets/javascripts/surveyor_gui/surveyor_gui.js +1428 -0
- data/lib/assets/stylesheets/.gitkeep +0 -0
- data/lib/assets/stylesheets/surveyor_gui/jquery.rating.css +12 -0
- data/lib/assets/stylesheets/surveyor_gui/surveyor_add_ons.css +3 -0
- data/lib/assets/stylesheets/surveyor_gui/surveyor_gui.sass +652 -0
- data/lib/enumerable_extenders.rb +31 -0
- data/lib/generators/surveyor_gui/install_generator.rb +57 -0
- data/lib/generators/surveyor_gui/templates/app/assets/javascripts/surveyor_add_ons.js +2 -0
- data/lib/generators/surveyor_gui/templates/app/assets/javascripts/surveyor_gui_all.js +24 -0
- data/lib/generators/surveyor_gui/templates/app/assets/stylesheets/surveyor_add_ons.css.sass +1 -0
- data/lib/generators/surveyor_gui/templates/app/assets/stylesheets/surveyor_gui_all.css.sass +8 -0
- data/lib/generators/surveyor_gui/templates/app/helpers/surveyor_helper.rb +4 -0
- data/lib/generators/surveyor_gui/templates/app/models/response_set_user.rb +13 -0
- data/lib/generators/surveyor_gui/templates/app/views/layouts/surveyor_gui/surveyor_gui_default.html.erb +17 -0
- data/lib/generators/surveyor_gui/templates/config/initializers/simple_form.rb +140 -0
- data/lib/generators/surveyor_gui/templates/config/locales/en.yml +5 -0
- data/lib/surveyor_gui/engine.rb +31 -0
- data/lib/surveyor_gui/helpers/surveyor_helper_methods.rb +19 -0
- data/lib/surveyor_gui/models/answer_methods.rb +24 -0
- data/lib/surveyor_gui/models/column_methods.rb +43 -0
- data/lib/surveyor_gui/models/dependency_condition_methods.rb +53 -0
- data/lib/surveyor_gui/models/dependency_methods.rb +83 -0
- data/lib/surveyor_gui/models/question_and_group_shared_methods.rb +11 -0
- data/lib/surveyor_gui/models/question_group_methods.rb +55 -0
- data/lib/surveyor_gui/models/question_methods.rb +435 -0
- data/lib/surveyor_gui/models/question_type_methods.rb +493 -0
- data/lib/surveyor_gui/models/response_methods.rb +71 -0
- data/lib/surveyor_gui/models/response_set_methods.rb +56 -0
- data/lib/surveyor_gui/models/row_methods.rb +11 -0
- data/lib/surveyor_gui/models/survey_methods.rb +32 -0
- data/lib/surveyor_gui/models/survey_section_methods.rb +32 -0
- data/lib/surveyor_gui/surveyforms_controller_methods.rb +258 -0
- data/lib/surveyor_gui/version.rb +3 -0
- data/lib/surveyor_gui.rb +17 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/surveyor_gui_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/spec/controllers/surveyforms_controller_spec.rb +362 -0
- data/spec/controllers/surveyor_controller_spec.rb +303 -0
- data/spec/factories.rb +181 -0
- data/spec/features/create_survey_spec.rb +417 -0
- data/spec/features/dependencies_spec.rb +65 -0
- data/spec/features/make_and_take_spec.rb +187 -0
- data/spec/features/rearrange_survey_spec.rb +118 -0
- data/spec/features/ui_spec.rb +469 -0
- data/spec/fixtures/REDCapDemoDatabase_DataDictionary.csv +127 -0
- data/spec/fixtures/chinese_survey.rb +14 -0
- data/spec/fixtures/everything.rb +215 -0
- data/spec/fixtures/favorites-ish.rb +22 -0
- data/spec/fixtures/favorites.rb +22 -0
- data/spec/fixtures/feelings.rb +38 -0
- data/spec/fixtures/lifestyle.rb +55 -0
- data/spec/fixtures/numbers.rb +21 -0
- data/spec/fixtures/redcap_new_headers.csv +1 -0
- data/spec/fixtures/redcap_siblings.csv +1 -0
- data/spec/fixtures/redcap_whitespace.csv +1 -0
- data/spec/helpers/formtastic_custom_input_spec.rb +15 -0
- data/spec/helpers/surveyor_helper_spec.rb +116 -0
- data/spec/lib/common_spec.rb +37 -0
- data/spec/lib/parser_spec.rb +393 -0
- data/spec/lib/rake_kitchen_sink.rb +42 -0
- data/spec/lib/redcap_parser_spec.rb +129 -0
- data/spec/lib/unparser_spec.rb +126 -0
- data/spec/models/answer_spec.rb +144 -0
- data/spec/models/dependency_condition_spec.rb +428 -0
- data/spec/models/dependency_spec.rb +90 -0
- data/spec/models/question_group_spec.rb +66 -0
- data/spec/models/question_spec.rb +176 -0
- data/spec/models/response_set_spec.rb +452 -0
- data/spec/models/response_spec.rb +208 -0
- data/spec/models/survey_section_spec.rb +58 -0
- data/spec/models/survey_spec.rb +155 -0
- data/spec/models/surveyor_gui/question_spec.rb +60 -0
- data/spec/models/surveyor_gui/question_type_spec.rb +268 -0
- data/spec/models/validation_condition_spec.rb +98 -0
- data/spec/models/validation_spec.rb +64 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +119 -0
- data/spec/support/scenario_outline_helper.rb +39 -0
- data/spec/support/shared.rb +10 -0
- data/spec/support/surveyforms_creation_helpers.rb +313 -0
- data/spec/support/surveyforms_rearrangement_helpers.rb +170 -0
- data/spec/support/surveyor_api_helpers.rb +15 -0
- data/spec/support/surveyor_ui_helpers.rb +108 -0
- data/spec/support/wait_for_ajax.rb +11 -0
- data/spec/views/questions/edit.html.erb_spec.rb +74 -0
- data/spec/views/surveyforms/edit.html.erb_spec.rb +126 -0
- data/surveyor_gui.gemspec +52 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/surveyor-gui_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- data/tmp/cache/assets/CF0/DA0/sprockets%2Fd7d5b37686831d37c4dd75e645f5e016 +0 -0
- data/tmp/cache/assets/E25/4C0/sprockets%2Fde2fd9fd11c04a582cdbbe3d84a35ae6 +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/custom.sass +5 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +600 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
<div class="question_editor shadebox">
|
2
|
+
<%= render "surveyor_gui/partials/url_helpers" %>
|
3
|
+
<h1 ><%= @title %></h1>
|
4
|
+
<%= simple_form_for [surveyor_gui, @question] do |f| %>
|
5
|
+
<div class = 'questions'>
|
6
|
+
<%= f.error_messages %>
|
7
|
+
<%= f.hidden_field :id %>
|
8
|
+
<%= f.hidden_field :survey_section_id %>
|
9
|
+
<%= f.hidden_field :display_order %>
|
10
|
+
<%= f.hidden_field :pick %>
|
11
|
+
<%= f.hidden_field :display_type %>
|
12
|
+
<%= f.hidden_field :modifiable %>
|
13
|
+
<%= f.hidden_field :question_group_id %>
|
14
|
+
|
15
|
+
<%= f.label :Question, :input_html=>{:size=>'15'} %>
|
16
|
+
<%= f.input :text , :label => false, :input_html=>{:size=>'55', value: adjusted_text} %>
|
17
|
+
<span class='fl'><strong>Mandatory?</strong></span>
|
18
|
+
<%= f.input :is_mandatory, :label => false, :wrapper_html=>{:class=>'fl notfirst'}%>
|
19
|
+
<br />
|
20
|
+
<br />
|
21
|
+
<strong>Question Type</strong><br/>
|
22
|
+
<div class="question_type">
|
23
|
+
<span class="question_type_grid1">
|
24
|
+
<%= f.input :question_type_id,
|
25
|
+
collection: question_type_subset([:pick_one]) ,
|
26
|
+
:as => :radio_buttons , :wrapper_html=>{:size=>'60'}, :label => false%>
|
27
|
+
</span>
|
28
|
+
<span class="question_type_grid1">
|
29
|
+
<%= f.input :question_type_id,
|
30
|
+
collection: question_type_subset([:pick_any]) ,
|
31
|
+
:as => :radio_buttons , :wrapper_html=>{:size=>'60'}, :label => false%>
|
32
|
+
</span>
|
33
|
+
<br />
|
34
|
+
<span class="question_type_grid">
|
35
|
+
<%= f.input :question_type_id,
|
36
|
+
collection: question_type_subset([:dropdown, :string, :number, :stars, :label, :box]) ,
|
37
|
+
:as => :radio_buttons , :wrapper_html=>{:size=>'60'}, :label => false%>
|
38
|
+
</span>
|
39
|
+
<span class="question_type_grid">
|
40
|
+
<%= f.input :question_type_id,
|
41
|
+
collection: question_type_subset([:date, :datetime, :time, :slider, :group_default ]) ,
|
42
|
+
:as => :radio_buttons , :wrapper_html=>{:size=>'60'}, :label => false%>
|
43
|
+
</span>
|
44
|
+
<span class="question_type_grid">
|
45
|
+
<%= f.input :question_type_id,
|
46
|
+
collection: question_type_subset([:file, :grid_one, :grid_any, :grid_dropdown, :group_inline, :repeater]) ,
|
47
|
+
:as => :radio_buttons , :wrapper_html=>{:size=>'60'}, :label => false %>
|
48
|
+
</span>
|
49
|
+
</div>
|
50
|
+
<br />
|
51
|
+
<div id="answer_choice">
|
52
|
+
<%= render 'picks', :f => f %>
|
53
|
+
</div>
|
54
|
+
<div id="number_questions"></div>
|
55
|
+
|
56
|
+
<div id="report_code" style="display:none">
|
57
|
+
<br />
|
58
|
+
<%= f.input :report_code, :label=>'Report Code', :label_html=>{:style=>'width:10em;'},:hint=>'Use this code to uniquely identify application data driven questions for reporting.' %>
|
59
|
+
<br />
|
60
|
+
</div>
|
61
|
+
<br />
|
62
|
+
</div>
|
63
|
+
<%= f.button :submit, 'Save Changes', :id=>'question_submit' %>
|
64
|
+
<% end %>
|
65
|
+
<% 20.times do -%><br/><% end -%>
|
66
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= c.hidden_field :id %>
|
2
|
+
<%= c.hidden_field :question_group_id %>
|
3
|
+
<div class="column-box">
|
4
|
+
<h3>Column #<%= 1 + c.index %> heading</h3>
|
5
|
+
<%= c.input :text, as: :string, label: false, placeholder: "column #{1+c.index}" %><br/>
|
6
|
+
<h3>Column #<%=1 + c.index %> choices</h3><br/>
|
7
|
+
<%= c.input :answers_textbox, :as => :text,
|
8
|
+
:wrapper_html => {:class=>'answers_collection'}, :label => false %>
|
9
|
+
</div>
|
10
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<%= simple_fields_for 'question', @questions do |f| %>
|
2
|
+
Number of columns:
|
3
|
+
<%= f.input :dropdown_column_count, :collection =>
|
4
|
+
10.times.map{|i| [(i+1).to_s + " column".pluralize(i+1), i+1]},
|
5
|
+
:as => :select, :label => false,
|
6
|
+
:include_blank => false, :wrapper_html=>{:class => 'shrink_slider'}
|
7
|
+
%>
|
8
|
+
<%= f.simple_fields_for :question_group, @question_group do |qg| %>
|
9
|
+
<%= qg.hidden_field :id %>
|
10
|
+
Columns: <span class="grid_textbox_hint">Columns: enter the choices for each column option on a separate line under "Column Options"</span><br/>
|
11
|
+
<div class="grid_dropdown_columns">
|
12
|
+
<span class="spacer"> </span>
|
13
|
+
<%= qg.simple_fields_for :columns do |c| %>
|
14
|
+
<%= render "grid_dropdown_columns", c: c %>
|
15
|
+
<% end -%>
|
16
|
+
</div>
|
17
|
+
<% end -%>
|
18
|
+
<div class="rows">
|
19
|
+
Rows: <span class="grid_textbox_hint">add each row as a new line</span><br/>
|
20
|
+
<%= f.input :grid_rows_textbox, :as => :text,
|
21
|
+
:wrapper_html => {:class=>'answers_collection'}, :label => false %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<br/><br/><br/>
|
25
|
+
<%= f.input :other_text,
|
26
|
+
label: "add a choice for",
|
27
|
+
hint: "user determines choice",
|
28
|
+
placeholder: "Other",
|
29
|
+
as: :string,
|
30
|
+
wrapper_html: {class: 'other_text fl'}
|
31
|
+
%>:
|
32
|
+
<%= f.input_field :other, label: false, as: :boolean %>
|
33
|
+
<br/><br/><br/>
|
34
|
+
<%= f.input :comments_text,
|
35
|
+
label: "at the bottom of questions, add",
|
36
|
+
hint: "box for notes/comments",
|
37
|
+
placeholder: "Comments",
|
38
|
+
as: :string,
|
39
|
+
wrapper_html: {class: 'comments_text fl'}
|
40
|
+
%>:
|
41
|
+
<%= f.input_field :comments, label: false, as: :boolean %>
|
42
|
+
<% end -%>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= simple_fields_for 'question', @questions do |f| %>
|
2
|
+
Columns: <span class="grid_textbox_hint">add each column as a new line</span><br/>
|
3
|
+
<%= f.input :grid_columns_textbox, :as => :text, :wrapper_html => {:class=>'answers_collection'}, :label => false %>
|
4
|
+
<br/><br/>
|
5
|
+
Rows: <span class="grid_textbox_hint">add each row as a new line</span><br/>
|
6
|
+
<%= f.input :grid_rows_textbox, :as => :text, :wrapper_html => {:class=>'answers_collection'}, :label => false %>
|
7
|
+
|
8
|
+
<%= render "answer_options", f: f %>
|
9
|
+
<% end -%>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= simple_fields_for 'question', @questions do |f| %>
|
2
|
+
<table class="number_hints">
|
3
|
+
<tr>
|
4
|
+
<td>Number Prefix</td><td>Number Suffix</td>
|
5
|
+
</tr>
|
6
|
+
<td>
|
7
|
+
<%= f.input :prefix, :label => false %>
|
8
|
+
</td>
|
9
|
+
<td>
|
10
|
+
<%= f.input :suffix, :label => false %>
|
11
|
+
<td>
|
12
|
+
<tr>
|
13
|
+
</table>
|
14
|
+
<%= f.simple_fields_for :answers, @questions.answers.first do |a| %>
|
15
|
+
<%= a.hidden_field :text %>
|
16
|
+
<% end -%>
|
17
|
+
<% end -%>
|
18
|
+
<br>
|
19
|
+
<span style='font-weight:normal;'>
|
20
|
+
Hint: affects how the number will be shown.<br/>
|
21
|
+
E.g. the number 60 could be shown as follows:<br/><br />
|
22
|
+
<table id="number_hint" style="margin-left:2em;">
|
23
|
+
<tr><td>Number Suffix</td><td>Number Prefix</td><td>Shown as</td>
|
24
|
+
<tr><td>$</td><td>USD</td><td>$60 USD</td>
|
25
|
+
<tr><td></td><td>Months</td><td>60 Months</td></tr>
|
26
|
+
<tr><td></td><td>Inches</td><td>60 Inches</td></tr>
|
27
|
+
</table>
|
28
|
+
</span>
|
29
|
+
<br />
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= simple_fields_for 'Question', @question do |f| %>
|
2
|
+
<span class='fl'>
|
3
|
+
Generate list from a database field?
|
4
|
+
</span>
|
5
|
+
<%= f.input :dynamically_generate, :as => :radio_buttons, :label => false, :wrapper_html=>{:class=>'fl notfirst'}, :input_html=>{:class=>'fl notfirst'} %><br /><br />
|
6
|
+
<div id="dynamic_source">
|
7
|
+
Specify statement used to generate list:<br />
|
8
|
+
<%= f.input :dynamic_source, :label=>false %>
|
9
|
+
</div>
|
10
|
+
<div id="fixed_source">
|
11
|
+
<strong>Possible Answers:</strong>
|
12
|
+
<div id='sortable_answers'>
|
13
|
+
<%= f.simple_fields_for @answers do |a| %>
|
14
|
+
<%= render 'answer_fields', :a => a %>
|
15
|
+
<% end %>
|
16
|
+
<p class="floatdown2">
|
17
|
+
Add Possible Answer<%= link_to_add_fields "Add Answer", @questions.id, f, :answers, 'a' %>
|
18
|
+
</p>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!--<span class='fl'>
|
2
|
+
Generate list from a database field?
|
3
|
+
</span>
|
4
|
+
<%= f.input :dynamically_generate, :as => :radio_buttons, :label => false, :wrapper_html=>{:class=>'fl notfirst'}, :input_html=>{:class=>'fl notfirst'} %><br /><br />
|
5
|
+
<div id="dynamic_source">
|
6
|
+
Specify statement used to generate list:<br />
|
7
|
+
<%= f.input :dynamic_source, :label=>false %>
|
8
|
+
</div>
|
9
|
+
-->
|
10
|
+
<div id="fixed_source">
|
11
|
+
<div id='sortable_answers'></div>
|
12
|
+
</div>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
- if [:pick_one,:pick_any,:dropdown,:number,:date,:datetime,:time,:stars,:slider,:grid_one, :grid_any, :grid_dropdown].include? q.question_type_id
|
2
|
+
%tr{:class => q.surveyresponse_class(@response_sets)}
|
3
|
+
%td
|
4
|
+
%tr{:class => q.surveyresponse_class(@response_sets)}
|
5
|
+
%td
|
6
|
+
%td
|
7
|
+
%td
|
8
|
+
- if q.display_type=='stars'
|
9
|
+
- 10.times.each do |index|
|
10
|
+
%input{name: "star#{q.id.to_s}", type: "radio", class: "star {split:2}", disabled: "disabled", checked: (index+1)==star_average(@responses,q) ? "checked" : nil}
|
11
|
+
- else
|
12
|
+
%div{:id => "hi_chart#{q.id}", :style => "height:410px; margin: 0; clear:both; min-width: 800px"}
|
13
|
+
= high_chart("hi_chart"+q.id.to_s , @chart[q.id.to_s]) do
|
14
|
+
- if q.pick == 'one' && !([:grid_one, :grid_dropdown].include? q.question_type_id)
|
15
|
+
= "options.tooltip.formatter = function() {return '<b>'+ this.point.name +'</b>: '+ this.y;}".html_safe
|
16
|
+
= "options.plotOptions.pie.dataLabels = {}".html_safe
|
17
|
+
= "options.plotOptions.pie.dataLabels.formatter = function() {return '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed()+' %';}".html_safe
|
18
|
+
- elsif q.question_type_id == :grid_dropdown
|
19
|
+
= "options.plotOptions.column.dataLabels.formatter = function() {if(this.y != 0) {return this.y;}}"
|
20
|
+
- else
|
21
|
+
= "options.tooltip.formatter = function() {return '<b>'+ this.x +'</b>: '+ this.y;}".html_safe
|
@@ -0,0 +1,42 @@
|
|
1
|
+
= render "graphs", q: question_group.questions.first
|
2
|
+
= render "surveyor_gui/shared/new_line"
|
3
|
+
%tr
|
4
|
+
%td
|
5
|
+
%td
|
6
|
+
%td
|
7
|
+
%table.report_data.report_data_display
|
8
|
+
%tr{:style => "font-weight:bold;"}
|
9
|
+
%td User Id
|
10
|
+
%td
|
11
|
+
- question_group.questions.is_not_comment.first.answers.each do |answer|
|
12
|
+
%td
|
13
|
+
= answer.text
|
14
|
+
- @response_sets.each do |response_set|
|
15
|
+
- question_group.questions.is_not_comment.each_with_index do |question, index|
|
16
|
+
%tr{class: index==0 ? "first_row" : nil}
|
17
|
+
%td
|
18
|
+
%span.user_id
|
19
|
+
= response_set.report_user_name
|
20
|
+
%td
|
21
|
+
= question.text
|
22
|
+
- question.answers.each do |answer|
|
23
|
+
%td
|
24
|
+
- if Response.where(response_set_id: response_set.id, question_id: question.id, answer_id: answer.id).count > 0
|
25
|
+
.ui-icon.ui-icon-check
|
26
|
+
= render "surveyor_gui/shared/grid_comments", question_group: question_group
|
27
|
+
= render "surveyor_gui/shared/new_line"
|
28
|
+
%table.report_data_functions
|
29
|
+
%tr
|
30
|
+
%td{:style => "font-weight:bold;"}
|
31
|
+
|
32
|
+
- question_group.questions.first.answers.each do |answer|
|
33
|
+
%td{:style => "font-weight:bold;"}
|
34
|
+
= answer.text
|
35
|
+
- question_group.questions.each do |q|
|
36
|
+
%tr
|
37
|
+
%td
|
38
|
+
= q.text
|
39
|
+
- q.answers.each do |answer|
|
40
|
+
%td.table_number
|
41
|
+
= @responses.where(question_id: q.id, answer_id: answer.id).count
|
42
|
+
= render "surveyor_gui/shared/new_line"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
- question_group.questions.each do |q|
|
2
|
+
= render "graphs", q: q
|
3
|
+
= render "surveyor_gui/shared/new_line"
|
4
|
+
%table.report_data.report_data_display
|
5
|
+
%tr{:style => "font-weight:bold;"}
|
6
|
+
%td
|
7
|
+
%td
|
8
|
+
%td User Id
|
9
|
+
%td
|
10
|
+
- question_group.columns.each do |column|
|
11
|
+
%td
|
12
|
+
= column.text
|
13
|
+
- @response_sets.each do |response_set|
|
14
|
+
- question_group.questions.is_not_comment.each_with_index do |question, index|
|
15
|
+
%tr{class: index==0 ? "first_row" : nil}
|
16
|
+
%td
|
17
|
+
%td
|
18
|
+
%td
|
19
|
+
%span.user_id
|
20
|
+
= response_set.report_user_name
|
21
|
+
%td
|
22
|
+
= question.text
|
23
|
+
- question_group.columns.each do |column|
|
24
|
+
%td
|
25
|
+
-if (response = Response.where(response_set_id: response_set.id, question_id: question.id, column_id: column.id).first)
|
26
|
+
= response.answer.text
|
27
|
+
= render "surveyor_gui/shared/grid_comments", question_group: question_group
|
28
|
+
= render "surveyor_gui/shared/new_line"
|
29
|
+
%table.report_data_functions
|
30
|
+
%tr
|
31
|
+
%td
|
32
|
+
%td
|
33
|
+
%td{:style => "font-weight:bold;"}
|
34
|
+
|
35
|
+
- question_group.columns.each do |column|
|
36
|
+
%td{style: "font-weight:bold; text-align: center;", colspan: "#{column.answers.count/question_group.questions.count}"}
|
37
|
+
= column.text
|
38
|
+
%tr
|
39
|
+
%td
|
40
|
+
%td
|
41
|
+
%td
|
42
|
+
- question_group.columns.each do |column|
|
43
|
+
- column.answers.map{|a| a.text}.uniq.each do |answer|
|
44
|
+
%td
|
45
|
+
= answer
|
46
|
+
- question_group.questions.is_not_comment.each do |q|
|
47
|
+
%tr
|
48
|
+
%td
|
49
|
+
%td
|
50
|
+
%td
|
51
|
+
= q.text
|
52
|
+
- question_group.columns.each do |column|
|
53
|
+
- Answer.where(question_id: q.id, column_id: column.id).each do |a|
|
54
|
+
%td.table_number
|
55
|
+
= @responses.where(question_id: q.id, column_id: column.id, answer_id: a.id).count
|
56
|
+
= render "surveyor_gui/shared/new_line"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%table
|
2
|
+
%tr.question_group
|
3
|
+
%td
|
4
|
+
%td
|
5
|
+
%td
|
6
|
+
%table
|
7
|
+
%tr.question_group_header
|
8
|
+
%td User Id
|
9
|
+
- question_group.questions.each do |group_question|
|
10
|
+
%td
|
11
|
+
= group_question.text
|
12
|
+
|
13
|
+
- questions = question_group.questions
|
14
|
+
- question_ids = questions.collect(&:id)
|
15
|
+
- responses = @responses.where('responses.question_id in (?)', question_ids).map{|r| {response_set_id: r.response_set_id, question_id: r.question_id, response: r.response_value}}
|
16
|
+
- @response_sets.each do |response_set|
|
17
|
+
- (responses.select{|response| response[:response_set_id]==response_set.id}.count/question_ids.count).times do |index|
|
18
|
+
%tr{class: index==0 ? "first_row" : nil}
|
19
|
+
%td
|
20
|
+
%span.user_id
|
21
|
+
= response_set.report_user_name
|
22
|
+
- questions.each do |question|
|
23
|
+
%td
|
24
|
+
- if response = responses.select{|response| response[:response_set_id] == response_set.id && response[:question_id] == question.id}[index]
|
25
|
+
- response_formatter = ReportFormatter.new(question, @responses)
|
26
|
+
= response_formatter.format_stats(response[:response])
|
27
|
+
= render "surveyor_gui/shared/new_line"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
- @question_no = 1
|
2
|
+
- @survey.survey_sections.each do |ss|
|
3
|
+
%h3= ss.title
|
4
|
+
%br
|
5
|
+
- ss.questions.each do |q|
|
6
|
+
%div{class: q.surveyresponse_class(@response_sets)}
|
7
|
+
%div{class: q.repeater? ? "repeater" : "non_repeater"}
|
8
|
+
- if q.part_of_group?
|
9
|
+
- @question_group = @question_group || QuestionGroupTracker.new(q.question_group)
|
10
|
+
- if @question_group.check_for_new_group(q)
|
11
|
+
- if ["default", "inline", "repeater", "grid"].include? q.question_group.display_type
|
12
|
+
%table
|
13
|
+
%tr
|
14
|
+
%td
|
15
|
+
|
16
|
+
%td{colspan: 3}
|
17
|
+
= @question_no.to_s+") #{q.question_group.text}"
|
18
|
+
- @question_no += 1
|
19
|
+
%tr
|
20
|
+
%td
|
21
|
+
- if ["default", "inline", "repeater"].include? q.question_group.display_type
|
22
|
+
- if q.question_group.display_type == "repeater"
|
23
|
+
= render "repeater", question_group: q.question_group
|
24
|
+
- q.question_group.questions.each do |group_question|
|
25
|
+
%table
|
26
|
+
= render "single_question", q: group_question
|
27
|
+
- elsif [:grid_one, :grid_any].include? q.question_type_id
|
28
|
+
= render "grid", question_group: q.question_group, question_type: q.question_type_id
|
29
|
+
- elsif q.question_type_id == :grid_dropdown
|
30
|
+
= render "grid_dropdown", question_group: q.question_group
|
31
|
+
- else
|
32
|
+
%table
|
33
|
+
= render "single_question", q: q
|
@@ -0,0 +1,70 @@
|
|
1
|
+
= render "surveyor_gui/shared/question_number", q: q
|
2
|
+
- if q.display_type == 'label'
|
3
|
+
= render "surveyor_gui/shared/new_line"
|
4
|
+
- else
|
5
|
+
= render "graphs", q: q
|
6
|
+
- if [:pick_one,:pick_any,:dropdown,:number,:date,:datetime,:time,:stars,:slider, :string, :box].include? q.question_type_id
|
7
|
+
= render "surveyor_gui/shared/new_line"
|
8
|
+
- if q.question_type_id == :stars
|
9
|
+
= render "surveyor_gui/shared/stars_report_data", q: q, toggle: true
|
10
|
+
- elsif [:number,:date,:datetime,:time].include? q.question_type_id
|
11
|
+
= render "surveyor_gui/shared/report_data", q: q, toggle: true
|
12
|
+
%tr
|
13
|
+
%td
|
14
|
+
%td
|
15
|
+
%td
|
16
|
+
%table.report_data_function
|
17
|
+
- response_formatter = ReportFormatter.new(q, @responses)
|
18
|
+
- if q.question_type_id == :numbers
|
19
|
+
%tr
|
20
|
+
%td{:style => "font-weight:bold;"} Total
|
21
|
+
%td.table_number
|
22
|
+
= q.prefix
|
23
|
+
= response_formatter.stats(:sum)
|
24
|
+
\ #{q.suffix}
|
25
|
+
%tr
|
26
|
+
%td{:style => "font-weight:bold;"} Min
|
27
|
+
%td.table_number
|
28
|
+
= q.prefix
|
29
|
+
= response_formatter.stats(:min)
|
30
|
+
\ #{q.suffix}
|
31
|
+
%tr
|
32
|
+
%td{:style => "font-weight:bold;"} Max
|
33
|
+
%td.table_number
|
34
|
+
= q.prefix
|
35
|
+
= response_formatter.stats(:max)
|
36
|
+
\ #{q.suffix}
|
37
|
+
%tr
|
38
|
+
%td{:style => "font-weight:bold;"} Average
|
39
|
+
%td.table_number
|
40
|
+
= q.prefix
|
41
|
+
= response_formatter.stats(:average)
|
42
|
+
\ #{q.suffix}
|
43
|
+
- elsif q.pick=='any' || q.pick=='one'
|
44
|
+
= render "surveyor_gui/shared/report_data", q: q, toggle: true
|
45
|
+
%tr
|
46
|
+
%td
|
47
|
+
%td
|
48
|
+
%td
|
49
|
+
%table.report_data_functions
|
50
|
+
%tr
|
51
|
+
%td{:style => "font-weight:bold;"}
|
52
|
+
Answer
|
53
|
+
%td{:style => "font-weight:bold;"}
|
54
|
+
Count
|
55
|
+
- q.answers.is_not_comment.each do |answer|
|
56
|
+
%tr
|
57
|
+
%td
|
58
|
+
= answer.text
|
59
|
+
%td.table_number
|
60
|
+
= @responses.where(question_id: q.id, answer_id: answer.id).count
|
61
|
+
- elsif !q.repeater?
|
62
|
+
= render "surveyor_gui/shared/report_data", q: q, toggle: false
|
63
|
+
= render "surveyor_gui/shared/new_line"
|
64
|
+
- elsif q.question_type_id == :file
|
65
|
+
%tr
|
66
|
+
%td
|
67
|
+
%td
|
68
|
+
%td
|
69
|
+
This question was used for file uploads.
|
70
|
+
= render "surveyor_gui/shared/new_line"
|