helena 0.3.3 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -4
- data/Gemfile +1 -2
- data/Gemfile.lock +88 -95
- data/README.md +10 -25
- data/app/controllers/helena/application_controller.rb +0 -10
- data/app/controllers/helena/sessions_controller.rb +17 -6
- data/app/models/helena/answer.rb +1 -2
- data/app/models/helena/concerns/application_model.rb +0 -9
- data/app/models/helena/concerns/questions/validates_one_label.rb +1 -1
- data/app/models/helena/question.rb +5 -5
- data/app/models/helena/question_group.rb +4 -3
- data/app/models/helena/session.rb +27 -0
- data/app/models/helena/survey.rb +2 -7
- data/app/models/helena/version.rb +6 -4
- data/app/views/helena/questions/_static_text.html.slim +1 -0
- data/app/views/helena/sessions/_progressbar.html.slim +9 -0
- data/app/views/helena/sessions/edit.html.slim +18 -0
- data/app/views/helena/sessions/{end_message.html.haml → end_message.html.slim} +1 -1
- data/config/locales/models/question_group/en.yml +1 -0
- data/config/locales/models/session/en.yml +4 -0
- data/config/locales/models/survey/en.yml +3 -0
- data/config/locales/views/sessions/en.yml +4 -0
- data/config/routes.rb +1 -25
- data/db/seeds.rb +12 -140
- data/db/swls_survey.en.yml +67 -0
- data/helena.gemspec +1 -0
- data/lib/helena/engine.rb +11 -0
- data/lib/helena/survey_importer.rb +52 -0
- data/lib/helena/version.rb +1 -1
- data/lib/helena/version_publisher.rb +34 -2
- data/lib/helena.rb +3 -0
- data/spec/controllers/helena/sessions_controller_spec.rb +8 -3
- data/spec/dummy/app/controllers/application_controller.rb +0 -4
- data/spec/factories/helena/labels.rb +0 -1
- data/spec/factories/helena/question_groups.rb +0 -1
- data/spec/factories/helena/questions.rb +0 -1
- data/spec/factories/helena/sub_questions.rb +0 -1
- data/spec/factories/helena/surveys.rb +0 -1
- data/spec/features/helena/manage_session_spec.rb +76 -16
- data/spec/lib/survey_importer_spec.rb +14 -0
- data/spec/lib/version_publisher_spec.rb +5 -4
- data/spec/models/helena/answer_spec.rb +0 -1
- data/spec/models/helena/question_group_spec.rb +2 -1
- data/spec/models/helena/question_spec.rb +12 -4
- data/spec/models/helena/questions/checkbox_group_spec.rb +17 -0
- data/spec/models/helena/questions/radio_group_spec.rb +6 -0
- data/spec/models/helena/questions/radio_matrix_spec.rb +7 -0
- data/spec/models/helena/session_spec.rb +50 -0
- data/spec/models/helena/survey_spec.rb +12 -1
- data/spec/models/helena/version_spec.rb +11 -2
- metadata +26 -73
- data/app/assets/images/helena/icons/export.svg +0 -29
- data/app/assets/stylesheets/helena/admin/labels.css.sass +0 -7
- data/app/assets/stylesheets/helena/admin/layout.css.sass +0 -6
- data/app/assets/stylesheets/helena/admin/question_groups.css.sass +0 -7
- data/app/assets/stylesheets/helena/admin/questions.css.sass +0 -9
- data/app/assets/stylesheets/helena/admin/sessions.css.sass +0 -5
- data/app/assets/stylesheets/helena/admin/subquestions.css.sass +0 -7
- data/app/assets/stylesheets/helena/admin/versions.css.sass +0 -9
- data/app/controllers/helena/admin/application_controller.rb +0 -31
- data/app/controllers/helena/admin/question_groups_controller.rb +0 -78
- data/app/controllers/helena/admin/questions/checkbox_groups_controller.rb +0 -17
- data/app/controllers/helena/admin/questions/checkbox_matrix_controller.rb +0 -9
- data/app/controllers/helena/admin/questions/long_texts_controller.rb +0 -13
- data/app/controllers/helena/admin/questions/radio_groups_controller.rb +0 -17
- data/app/controllers/helena/admin/questions/radio_matrix_controller.rb +0 -9
- data/app/controllers/helena/admin/questions/short_texts_controller.rb +0 -13
- data/app/controllers/helena/admin/questions/static_texts_controller.rb +0 -13
- data/app/controllers/helena/admin/questions_controller.rb +0 -105
- data/app/controllers/helena/admin/sessions_controller.rb +0 -35
- data/app/controllers/helena/admin/surveys_controller.rb +0 -78
- data/app/controllers/helena/admin/versions_controller.rb +0 -71
- data/app/controllers/helena/surveys_controller.rb +0 -11
- data/app/views/helena/admin/question_groups/_form.html.haml +0 -3
- data/app/views/helena/admin/question_groups/edit.html.haml +0 -3
- data/app/views/helena/admin/question_groups/index.html.haml +0 -41
- data/app/views/helena/admin/question_groups/new.html.haml +0 -3
- data/app/views/helena/admin/questions/_form.html.haml +0 -15
- data/app/views/helena/admin/questions/_labels.html.haml +0 -24
- data/app/views/helena/admin/questions/_sub_questions.html.haml +0 -32
- data/app/views/helena/admin/questions/edit.html.haml +0 -3
- data/app/views/helena/admin/questions/index.html.haml +0 -49
- data/app/views/helena/admin/questions/new.html.haml +0 -3
- data/app/views/helena/admin/sessions/index.html.haml +0 -46
- data/app/views/helena/admin/surveys/_form.html.haml +0 -10
- data/app/views/helena/admin/surveys/edit.html.haml +0 -5
- data/app/views/helena/admin/surveys/index.html.haml +0 -35
- data/app/views/helena/admin/surveys/new.html.haml +0 -3
- data/app/views/helena/admin/versions/_form.html.haml +0 -5
- data/app/views/helena/admin/versions/default_session_report.html.haml +0 -17
- data/app/views/helena/admin/versions/edit.html.haml +0 -3
- data/app/views/helena/admin/versions/index.html.haml +0 -35
- data/app/views/helena/admin/versions/new.html.haml +0 -3
- data/app/views/helena/sessions/edit.html.haml +0 -16
- data/app/views/helena/surveys/_survey.html.haml +0 -3
- data/app/views/helena/surveys/index.html.haml +0 -2
- data/config/locales/views/admin/question_groups/en.yml +0 -12
- data/config/locales/views/admin/questions/en.yml +0 -16
- data/config/locales/views/admin/sessions/en.yml +0 -11
- data/config/locales/views/admin/surveys/en.yml +0 -10
- data/config/locales/views/admin/versions/en.yml +0 -8
- data/spec/controllers/helena/admin/question_group_controller_spec.rb +0 -59
- data/spec/controllers/helena/admin/questions_controller_spec.rb +0 -60
- data/spec/controllers/helena/admin/sessions_controller_spec.rb +0 -84
- data/spec/controllers/helena/admin/survey_controller_spec.rb +0 -89
- data/spec/controllers/helena/admin/versions_controller_spec.rb +0 -19
- data/spec/controllers/helena/application_controller_spec.rb +0 -15
- data/spec/features/helena/admin/manage_question_group_spec.rb +0 -101
- data/spec/features/helena/admin/manage_question_spec.rb +0 -105
- data/spec/features/helena/admin/manage_session_spec.rb +0 -40
- data/spec/features/helena/admin/manage_survey_spec.rb +0 -141
- data/spec/features/helena/admin/manage_version_spec.rb +0 -74
- data/spec/features/helena/admin/question_types/manage_checkbox_group_question_spec.rb +0 -55
- data/spec/features/helena/admin/question_types/manage_long_text_question_spec.rb +0 -21
- data/spec/features/helena/admin/question_types/manage_radio_group_question_spec.rb +0 -59
- data/spec/features/helena/admin/question_types/manage_radio_matrix_question_spec.rb +0 -80
- data/spec/features/helena/admin/question_types/manage_short_text_question_spec.rb +0 -19
- data/spec/features/helena/admin/question_types/manage_static_text_question_spec.rb +0 -17
- data/spec/features/helena/manage_survey_spec.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99c25cfaf9b02dab3d017489cfee174c802b6049
|
4
|
+
data.tar.gz: 26f27f12b6d08d631418cc7e7846f5b726f53c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61ac7c30e3374da1053c12c35c05825cb7b812fdc66c5ea3118f20cce9345616c2c1e07d260eedc0dc380a04b4b5f62180c1cf54723909fe17aca6d622d1bc39
|
7
|
+
data.tar.gz: a7c729ae4775d4928e8934b4fef8fde8cc14e8fcf946522f22c8fbdb8b28d9ed4b05b3ec149f8e6326631c499b7aef39b80f90b8716f382c89fd7e024971fd4f
|
data/.rubocop.yml
CHANGED
@@ -4,13 +4,11 @@ AllCops:
|
|
4
4
|
- '**/config.ru'
|
5
5
|
Exclude:
|
6
6
|
- bin/**
|
7
|
-
- spec/dummy/db/schema.rb
|
8
7
|
- spec/dummy/config/initializers/secret_token.rb
|
9
|
-
- db/migrate/**
|
10
|
-
- db/seeds.rb
|
11
8
|
Documentation:
|
12
9
|
Enabled: false
|
13
10
|
LineLength:
|
14
11
|
Enabled: true
|
15
12
|
Max: 160
|
16
|
-
|
13
|
+
AbcSize:
|
14
|
+
Enabled: false
|
data/Gemfile
CHANGED
@@ -15,8 +15,7 @@ group :development, :test do
|
|
15
15
|
gem 'pry'
|
16
16
|
gem 'pry-byebug'
|
17
17
|
gem 'ruby-progressbar'
|
18
|
-
gem 'mongoid-rspec',
|
19
|
-
gem 'colorize'
|
18
|
+
gem 'mongoid-rspec', '~> 2.0.0.rc1'
|
20
19
|
gem 'quiet_assets'
|
21
20
|
gem 'better_errors'
|
22
21
|
gem 'launchy'
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,7 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/gurix/mongoid-rspec.git
|
3
|
-
revision: d73b0e544f500a18444190193f942687a54e8e87
|
4
|
-
specs:
|
5
|
-
mongoid-rspec (2.0.0)
|
6
|
-
mongoid (~> 4.0.0)
|
7
|
-
rake
|
8
|
-
rspec (>= 2.14)
|
9
|
-
|
10
1
|
PATH
|
11
2
|
remote: .
|
12
3
|
specs:
|
13
|
-
helena (0.
|
4
|
+
helena (1.0.0.rc1)
|
14
5
|
bootstrap-sass (~> 3.2)
|
15
6
|
breadcrumbs_on_rails (~> 2.3)
|
16
7
|
haml-rails (~> 0.5)
|
@@ -22,31 +13,32 @@ PATH
|
|
22
13
|
rails-i18n (~> 4.0)
|
23
14
|
sass-rails (~> 4.0.3)
|
24
15
|
simple_form (~> 3.1.0.rc2)
|
16
|
+
slim (~> 2.1.0)
|
25
17
|
|
26
18
|
GEM
|
27
19
|
remote: https://rubygems.org/
|
28
20
|
specs:
|
29
|
-
actionmailer (4.1.
|
30
|
-
actionpack (= 4.1.
|
31
|
-
actionview (= 4.1.
|
32
|
-
mail (~> 2.5.4)
|
33
|
-
actionpack (4.1.
|
34
|
-
actionview (= 4.1.
|
35
|
-
activesupport (= 4.1.
|
21
|
+
actionmailer (4.1.7)
|
22
|
+
actionpack (= 4.1.7)
|
23
|
+
actionview (= 4.1.7)
|
24
|
+
mail (~> 2.5, >= 2.5.4)
|
25
|
+
actionpack (4.1.7)
|
26
|
+
actionview (= 4.1.7)
|
27
|
+
activesupport (= 4.1.7)
|
36
28
|
rack (~> 1.5.2)
|
37
29
|
rack-test (~> 0.6.2)
|
38
|
-
actionview (4.1.
|
39
|
-
activesupport (= 4.1.
|
30
|
+
actionview (4.1.7)
|
31
|
+
activesupport (= 4.1.7)
|
40
32
|
builder (~> 3.1)
|
41
33
|
erubis (~> 2.7.0)
|
42
|
-
activemodel (4.1.
|
43
|
-
activesupport (= 4.1.
|
34
|
+
activemodel (4.1.7)
|
35
|
+
activesupport (= 4.1.7)
|
44
36
|
builder (~> 3.1)
|
45
|
-
activerecord (4.1.
|
46
|
-
activemodel (= 4.1.
|
47
|
-
activesupport (= 4.1.
|
37
|
+
activerecord (4.1.7)
|
38
|
+
activemodel (= 4.1.7)
|
39
|
+
activesupport (= 4.1.7)
|
48
40
|
arel (~> 5.0.0)
|
49
|
-
activesupport (4.1.
|
41
|
+
activesupport (4.1.7)
|
50
42
|
i18n (~> 0.6, >= 0.6.9)
|
51
43
|
json (~> 1.7, >= 1.7.7)
|
52
44
|
minitest (~> 5.1)
|
@@ -60,25 +52,24 @@ GEM
|
|
60
52
|
rack (>= 0.9.0)
|
61
53
|
binding_of_caller (0.7.2)
|
62
54
|
debug_inspector (>= 0.0.1)
|
63
|
-
bootstrap-sass (3.
|
55
|
+
bootstrap-sass (3.3.0.1)
|
64
56
|
sass (~> 3.2)
|
65
57
|
breadcrumbs_on_rails (2.3.0)
|
66
58
|
bson (2.3.0)
|
67
59
|
builder (3.2.2)
|
68
|
-
byebug (3.
|
60
|
+
byebug (3.5.1)
|
69
61
|
columnize (~> 0.8)
|
70
62
|
debugger-linecache (~> 1.2)
|
71
63
|
slop (~> 3.6)
|
72
|
-
capybara (2.4.
|
64
|
+
capybara (2.4.4)
|
73
65
|
mime-types (>= 1.16)
|
74
66
|
nokogiri (>= 1.3.3)
|
75
67
|
rack (>= 1.0.0)
|
76
68
|
rack-test (>= 0.5.4)
|
77
69
|
xpath (~> 2.0)
|
78
|
-
childprocess (0.5.
|
70
|
+
childprocess (0.5.5)
|
79
71
|
ffi (~> 1.0, >= 1.0.11)
|
80
72
|
coderay (1.1.0)
|
81
|
-
colorize (0.7.3)
|
82
73
|
columnize (0.8.9)
|
83
74
|
connection_pool (2.0.0)
|
84
75
|
coveralls (0.7.1)
|
@@ -97,13 +88,13 @@ GEM
|
|
97
88
|
thread
|
98
89
|
thread_safe
|
99
90
|
erubis (2.7.0)
|
100
|
-
factory_girl (4.
|
91
|
+
factory_girl (4.5.0)
|
101
92
|
activesupport (>= 3.0.0)
|
102
|
-
factory_girl_rails (4.
|
103
|
-
factory_girl (~> 4.
|
93
|
+
factory_girl_rails (4.5.0)
|
94
|
+
factory_girl (~> 4.5.0)
|
104
95
|
railties (>= 3.0.0)
|
105
96
|
ffaker (1.25.0)
|
106
|
-
ffi (1.9.
|
97
|
+
ffi (1.9.6)
|
107
98
|
haml (4.0.5)
|
108
99
|
tilt
|
109
100
|
haml-rails (0.5.3)
|
@@ -114,7 +105,7 @@ GEM
|
|
114
105
|
highline (1.6.21)
|
115
106
|
hike (1.2.3)
|
116
107
|
i18n (0.6.11)
|
117
|
-
i18n-tasks (0.7.
|
108
|
+
i18n-tasks (0.7.8)
|
118
109
|
activesupport
|
119
110
|
easy_translate (>= 0.5.0)
|
120
111
|
erubis
|
@@ -127,36 +118,38 @@ GEM
|
|
127
118
|
railties (>= 3.0, < 5.0)
|
128
119
|
thor (>= 0.14, < 2.0)
|
129
120
|
json (1.8.1)
|
130
|
-
launchy (2.4.
|
121
|
+
launchy (2.4.3)
|
131
122
|
addressable (~> 2.3)
|
132
|
-
mail (2.
|
133
|
-
mime-types (
|
134
|
-
treetop (~> 1.4.8)
|
123
|
+
mail (2.6.3)
|
124
|
+
mime-types (>= 1.16, < 3)
|
135
125
|
method_source (0.8.2)
|
136
|
-
mime-types (
|
137
|
-
mini_portile (0.6.
|
138
|
-
minitest (5.4.
|
126
|
+
mime-types (2.4.3)
|
127
|
+
mini_portile (0.6.1)
|
128
|
+
minitest (5.4.2)
|
139
129
|
mongoid (4.0.0)
|
140
130
|
activemodel (~> 4.0)
|
141
131
|
moped (~> 2.0.0)
|
142
132
|
origin (~> 2.1)
|
143
133
|
tzinfo (>= 0.3.37)
|
134
|
+
mongoid-rspec (2.0.0.rc1)
|
135
|
+
mongoid (~> 4.0.0)
|
136
|
+
rake
|
137
|
+
rspec (~> 3.0)
|
144
138
|
mongoid-simple-tags (0.1.3)
|
145
139
|
json (~> 1.8)
|
146
140
|
mongoid (>= 3.0.3)
|
147
141
|
mongoid_orderable (4.1.0)
|
148
142
|
mongoid
|
149
|
-
moped (2.0.
|
143
|
+
moped (2.0.1)
|
150
144
|
bson (~> 2.2)
|
151
145
|
connection_pool (~> 2.0)
|
152
146
|
optionable (~> 0.2.0)
|
153
147
|
multi_json (1.10.1)
|
154
|
-
netrc (0.
|
155
|
-
nokogiri (1.6.
|
156
|
-
mini_portile (
|
148
|
+
netrc (0.8.0)
|
149
|
+
nokogiri (1.6.4.1)
|
150
|
+
mini_portile (~> 0.6.0)
|
157
151
|
optionable (0.2.0)
|
158
152
|
origin (2.1.1)
|
159
|
-
polyglot (0.3.5)
|
160
153
|
pry (0.10.1)
|
161
154
|
coderay (~> 1.1.0)
|
162
155
|
method_source (~> 0.8.1)
|
@@ -169,81 +162,85 @@ GEM
|
|
169
162
|
rack (1.5.2)
|
170
163
|
rack-test (0.6.2)
|
171
164
|
rack (>= 1.0)
|
172
|
-
rails (4.1.
|
173
|
-
actionmailer (= 4.1.
|
174
|
-
actionpack (= 4.1.
|
175
|
-
actionview (= 4.1.
|
176
|
-
activemodel (= 4.1.
|
177
|
-
activerecord (= 4.1.
|
178
|
-
activesupport (= 4.1.
|
165
|
+
rails (4.1.7)
|
166
|
+
actionmailer (= 4.1.7)
|
167
|
+
actionpack (= 4.1.7)
|
168
|
+
actionview (= 4.1.7)
|
169
|
+
activemodel (= 4.1.7)
|
170
|
+
activerecord (= 4.1.7)
|
171
|
+
activesupport (= 4.1.7)
|
179
172
|
bundler (>= 1.3.0, < 2.0)
|
180
|
-
railties (= 4.1.
|
173
|
+
railties (= 4.1.7)
|
181
174
|
sprockets-rails (~> 2.0)
|
182
|
-
rails-i18n (4.0.
|
175
|
+
rails-i18n (4.0.3)
|
183
176
|
i18n (~> 0.6)
|
184
|
-
|
185
|
-
railties (4.1.
|
186
|
-
actionpack (= 4.1.
|
187
|
-
activesupport (= 4.1.
|
177
|
+
railties (~> 4.0)
|
178
|
+
railties (4.1.7)
|
179
|
+
actionpack (= 4.1.7)
|
180
|
+
activesupport (= 4.1.7)
|
188
181
|
rake (>= 0.8.7)
|
189
182
|
thor (>= 0.18.1, < 2.0)
|
190
183
|
rake (10.3.2)
|
191
184
|
rest-client (1.7.2)
|
192
185
|
mime-types (>= 1.16, < 3.0)
|
193
186
|
netrc (~> 0.7)
|
194
|
-
rspec (3.
|
195
|
-
rspec-core (~> 3.
|
196
|
-
rspec-expectations (~> 3.
|
197
|
-
rspec-mocks (~> 3.
|
187
|
+
rspec (3.1.0)
|
188
|
+
rspec-core (~> 3.1.0)
|
189
|
+
rspec-expectations (~> 3.1.0)
|
190
|
+
rspec-mocks (~> 3.1.0)
|
198
191
|
rspec-collection_matchers (1.0.0)
|
199
192
|
rspec-expectations (>= 2.99.0.beta1)
|
200
|
-
rspec-core (3.
|
201
|
-
rspec-support (~> 3.
|
202
|
-
rspec-expectations (3.
|
193
|
+
rspec-core (3.1.7)
|
194
|
+
rspec-support (~> 3.1.0)
|
195
|
+
rspec-expectations (3.1.2)
|
203
196
|
diff-lcs (>= 1.2.0, < 2.0)
|
204
|
-
rspec-support (~> 3.
|
205
|
-
rspec-mocks (3.
|
206
|
-
rspec-support (~> 3.
|
207
|
-
rspec-rails (3.0
|
197
|
+
rspec-support (~> 3.1.0)
|
198
|
+
rspec-mocks (3.1.3)
|
199
|
+
rspec-support (~> 3.1.0)
|
200
|
+
rspec-rails (3.1.0)
|
208
201
|
actionpack (>= 3.0)
|
209
202
|
activesupport (>= 3.0)
|
210
203
|
railties (>= 3.0)
|
211
|
-
rspec-core (~> 3.
|
212
|
-
rspec-expectations (~> 3.
|
213
|
-
rspec-mocks (~> 3.
|
214
|
-
rspec-support (~> 3.
|
215
|
-
rspec-support (3.
|
216
|
-
ruby-progressbar (1.
|
204
|
+
rspec-core (~> 3.1.0)
|
205
|
+
rspec-expectations (~> 3.1.0)
|
206
|
+
rspec-mocks (~> 3.1.0)
|
207
|
+
rspec-support (~> 3.1.0)
|
208
|
+
rspec-support (3.1.2)
|
209
|
+
ruby-progressbar (1.7.0)
|
217
210
|
rubyzip (1.1.6)
|
218
211
|
sass (3.2.19)
|
219
|
-
sass-rails (4.0.
|
212
|
+
sass-rails (4.0.4)
|
220
213
|
railties (>= 4.0.0, < 5.0)
|
221
|
-
sass (~> 3.2.
|
222
|
-
sprockets (~> 2.8,
|
214
|
+
sass (~> 3.2.2)
|
215
|
+
sprockets (~> 2.8, < 2.12)
|
223
216
|
sprockets-rails (~> 2.0)
|
224
|
-
selenium-webdriver (2.
|
225
|
-
childprocess (
|
217
|
+
selenium-webdriver (2.44.0)
|
218
|
+
childprocess (~> 0.5)
|
226
219
|
multi_json (~> 1.0)
|
227
220
|
rubyzip (~> 1.0)
|
228
|
-
websocket (~> 1.0
|
221
|
+
websocket (~> 1.0)
|
229
222
|
simple_form (3.1.0.rc2)
|
230
223
|
actionpack (~> 4.0)
|
231
224
|
activemodel (~> 4.0)
|
232
|
-
simplecov (0.9.
|
225
|
+
simplecov (0.9.1)
|
233
226
|
docile (~> 1.1.0)
|
234
|
-
multi_json
|
227
|
+
multi_json (~> 1.0)
|
235
228
|
simplecov-html (~> 0.8.0)
|
236
229
|
simplecov-html (0.8.0)
|
230
|
+
slim (2.1.0)
|
231
|
+
temple (~> 0.6.9)
|
232
|
+
tilt (>= 1.3.3, < 2.1)
|
237
233
|
slop (3.6.0)
|
238
|
-
sprockets (2.11.
|
234
|
+
sprockets (2.11.3)
|
239
235
|
hike (~> 1.2)
|
240
236
|
multi_json (~> 1.0)
|
241
237
|
rack (~> 1.0)
|
242
238
|
tilt (~> 1.1, != 1.3.0)
|
243
|
-
sprockets-rails (2.
|
239
|
+
sprockets-rails (2.2.0)
|
244
240
|
actionpack (>= 3.0)
|
245
241
|
activesupport (>= 3.0)
|
246
|
-
sprockets (
|
242
|
+
sprockets (>= 2.8, < 4.0)
|
243
|
+
temple (0.6.10)
|
247
244
|
term-ansicolor (1.3.0)
|
248
245
|
tins (~> 1.0)
|
249
246
|
terminal-table (1.4.5)
|
@@ -251,13 +248,10 @@ GEM
|
|
251
248
|
thread (0.1.4)
|
252
249
|
thread_safe (0.3.4)
|
253
250
|
tilt (1.4.1)
|
254
|
-
tins (1.3.
|
255
|
-
treetop (1.4.15)
|
256
|
-
polyglot
|
257
|
-
polyglot (>= 0.3.1)
|
251
|
+
tins (1.3.3)
|
258
252
|
tzinfo (1.2.2)
|
259
253
|
thread_safe (~> 0.1)
|
260
|
-
websocket (1.
|
254
|
+
websocket (1.2.1)
|
261
255
|
xpath (2.0.0)
|
262
256
|
nokogiri (~> 1.3)
|
263
257
|
|
@@ -270,7 +264,6 @@ DEPENDENCIES
|
|
270
264
|
bootstrap-sass
|
271
265
|
breadcrumbs_on_rails
|
272
266
|
capybara (~> 2.3)
|
273
|
-
colorize
|
274
267
|
coveralls
|
275
268
|
database_cleaner (~> 1.3)
|
276
269
|
factory_girl_rails (~> 4.4)
|
@@ -279,7 +272,7 @@ DEPENDENCIES
|
|
279
272
|
i18n-tasks
|
280
273
|
jquery-rails
|
281
274
|
launchy
|
282
|
-
mongoid-rspec
|
275
|
+
mongoid-rspec (~> 2.0.0.rc1)
|
283
276
|
pry
|
284
277
|
pry-byebug
|
285
278
|
quiet_assets
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
[![Build Status](https://img.shields.io/travis/gurix/helena/master.svg?style=flat)](https://travis-ci.org/gurix/helena)
|
2
2
|
[![Code Climate](https://img.shields.io/codeclimate/github/gurix/helena.svg?style=flat)](https://codeclimate.com/github/gurix/helena)
|
3
3
|
[![Dependency Status](https://img.shields.io/gemnasium/gurix/helena.svg?style=flat)](https://gemnasium.com/gurix/helena)
|
4
|
+
[![Dependency Status](https://img.shields.io/gem/v/helena.svg?style=flat)](https://rubygems.org/gems/helena)
|
5
|
+
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/gurix/helena?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
6
|
# Helena
|
5
7
|
Helena is an online survey/test framework designed for agile survey/test development, longitudinal studies and instant feedback.
|
6
8
|
|
@@ -10,7 +12,7 @@ Demo: http://helena-demo.herokuapp.com (https://github.com/gurix/helena-demo)
|
|
10
12
|
## Requirements
|
11
13
|
* Rails (4.1 or higher)
|
12
14
|
* Mongoid (4.0.0 or higher)
|
13
|
-
* MongoDB 2.4.10
|
15
|
+
* MongoDB (2.4.10 or higher)
|
14
16
|
|
15
17
|
## Installation
|
16
18
|
Add this line to your application's Gemfile:
|
@@ -27,35 +29,12 @@ Add this line to your routes will and you will be good to go!
|
|
27
29
|
|
28
30
|
mount Helena::Engine => '/helena'
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
Typical implementation would be:
|
33
|
-
|
34
|
-
```ruby
|
35
|
-
class ApplicationController < ActionController::Base
|
36
|
-
def current_user
|
37
|
-
@current_user ||= User.find(session[:user_id])
|
38
|
-
end
|
39
|
-
|
40
|
-
def can_administer?
|
41
|
-
current_user.try(:admin?)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
```
|
32
|
+
Since Version 1.0 the admin interface is no longer a part of the gem and was extracted to http://github.com/gurix/helena-admin.
|
45
33
|
|
46
34
|
## TODOS
|
47
35
|
* Support more question types, i.e Dates, Numeric inputs with validation, emails, ...
|
48
36
|
* Customize question type views for each survey
|
49
|
-
* Better admininterface with much better usability
|
50
|
-
|
51
|
-
## Dummy site for development
|
52
37
|
|
53
|
-
```
|
54
|
-
rake -f spec/dummy/Rakefile db:seed
|
55
|
-
cd spec/dummy
|
56
|
-
rails s
|
57
|
-
open http://localhost:3000/helena/admin/surveys
|
58
|
-
```
|
59
38
|
## Contributing
|
60
39
|
|
61
40
|
1. Fork it
|
@@ -64,6 +43,12 @@ open http://localhost:3000/helena/admin/surveys
|
|
64
43
|
4. Push to the branch (`git push origin my-new-feature`)
|
65
44
|
5. Create new Pull Request
|
66
45
|
|
46
|
+
## Contact
|
47
|
+
|
48
|
+
[info@markusgraf.ch](mailto: info@markusgraf.ch)
|
49
|
+
|
50
|
+
Or at [#HelenaFramework](irc://chat.freenode.net/HelenaFramework) on freenode.net
|
51
|
+
|
67
52
|
## Support
|
68
53
|
|
69
54
|
If you like helena and want to support the development, I would appreciate a donation:
|
@@ -1,15 +1,5 @@
|
|
1
1
|
module Helena
|
2
2
|
class ApplicationController < ::ApplicationController
|
3
3
|
helper Helena::Engine.helpers
|
4
|
-
|
5
|
-
helper_method :can_administer?
|
6
|
-
|
7
|
-
def authenticate_administrator
|
8
|
-
fail(ActionController::RoutingError, 'Access Denied') unless can_administer?
|
9
|
-
end
|
10
|
-
|
11
|
-
def add_breadcrumb(name, path = nil, options = {})
|
12
|
-
super(name.presence || t('shared.untitled'), path, options)
|
13
|
-
end
|
14
4
|
end
|
15
5
|
end
|
@@ -3,6 +3,7 @@ module Helena
|
|
3
3
|
respond_to :html
|
4
4
|
|
5
5
|
before_filter :load_session, only: [:edit, :update]
|
6
|
+
after_filter :update_last_question_group_id, only: :update
|
6
7
|
|
7
8
|
def show
|
8
9
|
@session = Helena::Session.find_by view_token: params[:token]
|
@@ -11,7 +12,7 @@ module Helena
|
|
11
12
|
@question_group = question_group
|
12
13
|
|
13
14
|
respond_to do |format|
|
14
|
-
format.html { render html:
|
15
|
+
format.html { render html: session_report }
|
15
16
|
format.json { render json: @session }
|
16
17
|
end
|
17
18
|
end
|
@@ -46,8 +47,9 @@ module Helena
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def question_group
|
49
|
-
|
50
|
-
|
50
|
+
question_group_id = params[:question_group] || @session.last_question_group_id
|
51
|
+
if question_group_id
|
52
|
+
@version.question_groups.find question_group_id
|
51
53
|
else
|
52
54
|
@version.question_groups.asc(:position).first
|
53
55
|
end
|
@@ -67,15 +69,16 @@ module Helena
|
|
67
69
|
end
|
68
70
|
|
69
71
|
def update_answers
|
72
|
+
return session_answers unless session_params
|
73
|
+
|
70
74
|
@question_group.question_codes.each do |question_code|
|
71
75
|
@session.answers.where(code: question_code).delete
|
72
76
|
|
73
|
-
value = session_params[:answers][question_code]
|
77
|
+
value = session_params[:answers][question_code]
|
74
78
|
|
75
79
|
next if value.blank?
|
76
80
|
|
77
|
-
|
78
|
-
@session.answers << answer
|
81
|
+
@session.answers << Helena::Answer.build_generic(question_code, value, request.remote_ip)
|
79
82
|
end
|
80
83
|
session_answers
|
81
84
|
end
|
@@ -89,5 +92,13 @@ module Helena
|
|
89
92
|
end
|
90
93
|
errors
|
91
94
|
end
|
95
|
+
|
96
|
+
def session_report
|
97
|
+
Slim::Template.new { @version.session_report }.render.html_safe if @version.session_report
|
98
|
+
end
|
99
|
+
|
100
|
+
def update_last_question_group_id
|
101
|
+
@session.update_attribute :last_question_group_id, @question_group.id
|
102
|
+
end
|
92
103
|
end
|
93
104
|
end
|
data/app/models/helena/answer.rb
CHANGED
@@ -8,8 +8,7 @@ module Helena
|
|
8
8
|
|
9
9
|
embedded_in :session, inverse_of: :answers
|
10
10
|
|
11
|
-
validates :code, :
|
12
|
-
validates :code, uniqueness: true
|
11
|
+
validates :code, presence: true, uniqueness: true
|
13
12
|
|
14
13
|
def self.build_generic(code, value, ip_address)
|
15
14
|
value = cast_value(value)
|
@@ -14,7 +14,7 @@ module Helena
|
|
14
14
|
selected_labels = labels.select { |label| label.preselected == true }
|
15
15
|
return if selected_labels.size <= 1
|
16
16
|
selected_labels.each { |label| label.errors.add(:preselected, I18n.t(:taken, scope: 'activerecord.errors.messages')) }
|
17
|
-
errors.add(:labels, I18n.t('helena.admin.radio_group.only_one_preselection_allowed'))
|
17
|
+
errors.add(:labels, I18n.t('helena.admin.radio_group.only_one_preselection_allowed')) # TODO: How to manage this translation?
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -14,7 +14,7 @@ module Helena
|
|
14
14
|
Helena::Questions::RadioMatrix
|
15
15
|
]
|
16
16
|
|
17
|
-
|
17
|
+
belongs_to :question_group, inverse_of: :questions
|
18
18
|
|
19
19
|
embeds_many :labels, class_name: 'Helena::Label'
|
20
20
|
embeds_many :sub_questions, class_name: 'Helena::SubQuestion'
|
@@ -25,7 +25,7 @@ module Helena
|
|
25
25
|
field :code, type: String
|
26
26
|
field :question_text, type: String
|
27
27
|
|
28
|
-
orderable
|
28
|
+
orderable scope: :question_group
|
29
29
|
|
30
30
|
validates :code, presence: true
|
31
31
|
|
@@ -51,13 +51,13 @@ module Helena
|
|
51
51
|
|
52
52
|
def reject_labels(attributed)
|
53
53
|
attributed['text'].blank? &&
|
54
|
-
|
54
|
+
attributed['value'].blank?
|
55
55
|
end
|
56
56
|
|
57
57
|
def reject_sub_questions(attributed)
|
58
58
|
attributed['code'].blank? &&
|
59
|
-
|
60
|
-
|
59
|
+
attributed['default_value'].blank? &&
|
60
|
+
attributed['question_text'].blank?
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -3,13 +3,14 @@ module Helena
|
|
3
3
|
include Helena::Concerns::ApplicationModel
|
4
4
|
include Mongoid::Orderable
|
5
5
|
|
6
|
-
|
6
|
+
belongs_to :version
|
7
7
|
|
8
|
-
|
8
|
+
has_many :questions, inverse_of: :question_group, class_name: 'Helena::Question', dependent: :destroy
|
9
9
|
|
10
|
-
orderable
|
10
|
+
orderable scope: :version
|
11
11
|
|
12
12
|
field :title, type: String
|
13
|
+
field :allow_to_go_back, type: Boolean
|
13
14
|
|
14
15
|
def question_codes
|
15
16
|
questions.map { |question| [question.code] + question.sub_questions.map(&:code) }.flatten
|
@@ -5,6 +5,7 @@ module Helena
|
|
5
5
|
field :token, type: String
|
6
6
|
field :view_token, type: String
|
7
7
|
field :completed, type: Boolean, default: false
|
8
|
+
field :last_question_group_id, type: BSON::ObjectId
|
8
9
|
|
9
10
|
belongs_to :survey, inverse_of: :sessions, class_name: 'Helena::Survey'
|
10
11
|
belongs_to :version, inverse_of: :sessions, class_name: 'Helena::Version'
|
@@ -15,6 +16,16 @@ module Helena
|
|
15
16
|
|
16
17
|
before_create :reset_tokens
|
17
18
|
|
19
|
+
def answers_as_yaml
|
20
|
+
Hash[answers.map { | answer | [answer.code, answer.value] }.sort].to_yaml
|
21
|
+
end
|
22
|
+
|
23
|
+
def answers_as_yaml=(yaml)
|
24
|
+
parsed_answers = YAML.load yaml
|
25
|
+
update_answers parsed_answers
|
26
|
+
remove_unparsed_answers parsed_answers
|
27
|
+
end
|
28
|
+
|
18
29
|
def reset_tokens
|
19
30
|
# NOTE: there are (2*26+10)^k tokens available
|
20
31
|
# To not run into performance issues we could pregenerate unique tokens in the future
|
@@ -72,5 +83,21 @@ module Helena
|
|
72
83
|
def unique_token_for?(field = :token)
|
73
84
|
self.class.where(field => send(field)).blank? && send(field).present?
|
74
85
|
end
|
86
|
+
|
87
|
+
def update_answers(parsed_answers)
|
88
|
+
parsed_answers.each do | code, value |
|
89
|
+
answer = answers.where(code: code).first
|
90
|
+
if answer
|
91
|
+
next if answer.value == value
|
92
|
+
answer.delete
|
93
|
+
end
|
94
|
+
answers << Helena::Answer.build_generic(code, value, '')
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def remove_unparsed_answers(parsed_answers)
|
99
|
+
unparsed_answers = answers.map(&:code) - parsed_answers.keys
|
100
|
+
answers.in(code: unparsed_answers).destroy
|
101
|
+
end
|
75
102
|
end
|
76
103
|
end
|
data/app/models/helena/survey.rb
CHANGED
@@ -8,9 +8,8 @@ module Helena
|
|
8
8
|
|
9
9
|
field :name, type: String
|
10
10
|
field :language, type: String
|
11
|
-
field :description, type: String
|
12
11
|
|
13
|
-
|
12
|
+
has_many :versions, inverse_of: :survey, dependent: :destroy, class_name: 'Helena::Version'
|
14
13
|
has_many :sessions, inverse_of: :survey, dependent: :destroy, class_name: 'Helena::Session'
|
15
14
|
|
16
15
|
accepts_nested_attributes_for :versions
|
@@ -18,12 +17,8 @@ module Helena
|
|
18
17
|
validates :name, presence: true, uniqueness: true
|
19
18
|
validates :language, presence: true
|
20
19
|
|
21
|
-
def draft_version
|
22
|
-
versions.find_by version: 0
|
23
|
-
end
|
24
|
-
|
25
20
|
def newest_version
|
26
|
-
versions.find_by version: versions.max(:version)
|
21
|
+
versions.find_by version: versions.max(:version) if versions.any?
|
27
22
|
end
|
28
23
|
end
|
29
24
|
end
|