surveillance 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +42 -0
- data/Rakefile +23 -0
- data/app/assets/javascripts/surveillance.js +6 -0
- data/app/assets/javascripts/surveillance/admin.coffee +4 -0
- data/app/assets/javascripts/surveillance/admin/matrix-questions.coffee +18 -0
- data/app/assets/javascripts/surveillance/application.js +17 -0
- data/app/assets/javascripts/surveillance/collections/branch_rule_collection.coffee +2 -0
- data/app/assets/javascripts/surveillance/form.coffee +7 -0
- data/app/assets/javascripts/surveillance/manifest.coffee +7 -0
- data/app/assets/javascripts/surveillance/models/branch_rule.coffee +21 -0
- data/app/assets/javascripts/surveillance/models/question.coffee +19 -0
- data/app/assets/javascripts/surveillance/models/questions/choosable_question.coffee +15 -0
- data/app/assets/javascripts/surveillance/models/questions/matrix.coffee +19 -0
- data/app/assets/javascripts/surveillance/models/questions/matrix_question.coffee +7 -0
- data/app/assets/javascripts/surveillance/models/questions/number.coffee +17 -0
- data/app/assets/javascripts/surveillance/vendor/backbone.min.js +1 -0
- data/app/assets/javascripts/surveillance/vendor/bootstrap.js +2118 -0
- data/app/assets/javascripts/surveillance/vendor/jquery-ui-sortable.js +2256 -0
- data/app/assets/javascripts/surveillance/vendor/jquery.scrollto.js +210 -0
- data/app/assets/javascripts/surveillance/vendor/underscore.min.js +5 -0
- data/app/assets/javascripts/surveillance/views/attempt_view.coffee +74 -0
- data/app/assets/javascripts/surveillance/views/question_view.coffee +53 -0
- data/app/assets/javascripts/surveillance/views/questions/choice_view.coffee +52 -0
- data/app/assets/javascripts/surveillance/views/questions/matrix_question_view.coffee +26 -0
- data/app/assets/javascripts/surveillance/views/questions/matrix_view.coffee +21 -0
- data/app/assets/javascripts/surveillance/views/questions/number_view.coffee +19 -0
- data/app/assets/javascripts/surveillance/views/questions/order.coffee +9 -0
- data/app/assets/javascripts/surveillance/views/questions/select_matrix_view.coffee +31 -0
- data/app/assets/javascripts/surveillance/views/section_view.coffee +54 -0
- data/app/assets/stylesheets/surveillance/admin.sass +1 -0
- data/app/assets/stylesheets/surveillance/application.css +14 -0
- data/app/assets/stylesheets/surveillance/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/surveillance/fonts/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/stylesheets/surveillance/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/surveillance/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/surveillance/overrides.sass +2 -0
- data/app/assets/stylesheets/surveillance/vendor/bootstrap.css +6175 -0
- data/app/controllers/concerns/surveillance/attempts_management_concern.rb +51 -0
- data/app/controllers/concerns/surveillance/base_controller_concern.rb +37 -0
- data/app/controllers/surveillance/admin/attempts_controller.rb +38 -0
- data/app/controllers/surveillance/admin/base_controller.rb +15 -0
- data/app/controllers/surveillance/admin/exports_controller.rb +24 -0
- data/app/controllers/surveillance/admin/options_controller.rb +44 -0
- data/app/controllers/surveillance/admin/questions_controller.rb +59 -0
- data/app/controllers/surveillance/admin/sections_controller.rb +46 -0
- data/app/controllers/surveillance/admin/surveys_controller.rb +43 -0
- data/app/controllers/surveillance/application_controller.rb +7 -0
- data/app/controllers/surveillance/response/attempts_controller.rb +50 -0
- data/app/controllers/surveillance/response/base_controller.rb +38 -0
- data/app/controllers/surveillance/response/partial_attempts_controller.rb +15 -0
- data/app/controllers/surveillance/surveys_controller.rb +6 -0
- data/app/helpers/surveillance/admin/exports_helper.rb +37 -0
- data/app/helpers/surveillance/application_helper.rb +84 -0
- data/app/models/surveillance/answer.rb +56 -0
- data/app/models/surveillance/answer_content.rb +7 -0
- data/app/models/surveillance/attempt.rb +146 -0
- data/app/models/surveillance/branch_rule.rb +52 -0
- data/app/models/surveillance/field_setting.rb +6 -0
- data/app/models/surveillance/option.rb +18 -0
- data/app/models/surveillance/question.rb +50 -0
- data/app/models/surveillance/section.rb +16 -0
- data/app/models/surveillance/survey.rb +38 -0
- data/app/views/layouts/surveillance/application.html.haml +11 -0
- data/app/views/surveillance/admin/attempts/index.html.haml +47 -0
- data/app/views/surveillance/admin/attempts/list.html.haml +11 -0
- data/app/views/surveillance/admin/attempts/overview.html.haml +6 -0
- data/app/views/surveillance/admin/attempts/show.html.haml +62 -0
- data/app/views/surveillance/admin/exports/show.rxls +39 -0
- data/app/views/surveillance/admin/options/_field.html.haml +11 -0
- data/app/views/surveillance/admin/options/_form.html.haml +8 -0
- data/app/views/surveillance/admin/options/_list.html.haml +10 -0
- data/app/views/surveillance/admin/options/_option.html.haml +13 -0
- data/app/views/surveillance/admin/options/edit.html.haml +7 -0
- data/app/views/surveillance/admin/options/new.html.haml +7 -0
- data/app/views/surveillance/admin/questions/_form.html.haml +35 -0
- data/app/views/surveillance/admin/questions/_list.html.haml +17 -0
- data/app/views/surveillance/admin/questions/_question.html.haml +27 -0
- data/app/views/surveillance/admin/questions/edit.html.haml +7 -0
- data/app/views/surveillance/admin/questions/new.html.haml +4 -0
- data/app/views/surveillance/admin/sections/_form.html.haml +16 -0
- data/app/views/surveillance/admin/sections/_list.html.haml +13 -0
- data/app/views/surveillance/admin/sections/_section.html.haml +16 -0
- data/app/views/surveillance/admin/sections/edit.html.haml +7 -0
- data/app/views/surveillance/admin/sections/new.html.haml +4 -0
- data/app/views/surveillance/admin/surveys/_form.html.haml +22 -0
- data/app/views/surveillance/admin/surveys/_list.html.haml +13 -0
- data/app/views/surveillance/admin/surveys/_survey.html.haml +32 -0
- data/app/views/surveillance/admin/surveys/edit.html.haml +7 -0
- data/app/views/surveillance/admin/surveys/index.html.haml +1 -0
- data/app/views/surveillance/admin/surveys/new.html.haml +4 -0
- data/app/views/surveillance/field/date/_form.html.haml +5 -0
- data/app/views/surveillance/field/date/_overview.html.haml +2 -0
- data/app/views/surveillance/field/date/_show.html.haml +10 -0
- data/app/views/surveillance/field/matrix/_form.html.haml +40 -0
- data/app/views/surveillance/field/matrix/_overview.html.haml +19 -0
- data/app/views/surveillance/field/matrix/_questions_fields.html.haml +11 -0
- data/app/views/surveillance/field/matrix/_settings.html.haml +18 -0
- data/app/views/surveillance/field/matrix/_show.html.haml +22 -0
- data/app/views/surveillance/field/multiple_choices/_form.html.haml +18 -0
- data/app/views/surveillance/field/multiple_choices/_settings.html.haml +21 -0
- data/app/views/surveillance/field/multiple_choices/_show.html.haml +21 -0
- data/app/views/surveillance/field/multiple_choices_matrix/_form.html.haml +33 -0
- data/app/views/surveillance/field/multiple_choices_matrix/_show.html.haml +1 -0
- data/app/views/surveillance/field/number/_form.html.haml +5 -0
- data/app/views/surveillance/field/number/_overview.html.haml +2 -0
- data/app/views/surveillance/field/number/_settings.html.haml +2 -0
- data/app/views/surveillance/field/number/_show.html.haml +10 -0
- data/app/views/surveillance/field/order/_form.html.haml +17 -0
- data/app/views/surveillance/field/order/_overview.html.haml +22 -0
- data/app/views/surveillance/field/order/_settings.html.haml +11 -0
- data/app/views/surveillance/field/order/_show.html.haml +8 -0
- data/app/views/surveillance/field/select_matrix/_form.html.haml +17 -0
- data/app/views/surveillance/field/shared/_rules_form.html.haml +30 -0
- data/app/views/surveillance/field/shared/settings/_boolean.html.haml +9 -0
- data/app/views/surveillance/field/shared/settings/_number.html.haml +5 -0
- data/app/views/surveillance/field/single_choice/_form.html.haml +16 -0
- data/app/views/surveillance/field/single_choice/_overview.html.haml +14 -0
- data/app/views/surveillance/field/single_choice/_settings.html.haml +2 -0
- data/app/views/surveillance/field/single_choice/_show.html.haml +21 -0
- data/app/views/surveillance/field/single_select/_form.html.haml +4 -0
- data/app/views/surveillance/field/single_select/_overview.html.haml +14 -0
- data/app/views/surveillance/field/single_select/_show.html.haml +13 -0
- data/app/views/surveillance/field/text/_form.html.haml +5 -0
- data/app/views/surveillance/field/text/_overview.html.haml +2 -0
- data/app/views/surveillance/field/text/_show.html.haml +10 -0
- data/app/views/surveillance/field/text_area/_form.html.haml +5 -0
- data/app/views/surveillance/field/text_area/_overview.html.haml +1 -0
- data/app/views/surveillance/field/text_area/_show.html.haml +10 -0
- data/app/views/surveillance/response/attempts/complete.html.haml +11 -0
- data/app/views/surveillance/response/attempts/edit.html.haml +15 -0
- data/app/views/surveillance/sections/_section.html.haml +24 -0
- data/app/views/surveillance/surveys/_survey.html.haml +4 -0
- data/app/views/surveillance/surveys/index.html.haml +8 -0
- data/app/views/surveillance/surveys/show.html.haml +15 -0
- data/config/locales/surveillance.fr.yml +165 -0
- data/config/routes.rb +30 -0
- data/db/migrate/20130626115136_create_surveillance_surveys.rb +13 -0
- data/db/migrate/20130626115805_create_surveillance_sections.rb +12 -0
- data/db/migrate/20130626130351_create_surveillance_questions.rb +14 -0
- data/db/migrate/20130702111125_create_surveillance_options.rb +11 -0
- data/db/migrate/20130703113456_create_surveillance_attempts.rb +11 -0
- data/db/migrate/20130703115649_create_surveillance_answers.rb +11 -0
- data/db/migrate/20130703115723_create_surveillance_answer_contents.rb +10 -0
- data/db/migrate/20130710151627_create_surveillance_field_settings.rb +11 -0
- data/db/migrate/20130711100032_create_surveillance_answers_options_join_table.rb +7 -0
- data/db/migrate/20130729143002_create_surveillance_branch_rules.rb +14 -0
- data/db/migrate/20140212153506_add_state_to_surveillance_attempts.rb +6 -0
- data/db/migrate/20140213101147_add_access_token_to_surveillance_attempts.rb +5 -0
- data/db/migrate/20140213133036_add_partial_to_surveillance_questions.rb +5 -0
- data/lib/generators/surveillance/install/install_generator.rb +34 -0
- data/lib/generators/surveillance/install/templates/initializer.rb +51 -0
- data/lib/surveillance.rb +61 -0
- data/lib/surveillance/branch_action.rb +5 -0
- data/lib/surveillance/branch_condition.rb +5 -0
- data/lib/surveillance/engine.rb +13 -0
- data/lib/surveillance/field.rb +58 -0
- data/lib/surveillance/field/base.rb +149 -0
- data/lib/surveillance/field/date.rb +17 -0
- data/lib/surveillance/field/matrix.rb +66 -0
- data/lib/surveillance/field/matrix_question.rb +13 -0
- data/lib/surveillance/field/multiple_choices.rb +29 -0
- data/lib/surveillance/field/multiple_choices_matrix.rb +13 -0
- data/lib/surveillance/field/number.rb +34 -0
- data/lib/surveillance/field/order.rb +40 -0
- data/lib/surveillance/field/order_question.rb +22 -0
- data/lib/surveillance/field/other_choice.rb +28 -0
- data/lib/surveillance/field/select_matrix.rb +13 -0
- data/lib/surveillance/field/single_choice.rb +36 -0
- data/lib/surveillance/field/single_select.rb +31 -0
- data/lib/surveillance/field/text.rb +13 -0
- data/lib/surveillance/field/text_area.rb +6 -0
- data/lib/surveillance/partials_collection.rb +7 -0
- data/lib/surveillance/setting.rb +24 -0
- data/lib/surveillance/settings_collection.rb +17 -0
- data/lib/surveillance/validators.rb +7 -0
- data/lib/surveillance/validators/answer_validator.rb +9 -0
- data/lib/surveillance/version.rb +3 -0
- data/lib/tasks/surveillance_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +28 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/locales/rails.fr.yml +226 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140113224541_create_surveillance_surveys.surveillance.rb +14 -0
- data/spec/dummy/db/migrate/20140113224542_create_surveillance_sections.surveillance.rb +13 -0
- data/spec/dummy/db/migrate/20140113224543_create_surveillance_questions.surveillance.rb +15 -0
- data/spec/dummy/db/migrate/20140113224544_create_surveillance_options.surveillance.rb +12 -0
- data/spec/dummy/db/migrate/20140113224545_create_surveillance_attempts.surveillance.rb +12 -0
- data/spec/dummy/db/migrate/20140113224546_create_surveillance_answers.surveillance.rb +12 -0
- data/spec/dummy/db/migrate/20140113224547_create_surveillance_answer_contents.surveillance.rb +11 -0
- data/spec/dummy/db/migrate/20140113224548_create_surveillance_field_settings.surveillance.rb +12 -0
- data/spec/dummy/db/migrate/20140113224549_create_surveillance_answers_options_join_table.surveillance.rb +8 -0
- data/spec/dummy/db/migrate/20140113224550_create_surveillance_branch_rules.surveillance.rb +15 -0
- data/spec/dummy/db/schema.rb +103 -0
- data/spec/dummy/log/development.log +38066 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0018421aaf29044fbd13363bbdfd8f44 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/017d7a30ec05c0fb0265fb5167c73ee9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/034b76adeb89d6ca63cd9eea649331f5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/05de8fbfacab66a0efe4f9790b2ac723 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0811effcff3b9107d49398bdba7488e5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0d45beae32861dc508fc2db09b9d95b3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0d4961f3da5a0d5234736a6abbf42226 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0f491ed240e1a27bbc05e5213afd48bb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/10e2a0dbdbb68c055e8b7ccd6f2906d8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1173cdef6c662a55ef590489fe26e8fe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1b3e93127523ec0f3c93bcd91d4390dc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1bb56fbf17ccbb14dcbaa4d6d639e620 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2bd0ba6a1598c9fa67081d8f906db6f8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3fbe053f103de46cc1b320f059b99c1f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4144b095447efb810a548b99e41df9eb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/421d097cb8d88f975d8ccf75c9e5e306 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/474bc1c9055df6cc1cdff58817a6cb41 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4829d251eeb22cdbd05b27b6ba809538 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4f584ca3f0c8ec62906e6f03bc5963c2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/55d647d88e01b91b2a146e7db0481c09 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/62db8b5885b79c5dc0667fab0fbf46bb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7080a4d265fe784c9704db71f81da832 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7220af243fd39e3dffd233252e4a8c17 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7cd0e5bfe12b86ed494d02e8e5b62bbf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7e37a8ae2a50653b388d57c573d12548 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8113790dad1da8858c82cfc3eb14ef87 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/83997102fc04f275cd6cd8c1ddb55835 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8a7b047a16adbc640e03eaabe4a4fe93 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/90b48fb4bfa22ddcd063734065d27086 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/935886b24c90d344752d2a80e3657801 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9606a6d70af63ce3fea26ded0a69d5c2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/97db73fdf0bbab24fb92892c61ec7a9b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a23bb60554e715c228ae3cdfb5d81807 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ad17e102b9f9288a9e919b0b0a2ab05b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c26ae1f6640b52c232bd392a6e2f7110 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c6cb3deca0f08bd9569d00fca09272da +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d39b4eebbd0042342e10497a34fd6378 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d5ee573b2abdcdc245a830bde2dd76f3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d6487e59842ff206d84f6de5e3a7400c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dafa124ddd0e828d7c5c0a5c4db455ba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e5bbd03518f9abc3e9bc1373c74fd3f1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ed5aa255edff522c2e36e6f0151ff747 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ee263a426f6530013f86aa860448fa91 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/efa0c4d855d425fdf4b63ab26c45e94c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f2881259fd5bad1c0a5b1ab5dff97c47 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f34108e540cff2fbc32036da452ca6ae +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7e7e00ef8efc13c6a2628e453344440 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f9a44009076e46b0f35af5e7031a1871 +0 -0
- data/spec/spec_helper.rb +87 -0
- metadata +598 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
%fieldset.question-branch-rule.form-group
|
2
|
+
.col-sm-10
|
3
|
+
= f.input :condition do
|
4
|
+
.pull-left
|
5
|
+
= f.input_field :condition, collection: Surveillance.options_for(question.field.available_branch_conditions, "branch_conditions"), class: "form-control"
|
6
|
+
|
7
|
+
- if question.options.length > 0
|
8
|
+
- if question.questions.length > 0
|
9
|
+
.pull-left
|
10
|
+
= f.input_field :sub_question_id, collection: question.questions, class: "form-control"
|
11
|
+
.pull-left
|
12
|
+
|
13
|
+
avec
|
14
|
+
|
15
|
+
.pull-left
|
16
|
+
= f.input_field :option_id, collection: question.field.options_list, class: "form-control"
|
17
|
+
|
18
|
+
.clearfix
|
19
|
+
|
20
|
+
= f.input :action do
|
21
|
+
.pull-left
|
22
|
+
= f.input_field :action, collection: Surveillance.options_for(question.field.available_branch_actions, "branch_actions"), class: "form-control"
|
23
|
+
.pull-left.sections-list
|
24
|
+
= f.input_field :section_id, collection: question.survey.sections, class: "form-control"
|
25
|
+
|
26
|
+
.col-sm-2
|
27
|
+
= f.hidden_field :_destroy, data: { destroy: true }
|
28
|
+
= link_to "#", class: "btn btn-danger", data: { "destroy-field" => true } do
|
29
|
+
%i.fa.fa-times
|
30
|
+
Supprimer
|
@@ -0,0 +1,9 @@
|
|
1
|
+
= f.fields_for :settings, question.settings.find_or_initialize_by(key: key.to_s) do |fb|
|
2
|
+
.form-group
|
3
|
+
= fb.label :value, setting.admin_label, class: "control-label col-sm-2"
|
4
|
+
.col-sm-10
|
5
|
+
= fb.check_box :value
|
6
|
+
|
7
|
+
|
8
|
+
= fb.hidden_field :key, value: key
|
9
|
+
= fb.hidden_field :id, value: fb.object.id if fb.object.persisted?
|
@@ -0,0 +1,5 @@
|
|
1
|
+
= f.fields_for :settings, question.settings.find_or_initialize_by(key: key.to_s) do |fb|
|
2
|
+
= fb.input :value, as: :numeric, label: setting.admin_label, required: false
|
3
|
+
|
4
|
+
= fb.hidden_field :key, value: key
|
5
|
+
= fb.hidden_field :id, value: fb.object.id if fb.object.persisted?
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= f.fields_for :answers, question.field.answer_or_initialize do |fa|
|
2
|
+
= fa.input :answer, label: question.title.html_safe, required: question.mandatory, hint: question.description do
|
3
|
+
- question.field.ordered_options.each do |option|
|
4
|
+
%label.radio
|
5
|
+
= fa.radio_button :option_id, option.id
|
6
|
+
= option.title
|
7
|
+
|
8
|
+
- if question.field.display_other_field?(question)
|
9
|
+
%label.radio
|
10
|
+
= fa.radio_button :option_id, "other", checked: fa.object.other_choosed
|
11
|
+
= question.field.settings.other.label
|
12
|
+
|
13
|
+
= fa.fields_for :content, fa.object.content_or_build do |fc|
|
14
|
+
= fc.input :value, as: :string, label: false
|
15
|
+
|
16
|
+
= fa.hidden_field :question_id, value: question.id if fa.object.new_record?
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h4= question.title.html_safe
|
2
|
+
%table.table.table-striped.table-bordered.table-rounded
|
3
|
+
%thead
|
4
|
+
%tr
|
5
|
+
%th Option
|
6
|
+
%th Nombre de réponses
|
7
|
+
|
8
|
+
%tbody
|
9
|
+
- question.options.each do |option|
|
10
|
+
%tr
|
11
|
+
%td= option.title
|
12
|
+
%td
|
13
|
+
%label
|
14
|
+
= option.answers_for(question).length
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.question
|
2
|
+
%span.title
|
3
|
+
= question.title.html_safe
|
4
|
+
|
5
|
+
%strong.answer
|
6
|
+
- field = question.field
|
7
|
+
- answer = field.answer
|
8
|
+
|
9
|
+
- if answer
|
10
|
+
- if answer.option
|
11
|
+
= answer.option.title
|
12
|
+
- elsif field.other_choosed?
|
13
|
+
= field.settings.other.label
|
14
|
+
\:
|
15
|
+
= field.answer_string
|
16
|
+
- else
|
17
|
+
Non répondu
|
18
|
+
|
19
|
+
- else
|
20
|
+
Non répondu
|
21
|
+
|
@@ -0,0 +1,4 @@
|
|
1
|
+
= f.fields_for :answers, question.field.answer_or_initialize do |fa|
|
2
|
+
= fa.input :answer, label: question.title.html_safe, required: question.mandatory, hint: question.description do
|
3
|
+
= fa.select :option_id, question.field.options_for_select, { include_blank: true }, class: 'form-control'
|
4
|
+
= fa.hidden_field :question_id, value: question.id if fa.object.new_record?
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h4= question.title.html_safe
|
2
|
+
%table.table.table-striped.table-bordered.table-rounded
|
3
|
+
%thead
|
4
|
+
%tr
|
5
|
+
%th Option
|
6
|
+
%th Nombre de réponses
|
7
|
+
|
8
|
+
%tbody
|
9
|
+
- question.options.each do |option|
|
10
|
+
%tr
|
11
|
+
%td= option.title
|
12
|
+
%td
|
13
|
+
%label
|
14
|
+
= option.answers_for(question).length
|
@@ -0,0 +1,5 @@
|
|
1
|
+
= f.fields_for :answers, (question.field.answer_or_initialize) do |fa|
|
2
|
+
= fa.fields_for :content, fa.object.content_or_build do |fc|
|
3
|
+
= fc.input :value, as: :string, label: question.title.html_safe, required: question.mandatory, hint: question.description
|
4
|
+
|
5
|
+
= fa.hidden_field :question_id, value: question.id if fa.object.new_record?
|
@@ -0,0 +1,5 @@
|
|
1
|
+
= f.fields_for :answers, (question.field.answer_or_initialize) do |fa|
|
2
|
+
= fa.fields_for :content, fa.object.content_or_build do |fc|
|
3
|
+
= fc.input :value, label: question.title.html_safe, required: question.mandatory, hint: question.description, input_html: { rows: 5 }
|
4
|
+
|
5
|
+
= fa.hidden_field :question_id, value: question.id if fa.object.new_record?
|
@@ -0,0 +1 @@
|
|
1
|
+
= render partial: "surveillance/field/text/overview", locals: { question: question }
|
@@ -0,0 +1,15 @@
|
|
1
|
+
= simple_form_for attempt, url: response_attempt_path(attempt), html: { class: "surveillance-attempt-form", data: { "partial-update-url" => response_partial_attempt_path(attempt) } } do |f|
|
2
|
+
= f.hidden_field :survey_id, value: survey.id
|
3
|
+
= f.hidden_field :last_answered_section, class: "last-answered-section"
|
4
|
+
|
5
|
+
.survey-question
|
6
|
+
.titre
|
7
|
+
= survey.title
|
8
|
+
|
9
|
+
- if survey.description.presence
|
10
|
+
.survey-description
|
11
|
+
= survey.description.html_safe
|
12
|
+
|
13
|
+
.survey-sections
|
14
|
+
- survey.sections.each_with_index do |section, index|
|
15
|
+
= render partial: "surveillance/sections/section", locals: { survey: survey, section: section, index: index, attempt: attempt, f: f }
|
@@ -0,0 +1,24 @@
|
|
1
|
+
.survey-section{ style: ("display:none;" if index != attempt.last_answered_section + 1), data: { id: section.id, index: index } }
|
2
|
+
.bloc
|
3
|
+
%h3
|
4
|
+
= section.title
|
5
|
+
|
6
|
+
- if section.description.presence
|
7
|
+
.section-description
|
8
|
+
= section.description.html_safe
|
9
|
+
|
10
|
+
- section.questions.each_with_index do |question, index|
|
11
|
+
= survey_field_for(f, question, index)
|
12
|
+
|
13
|
+
.form-group
|
14
|
+
- if index > 0
|
15
|
+
%button.btn.btn-danger.back-to-previous-section{ type: "button" }
|
16
|
+
Retour à la page précédente
|
17
|
+
|
18
|
+
- if index < (survey.sections.length - 1)
|
19
|
+
%button.btn.btn-primary.validate-section{ type: "button" }
|
20
|
+
Page suivante
|
21
|
+
- else
|
22
|
+
%button.btn.btn-primary.validate-survey{ type: "submit", autocomplete: "off", data: { "loading-text" => "Envoi en cours ..." } }
|
23
|
+
Soumettre le questionnaire
|
24
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.sub-header
|
2
|
+
.zone1
|
3
|
+
.bg-admin
|
4
|
+
.bloc
|
5
|
+
%h4
|
6
|
+
Votre participation a bien été prise en compte.
|
7
|
+
|
8
|
+
Votre participation au sondage
|
9
|
+
%strong= survey.title
|
10
|
+
a bien été prise en compte.
|
11
|
+
%br
|
12
|
+
Nous vous remercions pour vos réponses.
|
13
|
+
|
14
|
+
= link_to surveys_root_path, class: "btn btn-default" do
|
15
|
+
Retour aux sondages
|
@@ -0,0 +1,165 @@
|
|
1
|
+
fr:
|
2
|
+
flashes:
|
3
|
+
surveillance/admin/surveys:
|
4
|
+
create:
|
5
|
+
success: "La questionnaire a bien été créée"
|
6
|
+
error: "La questionnaire n'a pu être créée"
|
7
|
+
update:
|
8
|
+
success: "Le questionnaire a bien été mis à jour"
|
9
|
+
error: "Le questionnaire n'a pu être mis à jour"
|
10
|
+
destroy:
|
11
|
+
success: "Le questionnaire a bien été supprimé"
|
12
|
+
confirm_message: "Voulez-vous vraiment supprimer ce questionnaire ?"
|
13
|
+
surveillance/admin/attempts:
|
14
|
+
destroy:
|
15
|
+
success: "La réponse a bien été supprimée"
|
16
|
+
confirm_message: "Voulez-vous vraiment supprimer cette réponse ?"
|
17
|
+
surveillance/admin/sections:
|
18
|
+
create:
|
19
|
+
success: "La section a bien été créée"
|
20
|
+
error: "La section n'a pu être créée"
|
21
|
+
update:
|
22
|
+
success: "La section a bien été mise à jour"
|
23
|
+
error: "La section n'a pu être mise à jour"
|
24
|
+
destroy:
|
25
|
+
success: "La section a bien été supprimée"
|
26
|
+
sort:
|
27
|
+
success: "Les sections ont bien été réordonnés"
|
28
|
+
|
29
|
+
surveillance/admin/questions:
|
30
|
+
create:
|
31
|
+
success: "La question a bien été créée"
|
32
|
+
error: "La question n'a pu être créée"
|
33
|
+
update:
|
34
|
+
success: "La question a bien été mise à jour"
|
35
|
+
error: "La question n'a pu être mise à jour"
|
36
|
+
edit_rules:
|
37
|
+
success: "Les actions conditionnelles de la question ont bien été mises à jour"
|
38
|
+
error: "Les actions conditionnelles de la question n'ont pu être mises à jour"
|
39
|
+
destroy:
|
40
|
+
success: "La question a bien été supprimée"
|
41
|
+
sort:
|
42
|
+
success: "Les questions ont bien été réordonnés"
|
43
|
+
|
44
|
+
surveillance/admin/options:
|
45
|
+
create:
|
46
|
+
success: "L'option a bien été créée"
|
47
|
+
error: "L'option n'a pu être créée"
|
48
|
+
update:
|
49
|
+
success: "L'option a bien été mise à jour"
|
50
|
+
error: "L'option n'a pu être mise à jour"
|
51
|
+
destroy:
|
52
|
+
success: "L'option a bien été supprimée"
|
53
|
+
sort:
|
54
|
+
success: "Les options ont bien été réordonnés"
|
55
|
+
|
56
|
+
surveillance/attempts/response:
|
57
|
+
update:
|
58
|
+
error: |
|
59
|
+
Votre participation n'a pas pu être prise en compte.<br>
|
60
|
+
Merci de vérifier que tous les champs sont remplis correctement.
|
61
|
+
|
62
|
+
surveillance:
|
63
|
+
field_types:
|
64
|
+
text: "Champ texte"
|
65
|
+
text_area: "Zone de texte multiligne"
|
66
|
+
number: "Nombre"
|
67
|
+
single_choice: "Choix unique"
|
68
|
+
multiple_choices: "Choix multiples"
|
69
|
+
matrix: "Matrice"
|
70
|
+
multiple_choices_matrix: "Matrice à choix multiples"
|
71
|
+
select_matrix: "Matrice de sélection"
|
72
|
+
order: "Ordonner les réponses"
|
73
|
+
field:
|
74
|
+
errors:
|
75
|
+
not_present: must be filled
|
76
|
+
settings:
|
77
|
+
number:
|
78
|
+
minimum:
|
79
|
+
admin: "Valeur minimum"
|
80
|
+
maximum:
|
81
|
+
admin: "Valeur maximum"
|
82
|
+
single_choice:
|
83
|
+
other:
|
84
|
+
admin: "Ajouter un champ \"Autre\" ?"
|
85
|
+
field: "Autre"
|
86
|
+
randomize:
|
87
|
+
admin: "Ordre des réponses aléatoire"
|
88
|
+
multiple_choice:
|
89
|
+
other:
|
90
|
+
admin: "Ajouter un champ \"Autre\" ?"
|
91
|
+
field: "Autre"
|
92
|
+
matrix:
|
93
|
+
other:
|
94
|
+
admin: "Ajouter un champ \"Autre\" ?"
|
95
|
+
field: "Autre(s) préciser"
|
96
|
+
randomize_sub_questions:
|
97
|
+
admin: "Ordre des sous-questions aléatoire"
|
98
|
+
|
99
|
+
branch_actions:
|
100
|
+
goto_section: "Aller à la section"
|
101
|
+
finalize_survey: "Finaliser le questionnaire"
|
102
|
+
branch_conditions:
|
103
|
+
answers: "répond à la question"
|
104
|
+
doesnt_answer: "ne répond pas à la question"
|
105
|
+
answers_option: "choisi la réponse"
|
106
|
+
doesnt_answer_option: "ne choisi pas la réponse"
|
107
|
+
|
108
|
+
surveys:
|
109
|
+
no_survey_available: "Aucun sondage n'est disponible pour le moment"
|
110
|
+
|
111
|
+
attempts:
|
112
|
+
step: "Étape %{step}"
|
113
|
+
state: "Remplissage"
|
114
|
+
answer_date: "Date de réponse"
|
115
|
+
ip_address: "Adresse IP"
|
116
|
+
last_answered_section: "Dernière page remplie"
|
117
|
+
no_last_answered_section: "Aucune page remplie"
|
118
|
+
states:
|
119
|
+
empty: "Non commencé"
|
120
|
+
partially_filled: "Partiel"
|
121
|
+
completed: "Terminé"
|
122
|
+
errors:
|
123
|
+
already_completed: |
|
124
|
+
Vous avez déjà rempli le questionnaire et vous ne pouvez le remplir
|
125
|
+
qu'une seule fois. Merci pour votre participation !
|
126
|
+
no_survey_found: "Le sondage demandé n'a pu être trouvé, il n'existe pas ou plus"
|
127
|
+
survey_closed: "Le sondage demandé n'est plus disponible"
|
128
|
+
previous_attempt_recovered: |
|
129
|
+
Vous aviez déjà commencé à remplir le formulaire, il a donc été récupéré
|
130
|
+
pour vous, vous pouvez le continuer directement.
|
131
|
+
|
132
|
+
exports:
|
133
|
+
results: "resultats-questionnaire-%{survey}"
|
134
|
+
|
135
|
+
activerecord:
|
136
|
+
attributes:
|
137
|
+
surveillance/survey:
|
138
|
+
description: "Texte de présentation"
|
139
|
+
last_page_description: "Texte de fin du questionnaire"
|
140
|
+
end_date: "Date de fin"
|
141
|
+
published: "Publié ?"
|
142
|
+
title: "Titre"
|
143
|
+
sections_attributes: "Pages"
|
144
|
+
sections: "Pages"
|
145
|
+
project_id: "Projet"
|
146
|
+
featured_home: "Mettre sur la page d'accueil"
|
147
|
+
theme_id: "Mettre sur la page débats du thème"
|
148
|
+
authorize_public_attempts: "Autoriser les réponses de personnes non inscrites à la plateforme"
|
149
|
+
surveillance/section:
|
150
|
+
position: "Position"
|
151
|
+
survey_id: "Formulaire"
|
152
|
+
title: "Titre"
|
153
|
+
surveillance/question:
|
154
|
+
description: "Description"
|
155
|
+
mandatory: "Obligatoire ?"
|
156
|
+
section_id: "Page"
|
157
|
+
title: "Titre"
|
158
|
+
settings_attributes: "Paramètres"
|
159
|
+
field_type: "Type de question"
|
160
|
+
partial: "Template de champ"
|
161
|
+
surveillance/branch_rule:
|
162
|
+
condition: "Si l'utilisateur"
|
163
|
+
action: "Alors"
|
164
|
+
section: "Page"
|
165
|
+
option: "Réponse"
|
data/config/routes.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
Surveillance::Engine.routes.draw do
|
2
|
+
namespace :admin do
|
3
|
+
resources :surveys, shallow: true do
|
4
|
+
resources :sections do
|
5
|
+
resources :questions do
|
6
|
+
member do
|
7
|
+
match "edit-rules", action: "edit_rules", as: "edit_rules", via: [:put, :patch]
|
8
|
+
end
|
9
|
+
|
10
|
+
resources :options
|
11
|
+
resources :questions
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
resources :exports, only: [:show]
|
16
|
+
resources :attempts
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
resources :surveys, only: [:index, :show], shallow: true do
|
21
|
+
namespace :response do
|
22
|
+
resources :attempts, only: [:new, :edit, :update] do
|
23
|
+
member do
|
24
|
+
get "/complete", action: "complete", as: "complete"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
resources :partial_attempts, only: [:update]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|