qwester 0.1.3 → 0.1.4

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.
@@ -165,52 +165,58 @@ EOF
165
165
  para qwester_rule_set.rule
166
166
  end
167
167
 
168
- if qwester_rule_set.matching_answer_sets.present?
169
- div do
170
- h3 'Sample matching answer sets'
171
- if qwester_rule_set.matching_answer_sets.length
172
- para "There are at least #{qwester_rule_set.matching_answer_sets.length} combinations of answers that would pass this test."
173
- end
174
- para 'The following combinations of answers would pass'
175
- qwester_rule_set.matching_answer_sets.each do |answer_set|
176
- ul :style => 'border:#CCCCCC 1px solid;padding:5px;list-style:none;' do
177
- answer_set.each do |answer_id|
178
- next unless Answer.exists?(answer_id)
179
- answer = Answer.find(answer_id)
180
- question_summary = [answer.value, answer.question.title].join(' : ')
181
- li "(a#{answer_id}) #{question_summary}"
168
+ begin
169
+ if qwester_rule_set.matching_answer_sets.present?
170
+ div do
171
+ h3 'Sample matching answer sets'
172
+ if qwester_rule_set.matching_answer_sets.length
173
+ para "There are at least #{qwester_rule_set.matching_answer_sets.length} combinations of answers that would pass this test."
174
+ end
175
+ para 'The following combinations of answers would pass'
176
+ qwester_rule_set.matching_answer_sets.each do |answer_set|
177
+ ul :style => 'border:#CCCCCC 1px solid;padding:5px;list-style:none;' do
178
+ answer_set.each do |answer_id|
179
+ next unless Answer.exists?(answer_id)
180
+ answer = Answer.find(answer_id)
181
+ question_summary = [answer.value, answer.question.title].join(' : ')
182
+ li "(a#{answer_id}) #{question_summary}"
183
+ end
182
184
  end
183
185
  end
184
186
  end
187
+ else
188
+ div do
189
+ h3 'Matching answer sets'
190
+ para 'Answers will pass unless they contain a blocking answer set'
191
+ end
185
192
  end
186
- else
187
- div do
188
- h3 'Matching answer sets'
189
- para 'Answers will pass unless they contain a blocking answer set'
190
- end
191
- end
192
-
193
- if qwester_rule_set.blocking_answer_sets.present?
194
- div do
195
- h3 'Sample blocking answer sets'
196
- para 'The following combinations of answers would not pass'
197
- qwester_rule_set.blocking_answer_sets.each do |answer_set|
198
- ul :style => 'border:#CCCCCC 1px solid;padding:5px;list-style:none;' do
199
- answer_set.each do |answer_id|
200
- next unless Answer.exists?(answer_id)
201
- answer = Answer.find(answer_id)
202
- question_summary = [answer.value, answer.question.title].join(' : ')
203
- li "(a#{answer_id}) #{question_summary}"
193
+
194
+ if qwester_rule_set.blocking_answer_sets.present?
195
+ div do
196
+ h3 'Sample blocking answer sets'
197
+ para 'The following combinations of answers would not pass'
198
+ qwester_rule_set.blocking_answer_sets.each do |answer_set|
199
+ ul :style => 'border:#CCCCCC 1px solid;padding:5px;list-style:none;' do
200
+ answer_set.each do |answer_id|
201
+ next unless Answer.exists?(answer_id)
202
+ answer = Answer.find(answer_id)
203
+ question_summary = [answer.value, answer.question.title].join(' : ')
204
+ li "(a#{answer_id}) #{question_summary}"
205
+ end
204
206
  end
205
207
  end
206
208
  end
209
+ else
210
+ div do
211
+ h3 'Blocking answer sets'
212
+ para 'Answers will only pass if they contain a matching answer set'
213
+ end
207
214
  end
208
- else
209
- div do
210
- h3 'Blocking answer sets'
211
- para 'Answers will only pass if they contain a matching answer set'
212
- end
215
+ rescue ArrayLogic::UnableToDetermineCombinationsError => e
216
+ h3 'Sample combinations'
217
+ para e.message
213
218
  end
219
+
214
220
 
215
221
  end
216
222
 
@@ -1,10 +1,13 @@
1
1
  module Qwester
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
4
4
 
5
5
  # History
6
6
  # =======
7
7
  #
8
+ # 0.1.4 - Bug fix update
9
+ # Rescues exception in admin_rules_sets#show due to rule including a function
10
+ #
8
11
  # 0.1.3 - Update to use version of Array Logic that supports functions.
9
12
  # Allows RuleSet#rule to be defined using sum, average or count functions
10
13
  #
@@ -20,21 +23,21 @@ end
20
23
  # the list of questionnaires being displayed can change as questionnaires are
21
24
  # submitted.
22
25
  #
23
- # 0.0.9 - maintenance update
26
+ # 0.0.9 - Maintenance update
24
27
  # Removes cope_index from migrations.
25
28
  # Ensures answer_store#session_id is unique
26
29
  #
27
- # 0.0.8 - add facility to preserve answer stores
30
+ # 0.0.8 - Add facility to preserve answer stores
28
31
  # This allows snaps shots to be taken, and redundant answer stores to be
29
32
  # removed during routine maintenance.
30
33
  #
31
- # 0.0.7 - improves deployment process
34
+ # 0.0.7 - Improves deployment process
32
35
  # Fixes a bug in one of the migrations and updates the README
33
36
  #
34
- # 0.0.6 - bug fix update
37
+ # 0.0.6 - Bug fix update
35
38
  # Fixes issue where error raised if user submits a questionnaire without
36
39
  # selecting and answer.
37
40
  #
38
- # 0.0.5 - bug fix update
41
+ # 0.0.5 - Bug fix update
39
42
  # Fixes issue where active admin rule set form did not include link text field.
40
43
  #
Binary file
Binary file