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,11 @@
1
+ /* css for timepicker */
2
+ .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
3
+ .ui-timepicker-div dl { text-align: left; }
4
+ .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
5
+ .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
6
+ .ui-timepicker-div td { font-size: 90%; }
7
+ .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
8
+
9
+ .ui-timepicker-rtl{ direction: rtl; }
10
+ .ui-timepicker-rtl dl { text-align: right; }
11
+ .ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
@@ -0,0 +1,48 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/
2
+ v2.0 | 20110126
3
+ License: none (public domain)
4
+ */
5
+
6
+ html, body, div, span, applet, object, iframe,
7
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ a, abbr, acronym, address, big, cite, code,
9
+ del, dfn, em, img, ins, kbd, q, s, samp,
10
+ small, strike, strong, sub, sup, tt, var,
11
+ b, u, i, center,
12
+ dl, dt, dd, ol, ul, li,
13
+ fieldset, form, label, legend,
14
+ table, caption, tbody, tfoot, thead, tr, th, td,
15
+ article, aside, canvas, details, embed,
16
+ figure, figcaption, footer, header, hgroup,
17
+ menu, nav, output, ruby, section, summary,
18
+ time, mark, audio, video {
19
+ margin: 0;
20
+ padding: 0;
21
+ border: 0;
22
+ font-size: 100%;
23
+ font: inherit;
24
+ vertical-align: baseline;
25
+ }
26
+ /* HTML5 display-role reset for older browsers */
27
+ article, aside, details, figcaption, figure,
28
+ footer, header, hgroup, menu, nav, section {
29
+ display: block;
30
+ }
31
+ body {
32
+ line-height: 1;
33
+ }
34
+ ol, ul {
35
+ list-style: none;
36
+ }
37
+ blockquote, q {
38
+ quotes: none;
39
+ }
40
+ blockquote:before, blockquote:after,
41
+ q:before, q:after {
42
+ content: '';
43
+ content: none;
44
+ }
45
+ table {
46
+ border-collapse: collapse;
47
+ border-spacing: 0;
48
+ }
@@ -0,0 +1,125 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ .fieldWithErrors {
20
+ padding: 2px;
21
+ background-color: red;
22
+ display: table;
23
+ }
24
+
25
+ #errorExplanation {
26
+ width: 400px;
27
+ border: 2px solid red;
28
+ padding: 7px;
29
+ padding-bottom: 12px;
30
+ margin-bottom: 20px;
31
+ background-color: #f0f0f0;
32
+ }
33
+
34
+ #errorExplanation h2 {
35
+ text-align: left;
36
+ font-weight: bold;
37
+ padding: 5px 5px 5px 15px;
38
+ font-size: 12px;
39
+ margin: -7px;
40
+ background-color: #c00;
41
+ color: #fff;
42
+ }
43
+
44
+ #errorExplanation p {
45
+ color: #333;
46
+ margin-bottom: 0;
47
+ padding: 5px;
48
+ }
49
+
50
+ #errorExplanation ul li {
51
+ font-size: 12px;
52
+ list-style: square;
53
+ }
54
+
55
+
56
+
57
+ textarea, .preview {
58
+ width: 310px;
59
+ height: 360px;
60
+ }
61
+ .preview {
62
+ border: #abc 1px dotted;
63
+ padding: 3px;
64
+ }
65
+
66
+ .bluebox { padding:10px; border:1px solid #577BBF; background-color:#E6EDFF; }
67
+ input[type=submit] {
68
+ padding: 3px 7px;
69
+ font-weight: bold;
70
+ }
71
+
72
+ .list_table{width:100%;border-collapse: collapse;empty-cells: show;}
73
+ .list_table th{font: bold 12px Verdana, sans-serif; color: #fff;padding: 5px 15px 5px 5px;border: solid 1px #A0BDE4;background-color: #577BBF;}
74
+ .list_table tr td {border-collapse: collapse;padding: 5px 4px;color: #333;font-family: Verdana, sans-serif;font-size: 12px;border: 1px solid #DCE7F1;}
75
+ .list_table tr { background-color: #FFF; }
76
+ .list_table tr.even { background-color:#F2F5FB;}
77
+ .list_table tr:hover { background-color: #FDFCEA;}
78
+ .list_table tr.group td {background-color: #eee;font-weight:bold;font-size:13px;}
79
+ .list_table .border2px{border-left:2px solid #DCE7F1;}
80
+ .list_table a{padding:0 5px;}
81
+ .list_table th.asc{background:#577BBF url(../images/idp_views/arrow_down.gif) no-repeat right;}
82
+ .list_table th.desc{background:#577BBF url(../images/idp_views/arrow_up.gif) no-repeat right;}
83
+ .list_table th a{color:white;text-decoration:underline;}
84
+ .list_table .group{text-align:center;background:#f3f3f3;border-top:1px dotted #586A7E;border-bottom:1px dotted #586A7E;}
85
+ .list_table .group_top{border-top:1px dotted #586A7E;}
86
+ .list_table .group_bottom{border-bottom:1px dotted #586A7E;}
87
+ .list_table_page{padding:5px;text-align:center;}
88
+ .list_table_page form{display:inline}
89
+
90
+ .list_table1 {width:100%;border-collapse: collapse;empty-cells: show;}
91
+ .list_table1 th{ font: bold 12px Verdana, sans-serif; color: #577BBF; padding:3px 5px; background-color:#F2F5FB; border: 1px solid #DCE7F1; }
92
+ .list_table1 tr td {border-collapse: collapse;padding: 2px;color: #333;font-family: Verdana, sans-serif;font-size: 10px;border: 1px solid #DCE7F1;}
93
+ .list_table1 tr { background-color: #FFF; }
94
+ .list_table1 tr:hover { background-color: #FDFCEA;}
95
+
96
+ .legend_table { border-top: 1px solid #DCE7F1; border-bottom: 1px solid #DCE7F1; padding:1px 0; }
97
+
98
+ .list_table2 { width:100%; empty-cells: show; border-collapse:collapse;}
99
+ .list_table2 th{ font: bold 12px Verdana; padding:5px; text-align:left; background-color:#FFF;}
100
+ .list_table2 tr td { border-collapse:collapse; padding: 0px 3px; font-family: Verdana, sans-serif;font-size: 10px; border:1px solid #FFF; }
101
+ .list_table2 a:link { text-decoration:underline; color:#03F;}
102
+ .list_table2 a:visited { text-decoration:underline; color:#03F; }
103
+ .list_table2 a:hover { text-decoration:none; color:#03F; }
104
+
105
+ .list_table3{width:100%;border-collapse: collapse;empty-cells: show; margin:5px 0;}
106
+ .list_table3 th{font: bold 12px Arial; color: #fff;padding: 3px;border: solid 1px #A0BDE4;background-color: #577BBF;}
107
+ .list_table3 tr td { border-collapse: collapse;padding: 5px 2px; font-family: Arial;font-size: 11px;border: 1px solid #DCE7F1; line-height:1.2em;}
108
+ .list_table3 tr { background-color: #FFF;}
109
+ .list_table3 tr.even { background-color:#F2F5FB;}
110
+ .list_table3 tr:hover { background-color: #FDFCEA;}
111
+
112
+ .list_table4{ border-collapse: collapse;empty-cells: show;}
113
+ .list_table4 th{font: bold 11px Arial; padding: 3px; text-align:left; background-color:#F2F5FB; border: 1px solid #DCE7F1; color:#577BBF;}
114
+ .list_table4 tr td { border-collapse: collapse;padding: 0px 3px; font-family: Arial;font-size: 10px;border: 1px solid #DCE7F1;}
115
+ .list_table4 tr { background-color: #FFF; }
116
+ .list_table4 tr.even { background-color:#F2F5FB;}
117
+ .list_table4 tr:hover { background-color: #FDFCEA;}
118
+
119
+ .list_table5 { width:100%; empty-cells: show; border-collapse:collapse; margin:5px 0;}
120
+ .list_table5 th{ font: bold 12px Verdana; padding:5px; text-align:left; background-color:#FFF;}
121
+ .list_table5 tr td { border-collapse:collapse; padding: 5px; font-family: Verdana, sans-serif;font-size: 12px; }
122
+ .list_table5 a:link { text-decoration:underline; color:#03F;}
123
+ .list_table5 a:visited { text-decoration:underline; color:#03F; }
124
+ .list_table5 a:hover { text-decoration:none; color:#03F; }
125
+
@@ -0,0 +1,110 @@
1
+ /*NEW SLIDER STYLES FOR SCALE, ETC*/
2
+ /* slider widget */
3
+ .ui-slider {
4
+ text-decoration: none !important;
5
+ }
6
+ .ui-slider .ui-slider-handle {
7
+ overflow: visible !important;
8
+ }
9
+ .ui-slider .ui-slider-tooltip {
10
+ display: none;
11
+ }
12
+ .ui-slider .screenReaderContext {
13
+ position: absolute;
14
+ width: 0;
15
+ height: 0;
16
+ overflow: hidden;
17
+ left: -999999999px;
18
+ }
19
+ .ui-slider .ui-state-active .ui-slider-tooltip, .ui-slider .ui-state-focus .ui-slider-tooltip, .ui-slider .ui-state-hover .ui-slider-tooltip {
20
+ display: block;
21
+ position: absolute;
22
+ bottom: 2.5em;
23
+ text-align: center;
24
+ padding: .3em .2em .4em;
25
+ font-size: .9em;
26
+ width: 8em;
27
+ margin-left: -3.7em;
28
+ }
29
+ .ui-slider .ui-slider-tooltip .ui-tooltip-pointer-down, .ui-slider .ui-slider-tooltip .ui-tooltip-pointer-down-inner {
30
+ position: absolute;
31
+ display: block;
32
+ width:0;
33
+ height:0;
34
+ border-bottom-width: 0;
35
+ background: none;
36
+ }
37
+ .ui-slider .ui-slider-tooltip .ui-tooltip-pointer-down {
38
+ border-left: 7px dashed transparent;
39
+ border-right: 7px dashed transparent;
40
+ border-top-width: 8px;
41
+ bottom: -8px;
42
+ right: auto;
43
+ left: 50%;
44
+ margin-left: -7px;
45
+ }
46
+ .ui-slider .ui-slider-tooltip .ui-tooltip-pointer-down-inner {
47
+ border-left: 6px dashed transparent;
48
+ border-right: 6px dashed transparent;
49
+ border-top: 7px solid #fff;
50
+ bottom: auto;
51
+ top: -9px;
52
+ left: -6px;
53
+ }
54
+ .ui-slider a {
55
+ text-decoration: none;
56
+ }
57
+ .ui-slider ol, .ui-slider li, .ui-slider dl, .ui-slider dd, .ui-slider dt {
58
+ list-style: none;
59
+ margin: 0;
60
+ padding: 0;
61
+ }
62
+ .ui-slider ol, .ui-slider dl {
63
+ position: relative;
64
+ top: 1.3em;
65
+ width: 100%;
66
+ }
67
+ .ui-slider dt {
68
+ top: 1.5em;
69
+ position: absolute;
70
+ padding-top: .2em;
71
+ text-align: center;
72
+ border-bottom: 1px dotted #ddd;
73
+ height: .7em;
74
+ color: #999;
75
+ }
76
+ .ui-slider dt span {
77
+ background: #fff;
78
+ padding: 0 .5em;
79
+ }
80
+ .ui-slider li, .ui-slider dd {
81
+ position: absolute;
82
+ overflow: visible;
83
+ color: #666;
84
+ }
85
+ .ui-slider span.ui-slider-label {
86
+ position: absolute;
87
+ }
88
+ .ui-slider li span.ui-slider-label, .ui-slider dd span.ui-slider-label {
89
+ display: none;
90
+ }
91
+ .ui-slider li span.ui-slider-label-show, .ui-slider dd span.ui-slider-label-show {
92
+ display: block;
93
+ }
94
+ .ui-slider span.ui-slider-tic {
95
+ position: absolute;
96
+ left: 0;
97
+ height: .8em;
98
+ top: -1.3em;
99
+ }
100
+ .ui-slider li span.ui-widget-content, .ui-slider dd span.ui-widget-content {
101
+ border-right: 0;
102
+ border-left-width: 1px;
103
+ border-left-style: solid;
104
+ border-top: 0;
105
+ border-bottom: 0;
106
+ }
107
+ .ui-slider .first .ui-slider-tic, .ui-slider .last .ui-slider-tic {
108
+ display: none;
109
+ }
110
+
@@ -0,0 +1,18 @@
1
+ # encoding: UTF-8
2
+ require 'rails/generators'
3
+ module Surveyor
4
+ class CustomGenerator < Rails::Generators::Base
5
+ source_root File.expand_path("../templates", __FILE__)
6
+
7
+ def readme
8
+ copy_file "surveys/EXTENDING_SURVEYOR.md"
9
+ end
10
+ def controller
11
+ copy_file "app/controllers/surveyor_controller.rb"
12
+ end
13
+ def layout
14
+ copy_file "app/views/layouts/surveyor_custom.html.erb"
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,101 @@
1
+ # encoding: UTF-8
2
+ require 'rails/generators'
3
+ require 'surveyor/helpers/asset_pipeline'
4
+
5
+ module Surveyor
6
+ class InstallGenerator < Rails::Generators::Base
7
+ include Surveyor::Helpers::AssetPipeline
8
+
9
+ source_root File.expand_path("../templates", __FILE__)
10
+ desc "Generate surveyor README, migrations, assets and sample survey"
11
+ class_option :skip_migrations, :type => :boolean, :desc => "skip migrations, but generate everything else"
12
+
13
+ MIGRATION_ORDER = %w(
14
+ create_surveys
15
+ create_survey_sections
16
+ create_questions
17
+ create_question_groups create_answers
18
+ create_response_sets
19
+ create_responses
20
+ create_dependencies
21
+ create_dependency_conditions
22
+ create_validations
23
+ create_validation_conditions
24
+ add_display_order_to_surveys
25
+ add_correct_answer_id_to_questions
26
+ add_index_to_response_sets
27
+ add_index_to_surveys
28
+ add_unique_indicies
29
+ add_section_id_to_responses
30
+ add_default_value_to_answers
31
+ add_api_ids
32
+ add_display_type_to_answers
33
+ add_api_id_to_question_groups
34
+ add_api_ids_to_response_sets_and_responses
35
+ update_blank_api_ids_on_question_group
36
+ drop_unique_index_on_access_code_in_surveys
37
+ add_version_to_surveys
38
+ add_unique_index_on_access_code_and_version_in_surveys
39
+ update_blank_versions_on_surveys
40
+ api_ids_must_be_unique
41
+ create_survey_translations
42
+ add_input_mask_attributes_to_answer
43
+ )
44
+
45
+ def readme
46
+ copy_file "../../../../README.md", "surveys/README.md"
47
+ end
48
+ def migrations
49
+ unless options[:skip_migrations]
50
+ migration_files = Dir[File.join(self.class.source_root, 'db/migrate/*.rb')]
51
+ migrations_not_in_order =
52
+ migration_files.collect { |f| File.basename(f).sub(/\.rb$/, '') } - MIGRATION_ORDER
53
+ unless migrations_not_in_order.empty?
54
+ fail "%s migration%s not added to MIGRATION_ORDER: %s" % [
55
+ migrations_not_in_order.size,
56
+ migrations_not_in_order.size == 1 ? '' : 's',
57
+ migrations_not_in_order.join(', ')
58
+ ]
59
+ end
60
+
61
+ # because all migration timestamps end up the same, causing a collision when running rake db:migrate
62
+ # copied functionality from RAILS_GEM_PATH/lib/rails_generator/commands.rb
63
+ MIGRATION_ORDER.each_with_index do |model, i|
64
+ unless (prev_migrations = Dir.glob("db/migrate/[0-9]*_*.rb").grep(/[0-9]+_#{model}.rb$/)).empty?
65
+ prev_migration_timestamp = prev_migrations[0].match(/([0-9]+)_#{model}.rb$/)[1]
66
+ end
67
+ copy_file("db/migrate/#{model}.rb", "db/migrate/#{(prev_migration_timestamp || Time.now.utc.strftime("%Y%m%d%H%M%S").to_i + i).to_s}_#{model}.rb")
68
+ end
69
+ end
70
+ end
71
+
72
+ def routes
73
+ route('mount Surveyor::Engine => "/surveys", :as => "surveyor"')
74
+ end
75
+
76
+ def assets
77
+ if asset_pipeline_enabled?
78
+ directory "app/assets"
79
+ copy_file "vendor/assets/stylesheets/custom.sass"
80
+ else
81
+ directory "../../../assets/javascripts", "public/javascripts"
82
+ directory "../../../assets/images", "public/images"
83
+ directory "../../../assets/stylesheets/surveyor", "public/stylesheets/surveyor"
84
+ copy_file "../../../assets/stylesheets/surveyor.sass", "public/stylesheets/sass/surveyor.sass"
85
+ copy_file "vendor/assets/stylesheets/custom.sass", "public/stylesheets/sass/custom.sass"
86
+ end
87
+ end
88
+
89
+ def surveys
90
+ copy_file "surveys/kitchen_sink_survey.rb"
91
+ copy_file "surveys/quiz.rb"
92
+ copy_file "surveys/date_survey.rb"
93
+ copy_file "surveys/languages.rb"
94
+ directory "surveys/translations"
95
+ end
96
+
97
+ def locales
98
+ directory "config/locales"
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,6 @@
1
+ //= require surveyor/jquery-1.9.0
2
+ //= require surveyor/jquery-ui-1.10.0.custom
3
+ //= require surveyor/jquery-ui-timepicker-addon
4
+ //= require surveyor/jquery.selectToUISlider
5
+ //= require surveyor/jquery.surveyor
6
+ //= require surveyor/jquery.maskedinput
@@ -0,0 +1,9 @@
1
+ /*
2
+ *= require surveyor/reset
3
+ *= require surveyor/jquery-ui-1.10.0.custom
4
+ *= require surveyor/jquery-ui-timepicker-addon
5
+ *= require surveyor/ui.slider.extras
6
+ *= require surveyor/results
7
+ *= require surveyor
8
+ *= require custom
9
+ */
@@ -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