quby-compiler 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0693e46b261fa2268bf3a406811a27d3782bf34c9c6cb6de4e968206f4d1ab43'
4
- data.tar.gz: 7fc5013a7ca5893db68d1276ececc4996d0f72e75737bc8c7a7912d622c3d873
3
+ metadata.gz: 51cced2ed60f5bf58986b0bb1359a06e20349ee41f8313a86fd8abe7743b942f
4
+ data.tar.gz: 63dfc7514011d1a0518a5a5fd5dec191dd326104dab042eba491bb3b71380ff8
5
5
  SHA512:
6
- metadata.gz: 743ea4cc3c41f908806d6937aed62dac028d9684246d61f951846fb1657582f8a300dcc3f32bc590630425a254a3ef69543805f67ad0f0ebd271cd1219440f55
7
- data.tar.gz: af49465555957283e67aa518bf0fdeed8250b3888f98f0d68b1e7a19d8158792718a958f91d4b9e99077319125d26eb6e69ee3a232280c4c0d98ba05a062e7cb
6
+ metadata.gz: 0cef3595b41bdeb1eb0cd4ced9b903fc63441359a98a12b2999bdfda66daa2b705c07316cf6eaf16912e64a20098296348b838565eb89c6f15b42bab659fbdee
7
+ data.tar.gz: a5ad54369e5bf53e516d2f03665309d0e3e530b3acd488be9cad1eb4d1bcab0cebb6e3d23274c5d3bbfba225475e8970aa24fc776eee1b5206049428dd8c1d0d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.4.3
2
+
3
+ * roqua.json: add scores hash.
4
+
1
5
  # 0.4.2
2
6
 
3
7
  * quby2: Added labels to slider questions.
@@ -22,6 +22,7 @@ module Quby
22
22
  tags: questionnaire.tags.to_h.keys,
23
23
  charts: charts,
24
24
  outcome_tables_schema: outcome_tables_schema,
25
+ scores: scores,
25
26
  }
26
27
  end
27
28
 
@@ -139,7 +140,33 @@ module Quby
139
140
  tables: tables,
140
141
  }
141
142
  end
143
+
144
+ # [{ key: { .., subscores: { subkey: {..} } } }]
145
+ def scores
146
+ questionnaire.score_schemas.transform_values { |score|
147
+ {
148
+ key: score.key,
149
+ label: score.label,
150
+ subscores: subscores_for(score)
151
+ }
152
+ }
153
+ end
154
+
155
+ # { subkey: {..} }
156
+ def subscores_for(score)
157
+ score.subscore_schemas.to_h { |subscore|
158
+ [
159
+ subscore.key,
160
+ {
161
+ key: subscore.key,
162
+ label: subscore.label,
163
+ export_key: subscore.export_key,
164
+ only_for_export: subscore.only_for_export.presence
165
+ }.compact
166
+ ]
167
+ }
168
+ end
142
169
  end
143
170
  end
144
171
  end
145
- end
172
+ end
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel