hssc_surveyor 1.4.1.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. data/.gitignore +28 -0
  2. data/.rspec +1 -0
  3. data/CHANGELOG.md +198 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.rails_version +19 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +186 -0
  8. data/Rakefile +105 -0
  9. data/app/controllers/surveyor_controller.rb +6 -0
  10. data/app/helpers/results_helper.rb +20 -0
  11. data/app/helpers/survey_form_builder.rb +37 -0
  12. data/app/helpers/surveyor_helper.rb +3 -0
  13. data/app/inputs/quiet_input.rb +5 -0
  14. data/app/inputs/surveyor_check_boxes_input.rb +35 -0
  15. data/app/inputs/surveyor_radio_input.rb +18 -0
  16. data/app/models/answer.rb +4 -0
  17. data/app/models/dependency.rb +4 -0
  18. data/app/models/dependency_condition.rb +4 -0
  19. data/app/models/question.rb +4 -0
  20. data/app/models/question_group.rb +5 -0
  21. data/app/models/response.rb +5 -0
  22. data/app/models/response_set.rb +4 -0
  23. data/app/models/survey.rb +4 -0
  24. data/app/models/survey_section.rb +5 -0
  25. data/app/models/survey_section_sweeper.rb +15 -0
  26. data/app/models/survey_translation.rb +5 -0
  27. data/app/models/validation.rb +4 -0
  28. data/app/models/validation_condition.rb +4 -0
  29. data/app/views/layouts/results.html.erb +13 -0
  30. data/app/views/layouts/surveyor_default.html.erb +12 -0
  31. data/app/views/partials/_answer.html.haml +25 -0
  32. data/app/views/partials/_dependents.html.haml +5 -0
  33. data/app/views/partials/_question.html.haml +41 -0
  34. data/app/views/partials/_question_group.html.haml +44 -0
  35. data/app/views/partials/_section.html.haml +12 -0
  36. data/app/views/partials/_section_menu.html.haml +12 -0
  37. data/app/views/surveyor/edit.html.haml +24 -0
  38. data/app/views/surveyor/export.json.rabl +85 -0
  39. data/app/views/surveyor/new.html.haml +24 -0
  40. data/app/views/surveyor/show.html.haml +74 -0
  41. data/app/views/surveyor/show.json.rabl +15 -0
  42. data/ci-exec.sh +56 -0
  43. data/config/routes.rb +8 -0
  44. data/cucumber.yml +10 -0
  45. data/doc/REPRESENTATIONS.md +34 -0
  46. data/doc/api_id_schema.json +7 -0
  47. data/doc/question types.png +0 -0
  48. data/doc/response_set_schema.json +54 -0
  49. data/doc/surveyor question combinations.png +0 -0
  50. data/doc/surveyor reject or delete decision matrix.png +0 -0
  51. data/doc/surveyor_models.png +0 -0
  52. data/doc/surveyor_models2.png +0 -0
  53. data/doc/surveyor_timestamp_schema.json +9 -0
  54. data/features/ajax_submissions.feature +140 -0
  55. data/features/export_to_json.feature +344 -0
  56. data/features/internationalization.feature +121 -0
  57. data/features/no_duplicates.feature +110 -0
  58. data/features/show_survey.feature +71 -0
  59. data/features/step_definitions/parser_steps.rb +145 -0
  60. data/features/step_definitions/surveyor_steps.rb +325 -0
  61. data/features/step_definitions/ui_steps.rb +25 -0
  62. data/features/step_definitions/web_steps.rb +225 -0
  63. data/features/support/REDCapDemoDatabase_DataDictionary.csv +127 -0
  64. data/features/support/database_cleaner.rb +16 -0
  65. data/features/support/env.rb +56 -0
  66. data/features/support/hooks.rb +4 -0
  67. data/features/support/paths.rb +39 -0
  68. data/features/support/redcap_new_headers.csv +1 -0
  69. data/features/support/redcap_siblings.csv +1 -0
  70. data/features/support/redcap_whitespace.csv +1 -0
  71. data/features/support/selectors.rb +39 -0
  72. data/features/support/simultaneous_ajax.rb +101 -0
  73. data/features/support/single_quit_selenium_driver.rb +23 -0
  74. data/features/support/slow_updates.rb +18 -0
  75. data/features/surveyor.feature +895 -0
  76. data/features/surveyor_dependencies.feature +476 -0
  77. data/features/surveyor_parser.feature +504 -0
  78. data/features/z_redcap_parser.feature +62 -0
  79. data/lib/assets/images/surveyor/next.gif +0 -0
  80. data/lib/assets/images/surveyor/prev.gif +0 -0
  81. data/lib/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  82. data/lib/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  83. data/lib/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  84. data/lib/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  85. data/lib/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  86. data/lib/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  87. data/lib/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  88. data/lib/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  89. data/lib/assets/images/ui-icons_222222_256x240.png +0 -0
  90. data/lib/assets/images/ui-icons_2e83ff_256x240.png +0 -0
  91. data/lib/assets/images/ui-icons_454545_256x240.png +0 -0
  92. data/lib/assets/images/ui-icons_888888_256x240.png +0 -0
  93. data/lib/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
  94. data/lib/assets/javascripts/surveyor/jquery-1.9.0.js +9555 -0
  95. data/lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js +14850 -0
  96. data/lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js +1919 -0
  97. data/lib/assets/javascripts/surveyor/jquery.maskedinput.js +338 -0
  98. data/lib/assets/javascripts/surveyor/jquery.selectToUISlider.js +240 -0
  99. data/lib/assets/javascripts/surveyor/jquery.surveyor.js +156 -0
  100. data/lib/assets/stylesheets/surveyor/jquery-ui-1.10.0.custom.css +1174 -0
  101. data/lib/assets/stylesheets/surveyor/jquery-ui-timepicker-addon.css +11 -0
  102. data/lib/assets/stylesheets/surveyor/reset.css +48 -0
  103. data/lib/assets/stylesheets/surveyor/results.css +125 -0
  104. data/lib/assets/stylesheets/surveyor/ui.slider.extras.css +110 -0
  105. data/lib/assets/stylesheets/surveyor.sass +132 -0
  106. data/lib/generators/surveyor/custom_generator.rb +18 -0
  107. data/lib/generators/surveyor/install_generator.rb +102 -0
  108. data/lib/generators/surveyor/templates/app/assets/javascripts/surveyor_all.js +6 -0
  109. data/lib/generators/surveyor/templates/app/assets/stylesheets/surveyor_all.css +9 -0
  110. data/lib/generators/surveyor/templates/app/controllers/surveyor_controller.rb +40 -0
  111. data/lib/generators/surveyor/templates/app/views/layouts/surveyor_custom.html.erb +13 -0
  112. data/lib/generators/surveyor/templates/config/locales/surveyor_en.yml +19 -0
  113. data/lib/generators/surveyor/templates/config/locales/surveyor_es.yml +19 -0
  114. data/lib/generators/surveyor/templates/config/locales/surveyor_he.yml +19 -0
  115. data/lib/generators/surveyor/templates/config/locales/surveyor_ko.yml +19 -0
  116. data/lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb +10 -0
  117. data/lib/generators/surveyor/templates/db/migrate/add_api_ids.rb +14 -0
  118. data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb +12 -0
  119. data/lib/generators/surveyor/templates/db/migrate/add_attachment_to_response.rb +5 -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 +284 -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/acts_as_response.rb +17 -0
  158. data/lib/surveyor/common.rb +59 -0
  159. data/lib/surveyor/engine.rb +10 -0
  160. data/lib/surveyor/helpers/asset_pipeline.rb +13 -0
  161. data/lib/surveyor/helpers/formtastic_custom_input.rb +13 -0
  162. data/lib/surveyor/helpers/surveyor_helper_methods.rb +103 -0
  163. data/lib/surveyor/models/answer_methods.rb +86 -0
  164. data/lib/surveyor/models/dependency_condition_methods.rb +72 -0
  165. data/lib/surveyor/models/dependency_methods.rb +60 -0
  166. data/lib/surveyor/models/question_group_methods.rb +61 -0
  167. data/lib/surveyor/models/question_methods.rb +115 -0
  168. data/lib/surveyor/models/response_methods.rb +132 -0
  169. data/lib/surveyor/models/response_set_methods.rb +196 -0
  170. data/lib/surveyor/models/survey_methods.rb +103 -0
  171. data/lib/surveyor/models/survey_section_methods.rb +56 -0
  172. data/lib/surveyor/models/survey_translation_methods.rb +33 -0
  173. data/lib/surveyor/models/validation_condition_methods.rb +56 -0
  174. data/lib/surveyor/models/validation_methods.rb +48 -0
  175. data/lib/surveyor/mustache_context.rb +11 -0
  176. data/lib/surveyor/parser.rb +428 -0
  177. data/lib/surveyor/redcap_parser.rb +289 -0
  178. data/lib/surveyor/surveyor_controller_methods.rb +237 -0
  179. data/lib/surveyor/unparser.rb +147 -0
  180. data/lib/surveyor/version.rb +3 -0
  181. data/lib/surveyor.rb +13 -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 +307 -0
  185. data/spec/factories.rb +161 -0
  186. data/spec/helpers/formtastic_custom_input_spec.rb +15 -0
  187. data/spec/helpers/surveyor_helper_spec.rb +118 -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 +175 -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 +207 -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 +45 -0
  212. metadata +657 -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,132 @@
1
+ /* Do not change surveyor.sass or the generated
2
+ * surveyor.css. They will be overwritten by
3
+ * the surveyor generator. Instead, add
4
+ * custom styles to custom.sass, which will be
5
+ * loaded after the surveyor stylesheets */
6
+
7
+ $background_color:#EEEEEE
8
+ $surveyor_flash_background_color:#FFF1A8
9
+ $surveyor_color:#FFFFF1
10
+ $surveyor_text_color:#333333
11
+ $surveyor_dependent_color:#FFFFDF
12
+ $surveyor_menus_active_color:#EBEBCC
13
+ $surveyor_menus_border_color:#ccc
14
+
15
+ body
16
+ :background-color $background_color
17
+ #surveyor
18
+ :font-family "Century Gothic"
19
+ :width 960px
20
+ :padding 20px
21
+ :margin 0 auto
22
+ :text-align left
23
+ :font-family Helvetica
24
+ :font-size 100%
25
+ :background-color $surveyor_color
26
+ :color $surveyor_text_color
27
+ .surveyor_flash
28
+ :background-color $surveyor_flash_background_color
29
+ :margin 0 auto
30
+ :padding 5px
31
+ :width 300px
32
+ :font-weight bold
33
+ :text-align center
34
+ .survey_title
35
+ :font-size 2em
36
+ :font-weight bold
37
+ :padding 5px 0
38
+ .surveyor_menu
39
+ :float right
40
+ ul
41
+ :background-color $background_color
42
+ :border 1px solid $surveyor_menus_border_color
43
+ :border-bottom-width 0
44
+ :list-style none
45
+ li
46
+ :border 0 solid $surveyor_menus_border_color
47
+ :border-bottom-width 1px
48
+ li.active, li.active input[type="submit"]
49
+ :background-color $surveyor_menus_active_color
50
+ .surveyor_language_selection
51
+ :display none
52
+ //.previous_section
53
+ .next_section
54
+ :float right
55
+ .survey_section
56
+ span.title
57
+ :display block
58
+ :padding 5px 0
59
+ :font-weight bold
60
+ :font-size 1.5em
61
+
62
+ // question groups
63
+ fieldset.g_inline fieldset, fieldset.g_inline ol li
64
+ :display inline
65
+ fieldset.g_grid
66
+ table
67
+ :border-collapse collapse
68
+ li.surveyor_radio label, li.surveyor_check_boxes label
69
+ :visibility hidden
70
+ input
71
+ :visibility visible
72
+ fieldset.g_repeater
73
+ ol fieldset
74
+ :display inline
75
+ input[type="submit"].add_row
76
+ :font-size 0.7em
77
+
78
+ // question groups and questions
79
+ .survey_section>fieldset>ol
80
+ :padding-left 1em
81
+ fieldset
82
+ :padding-top 5px
83
+ :margin-bottom 10px
84
+ ol
85
+ fieldset
86
+ :vertical-align top
87
+ li
88
+ label, input
89
+ :vertical-align top
90
+ :padding 1px 0
91
+ p.inline-hints
92
+ :margin 0
93
+ :padding 0
94
+ :display inline
95
+ li.inline
96
+ :display inline
97
+ li.datetime, li.time
98
+ input, fieldset, fieldset ol li
99
+ :display inline
100
+ &.q_inline ol li, &.q_inline_inline ol li
101
+ :display inline
102
+ input, textarea, select
103
+ :margin 0 3px
104
+ input[type="text"], textarea
105
+ :font-size 0.8em
106
+
107
+ fieldset.q_hidden, fieldset.g_hidden, fieldset.g_grid tr.q_hidden
108
+ :display none !important
109
+ fieldset.q_dependent, fieldset.g_dependent
110
+ :background-color $surveyor_dependent_color
111
+ legend
112
+ :background-color $surveyor_dependent_color
113
+ :padding 3px 3px 3px 0
114
+ fieldset.q_dropdown, fieldset.q_inline_dropdown, fieldset.q_default_dropdown, fieldset.q_slider, fieldset.q_repeater_dropdown
115
+ label
116
+ :display none
117
+ fieldset.q_slider
118
+ :margin-bottom 3em
119
+ li.select
120
+ :width 50%
121
+ :font-size .8em
122
+ .ui-slider span.ui-slider-label-show
123
+ :position relative
124
+ :display inline
125
+
126
+ // buttons
127
+ input[type="submit"]
128
+ :font-size 1em
129
+ :border 1px
130
+ :padding 5px
131
+ :cursor pointer
132
+ :background-color $background_color
@@ -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,102 @@
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
+ add_attachment_to_response
44
+ )
45
+
46
+ def readme
47
+ copy_file "../../../../README.md", "surveys/README.md"
48
+ end
49
+ def migrations
50
+ unless options[:skip_migrations]
51
+ migration_files = Dir[File.join(self.class.source_root, 'db/migrate/*.rb')]
52
+ migrations_not_in_order =
53
+ migration_files.collect { |f| File.basename(f).sub(/\.rb$/, '') } - MIGRATION_ORDER
54
+ unless migrations_not_in_order.empty?
55
+ fail "%s migration%s not added to MIGRATION_ORDER: %s" % [
56
+ migrations_not_in_order.size,
57
+ migrations_not_in_order.size == 1 ? '' : 's',
58
+ migrations_not_in_order.join(', ')
59
+ ]
60
+ end
61
+
62
+ # because all migration timestamps end up the same, causing a collision when running rake db:migrate
63
+ # copied functionality from RAILS_GEM_PATH/lib/rails_generator/commands.rb
64
+ MIGRATION_ORDER.each_with_index do |model, i|
65
+ unless (prev_migrations = Dir.glob("db/migrate/[0-9]*_*.rb").grep(/[0-9]+_#{model}.rb$/)).empty?
66
+ prev_migration_timestamp = prev_migrations[0].match(/([0-9]+)_#{model}.rb$/)[1]
67
+ end
68
+ 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")
69
+ end
70
+ end
71
+ end
72
+
73
+ def routes
74
+ route('mount Surveyor::Engine => "/surveys", :as => "surveyor"')
75
+ end
76
+
77
+ def assets
78
+ if asset_pipeline_enabled?
79
+ directory "app/assets"
80
+ copy_file "vendor/assets/stylesheets/custom.sass"
81
+ else
82
+ directory "../../../assets/javascripts", "public/javascripts"
83
+ directory "../../../assets/images", "public/images"
84
+ directory "../../../assets/stylesheets/surveyor", "public/stylesheets/surveyor"
85
+ copy_file "../../../assets/stylesheets/surveyor.sass", "public/stylesheets/sass/surveyor.sass"
86
+ copy_file "vendor/assets/stylesheets/custom.sass", "public/stylesheets/sass/custom.sass"
87
+ end
88
+ end
89
+
90
+ def surveys
91
+ copy_file "surveys/kitchen_sink_survey.rb"
92
+ copy_file "surveys/quiz.rb"
93
+ copy_file "surveys/date_survey.rb"
94
+ copy_file "surveys/languages.rb"
95
+ directory "surveys/translations"
96
+ end
97
+
98
+ def locales
99
+ directory "config/locales"
100
+ end
101
+ end
102
+ 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
@@ -0,0 +1,13 @@
1
+ # encoding: UTF-8
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
+ <title>Survey: <%= controller.action_name %></title>
8
+ <%= surveyor_includes %>
9
+ </head>
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1,19 @@
1
+ # encoding: UTF-8
2
+ # Sample localization file for English. Add more files in this directory for other locales.
3
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
4
+
5
+ en:
6
+ surveyor:
7
+ take_these_surveys: "You may take these surveys"
8
+ take_it: "Take it"
9
+ completed_survey: "Completed survey"
10
+ unable_to_find_your_responses: "Unable to find your responses to the survey"
11
+ unable_to_update_survey: "Unable to update survey"
12
+ unable_to_find_that_survey: "Unable to find that survey"
13
+ survey_started_success: "Survey started successfully"
14
+ click_here_to_finish: "Click here to finish"
15
+ previous_section: "&laquo; Previous section"
16
+ next_section: "Next section &raquo;"
17
+ select_one: "Select one ..."
18
+ sections: "Sections"
19
+ language: "Language"
@@ -0,0 +1,19 @@
1
+ # encoding: UTF-8
2
+ # Sample localization file for Spanish. Add more files in this directory for other locales.
3
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
4
+
5
+ es:
6
+ surveyor:
7
+ take_these_surveys: "Bienvenido, usted puede tomar estas encuestas"
8
+ take_it: "Tomar"
9
+ completed_survey: "Encuesta completada"
10
+ unable_to_find_your_responses: "No se puede encontrar sus respuestas a la encuesta"
11
+ unable_to_update_survey: "No se puede actualizar la encuesta"
12
+ unable_to_find_that_survey: "No se puede encontrar la encuesta"
13
+ survey_started_success: "Encuesta iniciada correctamente"
14
+ click_here_to_finish: "Haga clic aquí para terminar"
15
+ previous_section: "&laquo; Sección anterior"
16
+ next_section: "Sección siguiente &raquo;"
17
+ select_one: "Seleccione una ..."
18
+ sections: "Secciones"
19
+ language: "Idioma"
@@ -0,0 +1,19 @@
1
+ # encoding: UTF-8
2
+ # Localization file for Hebrew. Add more files in this directory for other locales.
3
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
4
+
5
+ he:
6
+ surveyor:
7
+ take_these_surveys: "תוכלו לבצע סקרים אלו"
8
+ take_it: "בצע"
9
+ completed_survey: "סיום הסקר"
10
+ unable_to_find_your_responses: "לא נמצאו תשובותיך לסקר"
11
+ unable_to_update_survey: ""
12
+ unable_to_find_that_survey: "לא ניתן לאתר את הסקר המבוקש"
13
+ survey_started_success: "הסקר הוחל בהצלחה"
14
+ click_here_to_finish: "לסיום"
15
+ previous_section: "חזרה &raquo;"
16
+ next_section: "&laquo; המשך"
17
+ select_one: "בחר/י"
18
+ sections: "סעיפים"
19
+ language: "שפה"