affectiva-surveyor 1.5.0.pre.disco.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +28 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG.md +198 -0
  5. data/Gemfile +5 -0
  6. data/Gemfile.rails_version +27 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +166 -0
  9. data/Rakefile +106 -0
  10. data/app/controllers/surveyor_controller.rb +5 -0
  11. data/app/helpers/results_helper.rb +20 -0
  12. data/app/helpers/survey_form_builder.rb +37 -0
  13. data/app/helpers/surveyor_helper.rb +3 -0
  14. data/app/inputs/quiet_input.rb +5 -0
  15. data/app/inputs/surveyor_check_boxes_input.rb +35 -0
  16. data/app/inputs/surveyor_radio_input.rb +18 -0
  17. data/app/models/answer.rb +3 -0
  18. data/app/models/dependency.rb +3 -0
  19. data/app/models/dependency_condition.rb +3 -0
  20. data/app/models/question.rb +3 -0
  21. data/app/models/question_group.rb +4 -0
  22. data/app/models/response.rb +4 -0
  23. data/app/models/response_set.rb +3 -0
  24. data/app/models/survey.rb +3 -0
  25. data/app/models/survey_section.rb +4 -0
  26. data/app/models/survey_section_sweeper.rb +15 -0
  27. data/app/models/survey_translation.rb +4 -0
  28. data/app/models/validation.rb +3 -0
  29. data/app/models/validation_condition.rb +3 -0
  30. data/app/views/layouts/results.html.erb +13 -0
  31. data/app/views/layouts/surveyor_default.html.erb +12 -0
  32. data/app/views/partials/_answer.html.haml +25 -0
  33. data/app/views/partials/_dependents.html.haml +5 -0
  34. data/app/views/partials/_question.html.haml +28 -0
  35. data/app/views/partials/_question_group.html.haml +44 -0
  36. data/app/views/partials/_section.html.haml +12 -0
  37. data/app/views/partials/_section_menu.html.haml +12 -0
  38. data/app/views/surveyor/edit.html.haml +24 -0
  39. data/app/views/surveyor/export.json.rabl +85 -0
  40. data/app/views/surveyor/new.html.haml +24 -0
  41. data/app/views/surveyor/show.html.haml +74 -0
  42. data/app/views/surveyor/show.json.rabl +15 -0
  43. data/ci-exec.sh +56 -0
  44. data/config/routes.rb +8 -0
  45. data/cucumber.yml +10 -0
  46. data/doc/REPRESENTATIONS.md +34 -0
  47. data/doc/api_id_schema.json +7 -0
  48. data/doc/question types.png +0 -0
  49. data/doc/response_set_schema.json +54 -0
  50. data/doc/surveyor question combinations.png +0 -0
  51. data/doc/surveyor reject or delete decision matrix.png +0 -0
  52. data/doc/surveyor_models.png +0 -0
  53. data/doc/surveyor_models2.png +0 -0
  54. data/doc/surveyor_timestamp_schema.json +9 -0
  55. data/features/ajax_submissions.feature +140 -0
  56. data/features/export_to_json.feature +344 -0
  57. data/features/internationalization.feature +121 -0
  58. data/features/no_duplicates.feature +110 -0
  59. data/features/show_survey.feature +71 -0
  60. data/features/step_definitions/parser_steps.rb +145 -0
  61. data/features/step_definitions/surveyor_steps.rb +325 -0
  62. data/features/step_definitions/ui_steps.rb +25 -0
  63. data/features/step_definitions/web_steps.rb +225 -0
  64. data/features/support/REDCapDemoDatabase_DataDictionary.csv +127 -0
  65. data/features/support/database_cleaner.rb +16 -0
  66. data/features/support/env.rb +56 -0
  67. data/features/support/hooks.rb +4 -0
  68. data/features/support/paths.rb +39 -0
  69. data/features/support/redcap_new_headers.csv +1 -0
  70. data/features/support/redcap_siblings.csv +1 -0
  71. data/features/support/redcap_whitespace.csv +1 -0
  72. data/features/support/selectors.rb +39 -0
  73. data/features/support/simultaneous_ajax.rb +101 -0
  74. data/features/support/single_quit_selenium_driver.rb +23 -0
  75. data/features/support/slow_updates.rb +18 -0
  76. data/features/surveyor.feature +895 -0
  77. data/features/surveyor_dependencies.feature +476 -0
  78. data/features/surveyor_parser.feature +504 -0
  79. data/features/z_redcap_parser.feature +62 -0
  80. data/lib/assets/images/surveyor/next.gif +0 -0
  81. data/lib/assets/images/surveyor/prev.gif +0 -0
  82. data/lib/assets/images/surveyor/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  83. data/lib/assets/images/surveyor/ui-bg_flat_75_ffffff_40x100.png +0 -0
  84. data/lib/assets/images/surveyor/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  85. data/lib/assets/images/surveyor/ui-bg_glass_65_ffffff_1x400.png +0 -0
  86. data/lib/assets/images/surveyor/ui-bg_glass_75_dadada_1x400.png +0 -0
  87. data/lib/assets/images/surveyor/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  88. data/lib/assets/images/surveyor/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  89. data/lib/assets/images/surveyor/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  90. data/lib/assets/images/surveyor/ui-icons_222222_256x240.png +0 -0
  91. data/lib/assets/images/surveyor/ui-icons_2e83ff_256x240.png +0 -0
  92. data/lib/assets/images/surveyor/ui-icons_454545_256x240.png +0 -0
  93. data/lib/assets/images/surveyor/ui-icons_888888_256x240.png +0 -0
  94. data/lib/assets/images/surveyor/ui-icons_cd0a0a_256x240.png +0 -0
  95. data/lib/assets/javascripts/surveyor/jquery-1.9.0.js +9555 -0
  96. data/lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js +14850 -0
  97. data/lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js +1919 -0
  98. data/lib/assets/javascripts/surveyor/jquery.maskedinput.js +338 -0
  99. data/lib/assets/javascripts/surveyor/jquery.selectToUISlider.js +240 -0
  100. data/lib/assets/javascripts/surveyor/jquery.surveyor.js +154 -0
  101. data/lib/assets/stylesheets/surveyor.sass +132 -0
  102. data/lib/assets/stylesheets/surveyor/jquery-ui-1.10.0.custom.css +1174 -0
  103. data/lib/assets/stylesheets/surveyor/jquery-ui-timepicker-addon.css +11 -0
  104. data/lib/assets/stylesheets/surveyor/reset.css +48 -0
  105. data/lib/assets/stylesheets/surveyor/results.css +125 -0
  106. data/lib/assets/stylesheets/surveyor/ui.slider.extras.css +110 -0
  107. data/lib/generators/surveyor/custom_generator.rb +18 -0
  108. data/lib/generators/surveyor/install_generator.rb +101 -0
  109. data/lib/generators/surveyor/templates/app/assets/javascripts/surveyor_all.js +6 -0
  110. data/lib/generators/surveyor/templates/app/assets/stylesheets/surveyor_all.css +9 -0
  111. data/lib/generators/surveyor/templates/app/controllers/surveyor_controller.rb +40 -0
  112. data/lib/generators/surveyor/templates/app/views/layouts/surveyor_custom.html.erb +13 -0
  113. data/lib/generators/surveyor/templates/config/locales/surveyor_en.yml +19 -0
  114. data/lib/generators/surveyor/templates/config/locales/surveyor_es.yml +19 -0
  115. data/lib/generators/surveyor/templates/config/locales/surveyor_he.yml +19 -0
  116. data/lib/generators/surveyor/templates/config/locales/surveyor_ko.yml +19 -0
  117. data/lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb +10 -0
  118. data/lib/generators/surveyor/templates/db/migrate/add_api_ids.rb +14 -0
  119. data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb +12 -0
  120. data/lib/generators/surveyor/templates/db/migrate/add_correct_answer_id_to_questions.rb +10 -0
  121. data/lib/generators/surveyor/templates/db/migrate/add_default_value_to_answers.rb +10 -0
  122. data/lib/generators/surveyor/templates/db/migrate/add_display_order_to_surveys.rb +10 -0
  123. data/lib/generators/surveyor/templates/db/migrate/add_display_type_to_answers.rb +14 -0
  124. data/lib/generators/surveyor/templates/db/migrate/add_index_to_response_sets.rb +10 -0
  125. data/lib/generators/surveyor/templates/db/migrate/add_index_to_surveys.rb +10 -0
  126. data/lib/generators/surveyor/templates/db/migrate/add_input_mask_attributes_to_answer.rb +12 -0
  127. data/lib/generators/surveyor/templates/db/migrate/add_section_id_to_responses.rb +12 -0
  128. data/lib/generators/surveyor/templates/db/migrate/add_unique_index_on_access_code_and_version_in_surveys.rb +10 -0
  129. data/lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb +18 -0
  130. data/lib/generators/surveyor/templates/db/migrate/add_version_to_surveys.rb +10 -0
  131. data/lib/generators/surveyor/templates/db/migrate/api_ids_must_be_unique.rb +23 -0
  132. data/lib/generators/surveyor/templates/db/migrate/create_answers.rb +38 -0
  133. data/lib/generators/surveyor/templates/db/migrate/create_dependencies.rb +23 -0
  134. data/lib/generators/surveyor/templates/db/migrate/create_dependency_conditions.rb +30 -0
  135. data/lib/generators/surveyor/templates/db/migrate/create_question_groups.rb +28 -0
  136. data/lib/generators/surveyor/templates/db/migrate/create_questions.rb +37 -0
  137. data/lib/generators/surveyor/templates/db/migrate/create_response_sets.rb +23 -0
  138. data/lib/generators/surveyor/templates/db/migrate/create_responses.rb +34 -0
  139. data/lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb +30 -0
  140. data/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb +19 -0
  141. data/lib/generators/surveyor/templates/db/migrate/create_surveys.rb +32 -0
  142. data/lib/generators/surveyor/templates/db/migrate/create_validation_conditions.rb +33 -0
  143. data/lib/generators/surveyor/templates/db/migrate/create_validations.rb +21 -0
  144. data/lib/generators/surveyor/templates/db/migrate/drop_unique_index_on_access_code_in_surveys.rb +10 -0
  145. data/lib/generators/surveyor/templates/db/migrate/update_blank_api_ids_on_question_group.rb +22 -0
  146. data/lib/generators/surveyor/templates/db/migrate/update_blank_versions_on_surveys.rb +13 -0
  147. data/lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md +52 -0
  148. data/lib/generators/surveyor/templates/surveys/MODIFYING_SURVEYOR.md +91 -0
  149. data/lib/generators/surveyor/templates/surveys/date_survey.rb +16 -0
  150. data/lib/generators/surveyor/templates/surveys/kitchen_sink_survey.rb +280 -0
  151. data/lib/generators/surveyor/templates/surveys/languages.rb +14 -0
  152. data/lib/generators/surveyor/templates/surveys/quiz.rb +11 -0
  153. data/lib/generators/surveyor/templates/surveys/translations/languages.es.yml +18 -0
  154. data/lib/generators/surveyor/templates/surveys/translations/languages.he.yml +18 -0
  155. data/lib/generators/surveyor/templates/surveys/translations/languages.ko.yml +18 -0
  156. data/lib/generators/surveyor/templates/vendor/assets/stylesheets/custom.sass +5 -0
  157. data/lib/surveyor.rb +13 -0
  158. data/lib/surveyor/acts_as_response.rb +17 -0
  159. data/lib/surveyor/common.rb +59 -0
  160. data/lib/surveyor/engine.rb +10 -0
  161. data/lib/surveyor/helpers/asset_pipeline.rb +18 -0
  162. data/lib/surveyor/helpers/formtastic_custom_input.rb +13 -0
  163. data/lib/surveyor/helpers/surveyor_helper_methods.rb +103 -0
  164. data/lib/surveyor/models/answer_methods.rb +83 -0
  165. data/lib/surveyor/models/dependency_condition_methods.rb +69 -0
  166. data/lib/surveyor/models/dependency_methods.rb +57 -0
  167. data/lib/surveyor/models/question_group_methods.rb +58 -0
  168. data/lib/surveyor/models/question_methods.rb +112 -0
  169. data/lib/surveyor/models/response_methods.rb +126 -0
  170. data/lib/surveyor/models/response_set_methods.rb +188 -0
  171. data/lib/surveyor/models/survey_methods.rb +100 -0
  172. data/lib/surveyor/models/survey_section_methods.rb +53 -0
  173. data/lib/surveyor/models/survey_translation_methods.rb +30 -0
  174. data/lib/surveyor/models/validation_condition_methods.rb +54 -0
  175. data/lib/surveyor/models/validation_methods.rb +45 -0
  176. data/lib/surveyor/mustache_context.rb +11 -0
  177. data/lib/surveyor/parser.rb +427 -0
  178. data/lib/surveyor/redcap_parser.rb +288 -0
  179. data/lib/surveyor/surveyor_controller_methods.rb +236 -0
  180. data/lib/surveyor/unparser.rb +147 -0
  181. data/lib/surveyor/version.rb +3 -0
  182. data/lib/tasks/surveyor_tasks.rake +88 -0
  183. data/rails/init.rb +1 -0
  184. data/spec/controllers/surveyor_controller_spec.rb +311 -0
  185. data/spec/factories.rb +166 -0
  186. data/spec/helpers/formtastic_custom_input_spec.rb +15 -0
  187. data/spec/helpers/surveyor_helper_spec.rb +117 -0
  188. data/spec/lib/benchmark_spec.rb +22 -0
  189. data/spec/lib/chinese_survey.rb +14 -0
  190. data/spec/lib/common_spec.rb +34 -0
  191. data/spec/lib/parser_spec.rb +204 -0
  192. data/spec/lib/rake_kitchen_sink.rb +40 -0
  193. data/spec/lib/redcap_parser_spec.rb +75 -0
  194. data/spec/lib/tasks_spec.rake +26 -0
  195. data/spec/lib/unparser_spec.rb +126 -0
  196. data/spec/models/answer_spec.rb +174 -0
  197. data/spec/models/dependency_condition_spec.rb +439 -0
  198. data/spec/models/dependency_spec.rb +101 -0
  199. data/spec/models/question_group_spec.rb +93 -0
  200. data/spec/models/question_spec.rb +206 -0
  201. data/spec/models/response_set_spec.rb +477 -0
  202. data/spec/models/response_spec.rb +218 -0
  203. data/spec/models/survey_section_spec.rb +85 -0
  204. data/spec/models/survey_spec.rb +191 -0
  205. data/spec/models/validation_condition_spec.rb +113 -0
  206. data/spec/models/validation_spec.rb +74 -0
  207. data/spec/rcov.opts +2 -0
  208. data/spec/spec.opts +4 -0
  209. data/spec/spec_helper.rb +56 -0
  210. data/stacktests.sh +65 -0
  211. data/surveyor.gemspec +53 -0
  212. metadata +601 -0
@@ -0,0 +1,113 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe ValidationCondition, "Class methods" do
4
+ it "should have a list of operators" do
5
+ %w(== != < > <= >= =~).each{|operator| ValidationCondition.operators.include?(operator).should be_true }
6
+ end
7
+ end
8
+
9
+ describe ValidationCondition do
10
+ before(:each) do
11
+ @validation_condition = FactoryGirl.create(:validation_condition)
12
+ end
13
+
14
+ it "should be valid" do
15
+ @validation_condition.should be_valid
16
+ end
17
+ # this causes issues with building and saving
18
+ # it "should be invalid without a parent validation_id" do
19
+ # @validation_condition.validation_id = nil
20
+ # @validation_condition.should have(1).errors_on(:validation_id)
21
+ # end
22
+
23
+ it "should be invalid without an operator" do
24
+ @validation_condition.operator = nil
25
+ @validation_condition.should have(2).errors_on(:operator)
26
+ end
27
+
28
+ it "should be invalid without a rule_key" do
29
+ @validation_condition.should be_valid
30
+ @validation_condition.rule_key = nil
31
+ @validation_condition.should_not be_valid
32
+ @validation_condition.should have(1).errors_on(:rule_key)
33
+ end
34
+
35
+ it "should have unique rule_key within the context of a validation" do
36
+ @validation_condition.should be_valid
37
+ FactoryGirl.create(:validation_condition, :validation_id => 2, :rule_key => "2")
38
+ @validation_condition.rule_key = "2" #rule key uniquness is scoped by validation_id
39
+ @validation_condition.validation_id = 2
40
+ @validation_condition.should_not be_valid
41
+ @validation_condition.should have(1).errors_on(:rule_key)
42
+ end
43
+
44
+ it "should have an operator in ValidationCondition.operators" do
45
+ ValidationCondition.operators.each do |o|
46
+ @validation_condition.operator = o
47
+ @validation_condition.should have(0).errors_on(:operator)
48
+ end
49
+ @validation_condition.operator = "#"
50
+ @validation_condition.should have(1).error_on(:operator)
51
+ end
52
+ it "should protect timestamps" do
53
+ saved_attrs = @validation_condition.attributes
54
+ if defined? ActiveModel::MassAssignmentSecurity::Error
55
+ lambda {@validation_condition.update_attributes(:created_at => 3.days.ago, :updated_at => 3.hours.ago)}.should raise_error(ActiveModel::MassAssignmentSecurity::Error)
56
+ else
57
+ @validation_condition.attributes = {:created_at => 3.days.ago, :updated_at => 3.hours.ago} # automatically protected by Rails
58
+ end
59
+ @validation_condition.attributes.should == saved_attrs
60
+ end
61
+ end
62
+
63
+ describe ValidationCondition, "validating responses" do
64
+ def test_var(vhash, ahash, rhash)
65
+ v = FactoryGirl.create(:validation_condition, vhash)
66
+ a = FactoryGirl.create(:answer, ahash)
67
+ r = FactoryGirl.create(:response, {:answer => a, :question => a.question}.merge(rhash))
68
+ return v.is_valid?(r)
69
+ end
70
+
71
+ it "should validate a response by regexp" do
72
+ test_var({:operator => "=~", :regexp => '/^[a-z]{1,6}$/'}, {:response_class => "string"}, {:string_value => "clear"}).should be_true
73
+ test_var({:operator => "=~", :regexp => '/^[a-z]{1,6}$/'}, {:response_class => "string"}, {:string_value => "foobarbaz"}).should be_false
74
+ end
75
+ it "should validate a response by integer comparison" do
76
+ test_var({:operator => ">", :integer_value => 3}, {:response_class => "integer"}, {:integer_value => 4}).should be_true
77
+ test_var({:operator => "<=", :integer_value => 256}, {:response_class => "integer"}, {:integer_value => 512}).should be_false
78
+ end
79
+ it "should validate a response by (in)equality" do
80
+ test_var({:operator => "!=", :datetime_value => Date.today + 1}, {:response_class => "date"}, {:datetime_value => Date.today}).should be_true
81
+ test_var({:operator => "==", :string_value => "foo"}, {:response_class => "string"}, {:string_value => "foo"}).should be_true
82
+ end
83
+ it "should represent itself as a hash" do
84
+ @v = FactoryGirl.create(:validation_condition, :rule_key => "A")
85
+ @v.stub(:is_valid?).and_return(true)
86
+ @v.to_hash("foo").should == {:A => true}
87
+ @v.stub(:is_valid?).and_return(false)
88
+ @v.to_hash("foo").should == {:A => false}
89
+ end
90
+ end
91
+
92
+ describe ValidationCondition, "validating responses by other responses" do
93
+ def test_var(v_hash, a_hash, r_hash, ca_hash, cr_hash)
94
+ ca = FactoryGirl.create(:answer, ca_hash)
95
+ cr = FactoryGirl.create(:response, cr_hash.merge(:answer => ca, :question => ca.question))
96
+ v = FactoryGirl.create(:validation_condition, v_hash.merge({:question_id => ca.question.id, :answer_id => ca.id}))
97
+ a = FactoryGirl.create(:answer, a_hash)
98
+ r = FactoryGirl.create(:response, r_hash.merge(:answer => a, :question => a.question))
99
+ return v.is_valid?(r)
100
+ end
101
+ it "should validate a response by integer comparison" do
102
+ test_var({:operator => ">"}, {:response_class => "integer"}, {:integer_value => 4}, {:response_class => "integer"}, {:integer_value => 3}).should be_true
103
+ test_var({:operator => "<="}, {:response_class => "integer"}, {:integer_value => 512}, {:response_class => "integer"}, {:integer_value => 4}).should be_false
104
+ end
105
+ it "should validate a response by (in)equality" do
106
+ test_var({:operator => "!="}, {:response_class => "date"}, {:datetime_value => Date.today}, {:response_class => "date"}, {:datetime_value => Date.today + 1}).should be_true
107
+ test_var({:operator => "=="}, {:response_class => "string"}, {:string_value => "donuts"}, {:response_class => "string"}, {:string_value => "donuts"}).should be_true
108
+ end
109
+ it "should not validate a response by regexp" do
110
+ test_var({:operator => "=~"}, {:response_class => "date"}, {:datetime_value => Date.today}, {:response_class => "date"}, {:datetime_value => Date.today + 1}).should be_false
111
+ test_var({:operator => "=~"}, {:response_class => "string"}, {:string_value => "donuts"}, {:response_class => "string"}, {:string_value => "donuts"}).should be_false
112
+ end
113
+ end
@@ -0,0 +1,74 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Validation do
4
+ before(:each) do
5
+ @validation = FactoryGirl.create(:validation)
6
+ end
7
+
8
+ it "should be valid" do
9
+ @validation.should be_valid
10
+ end
11
+
12
+ it "should be invalid without a rule" do
13
+ @validation.rule = nil
14
+ @validation.should have(2).errors_on(:rule)
15
+ @validation.rule = " "
16
+ @validation.should have(1).errors_on(:rule)
17
+ end
18
+
19
+ # this causes issues with building and saving
20
+ # it "should be invalid without a answer_id" do
21
+ # @validation.answer_id = nil
22
+ # @validation.should have(1).error_on(:answer_id)
23
+ # end
24
+
25
+ it "should be invalid unless rule composed of only references and operators" do
26
+ @validation.rule = "foo"
27
+ @validation.should have(1).error_on(:rule)
28
+ @validation.rule = "1 to 2"
29
+ @validation.should have(1).error_on(:rule)
30
+ @validation.rule = "a and b"
31
+ @validation.should have(1).error_on(:rule)
32
+ end
33
+ it "should protect timestamps" do
34
+ saved_attrs = @validation.attributes
35
+ if defined? ActiveModel::MassAssignmentSecurity::Error
36
+ lambda {@validation.update_attributes(:created_at => 3.days.ago, :updated_at => 3.hours.ago)}#.should raise_error(ActiveModel::MassAssignmentSecurity::Error)
37
+ else
38
+ @validation.attributes = {:created_at => 3.days.ago, :updated_at => 3.hours.ago} # automatically protected by Rails
39
+ @validation.attributes = {:created_at => 3.days.ago, :updated_at => 3.hours.ago} # automatically protected by Rails
40
+ end
41
+ @validation.attributes.should == saved_attrs
42
+ end
43
+ end
44
+ describe Validation, "reporting its status" do
45
+ def test_var(vhash, vchashes, ahash, rhash)
46
+ a = FactoryGirl.create(:answer, ahash)
47
+ v = FactoryGirl.create(:validation, {:answer => a, :rule => "A"}.merge(vhash))
48
+ vchashes.each do |vchash|
49
+ FactoryGirl.create(:validation_condition, {:validation => v, :rule_key => "A"}.merge(vchash))
50
+ end
51
+ rs = FactoryGirl.create(:response_set)
52
+ r = FactoryGirl.create(:response, {:answer => a, :question => a.question}.merge(rhash))
53
+ rs.responses << r
54
+ return v.is_valid?(rs)
55
+ end
56
+
57
+ it "should validate a response by integer comparison" do
58
+ test_var({:rule => "A and B"}, [{:operator => ">=", :integer_value => 0}, {:rule_key => "B", :operator => "<=", :integer_value => 120}], {:response_class => "integer"}, {:integer_value => 48}).should be_true
59
+ end
60
+ it "should validate a response by regexp" do
61
+ test_var({}, [{:operator => "=~", :regexp => '/^[a-z]{1,6}$/'}], {:response_class => "string"}, {:string_value => ""}).should be_false
62
+ end
63
+ end
64
+ describe Validation, "with conditions" do
65
+ it "should destroy conditions when destroyed" do
66
+ @validation = FactoryGirl.create(:validation)
67
+ FactoryGirl.create(:validation_condition, :validation => @validation, :rule_key => "A")
68
+ FactoryGirl.create(:validation_condition, :validation => @validation, :rule_key => "B")
69
+ FactoryGirl.create(:validation_condition, :validation => @validation, :rule_key => "C")
70
+ v_ids = @validation.validation_conditions.map(&:id)
71
+ @validation.destroy
72
+ v_ids.each{|id| DependencyCondition.find_by_id(id).should == nil}
73
+ end
74
+ end
@@ -0,0 +1,2 @@
1
+ --exclude "spec/*,gems/*"
2
+ --rails
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format progress
3
+ --loadby mtime
4
+ --reverse
@@ -0,0 +1,56 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ begin
4
+ require File.expand_path("../../testbed/config/environment", __FILE__)
5
+ rescue LoadError => e
6
+ fail "Could not load the testbed app. Have you generated it?\n#{e.class}: #{e}"
7
+ end
8
+ require 'rspec/rails'
9
+ require 'factories'
10
+ require 'json_spec'
11
+ require 'database_cleaner'
12
+
13
+ # for asset_pipeline_enabled? in models
14
+ include Surveyor::Helpers::AssetPipeline
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc,
17
+ # in spec/support/ and its subdirectories.
18
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
19
+
20
+ RSpec.configure do |config|
21
+ config.include JsonSpec::Helpers
22
+
23
+ config.treat_symbols_as_metadata_keys_with_true_values = true
24
+
25
+ # == Mock Framework
26
+ #
27
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
28
+ #
29
+ # config.mock_with :mocha
30
+ # config.mock_with :flexmock
31
+ # config.mock_with :rr
32
+ config.mock_with :rspec
33
+
34
+ ## Database Cleaner
35
+
36
+ config.before(:suite) do
37
+ DatabaseCleaner.strategy = :transaction
38
+ DatabaseCleaner.clean_with(:truncation)
39
+ end
40
+
41
+ config.before(:each, :clean_with_truncation) do
42
+ DatabaseCleaner.strategy = :truncation
43
+ end
44
+
45
+ config.after(:each, :clean_with_truncation) do
46
+ DatabaseCleaner.strategy = :transaction
47
+ end
48
+
49
+ config.before(:each) do
50
+ DatabaseCleaner.start
51
+ end
52
+
53
+ config.after(:each) do
54
+ DatabaseCleaner.clean
55
+ end
56
+ end
@@ -0,0 +1,65 @@
1
+ #!/bin/bash
2
+
3
+ echo ""
4
+
5
+ # Set the prompt for the select command
6
+ PS3="Choose a stack or 'q' to quit: "
7
+ export CUCUMBER_OPTS="--format CucumberSpinner::ProgressBarFormatter"
8
+ export SPEC_OPTS="--format Fuubar --color spec"
9
+ export BUNDLER_VERSION=1.3.1
10
+
11
+ options=""
12
+ rubies=(1.9.3)
13
+ rails_versions=(rails_3.1 rails_3.2)
14
+
15
+ for i in "${rubies[@]}"
16
+ do
17
+ for j in "${rails_versions[@]}"
18
+ do
19
+ options+="$i@$j "
20
+ done
21
+ done
22
+ options+="all"
23
+
24
+ # Show a menu and ask for input.
25
+ select combo in $options; do
26
+ case $combo in
27
+ all)
28
+ for i in "${rubies[@]}"
29
+ do
30
+ for j in "${rails_versions[@]}"
31
+ do
32
+ export CI_RUBY=$i
33
+ export RAILS_VERSION=$j
34
+ source ~/.rvm/scripts/rvm
35
+ rvm use $CI_RUBY@surveyor-$RAILS_VERSION --create
36
+ read -p "Press [Enter] to run tests on $CI_RUBY@$RAILS_VERSION..."
37
+ gem list -i bundler -v $BUNDLER_VERSION
38
+ if [ $? -ne 0 ]; then
39
+ gem install bundler -v $BUNDLER_VERSION
40
+ fi
41
+ bundle _${BUNDLER_VERSION}_ update
42
+ bundle _${BUNDLER_VERSION}_ exec rake testbed spec cucumber cucumber:wip
43
+ done
44
+ done
45
+ ;;
46
+ "")
47
+ echo ""
48
+ ;;
49
+ *)
50
+ arr=(${combo//@/ })
51
+ export CI_RUBY=${arr[0]}
52
+ export RAILS_VERSION=${arr[1]}
53
+ source ~/.rvm/scripts/rvm
54
+ rvm use $CI_RUBY@surveyor-$RAILS_VERSION --create
55
+ read -p "Press [Enter] to run tests on $CI_RUBY@$RAILS_VERSION..."
56
+ gem list -i bundler -v $BUNDLER_VERSION
57
+ if [ $? -ne 0 ]; then
58
+ gem install bundler -v $BUNDLER_VERSION
59
+ fi
60
+ bundle _${BUNDLER_VERSION}_ update
61
+ bundle _${BUNDLER_VERSION}_ exec rake testbed spec cucumber cucumber:wip
62
+ ;;
63
+ esac
64
+ break
65
+ done
@@ -0,0 +1,53 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "surveyor/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{affectiva-surveyor}
7
+ s.version = Surveyor::VERSION
8
+
9
+ s.authors = ["Brian Chamberlain", "Mark Yoon", "Affectiva"]
10
+ s.email = %q{webops@affectiva.com}
11
+ s.homepage = %q{http://github.com/NUBIC/surveyor}
12
+ s.post_install_message = %q{Thanks for installing surveyor! The time has come to run the surveyor generator and migrate your database, even if you are upgrading.}
13
+ s.summary = %q{A rails (gem) plugin to enable surveys in your application}
14
+
15
+ s.files = `git ls-files`.split("\n") - ['irb']
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency('rails', '~> 4.0')
21
+ # observers used to be part of core Rails but now are a separate gem
22
+ s.add_dependency('rails-observers', '~> 0.1')
23
+ # '< 5.0' is to be conservative; once 5.0 comes out we should test with it and
24
+ # allow it if it works.
25
+ s.add_dependency('haml')#, '>= 3.1.3', '< 5.0')
26
+ s.add_dependency('sass')
27
+ s.add_dependency('fastercsv')#, '~> 1.5.4')
28
+ s.add_dependency('formtastic')#, '~> 2.1.0')
29
+ s.add_dependency('uuidtools')#, '~> 2.1')
30
+ s.add_dependency('mustache')#, '0.99.4')
31
+ s.add_dependency('rabl')#, '~>0.6.13')
32
+
33
+ s.add_development_dependency('yard')
34
+ s.add_development_dependency('rake')#, '>= 0.9.2')
35
+ s.add_development_dependency('rspec-rails')#, '~> 2.9.0')
36
+ s.add_development_dependency('bundler')#, '~> 1.0', '>= 1.0.21')
37
+ s.add_development_dependency('factory_girl')#, '~> 2.1.2')
38
+ s.add_development_dependency('sqlite3')
39
+ s.add_development_dependency('cucumber-rails')#, '~> 1.1.1')
40
+
41
+ # FIXME
42
+ # https://github.com/bmabey/database_cleaner/issues/224
43
+ # tests failed because the database_cleaner postgresql monkeypatch
44
+ # was being applied to the same adapter as the sqlite monkeypatch.
45
+ # 1.0.1 is the last known-good version.
46
+ s.add_development_dependency('database_cleaner', '= 1.0.1')
47
+
48
+ s.add_development_dependency('launchy')#, '~> 2.0.5')
49
+ s.add_development_dependency('capybara')#, '~> 1.1.1')
50
+ s.add_development_dependency('ci_reporter')#, '1.6.6')
51
+ s.add_development_dependency('json_spec')#, '~> 1.0.3')
52
+ end
53
+
metadata ADDED
@@ -0,0 +1,601 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: affectiva-surveyor
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0.pre.disco.2
5
+ platform: ruby
6
+ authors:
7
+ - Brian Chamberlain
8
+ - Mark Yoon
9
+ - Affectiva
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2016-02-02 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '4.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '4.0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rails-observers
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '0.1'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.1'
43
+ - !ruby/object:Gem::Dependency
44
+ name: haml
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: sass
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: fastercsv
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: formtastic
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ - !ruby/object:Gem::Dependency
100
+ name: uuidtools
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: mustache
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: rabl
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ - !ruby/object:Gem::Dependency
142
+ name: yard
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ - !ruby/object:Gem::Dependency
156
+ name: rake
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ type: :development
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ - !ruby/object:Gem::Dependency
170
+ name: rspec-rails
171
+ requirement: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ type: :development
177
+ prerelease: false
178
+ version_requirements: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ - !ruby/object:Gem::Dependency
184
+ name: bundler
185
+ requirement: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ type: :development
191
+ prerelease: false
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ - !ruby/object:Gem::Dependency
198
+ name: factory_girl
199
+ requirement: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ type: :development
205
+ prerelease: false
206
+ version_requirements: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - ">="
209
+ - !ruby/object:Gem::Version
210
+ version: '0'
211
+ - !ruby/object:Gem::Dependency
212
+ name: sqlite3
213
+ requirement: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: '0'
218
+ type: :development
219
+ prerelease: false
220
+ version_requirements: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - ">="
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ - !ruby/object:Gem::Dependency
226
+ name: cucumber-rails
227
+ requirement: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - ">="
230
+ - !ruby/object:Gem::Version
231
+ version: '0'
232
+ type: :development
233
+ prerelease: false
234
+ version_requirements: !ruby/object:Gem::Requirement
235
+ requirements:
236
+ - - ">="
237
+ - !ruby/object:Gem::Version
238
+ version: '0'
239
+ - !ruby/object:Gem::Dependency
240
+ name: database_cleaner
241
+ requirement: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - '='
244
+ - !ruby/object:Gem::Version
245
+ version: 1.0.1
246
+ type: :development
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - '='
251
+ - !ruby/object:Gem::Version
252
+ version: 1.0.1
253
+ - !ruby/object:Gem::Dependency
254
+ name: launchy
255
+ requirement: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ version: '0'
260
+ type: :development
261
+ prerelease: false
262
+ version_requirements: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - ">="
265
+ - !ruby/object:Gem::Version
266
+ version: '0'
267
+ - !ruby/object:Gem::Dependency
268
+ name: capybara
269
+ requirement: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - ">="
272
+ - !ruby/object:Gem::Version
273
+ version: '0'
274
+ type: :development
275
+ prerelease: false
276
+ version_requirements: !ruby/object:Gem::Requirement
277
+ requirements:
278
+ - - ">="
279
+ - !ruby/object:Gem::Version
280
+ version: '0'
281
+ - !ruby/object:Gem::Dependency
282
+ name: ci_reporter
283
+ requirement: !ruby/object:Gem::Requirement
284
+ requirements:
285
+ - - ">="
286
+ - !ruby/object:Gem::Version
287
+ version: '0'
288
+ type: :development
289
+ prerelease: false
290
+ version_requirements: !ruby/object:Gem::Requirement
291
+ requirements:
292
+ - - ">="
293
+ - !ruby/object:Gem::Version
294
+ version: '0'
295
+ - !ruby/object:Gem::Dependency
296
+ name: json_spec
297
+ requirement: !ruby/object:Gem::Requirement
298
+ requirements:
299
+ - - ">="
300
+ - !ruby/object:Gem::Version
301
+ version: '0'
302
+ type: :development
303
+ prerelease: false
304
+ version_requirements: !ruby/object:Gem::Requirement
305
+ requirements:
306
+ - - ">="
307
+ - !ruby/object:Gem::Version
308
+ version: '0'
309
+ description:
310
+ email: webops@affectiva.com
311
+ executables: []
312
+ extensions: []
313
+ extra_rdoc_files: []
314
+ files:
315
+ - ".gitignore"
316
+ - ".rspec"
317
+ - CHANGELOG.md
318
+ - Gemfile
319
+ - Gemfile.rails_version
320
+ - MIT-LICENSE
321
+ - README.md
322
+ - Rakefile
323
+ - app/controllers/surveyor_controller.rb
324
+ - app/helpers/results_helper.rb
325
+ - app/helpers/survey_form_builder.rb
326
+ - app/helpers/surveyor_helper.rb
327
+ - app/inputs/quiet_input.rb
328
+ - app/inputs/surveyor_check_boxes_input.rb
329
+ - app/inputs/surveyor_radio_input.rb
330
+ - app/models/answer.rb
331
+ - app/models/dependency.rb
332
+ - app/models/dependency_condition.rb
333
+ - app/models/question.rb
334
+ - app/models/question_group.rb
335
+ - app/models/response.rb
336
+ - app/models/response_set.rb
337
+ - app/models/survey.rb
338
+ - app/models/survey_section.rb
339
+ - app/models/survey_section_sweeper.rb
340
+ - app/models/survey_translation.rb
341
+ - app/models/validation.rb
342
+ - app/models/validation_condition.rb
343
+ - app/views/layouts/results.html.erb
344
+ - app/views/layouts/surveyor_default.html.erb
345
+ - app/views/partials/_answer.html.haml
346
+ - app/views/partials/_dependents.html.haml
347
+ - app/views/partials/_question.html.haml
348
+ - app/views/partials/_question_group.html.haml
349
+ - app/views/partials/_section.html.haml
350
+ - app/views/partials/_section_menu.html.haml
351
+ - app/views/surveyor/edit.html.haml
352
+ - app/views/surveyor/export.json.rabl
353
+ - app/views/surveyor/new.html.haml
354
+ - app/views/surveyor/show.html.haml
355
+ - app/views/surveyor/show.json.rabl
356
+ - ci-exec.sh
357
+ - config/routes.rb
358
+ - cucumber.yml
359
+ - doc/REPRESENTATIONS.md
360
+ - doc/api_id_schema.json
361
+ - doc/question types.png
362
+ - doc/response_set_schema.json
363
+ - doc/surveyor question combinations.png
364
+ - doc/surveyor reject or delete decision matrix.png
365
+ - doc/surveyor_models.png
366
+ - doc/surveyor_models2.png
367
+ - doc/surveyor_timestamp_schema.json
368
+ - features/ajax_submissions.feature
369
+ - features/export_to_json.feature
370
+ - features/internationalization.feature
371
+ - features/no_duplicates.feature
372
+ - features/show_survey.feature
373
+ - features/step_definitions/parser_steps.rb
374
+ - features/step_definitions/surveyor_steps.rb
375
+ - features/step_definitions/ui_steps.rb
376
+ - features/step_definitions/web_steps.rb
377
+ - features/support/REDCapDemoDatabase_DataDictionary.csv
378
+ - features/support/database_cleaner.rb
379
+ - features/support/env.rb
380
+ - features/support/hooks.rb
381
+ - features/support/paths.rb
382
+ - features/support/redcap_new_headers.csv
383
+ - features/support/redcap_siblings.csv
384
+ - features/support/redcap_whitespace.csv
385
+ - features/support/selectors.rb
386
+ - features/support/simultaneous_ajax.rb
387
+ - features/support/single_quit_selenium_driver.rb
388
+ - features/support/slow_updates.rb
389
+ - features/surveyor.feature
390
+ - features/surveyor_dependencies.feature
391
+ - features/surveyor_parser.feature
392
+ - features/z_redcap_parser.feature
393
+ - lib/assets/images/surveyor/next.gif
394
+ - lib/assets/images/surveyor/prev.gif
395
+ - lib/assets/images/surveyor/ui-bg_flat_0_aaaaaa_40x100.png
396
+ - lib/assets/images/surveyor/ui-bg_flat_75_ffffff_40x100.png
397
+ - lib/assets/images/surveyor/ui-bg_glass_55_fbf9ee_1x400.png
398
+ - lib/assets/images/surveyor/ui-bg_glass_65_ffffff_1x400.png
399
+ - lib/assets/images/surveyor/ui-bg_glass_75_dadada_1x400.png
400
+ - lib/assets/images/surveyor/ui-bg_glass_75_e6e6e6_1x400.png
401
+ - lib/assets/images/surveyor/ui-bg_glass_95_fef1ec_1x400.png
402
+ - lib/assets/images/surveyor/ui-bg_highlight-soft_75_cccccc_1x100.png
403
+ - lib/assets/images/surveyor/ui-icons_222222_256x240.png
404
+ - lib/assets/images/surveyor/ui-icons_2e83ff_256x240.png
405
+ - lib/assets/images/surveyor/ui-icons_454545_256x240.png
406
+ - lib/assets/images/surveyor/ui-icons_888888_256x240.png
407
+ - lib/assets/images/surveyor/ui-icons_cd0a0a_256x240.png
408
+ - lib/assets/javascripts/surveyor/jquery-1.9.0.js
409
+ - lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js
410
+ - lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js
411
+ - lib/assets/javascripts/surveyor/jquery.maskedinput.js
412
+ - lib/assets/javascripts/surveyor/jquery.selectToUISlider.js
413
+ - lib/assets/javascripts/surveyor/jquery.surveyor.js
414
+ - lib/assets/stylesheets/surveyor.sass
415
+ - lib/assets/stylesheets/surveyor/jquery-ui-1.10.0.custom.css
416
+ - lib/assets/stylesheets/surveyor/jquery-ui-timepicker-addon.css
417
+ - lib/assets/stylesheets/surveyor/reset.css
418
+ - lib/assets/stylesheets/surveyor/results.css
419
+ - lib/assets/stylesheets/surveyor/ui.slider.extras.css
420
+ - lib/generators/surveyor/custom_generator.rb
421
+ - lib/generators/surveyor/install_generator.rb
422
+ - lib/generators/surveyor/templates/app/assets/javascripts/surveyor_all.js
423
+ - lib/generators/surveyor/templates/app/assets/stylesheets/surveyor_all.css
424
+ - lib/generators/surveyor/templates/app/controllers/surveyor_controller.rb
425
+ - lib/generators/surveyor/templates/app/views/layouts/surveyor_custom.html.erb
426
+ - lib/generators/surveyor/templates/config/locales/surveyor_en.yml
427
+ - lib/generators/surveyor/templates/config/locales/surveyor_es.yml
428
+ - lib/generators/surveyor/templates/config/locales/surveyor_he.yml
429
+ - lib/generators/surveyor/templates/config/locales/surveyor_ko.yml
430
+ - lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb
431
+ - lib/generators/surveyor/templates/db/migrate/add_api_ids.rb
432
+ - lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb
433
+ - lib/generators/surveyor/templates/db/migrate/add_correct_answer_id_to_questions.rb
434
+ - lib/generators/surveyor/templates/db/migrate/add_default_value_to_answers.rb
435
+ - lib/generators/surveyor/templates/db/migrate/add_display_order_to_surveys.rb
436
+ - lib/generators/surveyor/templates/db/migrate/add_display_type_to_answers.rb
437
+ - lib/generators/surveyor/templates/db/migrate/add_index_to_response_sets.rb
438
+ - lib/generators/surveyor/templates/db/migrate/add_index_to_surveys.rb
439
+ - lib/generators/surveyor/templates/db/migrate/add_input_mask_attributes_to_answer.rb
440
+ - lib/generators/surveyor/templates/db/migrate/add_section_id_to_responses.rb
441
+ - lib/generators/surveyor/templates/db/migrate/add_unique_index_on_access_code_and_version_in_surveys.rb
442
+ - lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
443
+ - lib/generators/surveyor/templates/db/migrate/add_version_to_surveys.rb
444
+ - lib/generators/surveyor/templates/db/migrate/api_ids_must_be_unique.rb
445
+ - lib/generators/surveyor/templates/db/migrate/create_answers.rb
446
+ - lib/generators/surveyor/templates/db/migrate/create_dependencies.rb
447
+ - lib/generators/surveyor/templates/db/migrate/create_dependency_conditions.rb
448
+ - lib/generators/surveyor/templates/db/migrate/create_question_groups.rb
449
+ - lib/generators/surveyor/templates/db/migrate/create_questions.rb
450
+ - lib/generators/surveyor/templates/db/migrate/create_response_sets.rb
451
+ - lib/generators/surveyor/templates/db/migrate/create_responses.rb
452
+ - lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb
453
+ - lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb
454
+ - lib/generators/surveyor/templates/db/migrate/create_surveys.rb
455
+ - lib/generators/surveyor/templates/db/migrate/create_validation_conditions.rb
456
+ - lib/generators/surveyor/templates/db/migrate/create_validations.rb
457
+ - lib/generators/surveyor/templates/db/migrate/drop_unique_index_on_access_code_in_surveys.rb
458
+ - lib/generators/surveyor/templates/db/migrate/update_blank_api_ids_on_question_group.rb
459
+ - lib/generators/surveyor/templates/db/migrate/update_blank_versions_on_surveys.rb
460
+ - lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
461
+ - lib/generators/surveyor/templates/surveys/MODIFYING_SURVEYOR.md
462
+ - lib/generators/surveyor/templates/surveys/date_survey.rb
463
+ - lib/generators/surveyor/templates/surveys/kitchen_sink_survey.rb
464
+ - lib/generators/surveyor/templates/surveys/languages.rb
465
+ - lib/generators/surveyor/templates/surveys/quiz.rb
466
+ - lib/generators/surveyor/templates/surveys/translations/languages.es.yml
467
+ - lib/generators/surveyor/templates/surveys/translations/languages.he.yml
468
+ - lib/generators/surveyor/templates/surveys/translations/languages.ko.yml
469
+ - lib/generators/surveyor/templates/vendor/assets/stylesheets/custom.sass
470
+ - lib/surveyor.rb
471
+ - lib/surveyor/acts_as_response.rb
472
+ - lib/surveyor/common.rb
473
+ - lib/surveyor/engine.rb
474
+ - lib/surveyor/helpers/asset_pipeline.rb
475
+ - lib/surveyor/helpers/formtastic_custom_input.rb
476
+ - lib/surveyor/helpers/surveyor_helper_methods.rb
477
+ - lib/surveyor/models/answer_methods.rb
478
+ - lib/surveyor/models/dependency_condition_methods.rb
479
+ - lib/surveyor/models/dependency_methods.rb
480
+ - lib/surveyor/models/question_group_methods.rb
481
+ - lib/surveyor/models/question_methods.rb
482
+ - lib/surveyor/models/response_methods.rb
483
+ - lib/surveyor/models/response_set_methods.rb
484
+ - lib/surveyor/models/survey_methods.rb
485
+ - lib/surveyor/models/survey_section_methods.rb
486
+ - lib/surveyor/models/survey_translation_methods.rb
487
+ - lib/surveyor/models/validation_condition_methods.rb
488
+ - lib/surveyor/models/validation_methods.rb
489
+ - lib/surveyor/mustache_context.rb
490
+ - lib/surveyor/parser.rb
491
+ - lib/surveyor/redcap_parser.rb
492
+ - lib/surveyor/surveyor_controller_methods.rb
493
+ - lib/surveyor/unparser.rb
494
+ - lib/surveyor/version.rb
495
+ - lib/tasks/surveyor_tasks.rake
496
+ - rails/init.rb
497
+ - spec/controllers/surveyor_controller_spec.rb
498
+ - spec/factories.rb
499
+ - spec/helpers/formtastic_custom_input_spec.rb
500
+ - spec/helpers/surveyor_helper_spec.rb
501
+ - spec/lib/benchmark_spec.rb
502
+ - spec/lib/chinese_survey.rb
503
+ - spec/lib/common_spec.rb
504
+ - spec/lib/parser_spec.rb
505
+ - spec/lib/rake_kitchen_sink.rb
506
+ - spec/lib/redcap_parser_spec.rb
507
+ - spec/lib/tasks_spec.rake
508
+ - spec/lib/unparser_spec.rb
509
+ - spec/models/answer_spec.rb
510
+ - spec/models/dependency_condition_spec.rb
511
+ - spec/models/dependency_spec.rb
512
+ - spec/models/question_group_spec.rb
513
+ - spec/models/question_spec.rb
514
+ - spec/models/response_set_spec.rb
515
+ - spec/models/response_spec.rb
516
+ - spec/models/survey_section_spec.rb
517
+ - spec/models/survey_spec.rb
518
+ - spec/models/validation_condition_spec.rb
519
+ - spec/models/validation_spec.rb
520
+ - spec/rcov.opts
521
+ - spec/spec.opts
522
+ - spec/spec_helper.rb
523
+ - stacktests.sh
524
+ - surveyor.gemspec
525
+ homepage: http://github.com/NUBIC/surveyor
526
+ licenses: []
527
+ metadata: {}
528
+ post_install_message: Thanks for installing surveyor! The time has come to run the
529
+ surveyor generator and migrate your database, even if you are upgrading.
530
+ rdoc_options: []
531
+ require_paths:
532
+ - lib
533
+ required_ruby_version: !ruby/object:Gem::Requirement
534
+ requirements:
535
+ - - ">="
536
+ - !ruby/object:Gem::Version
537
+ version: '0'
538
+ required_rubygems_version: !ruby/object:Gem::Requirement
539
+ requirements:
540
+ - - ">"
541
+ - !ruby/object:Gem::Version
542
+ version: 1.3.1
543
+ requirements: []
544
+ rubyforge_project:
545
+ rubygems_version: 2.4.6
546
+ signing_key:
547
+ specification_version: 4
548
+ summary: A rails (gem) plugin to enable surveys in your application
549
+ test_files:
550
+ - features/ajax_submissions.feature
551
+ - features/export_to_json.feature
552
+ - features/internationalization.feature
553
+ - features/no_duplicates.feature
554
+ - features/show_survey.feature
555
+ - features/step_definitions/parser_steps.rb
556
+ - features/step_definitions/surveyor_steps.rb
557
+ - features/step_definitions/ui_steps.rb
558
+ - features/step_definitions/web_steps.rb
559
+ - features/support/REDCapDemoDatabase_DataDictionary.csv
560
+ - features/support/database_cleaner.rb
561
+ - features/support/env.rb
562
+ - features/support/hooks.rb
563
+ - features/support/paths.rb
564
+ - features/support/redcap_new_headers.csv
565
+ - features/support/redcap_siblings.csv
566
+ - features/support/redcap_whitespace.csv
567
+ - features/support/selectors.rb
568
+ - features/support/simultaneous_ajax.rb
569
+ - features/support/single_quit_selenium_driver.rb
570
+ - features/support/slow_updates.rb
571
+ - features/surveyor.feature
572
+ - features/surveyor_dependencies.feature
573
+ - features/surveyor_parser.feature
574
+ - features/z_redcap_parser.feature
575
+ - spec/controllers/surveyor_controller_spec.rb
576
+ - spec/factories.rb
577
+ - spec/helpers/formtastic_custom_input_spec.rb
578
+ - spec/helpers/surveyor_helper_spec.rb
579
+ - spec/lib/benchmark_spec.rb
580
+ - spec/lib/chinese_survey.rb
581
+ - spec/lib/common_spec.rb
582
+ - spec/lib/parser_spec.rb
583
+ - spec/lib/rake_kitchen_sink.rb
584
+ - spec/lib/redcap_parser_spec.rb
585
+ - spec/lib/tasks_spec.rake
586
+ - spec/lib/unparser_spec.rb
587
+ - spec/models/answer_spec.rb
588
+ - spec/models/dependency_condition_spec.rb
589
+ - spec/models/dependency_spec.rb
590
+ - spec/models/question_group_spec.rb
591
+ - spec/models/question_spec.rb
592
+ - spec/models/response_set_spec.rb
593
+ - spec/models/response_spec.rb
594
+ - spec/models/survey_section_spec.rb
595
+ - spec/models/survey_spec.rb
596
+ - spec/models/validation_condition_spec.rb
597
+ - spec/models/validation_spec.rb
598
+ - spec/rcov.opts
599
+ - spec/spec.opts
600
+ - spec/spec_helper.rb
601
+ has_rdoc: