upgrade_surveyor 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +30 -0
- data/.rspec +1 -0
- data/.travis.yml +18 -0
- data/CHANGELOG.md +253 -0
- data/Gemfile +5 -0
- data/Gemfile.rails_version +25 -0
- data/MIT-LICENSE +20 -0
- data/README.md +164 -0
- data/Rakefile +65 -0
- data/app/controllers/surveyor_controller.rb +5 -0
- data/app/helpers/results_helper.rb +20 -0
- data/app/helpers/survey_form_builder.rb +37 -0
- data/app/helpers/surveyor_helper.rb +3 -0
- data/app/inputs/quiet_input.rb +5 -0
- data/app/inputs/surveyor_check_boxes_input.rb +35 -0
- data/app/inputs/surveyor_radio_input.rb +18 -0
- data/app/models/answer.rb +3 -0
- data/app/models/dependency.rb +3 -0
- data/app/models/dependency_condition.rb +3 -0
- data/app/models/permitted_params.rb +102 -0
- data/app/models/question.rb +3 -0
- data/app/models/question_group.rb +3 -0
- data/app/models/response.rb +4 -0
- data/app/models/response_set.rb +3 -0
- data/app/models/survey.rb +3 -0
- data/app/models/survey_section.rb +4 -0
- data/app/models/survey_translation.rb +4 -0
- data/app/models/validation.rb +3 -0
- data/app/models/validation_condition.rb +3 -0
- data/app/views/layouts/results.html.erb +13 -0
- data/app/views/layouts/surveyor_default.html.erb +12 -0
- data/app/views/partials/_answer.html.haml +25 -0
- data/app/views/partials/_dependents.html.haml +5 -0
- data/app/views/partials/_question.html.haml +28 -0
- data/app/views/partials/_question_group.html.haml +44 -0
- data/app/views/partials/_section.html.haml +12 -0
- data/app/views/partials/_section_menu.html.haml +12 -0
- data/app/views/surveyor/edit.html.haml +21 -0
- data/app/views/surveyor/export.json.rabl +85 -0
- data/app/views/surveyor/new.html.haml +24 -0
- data/app/views/surveyor/show.html.haml +74 -0
- data/app/views/surveyor/show.json.rabl +15 -0
- data/config/routes.rb +8 -0
- data/doc/REPRESENTATIONS.md +34 -0
- data/doc/api_id_schema.json +7 -0
- data/doc/question types.png +0 -0
- data/doc/response_set_schema.json +54 -0
- data/doc/surveyor question combinations.png +0 -0
- data/doc/surveyor reject or delete decision matrix.png +0 -0
- data/doc/surveyor_models.png +0 -0
- data/doc/surveyor_models2.png +0 -0
- data/doc/surveyor_timestamp_schema.json +9 -0
- data/lib/assets/images/surveyor/next.gif +0 -0
- data/lib/assets/images/surveyor/prev.gif +0 -0
- data/lib/assets/images/surveyor/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/assets/images/surveyor/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/assets/images/surveyor/ui-icons_222222_256x240.png +0 -0
- data/lib/assets/images/surveyor/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/assets/images/surveyor/ui-icons_454545_256x240.png +0 -0
- data/lib/assets/images/surveyor/ui-icons_888888_256x240.png +0 -0
- data/lib/assets/images/surveyor/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/assets/javascripts/surveyor/jquery-1.9.0.js +9555 -0
- data/lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js +14850 -0
- data/lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js +1919 -0
- data/lib/assets/javascripts/surveyor/jquery.maskedinput.js +338 -0
- data/lib/assets/javascripts/surveyor/jquery.selectToUISlider.js +240 -0
- data/lib/assets/javascripts/surveyor/jquery.surveyor.js +154 -0
- data/lib/assets/stylesheets/surveyor/jquery-ui-1.10.0.custom.sass +1380 -0
- data/lib/assets/stylesheets/surveyor/jquery-ui-timepicker-addon.css +11 -0
- data/lib/assets/stylesheets/surveyor/reset.css +48 -0
- data/lib/assets/stylesheets/surveyor/results.css +125 -0
- data/lib/assets/stylesheets/surveyor/ui.slider.extras.css +110 -0
- data/lib/assets/stylesheets/surveyor.sass +132 -0
- data/lib/generators/surveyor/custom_generator.rb +18 -0
- data/lib/generators/surveyor/install_generator.rb +98 -0
- data/lib/generators/surveyor/templates/app/assets/javascripts/surveyor_all.js +6 -0
- data/lib/generators/surveyor/templates/app/assets/stylesheets/surveyor_all.css +9 -0
- data/lib/generators/surveyor/templates/app/controllers/surveyor_controller.rb +40 -0
- data/lib/generators/surveyor/templates/app/views/layouts/surveyor_custom.html.erb +13 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_en.yml +19 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_es.yml +19 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_he.yml +19 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_ko.yml +19 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_ids.rb +14 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb +12 -0
- data/lib/generators/surveyor/templates/db/migrate/add_correct_answer_id_to_questions.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_default_value_to_answers.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_display_order_to_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_display_type_to_answers.rb +14 -0
- data/lib/generators/surveyor/templates/db/migrate/add_index_to_response_sets.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_index_to_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_input_mask_attributes_to_answer.rb +12 -0
- data/lib/generators/surveyor/templates/db/migrate/add_section_id_to_responses.rb +12 -0
- data/lib/generators/surveyor/templates/db/migrate/add_unique_index_on_access_code_and_version_in_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb +18 -0
- data/lib/generators/surveyor/templates/db/migrate/add_version_to_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/api_ids_must_be_unique.rb +23 -0
- data/lib/generators/surveyor/templates/db/migrate/create_answers.rb +38 -0
- data/lib/generators/surveyor/templates/db/migrate/create_dependencies.rb +23 -0
- data/lib/generators/surveyor/templates/db/migrate/create_dependency_conditions.rb +30 -0
- data/lib/generators/surveyor/templates/db/migrate/create_question_groups.rb +28 -0
- data/lib/generators/surveyor/templates/db/migrate/create_questions.rb +37 -0
- data/lib/generators/surveyor/templates/db/migrate/create_response_sets.rb +23 -0
- data/lib/generators/surveyor/templates/db/migrate/create_responses.rb +34 -0
- data/lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb +30 -0
- data/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb +19 -0
- data/lib/generators/surveyor/templates/db/migrate/create_surveys.rb +32 -0
- data/lib/generators/surveyor/templates/db/migrate/create_validation_conditions.rb +33 -0
- data/lib/generators/surveyor/templates/db/migrate/create_validations.rb +21 -0
- data/lib/generators/surveyor/templates/db/migrate/drop_unique_index_on_access_code_in_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/update_blank_api_ids_on_question_group.rb +22 -0
- data/lib/generators/surveyor/templates/db/migrate/update_blank_versions_on_surveys.rb +13 -0
- data/lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md +52 -0
- data/lib/generators/surveyor/templates/surveys/MODIFYING_SURVEYOR.md +91 -0
- data/lib/generators/surveyor/templates/surveys/date_survey.rb +16 -0
- data/lib/generators/surveyor/templates/surveys/kitchen_sink_survey.rb +280 -0
- data/lib/generators/surveyor/templates/surveys/languages.rb +14 -0
- data/lib/generators/surveyor/templates/surveys/quiz.rb +11 -0
- data/lib/generators/surveyor/templates/surveys/translations/languages.es.yml +18 -0
- data/lib/generators/surveyor/templates/surveys/translations/languages.he.yml +18 -0
- data/lib/generators/surveyor/templates/surveys/translations/languages.ko.yml +18 -0
- data/lib/generators/surveyor/templates/vendor/assets/stylesheets/custom.sass +5 -0
- data/lib/surveyor/acts_as_response.rb +19 -0
- data/lib/surveyor/common.rb +59 -0
- data/lib/surveyor/engine.rb +15 -0
- data/lib/surveyor/helpers/formtastic_custom_input.rb +13 -0
- data/lib/surveyor/helpers/surveyor_helper_methods.rb +86 -0
- data/lib/surveyor/models/answer_methods.rb +76 -0
- data/lib/surveyor/models/dependency_condition_methods.rb +65 -0
- data/lib/surveyor/models/dependency_methods.rb +57 -0
- data/lib/surveyor/models/question_group_methods.rb +62 -0
- data/lib/surveyor/models/question_methods.rb +103 -0
- data/lib/surveyor/models/response_methods.rb +125 -0
- data/lib/surveyor/models/response_set_methods.rb +187 -0
- data/lib/surveyor/models/survey_methods.rb +95 -0
- data/lib/surveyor/models/survey_section_methods.rb +48 -0
- data/lib/surveyor/models/survey_translation_methods.rb +28 -0
- data/lib/surveyor/models/validation_condition_methods.rb +42 -0
- data/lib/surveyor/models/validation_methods.rb +41 -0
- data/lib/surveyor/mustache_context.rb +13 -0
- data/lib/surveyor/parser.rb +427 -0
- data/lib/surveyor/redcap_parser.rb +288 -0
- data/lib/surveyor/surveyor_controller_methods.rb +237 -0
- data/lib/surveyor/unparser.rb +161 -0
- data/lib/surveyor/version.rb +3 -0
- data/lib/surveyor.rb +13 -0
- data/lib/tasks/surveyor_tasks.rake +88 -0
- data/rails/init.rb +1 -0
- data/spec/controllers/surveyor_controller_spec.rb +304 -0
- data/spec/factories.rb +166 -0
- data/spec/features/ajax_spec.rb +205 -0
- data/spec/features/api_spec.rb +157 -0
- data/spec/features/duplicate_prevention_spec.rb +50 -0
- data/spec/features/translations_spec.rb +116 -0
- data/spec/features/ui_spec.rb +466 -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 +114 -0
- data/spec/lib/common_spec.rb +37 -0
- data/spec/lib/parser_spec.rb +393 -0
- data/spec/lib/rake_kitchen_sink.rb +40 -0
- data/spec/lib/redcap_parser_spec.rb +129 -0
- data/spec/lib/tasks_spec.rake +26 -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 +447 -0
- data/spec/models/response_spec.rb +205 -0
- data/spec/models/survey_section_spec.rb +58 -0
- data/spec/models/survey_spec.rb +155 -0
- data/spec/models/validation_condition_spec.rb +98 -0
- data/spec/models/validation_spec.rb +64 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +99 -0
- data/spec/support/shared.rb +5 -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/surveyor.gemspec +40 -0
- data/switch.sh +53 -0
- metadata +510 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
module Surveyor
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
|
7
|
+
source_root File.expand_path("../templates", __FILE__)
|
8
|
+
desc "Generate surveyor README, migrations, assets and sample survey"
|
9
|
+
class_option :skip_migrations, :type => :boolean, :desc => "skip migrations, but generate everything else"
|
10
|
+
|
11
|
+
SURVEYOR_MIGRATIONS = %w(
|
12
|
+
create_surveys
|
13
|
+
create_survey_sections
|
14
|
+
create_questions
|
15
|
+
create_question_groups create_answers
|
16
|
+
create_response_sets
|
17
|
+
create_responses
|
18
|
+
create_dependencies
|
19
|
+
create_dependency_conditions
|
20
|
+
create_validations
|
21
|
+
create_validation_conditions
|
22
|
+
add_display_order_to_surveys
|
23
|
+
add_correct_answer_id_to_questions
|
24
|
+
add_index_to_response_sets
|
25
|
+
add_index_to_surveys
|
26
|
+
add_unique_indicies
|
27
|
+
add_section_id_to_responses
|
28
|
+
add_default_value_to_answers
|
29
|
+
add_api_ids
|
30
|
+
add_display_type_to_answers
|
31
|
+
add_api_id_to_question_groups
|
32
|
+
add_api_ids_to_response_sets_and_responses
|
33
|
+
update_blank_api_ids_on_question_group
|
34
|
+
drop_unique_index_on_access_code_in_surveys
|
35
|
+
add_version_to_surveys
|
36
|
+
add_unique_index_on_access_code_and_version_in_surveys
|
37
|
+
update_blank_versions_on_surveys
|
38
|
+
api_ids_must_be_unique
|
39
|
+
create_survey_translations
|
40
|
+
add_input_mask_attributes_to_answer
|
41
|
+
)
|
42
|
+
|
43
|
+
def readme
|
44
|
+
copy_file "../../../../README.md", "surveys/README.md"
|
45
|
+
end
|
46
|
+
def migrations
|
47
|
+
unless options[:skip_migrations]
|
48
|
+
check_for_orphaned_migration_files
|
49
|
+
|
50
|
+
# increment migration timestamps to prevent collisions. copied functionality from RAILS_GEM_PATH/lib/rails_generator/commands.rb
|
51
|
+
SURVEYOR_MIGRATIONS.each_with_index do |name, i|
|
52
|
+
unless (prev_migrations = check_for_existing_migrations(name)).empty?
|
53
|
+
prev_migration_timestamp = prev_migrations[0].match(/([0-9]+)_#{name}.rb$/)[1]
|
54
|
+
end
|
55
|
+
copy_file("db/migrate/#{name}.rb", "db/migrate/#{(prev_migration_timestamp || Time.now.utc.strftime("%Y%m%d%H%M%S").to_i + i).to_s}_#{name}.rb")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def routes
|
61
|
+
route('mount Surveyor::Engine => "/surveys", :as => "surveyor"')
|
62
|
+
end
|
63
|
+
|
64
|
+
def assets
|
65
|
+
directory "app/assets"
|
66
|
+
copy_file "vendor/assets/stylesheets/custom.sass"
|
67
|
+
end
|
68
|
+
|
69
|
+
def surveys
|
70
|
+
copy_file "surveys/kitchen_sink_survey.rb"
|
71
|
+
copy_file "surveys/quiz.rb"
|
72
|
+
copy_file "surveys/date_survey.rb"
|
73
|
+
copy_file "surveys/languages.rb"
|
74
|
+
directory "surveys/translations"
|
75
|
+
end
|
76
|
+
|
77
|
+
def locales
|
78
|
+
directory "config/locales"
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def check_for_existing_migrations(name)
|
84
|
+
Dir.glob("db/migrate/[0-9]*_*.rb").grep(/[0-9]+_#{name}.rb$/)
|
85
|
+
end
|
86
|
+
def check_for_orphaned_migration_files
|
87
|
+
migration_files = Dir[File.join(self.class.source_root, 'db/migrate/*.rb')]
|
88
|
+
orphans = migration_files.collect { |f| File.basename(f).sub(/\.rb$/, '') } - SURVEYOR_MIGRATIONS
|
89
|
+
unless orphans.empty?
|
90
|
+
fail "%s migration%s not added to SURVEYOR_MIGRATIONS: %s" % [
|
91
|
+
orphans.size,
|
92
|
+
orphans.size == 1 ? '' : 's',
|
93
|
+
orphans.join(', ')
|
94
|
+
]
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module SurveyorControllerCustomMethods
|
3
|
+
def self.included(base)
|
4
|
+
# base.send :before_filter, :require_user # AuthLogic
|
5
|
+
# base.send :before_filter, :login_required # Restful Authentication
|
6
|
+
# base.send :layout, 'surveyor_custom'
|
7
|
+
end
|
8
|
+
|
9
|
+
# Actions
|
10
|
+
def new
|
11
|
+
super
|
12
|
+
# @title = "You can take these surveys"
|
13
|
+
end
|
14
|
+
def create
|
15
|
+
super
|
16
|
+
end
|
17
|
+
def show
|
18
|
+
super
|
19
|
+
end
|
20
|
+
def edit
|
21
|
+
super
|
22
|
+
end
|
23
|
+
def update
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
# Paths
|
28
|
+
def surveyor_index
|
29
|
+
# most of the above actions redirect to this method
|
30
|
+
super # surveyor.available_surveys_path
|
31
|
+
end
|
32
|
+
def surveyor_finish
|
33
|
+
# the update action redirects to this method if given params[:finish]
|
34
|
+
super # surveyor.available_surveys_path
|
35
|
+
end
|
36
|
+
end
|
37
|
+
class SurveyorController < ApplicationController
|
38
|
+
include Surveyor::SurveyorControllerMethods
|
39
|
+
include SurveyorControllerCustomMethods
|
40
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Survey: <%= controller.action_name %></title>
|
8
|
+
<%= surveyor_includes %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<%= yield %>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Sample localization file for English. Add more files in this directory for other locales.
|
3
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
4
|
+
|
5
|
+
en:
|
6
|
+
surveyor:
|
7
|
+
take_these_surveys: "You may take these surveys"
|
8
|
+
take_it: "Take it"
|
9
|
+
completed_survey: "Completed survey"
|
10
|
+
unable_to_find_your_responses: "Unable to find your responses to the survey"
|
11
|
+
unable_to_update_survey: "Unable to update survey"
|
12
|
+
unable_to_find_that_survey: "Unable to find that survey"
|
13
|
+
survey_started_success: "Survey started successfully"
|
14
|
+
click_here_to_finish: "Click here to finish"
|
15
|
+
previous_section: "« Previous section"
|
16
|
+
next_section: "Next section »"
|
17
|
+
select_one: "Select one ..."
|
18
|
+
sections: "Sections"
|
19
|
+
language: "Language"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Sample localization file for Spanish. Add more files in this directory for other locales.
|
3
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
4
|
+
|
5
|
+
es:
|
6
|
+
surveyor:
|
7
|
+
take_these_surveys: "Bienvenido, usted puede tomar estas encuestas"
|
8
|
+
take_it: "Tomar"
|
9
|
+
completed_survey: "Encuesta completada"
|
10
|
+
unable_to_find_your_responses: "No se puede encontrar sus respuestas a la encuesta"
|
11
|
+
unable_to_update_survey: "No se puede actualizar la encuesta"
|
12
|
+
unable_to_find_that_survey: "No se puede encontrar la encuesta"
|
13
|
+
survey_started_success: "Encuesta iniciada correctamente"
|
14
|
+
click_here_to_finish: "Haga clic aquí para terminar"
|
15
|
+
previous_section: "« Sección anterior"
|
16
|
+
next_section: "Sección siguiente »"
|
17
|
+
select_one: "Seleccione una ..."
|
18
|
+
sections: "Secciones"
|
19
|
+
language: "Idioma"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Localization file for Hebrew. Add more files in this directory for other locales.
|
3
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
4
|
+
|
5
|
+
he:
|
6
|
+
surveyor:
|
7
|
+
take_these_surveys: "תוכלו לבצע סקרים אלו"
|
8
|
+
take_it: "בצע"
|
9
|
+
completed_survey: "סיום הסקר"
|
10
|
+
unable_to_find_your_responses: "לא נמצאו תשובותיך לסקר"
|
11
|
+
unable_to_update_survey: ""
|
12
|
+
unable_to_find_that_survey: "לא ניתן לאתר את הסקר המבוקש"
|
13
|
+
survey_started_success: "הסקר הוחל בהצלחה"
|
14
|
+
click_here_to_finish: "לסיום"
|
15
|
+
previous_section: "חזרה »"
|
16
|
+
next_section: "« המשך"
|
17
|
+
select_one: "בחר/י"
|
18
|
+
sections: "סעיפים"
|
19
|
+
language: "שפה"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Sample localization file for Korean. Add more files in this directory for other locales.
|
3
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
4
|
+
|
5
|
+
ko:
|
6
|
+
surveyor:
|
7
|
+
take_these_surveys: "설문에 답을 하셔도 좋습니다"
|
8
|
+
take_it: "답을 하십시요"
|
9
|
+
completed_survey: "완료된 설문"
|
10
|
+
unable_to_find_your_responses: "설문에 대한 답을 찾을 수 없습니다"
|
11
|
+
unable_to_update_survey: "설문을 업데이트 할 수 없습니다"
|
12
|
+
unable_to_find_that_survey: "이 설문을 찾을 수 없습니다"
|
13
|
+
survey_started_success: "설문 조사가 성공적으로 시작되었습니다"
|
14
|
+
click_here_to_finish: "종료 하려면 여기를 누르십시요"
|
15
|
+
previous_section: "« 이전 항목으로"
|
16
|
+
next_section: "다음 항목으로 »"
|
17
|
+
select_one: "하나를 선택하십시요"
|
18
|
+
sections: "항목"
|
19
|
+
language: "언어"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddApiIds < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :surveys, :api_id, :string
|
5
|
+
add_column :questions, :api_id, :string
|
6
|
+
add_column :answers, :api_id, :string
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_column :surveys, :api_id
|
11
|
+
remove_column :questions, :api_id
|
12
|
+
remove_column :answers, :api_id
|
13
|
+
end
|
14
|
+
end
|
data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddApiIdsToResponseSetsAndResponses < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :response_sets, :api_id, :string
|
5
|
+
add_column :responses, :api_id, :string
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
remove_column :response_sets, :api_id
|
10
|
+
remove_column :responses, :api_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddDisplayTypeToAnswers < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :answers, :display_type, :string
|
5
|
+
Answer.all.each{|a| a.update_attributes(:display_type => "hidden_label") if a.hide_label == true}
|
6
|
+
remove_column :answers, :hide_label
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
add_column :answers, :hide_label, :boolean
|
11
|
+
Answer.all.each{|a| a.update_attributes(:hide_label => true) if a.display_type == "hidden_label"}
|
12
|
+
remove_column :answers, :display_type
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddIndexToResponseSets < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_index(:response_sets, :access_code, :name => 'response_sets_ac_idx')
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_index(:response_sets, :name => 'response_sets_ac_idx')
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddInputMaskAttributesToAnswer < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :answers, :input_mask, :string
|
5
|
+
add_column :answers, :input_mask_placeholder, :string
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
remove_column :answers, :input_mask
|
10
|
+
remove_column :answers, :input_mask_placeholder
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddSectionIdToResponses < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :responses, :survey_section_id, :integer
|
5
|
+
add_index :responses, :survey_section_id
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
remove_index :responses, :survey_section_id
|
10
|
+
remove_column :responses, :survey_section_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddUniqueIndexOnAccessCodeAndVersionInSurveys < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_index(:surveys, [ :access_code, :survey_version], :name => 'surveys_access_code_version_idx', :unique => true)
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_index( :surveys, :name => 'surveys_access_code_version_idx' )
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
class AddUniqueIndicies < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
remove_index(:response_sets, :name => 'response_sets_ac_idx')
|
5
|
+
add_index(:response_sets, :access_code, :name => 'response_sets_ac_idx', :unique => true)
|
6
|
+
|
7
|
+
remove_index(:surveys, :name => 'surveys_ac_idx')
|
8
|
+
add_index(:surveys, :access_code, :name => 'surveys_ac_idx', :unique => true)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
remove_index(:response_sets, :name => 'response_sets_ac_idx')
|
13
|
+
add_index(:response_sets, :access_code, :name => 'response_sets_ac_idx')
|
14
|
+
|
15
|
+
remove_index(:surveys, :name => 'surveys_ac_idx')
|
16
|
+
add_index(:surveys, :access_code, :name => 'surveys_ac_idx')
|
17
|
+
end
|
18
|
+
end
|