surveyor 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +0 -6
- data/README.md +40 -14
- data/app/helpers/surveyor_helper.rb +1 -85
- data/app/views/partials/_answer.html.haml +5 -4
- data/app/views/partials/_question.html.haml +7 -5
- data/app/views/partials/_question_group.html.haml +2 -2
- data/app/views/surveyor/export.json.rabl +75 -0
- data/app/views/surveyor/show.html.haml +75 -13
- data/app/views/surveyor/show.json.rabl +14 -0
- data/config/routes.rb +2 -3
- data/doc/surveyor reject or delete decision matrix.png +0 -0
- data/features/export_to_json.feature +96 -0
- data/features/show_survey.feature +42 -0
- data/features/step_definitions/{common_setps.rb → common_steps.rb} +0 -0
- data/features/step_definitions/surveyor_steps.rb +46 -12
- data/features/step_definitions/web_steps.rb +15 -5
- data/features/support/paths.rb +2 -1
- data/features/surveyor.feature +192 -41
- data/features/surveyor_parser.feature +10 -10
- data/features/{redcap_parser.feature → z_redcap_parser.feature} +9 -6
- data/lib/formtastic/surveyor_builder.rb +1 -4
- data/lib/generators/surveyor/install_generator.rb +6 -5
- data/lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb +9 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb +11 -0
- data/lib/generators/surveyor/templates/public/javascripts/surveyor/jquery-ui-timepicker-addon.js +1277 -0
- data/lib/generators/surveyor/templates/public/javascripts/surveyor/jquery-ui.js +11729 -0
- data/lib/generators/surveyor/templates/public/javascripts/surveyor/jquery.surveyor.js +54 -10
- data/lib/generators/surveyor/templates/public/stylesheets/sass/surveyor.sass +1 -1
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/jquery-ui-timepicker-addon.css +6 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/jquery-ui.custom.css +572 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-icons_ef8c08_256x240.png +0 -0
- data/lib/generators/surveyor/templates/public/stylesheets/surveyor/ui-icons_ffffff_256x240.png +0 -0
- data/lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md +14 -0
- data/lib/generators/surveyor/templates/surveys/MODIFYING_SURVEYOR.md +91 -0
- data/lib/generators/surveyor/templates/surveys/date_survey.rb +15 -0
- data/lib/generators/surveyor/templates/surveys/kitchen_sink_survey.rb +2 -2
- data/lib/surveyor/common.rb +31 -4
- data/lib/surveyor/helpers/surveyor_helper_methods.rb +99 -0
- data/lib/surveyor/models/answer_methods.rb +6 -5
- data/lib/surveyor/models/dependency_condition_methods.rb +0 -1
- data/lib/surveyor/models/dependency_methods.rb +1 -1
- data/lib/surveyor/models/question_group_methods.rb +5 -0
- data/lib/surveyor/models/question_methods.rb +5 -2
- data/lib/surveyor/models/response_methods.rb +44 -3
- data/lib/surveyor/models/response_set_methods.rb +14 -4
- data/lib/surveyor/models/survey_methods.rb +8 -2
- data/lib/surveyor/models/survey_section_methods.rb +13 -1
- data/lib/surveyor/parser.rb +18 -11
- data/lib/surveyor/render_text.rb +19 -0
- data/lib/surveyor/surveyor_controller_methods.rb +19 -1
- data/lib/surveyor/unparser.rb +1 -1
- data/lib/surveyor/version.rb +1 -1
- data/lib/tasks/surveyor_tasks.rake +1 -1
- data/spec/controllers/surveyor_controller_spec.rb +7 -3
- data/spec/helpers/surveyor_helper_spec.rb +104 -9
- data/spec/lib/chinese_survey.rb +14 -0
- data/spec/lib/common_spec.rb +52 -1
- data/spec/lib/rake_kitchen_sink.rb +40 -0
- data/spec/models/answer_spec.rb +11 -0
- data/spec/models/question_spec.rb +15 -0
- data/spec/models/response_set_spec.rb +45 -1
- data/spec/models/response_spec.rb +7 -4
- data/surveyor.gemspec +4 -2
- metadata +99 -40
- data/app/controllers/results_controller.rb +0 -13
- data/app/views/results/index.html.erb +0 -17
- data/app/views/results/show.html.erb +0 -25
@@ -1,13 +0,0 @@
|
|
1
|
-
class ResultsController < ApplicationController
|
2
|
-
helper 'surveyor'
|
3
|
-
layout 'results'
|
4
|
-
def index
|
5
|
-
@surveys = Survey.all
|
6
|
-
end
|
7
|
-
|
8
|
-
def show
|
9
|
-
@survey = Survey.find_by_access_code(params[:survey_code])
|
10
|
-
@response_sets = @survey.response_sets
|
11
|
-
@questions = @survey.sections_with_questions.map(&:questions).flatten
|
12
|
-
end
|
13
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<h1>Listing Surveys</h1>
|
2
|
-
|
3
|
-
<table class="list_table">
|
4
|
-
<tr>
|
5
|
-
<th>ID</th>
|
6
|
-
<th>Name</th>
|
7
|
-
<th>Operation</th>
|
8
|
-
</tr>
|
9
|
-
|
10
|
-
<% @surveys.each do |survey| -%>
|
11
|
-
<tr>
|
12
|
-
<td><%=h survey.id %></td>
|
13
|
-
<td><%=h survey.title %></td>
|
14
|
-
<td><%= link_to "show results list(#{survey.response_sets.count})", result_path(survey.access_code) %></td>
|
15
|
-
</tr>
|
16
|
-
<% end %>
|
17
|
-
</table>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<table class="list_table">
|
2
|
-
<tr>
|
3
|
-
<th>ID</th>
|
4
|
-
<th>Code</th>
|
5
|
-
<% @questions.each do |question| %>
|
6
|
-
<% next if question.display_order == 1 %>
|
7
|
-
<th><%= "[" +question.display_order.to_s + "]" + question.text %></th>
|
8
|
-
<% end %>
|
9
|
-
</tr>
|
10
|
-
|
11
|
-
<% @response_sets.each do |r_set| %>
|
12
|
-
<tr>
|
13
|
-
<td><%=h r_set.id %></td>
|
14
|
-
<td><%=h r_set.access_code %></td>
|
15
|
-
<% @questions.each do |question| %>
|
16
|
-
<% next if question.display_order == 1 %>
|
17
|
-
<td><%= display_response(r_set,question) %></td>
|
18
|
-
<% end %>
|
19
|
-
</tr>
|
20
|
-
<% end %>
|
21
|
-
</table>
|
22
|
-
|
23
|
-
<br />
|
24
|
-
|
25
|
-
<%= link_to "Back", results_path %>
|