surveyor_gui 0.0.3

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 (283) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +44 -0
  3. data/.travis.yml +17 -0
  4. data/Gemfile +7 -0
  5. data/LICENSE +21 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +159 -0
  8. data/Rakefile +66 -0
  9. data/app/controllers/answers_controller.rb +3 -0
  10. data/app/controllers/application_controller.rb +3 -0
  11. data/app/controllers/dependencys_controller.rb +286 -0
  12. data/app/controllers/question_groups_controller.rb +84 -0
  13. data/app/controllers/questions_controller.rb +187 -0
  14. data/app/controllers/survey_sections_controller.rb +80 -0
  15. data/app/controllers/surveyforms_controller.rb +4 -0
  16. data/app/controllers/surveyor_controller.rb +89 -0
  17. data/app/controllers/surveyor_gui/reports_controller.rb +339 -0
  18. data/app/controllers/surveyor_gui/responses_controller.rb +39 -0
  19. data/app/controllers/surveyor_gui/survey_controller.rb +16 -0
  20. data/app/facades/report_formatter.rb +44 -0
  21. data/app/facades/report_preview_wrapper.rb +11 -0
  22. data/app/facades/report_response_generator.rb +147 -0
  23. data/app/helpers/application_helper.rb +2 -0
  24. data/app/helpers/dependency_helper.rb +5 -0
  25. data/app/helpers/question_helper.rb +22 -0
  26. data/app/helpers/surveyform_helper.rb +179 -0
  27. data/app/helpers/surveyor_gui/report_helper.rb +19 -0
  28. data/app/helpers/surveyor_helper.rb +4 -0
  29. data/app/inputs/currency_input.rb +5 -0
  30. data/app/inputs/date_picker_input.rb +7 -0
  31. data/app/inputs/datetime_picker_input.rb +5 -0
  32. data/app/inputs/percent_input.rb +5 -0
  33. data/app/inputs/time_picker_input.rb +5 -0
  34. data/app/mailers/.gitkeep +0 -0
  35. data/app/models/.gitkeep +0 -0
  36. data/app/models/answer.rb +4 -0
  37. data/app/models/column.rb +3 -0
  38. data/app/models/dependency.rb +4 -0
  39. data/app/models/dependency_condition.rb +4 -0
  40. data/app/models/permitted_params_decorator.rb +80 -0
  41. data/app/models/question.rb +4 -0
  42. data/app/models/question_group.rb +4 -0
  43. data/app/models/question_type.rb +7 -0
  44. data/app/models/response.rb +4 -0
  45. data/app/models/response_set.rb +4 -0
  46. data/app/models/row.rb +3 -0
  47. data/app/models/survey.rb +4 -0
  48. data/app/models/survey_section.rb +4 -0
  49. data/app/models/surveyform.rb +103 -0
  50. data/app/uploaders/blob_uploader.rb +48 -0
  51. data/app/views/dependencys/_column.html.erb +1 -0
  52. data/app/views/dependencys/_dependency.html.erb +22 -0
  53. data/app/views/dependencys/_dependency_condition_fields.html.erb +48 -0
  54. data/app/views/dependencys/_form.html.erb +20 -0
  55. data/app/views/dependencys/blank.html.erb +0 -0
  56. data/app/views/dependencys/edit.html.erb +1 -0
  57. data/app/views/dependencys/new.html.erb +1 -0
  58. data/app/views/layouts/application.html.erb +14 -0
  59. data/app/views/layouts/surveyor_gui_blank.html.erb +12 -0
  60. data/app/views/layouts/surveyor_gui_default.html.erb +16 -0
  61. data/app/views/layouts/surveyor_modified.html.erb +14 -0
  62. data/app/views/partials/_answer.html.haml +33 -0
  63. data/app/views/partials/_question.html.haml +33 -0
  64. data/app/views/partials/_question_group.html.haml +73 -0
  65. data/app/views/partials/_section.html.haml +13 -0
  66. data/app/views/question_groups/_form.html.erb +56 -0
  67. data/app/views/question_groups/_group_inline_field.html.erb +21 -0
  68. data/app/views/question_groups/_group_inline_fields.html.erb +25 -0
  69. data/app/views/question_groups/blank.html.erb +0 -0
  70. data/app/views/question_groups/edit.html.erb +1 -0
  71. data/app/views/question_groups/new.html.erb +1 -0
  72. data/app/views/questions/_answer_fields.html.erb +23 -0
  73. data/app/views/questions/_answer_options.html.erb +28 -0
  74. data/app/views/questions/_form.html.erb +65 -0
  75. data/app/views/questions/_grid_dropdown_columns.html.erb +10 -0
  76. data/app/views/questions/_grid_dropdown_fields.html.erb +42 -0
  77. data/app/views/questions/_grid_fields.html.erb +9 -0
  78. data/app/views/questions/_no_picks.html.erb +29 -0
  79. data/app/views/questions/_pick.html +21 -0
  80. data/app/views/questions/_picks.html.erb +12 -0
  81. data/app/views/questions/blank.html.erb +0 -0
  82. data/app/views/questions/edit.html.erb +1 -0
  83. data/app/views/questions/new.html.erb +1 -0
  84. data/app/views/survey_sections/_form.html.erb +13 -0
  85. data/app/views/survey_sections/blank.html.erb +0 -0
  86. data/app/views/survey_sections/edit.html.erb +1 -0
  87. data/app/views/survey_sections/new.html.erb +1 -0
  88. data/app/views/surveyforms/_form.html.erb +50 -0
  89. data/app/views/surveyforms/_question_field.html.erb +148 -0
  90. data/app/views/surveyforms/_question_group.html.erb +116 -0
  91. data/app/views/surveyforms/_question_group_fields.html.erb +3 -0
  92. data/app/views/surveyforms/_question_name_and_number.html.erb +6 -0
  93. data/app/views/surveyforms/_question_section.html.erb +15 -0
  94. data/app/views/surveyforms/_question_wrapper.html.erb +109 -0
  95. data/app/views/surveyforms/_survey_section_fields.html.erb +138 -0
  96. data/app/views/surveyforms/clone_survey.html.erb +13 -0
  97. data/app/views/surveyforms/edit.html.erb +5 -0
  98. data/app/views/surveyforms/index.html.erb +40 -0
  99. data/app/views/surveyforms/new.html.erb +1 -0
  100. data/app/views/surveyforms/show.html.erb +5 -0
  101. data/app/views/surveyor_gui/reports/_graphs.html.haml +21 -0
  102. data/app/views/surveyor_gui/reports/_grid.html.haml +42 -0
  103. data/app/views/surveyor_gui/reports/_grid_dropdown.html.haml +56 -0
  104. data/app/views/surveyor_gui/reports/_repeater.html.haml +28 -0
  105. data/app/views/surveyor_gui/reports/_show_report.html.haml +33 -0
  106. data/app/views/surveyor_gui/reports/_single_question.html.haml +70 -0
  107. data/app/views/surveyor_gui/reports/show.html.erb +14 -0
  108. data/app/views/surveyor_gui/responses/_grid.html.haml +20 -0
  109. data/app/views/surveyor_gui/responses/_grid_dropdown.html.haml +20 -0
  110. data/app/views/surveyor_gui/responses/_repeater.html.haml +22 -0
  111. data/app/views/surveyor_gui/responses/_survey_results.html.haml +40 -0
  112. data/app/views/surveyor_gui/responses/index.html.haml +24 -0
  113. data/app/views/surveyor_gui/responses/show.html.haml +42 -0
  114. data/app/views/surveyor_gui/shared/_grid_comments.html.haml +10 -0
  115. data/app/views/surveyor_gui/shared/_new_line.html.haml +2 -0
  116. data/app/views/surveyor_gui/shared/_pick_comments.html.haml +15 -0
  117. data/app/views/surveyor_gui/shared/_question_number.html.haml +9 -0
  118. data/app/views/surveyor_gui/shared/_report_data.html.haml +24 -0
  119. data/app/views/surveyor_gui/shared/_stars_report_data.html.haml +14 -0
  120. data/config.ru +4 -0
  121. data/config/environment.rb +0 -0
  122. data/config/routes.rb +71 -0
  123. data/db/migrate/20140307204049_add_template_to_surveys.rb +5 -0
  124. data/db/migrate/20140307235607_add_test_data_to_response_sets.rb +5 -0
  125. data/db/migrate/20140308171947_add_original_choice_to_answers.rb +5 -0
  126. data/db/migrate/20140308172118_add_blob_to_responses.rb +5 -0
  127. data/db/migrate/20140308172417_add_modifiable_to_survey_section.rb +5 -0
  128. data/db/migrate/20140308174532_add_modifiable_to_question.rb +5 -0
  129. data/db/migrate/20140308175305_add_dynamically_generate_to_questions.rb +5 -0
  130. data/db/migrate/20140311032923_add_dummy_blob_to_questions.rb +5 -0
  131. data/db/migrate/20140311160609_add_dynamic_source_to_questions.rb +5 -0
  132. data/db/migrate/20140311161714_add_report_code_to_questions.rb +5 -0
  133. data/db/migrate/20140530181134_add_is_comment_to_questions.rb +5 -0
  134. data/db/migrate/20140531012006_add_is_comment_to_answers.rb +5 -0
  135. data/db/migrate/20140531225529_create_rows.rb +9 -0
  136. data/db/migrate/20140601011151_create_columns.rb +11 -0
  137. data/db/migrate/20140602030330_add_column_id_to_answers.rb +5 -0
  138. data/db/migrate/20140603155606_add_column_id_to_responses.rb +5 -0
  139. data/db/migrate/20140606023527_add_column_id_to_dependency_conditions.rb +5 -0
  140. data/db/migrate/20140815165307_add_user_id_to_survey.rb +5 -0
  141. data/lib/assets/.gitkeep +0 -0
  142. data/lib/assets/images/addicon.png +0 -0
  143. data/lib/assets/images/datepicker.gif +0 -0
  144. data/lib/assets/images/delete.gif +0 -0
  145. data/lib/assets/images/delete.png +0 -0
  146. data/lib/assets/images/images/border.png +0 -0
  147. data/lib/assets/images/images/controls.png +0 -0
  148. data/lib/assets/images/images/loading.gif +0 -0
  149. data/lib/assets/images/images/loading_background.png +0 -0
  150. data/lib/assets/images/images/overlay.png +0 -0
  151. data/lib/assets/images/rails.png +0 -0
  152. data/lib/assets/images/star.gif +0 -0
  153. data/lib/assets/javascripts/.gitkeep +0 -0
  154. data/lib/assets/javascripts/surveyor_gui/jquery.MetaData.js +121 -0
  155. data/lib/assets/javascripts/surveyor_gui/jquery.blockUI.js +619 -0
  156. data/lib/assets/javascripts/surveyor_gui/jquery.rating.js +377 -0
  157. data/lib/assets/javascripts/surveyor_gui/jquery.validate.js +1188 -0
  158. data/lib/assets/javascripts/surveyor_gui/surveyor_add_ons.js +10 -0
  159. data/lib/assets/javascripts/surveyor_gui/surveyor_gui.js +1417 -0
  160. data/lib/assets/stylesheets/.gitkeep +0 -0
  161. data/lib/assets/stylesheets/surveyor_gui/jquery.rating.css +12 -0
  162. data/lib/assets/stylesheets/surveyor_gui/surveyor_add_ons.css +3 -0
  163. data/lib/assets/stylesheets/surveyor_gui/surveyor_gui.sass +650 -0
  164. data/lib/enumerable_extenders.rb +31 -0
  165. data/lib/generators/surveyor_gui/install_generator.rb +57 -0
  166. data/lib/generators/surveyor_gui/templates/app/assets/javascripts/surveyor_add_ons.js +2 -0
  167. data/lib/generators/surveyor_gui/templates/app/assets/javascripts/surveyor_gui_all.js +24 -0
  168. data/lib/generators/surveyor_gui/templates/app/assets/stylesheets/surveyor_add_ons.css.sass +1 -0
  169. data/lib/generators/surveyor_gui/templates/app/assets/stylesheets/surveyor_gui_all.css.sass +8 -0
  170. data/lib/generators/surveyor_gui/templates/app/helpers/surveyor_helper.rb +4 -0
  171. data/lib/generators/surveyor_gui/templates/app/models/response_set_user.rb +13 -0
  172. data/lib/generators/surveyor_gui/templates/app/views/layouts/surveyor_gui_default.html.erb +16 -0
  173. data/lib/generators/surveyor_gui/templates/config/initializers/simple_form.rb +140 -0
  174. data/lib/generators/surveyor_gui/templates/config/locales/en.yml +5 -0
  175. data/lib/surveyor_gui.rb +17 -0
  176. data/lib/surveyor_gui/engine.rb +30 -0
  177. data/lib/surveyor_gui/helpers/surveyor_helper_methods.rb +19 -0
  178. data/lib/surveyor_gui/models/answer_methods.rb +24 -0
  179. data/lib/surveyor_gui/models/column_methods.rb +43 -0
  180. data/lib/surveyor_gui/models/dependency_condition_methods.rb +53 -0
  181. data/lib/surveyor_gui/models/dependency_methods.rb +83 -0
  182. data/lib/surveyor_gui/models/question_and_group_shared_methods.rb +11 -0
  183. data/lib/surveyor_gui/models/question_group_methods.rb +55 -0
  184. data/lib/surveyor_gui/models/question_methods.rb +435 -0
  185. data/lib/surveyor_gui/models/question_type_methods.rb +493 -0
  186. data/lib/surveyor_gui/models/response_methods.rb +67 -0
  187. data/lib/surveyor_gui/models/response_set_methods.rb +54 -0
  188. data/lib/surveyor_gui/models/row_methods.rb +11 -0
  189. data/lib/surveyor_gui/models/survey_methods.rb +32 -0
  190. data/lib/surveyor_gui/models/survey_section_methods.rb +32 -0
  191. data/lib/surveyor_gui/surveyforms_controller_methods.rb +258 -0
  192. data/lib/surveyor_gui/version.rb +3 -0
  193. data/lib/tasks/.gitkeep +0 -0
  194. data/lib/tasks/surveyor_gui_tasks.rake +4 -0
  195. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  196. data/spec/controllers/surveyforms_controller_spec.rb +361 -0
  197. data/spec/controllers/surveyor_controller_spec.rb +303 -0
  198. data/spec/factories.rb +181 -0
  199. data/spec/features/create_survey_spec.rb +418 -0
  200. data/spec/features/dependencies_spec.rb +61 -0
  201. data/spec/features/rearrange_survey_spec.rb +118 -0
  202. data/spec/features/ui_spec.rb +469 -0
  203. data/spec/fixtures/REDCapDemoDatabase_DataDictionary.csv +127 -0
  204. data/spec/fixtures/chinese_survey.rb +14 -0
  205. data/spec/fixtures/everything.rb +215 -0
  206. data/spec/fixtures/favorites-ish.rb +22 -0
  207. data/spec/fixtures/favorites.rb +22 -0
  208. data/spec/fixtures/feelings.rb +38 -0
  209. data/spec/fixtures/lifestyle.rb +55 -0
  210. data/spec/fixtures/numbers.rb +21 -0
  211. data/spec/fixtures/redcap_new_headers.csv +1 -0
  212. data/spec/fixtures/redcap_siblings.csv +1 -0
  213. data/spec/fixtures/redcap_whitespace.csv +1 -0
  214. data/spec/helpers/formtastic_custom_input_spec.rb +15 -0
  215. data/spec/helpers/surveyor_helper_spec.rb +116 -0
  216. data/spec/lib/common_spec.rb +37 -0
  217. data/spec/lib/parser_spec.rb +393 -0
  218. data/spec/lib/rake_kitchen_sink.rb +42 -0
  219. data/spec/lib/redcap_parser_spec.rb +129 -0
  220. data/spec/lib/unparser_spec.rb +126 -0
  221. data/spec/models/answer_spec.rb +144 -0
  222. data/spec/models/dependency_condition_spec.rb +428 -0
  223. data/spec/models/dependency_spec.rb +90 -0
  224. data/spec/models/question_group_spec.rb +66 -0
  225. data/spec/models/question_spec.rb +176 -0
  226. data/spec/models/response_set_spec.rb +452 -0
  227. data/spec/models/response_spec.rb +208 -0
  228. data/spec/models/survey_section_spec.rb +58 -0
  229. data/spec/models/survey_spec.rb +155 -0
  230. data/spec/models/surveyor_gui/question_spec.rb +60 -0
  231. data/spec/models/surveyor_gui/question_type_spec.rb +268 -0
  232. data/spec/models/validation_condition_spec.rb +98 -0
  233. data/spec/models/validation_spec.rb +64 -0
  234. data/spec/spec.opts +4 -0
  235. data/spec/spec_helper.rb +119 -0
  236. data/spec/support/scenario_outline_helper.rb +39 -0
  237. data/spec/support/shared.rb +10 -0
  238. data/spec/support/surveyforms_creation_helpers.rb +312 -0
  239. data/spec/support/surveyforms_rearrangement_helpers.rb +170 -0
  240. data/spec/support/surveyor_api_helpers.rb +15 -0
  241. data/spec/support/surveyor_ui_helpers.rb +108 -0
  242. data/spec/support/wait_for_ajax.rb +11 -0
  243. data/spec/views/questions/edit.html.erb_spec.rb +73 -0
  244. data/spec/views/surveyforms/edit.html.erb_spec.rb +126 -0
  245. data/surveyor_gui.gemspec +52 -0
  246. data/test/dummy/README.rdoc +261 -0
  247. data/test/dummy/Rakefile +7 -0
  248. data/test/dummy/app/assets/javascripts/application.js +15 -0
  249. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  250. data/test/dummy/app/controllers/application_controller.rb +3 -0
  251. data/test/dummy/app/helpers/application_helper.rb +2 -0
  252. data/test/dummy/app/mailers/.gitkeep +0 -0
  253. data/test/dummy/app/models/.gitkeep +0 -0
  254. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  255. data/test/dummy/config.ru +4 -0
  256. data/test/dummy/config/application.rb +59 -0
  257. data/test/dummy/config/boot.rb +10 -0
  258. data/test/dummy/config/database.yml +25 -0
  259. data/test/dummy/config/environment.rb +5 -0
  260. data/test/dummy/config/environments/development.rb +37 -0
  261. data/test/dummy/config/environments/production.rb +67 -0
  262. data/test/dummy/config/environments/test.rb +37 -0
  263. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  264. data/test/dummy/config/initializers/inflections.rb +15 -0
  265. data/test/dummy/config/initializers/mime_types.rb +5 -0
  266. data/test/dummy/config/initializers/secret_token.rb +7 -0
  267. data/test/dummy/config/initializers/session_store.rb +8 -0
  268. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  269. data/test/dummy/config/locales/en.yml +5 -0
  270. data/test/dummy/config/routes.rb +58 -0
  271. data/test/dummy/lib/assets/.gitkeep +0 -0
  272. data/test/dummy/log/.gitkeep +0 -0
  273. data/test/dummy/public/404.html +26 -0
  274. data/test/dummy/public/422.html +26 -0
  275. data/test/dummy/public/500.html +25 -0
  276. data/test/dummy/public/favicon.ico +0 -0
  277. data/test/dummy/script/rails +6 -0
  278. data/test/surveyor-gui_test.rb +7 -0
  279. data/test/test_helper.rb +15 -0
  280. data/vendor/assets/stylesheets/.gitkeep +0 -0
  281. data/vendor/assets/stylesheets/custom.sass +5 -0
  282. data/vendor/plugins/.gitkeep +0 -0
  283. metadata +664 -0
@@ -0,0 +1,127 @@
1
+ "Variable / Field Name","Form Name","Field Units","Section Header","Field Type","Field Label","Choices OR Calculations","Field Note","Text Validation Type","Text Validation Min","Text Validation Max",Identifier?,"Branching Logic (Show field only if...)","Required Field?"
2
+ study_id,demographics,,,text,"Study ID",,,,,,,,
3
+ date_enrolled,demographics,,"Demographic Characteristics",text,"Date subject signed consent",,YYYY-MM-DD,date,,,,,
4
+ first_name,demographics,,,text,"First Name",,,,,,y,,
5
+ last_name,demographics,,,text,"Last Name",,,,,,y,,
6
+ address,demographics,,"Contact Information",notes,"Street, City, State, ZIP",,,,,,y,,
7
+ telephone_1,demographics,,,text,"Phone number",,"Include Area Code",phone,,,y,,
8
+ telephone_2,demographics,,,text,"Second phone number",,"Include Area Code",phone,,,y,,
9
+ email,demographics,,,text,E-mail,,,email,,,y,,
10
+ sex,demographics,,,dropdown,Gender,"0, Female | 1, Male",,,,,,,y
11
+ given_birth,demographics,,,dropdown,"Has the subject given birth before?","0, No | 1, Yes",,,,,,"[sex] = ""0""",
12
+ num_children,demographics,,,text,"How many times has the subject given birth?",,,integer,0,,,"[sex] = ""0"" and [given_birth] = ""1""",
13
+ ethnicity,demographics,,,radio,Ethnicity,"0, Hispanic or Latino | 1, NOT Hispanic or Latino | 2, Unknown / Not Reported",,,,,,,
14
+ race,demographics,,,radio,Race,"0, American Indian/Alaska Native | 1, Asian | 2, Native Hawaiian or Other Pacific Islander | 3, Black or African American | 4, White | 5, More Than One Race | 6, Unknown / Not Reported",,,,,,,
15
+ dob,demographics,,,text,"Date of birth",,,date,,,y,,
16
+ age,demographics,,,calc,"Age (years)","round(datediff([dob],'today','y'),1)",,,,,,,
17
+ height,demographics,cm,,text,"Height (cm)",,,number,130,215,,,
18
+ weight,demographics,kilograms,,text,"Weight (kilograms)",,,integer,35,200,,,
19
+ bmi,demographics,kilograms,,calc,BMI,"round(([weight]*10000)/(([height])^(2)),1)",,,,,,,
20
+ patient_document,demographics,,,file,"Patient document",,,,,,,,
21
+ meds,demographics,,,checkbox,"Is patient taking any of the following medications? (check all that apply)","1, Lexapro | 2, Celexa | 3, Prozac | 4, Paxil | 5, Zoloft",,,,,,,
22
+ diabetes,demographics,,,dropdown,"Patient has a diagnosis of diabetes mellitus?","0, No | 1, Yes",,,,,,,
23
+ diabetes_type,demographics,,,dropdown,"Type of Diabetes Mellitus","0, Type 1 insulin-dependent | 1, Type 2 insulin-dependent | 2, Type 2 non insulin-dependent",,,,,,,
24
+ dialysis_initiation,demographics,,"Dialysis Information",text,"Date of first outpatient dialysis treatment",,,date,,,,,
25
+ access_type,demographics,,,dropdown,"Type of vascular access","0, Graft | 1, Fistula | 2, Catheter with maturing graft | 3, Catheter with maturing fistula",,,,,,,
26
+ access_location,demographics,,,dropdown,"Location of currently used vascular access","0, Forearm | 1, Upper arm | 2, Internal jugular vein | 3, Subclavian vein | 4, Other",,,,,,,
27
+ dialysis_unit_name,demographics,,,text,"Name of dialysis unit",,,,,,,,
28
+ dialysis_unit_phone,demographics,,,text,"Phone number",,"Include Area Code",phone,,,,,
29
+ dialysis_schedule_days,demographics,,,radio,"Days of the week patient is dialyzed","0, Monday-Wednesday-Friday | 1, Tuesday-Thursday-Saturday | 2, Other",,,,,,,
30
+ dialysis_schedule_time,demographics,,,dropdown,"Shift patient is dialyzed","0, First shift | 1, Second shift | 2, Third shift | 3, Fourth shift",,,,,,,
31
+ etiology_esrd,demographics,,,dropdown,"Etiology of ESRD","0, Diabetes | 1, Hypertension | 2, Glomerulonephritis | 3, Polycystic Kidney Disease | 4, Interstitial Nephritis | 5, Hereditary Nephritis | 6, Other",,,,,,,
32
+ subject_comments,demographics,,"General Comments",notes,Comments,,,,,,,,
33
+ date_visit_b,baseline_data,,"Baseline Measurements",text,"Date of baseline visit",,,date,,,,,
34
+ date_blood_b,baseline_data,,,text,"Date blood was drawn",,,date,,,,,
35
+ alb_b,baseline_data,g/dL,,text,"Serum Albumin (g/dL)",,,integer,3,5,,,
36
+ prealb_b,baseline_data,mg/dL,,text,"Serum Prealbumin (mg/dL)",,,number,10,40,,,
37
+ creat_b,baseline_data,mg/dL,,text,"Creatinine (mg/dL)",,,number,0.5,20,,,
38
+ npcr_b,baseline_data,g/kg/d,,text,"Normalized Protein Catabolic Rate (g/kg/d)",,,number,0.5,2,,,
39
+ chol_b,baseline_data,mg/dL,,text,"Cholesterol (mg/dL)",,,number,100,300,,,
40
+ transferrin_b,baseline_data,mg/dL,,text,"Transferrin (mg/dL)",,,number,100,300,,,
41
+ kt_v_b,baseline_data,,,text,Kt/V,,,number,0.9,3,,,
42
+ drywt_b,baseline_data,kilograms,,text,"Dry weight (kilograms)",,,number,35,200,,,
43
+ plasma1_b,baseline_data,,,dropdown,"Collected Plasma 1?","0, No | 1, Yes",,,,,,,
44
+ plasma2_b,baseline_data,,,dropdown,"Collected Plasma 2?","0, No | 1, Yes",,,,,,,
45
+ plasma3_b,baseline_data,,,dropdown,"Collected Plasma 3?","0, No | 1, Yes",,,,,,,
46
+ serum1_b,baseline_data,,,dropdown,"Collected Serum 1?","0, No | 1, Yes",,,,,,,
47
+ serum2_b,baseline_data,,,dropdown,"Collected Serum 2?","0, No | 1, Yes",,,,,,,
48
+ serum3_b,baseline_data,,,dropdown,"Collected Serum 3?","0, No | 1, Yes",,,,,,,
49
+ sga_b,baseline_data,,,text,"Subject Global Assessment (score = 1-7)",,,number,0.9,7.1,,,
50
+ date_supplement_dispensed,baseline_data,,,text,"Date patient begins supplement",,,date,,,,,
51
+ date_visit_1,month_1_data,,"Month 1",text,"Date of Month 1 visit",,,date,,,,,
52
+ alb_1,month_1_data,g/dL,,text,"Serum Albumin (g/dL)",,,number,3,5,,,
53
+ prealb_1,month_1_data,mg/dL,,text,"Serum Prealbumin (mg/dL)",,,number,10,40,,,
54
+ creat_1,month_1_data,mg/dL,,text,"Creatinine (mg/dL)",,,number,0.5,20,,,
55
+ npcr_1,month_1_data,g/kg/d,,text,"Normalized Protein Catabolic Rate (g/kg/d)",,,number,0.5,2,,,
56
+ chol_1,month_1_data,mg/dL,,text,"Cholesterol (mg/dL)",,,number,100,300,,,
57
+ transferrin_1,month_1_data,mg/dL,,text,"Transferrin (mg/dL)",,,number,100,300,,,
58
+ kt_v_1,month_1_data,,,text,Kt/V,,,number,0.9,3,,,
59
+ drywt_1,month_1_data,kilograms,,text,"Dry weight (kilograms)",,,number,35,200,,,
60
+ no_show_1,month_1_data,,,text,"Number of treatments missed",,,number,0,7,,,
61
+ compliance_1,month_1_data,,,dropdown,"How compliant was the patient in drinking the supplement?","0, 100 percent | 1, 99-75 percent | 2, 74-50 percent | 3, 49-25 percent | 4, 0-24 percent",,,,,,,
62
+ hospit_1,month_1_data,,"Hospitalization Data",dropdown,"Was patient hospitalized since last visit?","0, No | 1, Yes",,,,,,,
63
+ cause_hosp_1,month_1_data,,,dropdown,"What was the cause of hospitalization?","1, Vascular access related events | 2, CVD events | 3, Other",,,,,,,
64
+ admission_date_1,month_1_data,,,text,"Date of hospital admission",,,date,,,,,
65
+ discharge_date_1,month_1_data,,,text,"Date of hospital discharge",,,date,,,,,
66
+ discharge_summary_1,month_1_data,,,dropdown,"Discharge summary in patients binder?","0, No | 1, Yes",,,,,,,
67
+ death_1,month_1_data,,"Mortality Data",dropdown,"Has patient died since last visit?","0, No | 1, Yes",,,,,,,
68
+ date_death_1,month_1_data,,,text,"Date of death",,,date,,,,,
69
+ cause_death_1,month_1_data,,,dropdown,"What was the cause of death?","1, All-cause | 2, Cardiovascular",,,,,,,
70
+ date_visit_2,month_2_data,,"Month 2",text,"Date of Month 2 visit",,,date,,,,,
71
+ alb_2,month_2_data,g/dL,,text,"Serum Albumin (g/dL)",,,number,3,5,,,
72
+ prealb_2,month_2_data,mg/dL,,text,"Serum Prealbumin (mg/dL)",,,number,10,40,,,
73
+ creat_2,month_2_data,mg/dL,,text,"Creatinine (mg/dL)",,,number,0.5,20,,,
74
+ npcr_2,month_2_data,g/kg/d,,text,"Normalized Protein Catabolic Rate (g/kg/d)",,,number,0.5,2,,,
75
+ chol_2,month_2_data,mg/dL,,text,"Cholesterol (mg/dL)",,,number,100,300,,,
76
+ transferrin_2,month_2_data,mg/dL,,text,"Transferrin (mg/dL)",,,number,100,300,,,
77
+ kt_v_2,month_2_data,,,text,Kt/V,,,number,0.9,3,,,
78
+ drywt_2,month_2_data,kilograms,,text,"Dry weight (kilograms)",,,number,35,200,,,
79
+ no_show_2,month_2_data,,,text,"Number of treatments missed",,,number,0,7,,,
80
+ compliance_2,month_2_data,,,dropdown,"How compliant was the patient in drinking the supplement?","0, 100 percent | 1, 99-75 percent | 2, 74-50 percent | 3, 49-25 percent | 4, 0-24 percent",,,,,,,
81
+ hospit_2,month_2_data,,"Hospitalization Data",dropdown,"Was patient hospitalized since last visit?","0, No | 1, Yes",,,,,,,
82
+ cause_hosp_2,month_2_data,,,dropdown,"What was the cause of hospitalization?","1, Vascular access related events | 2, CVD events | 3, Other",,,,,,,
83
+ admission_date_2,month_2_data,,,text,"Date of hospital admission",,,date,,,,,
84
+ discharge_date_2,month_2_data,,,text,"Date of hospital discharge",,,date,,,,,
85
+ discharge_summary_2,month_2_data,,,dropdown,"Discharge summary in patients binder?","0, No | 1, Yes",,,,,,,
86
+ death_2,month_2_data,,"Mortality Data",dropdown,"Has patient died since last visit?","0, No | 1, Yes",,,,,,,
87
+ date_death_2,month_2_data,,,text,"Date of death",,,date,,,,,
88
+ cause_death_2,month_2_data,,,dropdown,"What was the cause of death?","1, All-cause | 2, Cardiovascular",,,,,,,
89
+ date_visit_3,month_3_data,,"Month 3",text,"Date of Month 3 visit",,,date,,,,,
90
+ date_blood_3,month_3_data,,,text,"Date blood was drawn",,,date,,,,,
91
+ alb_3,month_3_data,g/dL,,text,"Serum Albumin (g/dL)",,,number,3,5,,,
92
+ prealb_3,month_3_data,mg/dL,,text,"Serum Prealbumin (mg/dL)",,,number,10,40,,,
93
+ creat_3,month_3_data,mg/dL,,text,"Creatinine (mg/dL)",,,number,0.5,20,,,
94
+ npcr_3,month_3_data,g/kg/d,,text,"Normalized Protein Catabolic Rate (g/kg/d)",,,number,0.5,2,,,
95
+ chol_3,month_3_data,mg/dL,,text,"Cholesterol (mg/dL)",,,number,100,300,,,
96
+ transferrin_3,month_3_data,mg/dL,,text,"Transferrin (mg/dL)",,,number,100,300,,,
97
+ kt_v_3,month_3_data,,,text,Kt/V,,,number,0.9,3,,,
98
+ drywt_3,month_3_data,kilograms,,text,"Dry weight (kilograms)",,,number,35,200,,,
99
+ plasma1_3,month_3_data,,,dropdown,"Collected Plasma 1?","0, No | 1, Yes",,,,,,,
100
+ plasma2_3,month_3_data,,,dropdown,"Collected Plasma 2?","0, No | 1, Yes",,,,,,,
101
+ plasma3_3,month_3_data,,,dropdown,"Collected Plasma 3?","0, No | 1, Yes",,,,,,,
102
+ serum1_3,month_3_data,,,dropdown,"Collected Serum 1?","0, No | 1, Yes",,,,,,,
103
+ serum2_3,month_3_data,,,dropdown,"Collected Serum 2?","0, No | 1, Yes",,,,,,,
104
+ serum3_3,month_3_data,,,dropdown,"Collected Serum 3?","0, No | 1, Yes",,,,,,,
105
+ sga_3,month_3_data,,,text,"Subject Global Assessment (score = 1-7)",,,number,0.9,7.1,,,
106
+ no_show_3,month_3_data,,,text,"Number of treatments missed",,,number,0,7,,,
107
+ compliance_3,month_3_data,,,dropdown,"How compliant was the patient in drinking the supplement?","0, 100 percent | 1, 99-75 percent | 2, 74-50 percent | 3, 49-25 percent | 4, 0-24 percent",,,,,,,
108
+ hospit_3,month_3_data,,"Hospitalization Data",dropdown,"Was patient hospitalized since last visit?","0, No | 1, Yes",,,,,,,
109
+ cause_hosp_3,month_3_data,,,dropdown,"What was the cause of hospitalization?","1, Vascular access related events | 2, CVD events | 3, Other",,,,,,,
110
+ admission_date_3,month_3_data,,,text,"Date of hospital admission",,,date,,,,,
111
+ discharge_date_3,month_3_data,,,text,"Date of hospital discharge",,,date,,,,,
112
+ discharge_summary_3,month_3_data,,,dropdown,"Discharge summary in patients binder?","0, No | 1, Yes",,,,,,,
113
+ death_3,month_3_data,,"Mortality Data",dropdown,"Has patient died since last visit?","0, No | 1, Yes",,,,,,,
114
+ date_death_3,month_3_data,,,text,"Date of death",,,date,,,,,
115
+ cause_death_3,month_3_data,,,dropdown,"What was the cause of death?","1, All-cause | 2, Cardiovascular",,,,,,,
116
+ complete_study,completion_data,,"Study Completion Information",dropdown,"Has patient completed study?","0, No | 1, Yes",,,,,,,
117
+ withdraw_date,completion_data,,,text,"Put a date if patient withdrew study",,,date,,,,,
118
+ withdraw_reason,completion_data,,,dropdown,"Reason patient withdrew from study","0, Non-compliance | 1, Did not wish to continue in study | 2, Could not tolerate the supplement | 3, Hospitalization | 4, Other",,,,,,,
119
+ complete_study_date,completion_data,,,text,"Date of study completion",,,date,,,,,
120
+ study_comments,completion_data,,"General Comments",notes,Comments,,,,,,,,
121
+ fatexp20_0d31d8,promis_fatigue__short_form_7a,,"Please respond to each item by marking one answer per question.<br><br>In the past 7 days...",radio,"How often did you feel tired?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
122
+ fatexp5_d80a4c,promis_fatigue__short_form_7a,,,radio,"How often did you experience extreme exhaustion?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
123
+ fatexp18_396fe5,promis_fatigue__short_form_7a,,,radio,"How often did you run out of energy?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
124
+ fatimp33_a9e236,promis_fatigue__short_form_7a,,,radio,"How often did your fatigue limit you at work (include work at home)?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
125
+ fatimp30_5f4d82,promis_fatigue__short_form_7a,,,radio,"How often were you too tired to think clearly?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
126
+ fatimp21_de19f3,promis_fatigue__short_form_7a,,,radio,"How often were you too tired to take a bath or shower?...","1, 1 Never | 2, 2 Rarely | 3, 3 Sometimes | 4, 4 Often | 5, 5 Always",,,,,,,
127
+ fatimp40_f7e5db,promis_fatigue__short_form_7a,,,radio,"How often did you have enough energy to exercise strenuously?...","5, 5 Never | 4, 4 Rarely | 3, 3 Sometimes | 2, 2 Often | 1, 1 Always",,,,,,,
@@ -0,0 +1,14 @@
1
+ survey "青少年人际关系问卷", :access_code => "青少年人际关系问卷" do
2
+ section "Basic questions" do
3
+ grid "第二部分:以下列出了一些描述。请您根据自己的实际情况作答。如果“非常不像我”,请选“1”,如果“非常像我”,请选“5”,以此类推。" do
4
+ a "1"
5
+ a "2"
6
+ a "3"
7
+ a "4"
8
+ a "5"
9
+ q "我常常想出新的有趣的点子", :pick => :one
10
+ q "我比同龄的其他孩子更有想象力", :pick => :one
11
+ q "即使一个人独处,我也不会觉得无聊", :pick => :one
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,215 @@
1
+ survey "Everything" do
2
+ section "Basic" do
3
+ question "What is your favorite color?", {reference_identifier: "1", pick: :one}
4
+ answer "red", {reference_identifier: "r", data_export_identifier: "1"}
5
+ answer "blue", {reference_identifier: "b", data_export_identifier: "2"}
6
+ answer "green", {reference_identifier: "g", data_export_identifier: "3"}
7
+ answer_other :other, :string
8
+
9
+ q_2b "Choose the colors you don't like", pick: :any
10
+ a_1 "orange", display_order: 1
11
+ a_2 "purple", display_order: 2
12
+ a_3 "brown", display_order: 0
13
+ a :omit
14
+
15
+ q_3 "What color is the sky right now?", pick: :one, display_type: :dropdown
16
+ a_sb "sky blue"
17
+ a_cw "cloud white"
18
+ a_nb "night black"
19
+ a_sr "sunset red"
20
+
21
+ q_fire_engine "What is the best color for a fire engine?"
22
+ a_color "Color", :string
23
+
24
+ q_last_room "What was the last room you painted, and what color?", pick: :one
25
+ a_kitchen "kitchen", :string
26
+ a_bedroom "bedroom", :string
27
+ a_bathroom "bathroom", :string
28
+ a_other "other", :text
29
+
30
+ q_all_rooms "What rooms have you painted, and what color?", pick: :any
31
+ a_kitchen "kitchen", :string
32
+ a_bedroom "bedroom", :string
33
+ a_bathroom "bathroom", :string
34
+ a_other "other", :text
35
+
36
+ q_color_run_date "When is the next color run?"
37
+ a_date "On", :date
38
+
39
+ q_color_run_time "What time does it start?"
40
+ a_time "At", :time
41
+
42
+ q_hair_appointment "When is your next hair color appointment?"
43
+ a_datetime "At", :datetime
44
+
45
+ q_color_poem "Please compose a poem about a color"
46
+ a_poem_text "Poem", :text
47
+
48
+ q_birth_date "What is your birth date?", pick: :one
49
+ a_date "I was born on", :date
50
+ a_refused "Refused"
51
+
52
+ q_birth_time "At what time were you born?", pick: :any
53
+ a_time "I was born at", :time
54
+ a_approx "This time is approximate"
55
+ end
56
+ section "Groups" do
57
+ grid_events "How interested are you in the following?" do
58
+ a "indifferent"
59
+ a "neutral"
60
+ a "interested"
61
+ q "births" , pick: :one
62
+ q "weddings", pick: :one
63
+ q "funerals", pick: :one
64
+ end
65
+ repeater_family "Tell us about your family" do
66
+ q_relation "Relation", pick: :one, display_type: :dropdown
67
+ a "Parent"
68
+ a "Sibling"
69
+ a "Child"
70
+ q_name "Name"
71
+ a "Name", :string
72
+ q_quality "Quality of your relationship"
73
+ a "Quality of your relationship", :string
74
+ end
75
+ group_drop_it "Drop it like it's hot" do
76
+ label "Like Snoop Dogg said"
77
+ q_what_drop "What to drop", pick: :one, display_type: :dropdown
78
+ a_it "It"
79
+ a_potato "Hot potato"
80
+ a_and_10 "And give me 10"
81
+ end
82
+ end
83
+ section "Dependencies" do
84
+ group "Greetings" do
85
+ q_anybody "Anybody there?", :pick => :one
86
+ a_yes "Yes"
87
+ a_no "No"
88
+
89
+ q_who "Who are you?"
90
+ dependency :rule => "A"
91
+ condition_A :q_anybody, "==", :a_yes
92
+ a :string
93
+
94
+ q_weird "Weird.. Must be talking to myself..", :pick => :one
95
+ dependency :rule => "A"
96
+ condition_A :q_anybody, "==", :a_no
97
+ a "Maybe"
98
+ a "Huh?"
99
+ end
100
+ group_anybody_no "No?" do
101
+ dependency :rule => "A"
102
+ condition_A :q_anybody, "==", :a_no
103
+
104
+ q_who_talking "Who is talking?", :pick => :one
105
+ a_you_are "You are"
106
+ a_you_nuts "Are you nuts?"
107
+ end
108
+ label_feels_like_it "It feels like it"
109
+ dependency :rule => "A"
110
+ condition_A :q_who_talking, "==", :a_you_nuts
111
+
112
+ q_cooling_1 "How do you cool your home?", :pick => :one
113
+ a_1 "Fans"
114
+ a_2 "Window AC"
115
+ a_3 "Central AC"
116
+ a_4 "Passive"
117
+
118
+ q_cooling_2 "How much does it cost to run your non-passive cooling solutions?"
119
+ dependency :rule => "A"
120
+ condition_A :q_cooling_1, "!=", :a_4
121
+ a_1 "$", :float
122
+
123
+ q_heating_1 "How do you heat your home?", :pick => :any
124
+ a_1 "Forced air"
125
+ a_2 "Radiators"
126
+ a_3 "Oven"
127
+ a_4 "Passive"
128
+
129
+ q_heating_2 "How much does it cost to run your non-passive heating solutions?"
130
+ dependency :rule => "A and B"
131
+ condition_A :q_heating_1, "!=", :a_4
132
+ condition_B :q_heating_1, "count>0"
133
+ a_1 "$", :float
134
+
135
+ q_heating_3 "How much do you spend on air filters each year?"
136
+ dependency :rule => "A"
137
+ condition_A :q_heating_1, "==", :a_1
138
+ a_1 "$", :float
139
+
140
+ q_counts "How many times do you count a day", :pick => :any
141
+ a_1 "Once for me"
142
+ a_2 "Once for you"
143
+ a_3 "Once for everyone"
144
+
145
+ label_counts_good "Good!"
146
+ dependency :rule => "A"
147
+ condition_A :q_counts, "count==1"
148
+
149
+ label_counts_twice "Twice as good!"
150
+ dependency :rule => "A"
151
+ condition_A :q_counts, "count==2"
152
+
153
+ label_thanks_counting "Thanks for counting!"
154
+ dependency :rule => "A or B or C"
155
+ condition_A :q_counts, "==", :a_1
156
+ condition_B :q_counts, "==", :a_2
157
+ condition_C :q_counts, "==", :a_3
158
+
159
+ label_yay_everyone "Yay for everyone!"
160
+ dependency :rule => "A"
161
+ condition_A :q_counts, "count>2"
162
+ end
163
+ section "Special" do
164
+ group_mustache_regarding "Regarding {{name}}", help_text: "Answer all you know about {{name}}" do
165
+ q_mustache_where "Where does {{name}} live?", pick: :one, help_text: "If you don't know where {{name}} lives, skip the question"
166
+ a_north_pole "{{name}} lives on North Pole"
167
+ a_south_pole "{{name}} lives on South Pole"
168
+ a_fake "{{name}} doesn't exist"
169
+ end
170
+ label "Now think about {{thing}}", help_text: "Yes, {{thing}}"
171
+
172
+ q_home_phone "What is your home phone number?"
173
+ a_hm_phone "phone", :string, input_mask: '(999)999-9999', input_mask_placeholder: '#'
174
+
175
+ q_cell_phone "What is your cell phone number?"
176
+ a_cl_phone "phone", :string, input_mask: '(999)999-9999'
177
+
178
+ q_favorite_letters "What are your favorite letters?"
179
+ a_fav_letters 'letters', :string, input_mask: 'aaaaaaaaa'
180
+
181
+ q_count_name "What is your name?", display_type: :hidden
182
+ a_name :string, help_text: "(e.g. Count Von Count)"
183
+
184
+ group_count_friends "Friends", display_type: :hidden do
185
+ q_count_who_friends "Who are your friends?"
186
+ a_friends :string
187
+ end
188
+
189
+ q_count_numbers "What is your favorite number?", pick: :one, custom_class: "hidden"
190
+ a_one "One"
191
+ a_two "Two"
192
+ a_three "Three!"
193
+
194
+ q_heat2 "Are there any other types of heat you use regularly during the heating season to heat your home? ", pick: :any
195
+ a_1 "Electric"
196
+ a_2 "Gas - propane or LP"
197
+ a_3 "Oil"
198
+ a_4 "Wood"
199
+ a_5 "Kerosene or diesel"
200
+ a_6 "Coal or coke"
201
+ a_7 "Solar energy"
202
+ a_8 "Heat pump"
203
+ a_9 "No other heating source", is_exclusive: true
204
+ a_neg_5 "Other"
205
+ a_neg_1 "Refused", is_exclusive: true
206
+ a_neg_2 "Don't know", is_exclusive: true
207
+
208
+ question_favorite_food "What is your favorite food?", help_text: "just say beef"
209
+ answer_food "food", :string, :default_value => "beef"
210
+
211
+ q_which_way "Which way?"
212
+ a_next "/assets/surveyor/next.gif", :display_type => "image"
213
+ a_prev "/assets/surveyor/prev.gif", :display_type => "image"
214
+ end
215
+ end
@@ -0,0 +1,22 @@
1
+ survey "Favorites" do
2
+ section_colors "Colors" do
3
+ label "These questions are examples of the basic supported input types"
4
+
5
+ question "What is your favorite color?", {reference_identifier: "1", pick: :one}
6
+ answer "redish", {reference_identifier: "r", data_export_identifier: "1"}
7
+ answer "blueish", {reference_identifier: "b", data_export_identifier: "2"}
8
+ answer "greenish", {reference_identifier: "g", data_export_identifier: "3"}
9
+ answer :other
10
+
11
+ q_2b "Choose the colors you don't like", :pick => :any
12
+ a_1 "orangeish", :display_order => 1
13
+ a_2 "purpleish", :display_order => 2
14
+ a_3 "brownish", :display_order => 0
15
+ a :omit
16
+
17
+ q_fire_engine "What is the best color for a fire engine?"
18
+ a_color "Color", :string
19
+ end
20
+ section_numbers "Numbers" do
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ survey "Favorites" do
2
+ section_colors "Colors" do
3
+ label "These questions are examples of the basic supported input types"
4
+
5
+ question "What is your favorite color?", {reference_identifier: "1", pick: :one}
6
+ answer "red", {reference_identifier: "r", data_export_identifier: "1"}
7
+ answer "blue", {reference_identifier: "b", data_export_identifier: "2"}
8
+ answer "green", {reference_identifier: "g", data_export_identifier: "3"}
9
+ answer :other
10
+
11
+ q_2b "Choose the colors you don't like", :pick => :any
12
+ a_1 "orange", :display_order => 1
13
+ a_2 "purple", :display_order => 2
14
+ a_3 "brown", :display_order => 0
15
+ a :omit
16
+
17
+ q_fire_engine "What is the best color for a fire engine?"
18
+ a_color "Color", :string
19
+ end
20
+ section_numbers "Numbers" do
21
+ end
22
+ end
@@ -0,0 +1,38 @@
1
+ survey "Feelings" do
2
+ section_daily "Current" do
3
+ grid_today "Tell us how you feel today" do
4
+ a "-2"
5
+ a "-1"
6
+ a "0"
7
+ a "1"
8
+ a "2"
9
+ q "anxious|calm" , pick: :one
10
+ q "sad|happy", pick: :one
11
+ q "tired|energetic", pick: :one
12
+ end
13
+ grid_events "How interested are you in the following?" do
14
+ a "indifferent"
15
+ a "neutral"
16
+ a "interested"
17
+ q "births" , pick: :one
18
+ q "weddings", pick: :one
19
+ q "funerals", pick: :one
20
+ end
21
+ repeater_family "Tell us about your family" do
22
+ q "Relation", pick: :one, display_type: :dropdown
23
+ a "Parent"
24
+ a "Sibling"
25
+ a "Child"
26
+ q "Name"
27
+ a :string
28
+ q "Quality of your relationship"
29
+ a :string
30
+ end
31
+ q_description "Tell us which of the following describe you, and why", pick: :any
32
+ a "joyful", :string
33
+ a "content", :string
34
+ a "anxious", :string
35
+ a "upset", :string
36
+ a :other, :string
37
+ end
38
+ end
@@ -0,0 +1,55 @@
1
+ survey "Lifestyle" do
2
+ section "Smoking" do
3
+ q_copd_sh_1 "Have you ever smoked cigarettes?", :pick => :one, :help_text => "NO means less than 20 packs of cigarettes or 12 oz. of tobacco in a lifetime or less than 1 cigarette a day for 1 year."
4
+ a_1 "Yes"
5
+ a_2 "No"
6
+
7
+ q_copd_sh_1b "Do you currently smoke cigarettes?", :pick => :one, :help_text => "as of 1 month ago"
8
+ a_current_as_of_one_month "Yes"
9
+ a_quit "No"
10
+ dependency :rule => "B"
11
+ condition_B :question_copd_sh_1, "==", :answer_1
12
+
13
+ q_copd_sh_1ba "How old were you when you stopped?"
14
+ a "Years", :integer
15
+ dependency :rule => "C"
16
+ condition_C :q_copd_sh_1b, "==", :a_quit
17
+
18
+ q_copd_sh_1bb "How many cigarettes do you smoke per day now?"
19
+ a_2 "integer"
20
+ dependency :rule => "D"
21
+ condition_D :q_copd_sh_1b, "==", :a_current_as_of_one_month
22
+ end
23
+ section "Pets" do
24
+ q_pets "How many pets do you own?"
25
+ a_number :integer
26
+ validation :rule => "P"
27
+ condition_P ">=", :integer_value => 0
28
+
29
+ group_one_pet "One pet" do
30
+ dependency :rule => "Q"
31
+ condition_Q :q_pets, "==", {:integer_value => 1, :answer_reference => "number"}
32
+
33
+ q_favorite_pet "What is you pet's name?"
34
+ a_name :string
35
+
36
+ label_very_creative "Very creative!"
37
+ dependency :rule => "R"
38
+ condition_R :q_favorite_pet, "==", {:string_value => "fido", :answer_reference => "name"}
39
+ end
40
+
41
+ q "What is the address of your vet?", :custom_class => 'address'
42
+ a :text, :custom_class => 'mapper'
43
+ validation :rule => "AC"
44
+ vcondition_AC "=~", :regexp => /[0-9a-zA-z\. #]/.to_s
45
+
46
+ q_dream_pet "What is your dream pet?", :pick => :any
47
+ a_1 "lion"
48
+ a_2 "tiger"
49
+ a_3 "bear"
50
+
51
+ label_oh_my "Oh my!"
52
+ dependency :rule => "S"
53
+ condition_S :q_dream_pet, "count>2"
54
+ end
55
+ end