quby-compiler 0.5.8 → 0.5.10

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: 44068865d5a7d4dab6a76cf5d6b11bc8c6ce64be7f373e822e3e1ec30bbd1889
4
- data.tar.gz: f0a6dc1e26bc3b212370054b1dbaad1af344b6833ea056b9c618b264b2a8e4f5
3
+ metadata.gz: 82298997f758c4ea2df21fe0c773a16ae92d25ac1074bf1a5b28481d5f9df91c
4
+ data.tar.gz: 20f134c1d21d928ff998066c776470dd4b15b3b74c337d8a8b1ff4cecca570ac
5
5
  SHA512:
6
- metadata.gz: 1d57ad082868f0f5e37dc1cf7094037d631dbc76232ec83400155ad07a05f6e4a37b569843750a973fa2543d134d5cbda63465775d0d64d912af1357c71ca56d
7
- data.tar.gz: 3301d9eeca5a25a3186043c506b39beab4568d99f7945f0e646d29bdbd223e7813fd3479e6c3a215ef28e9ca36f0edb63a168b2abcdb5fe9600b15e21edd8e4f
6
+ metadata.gz: 178feed69dac1d95d8a8323d783f09abb134cffd870d857e1fc709b1044992016985242c77d35a72ce4c6b4e36f4f3dea8110d7f7e5bc47ccc275f491f611823
7
+ data.tar.gz: e2d3e142e77b3806c2c407eff25fb71513f7fedacbce04a97c2d89c5352b9dca3aa45210ba67e2f79fb81290a1eb11377ae669f900b8266fa37c8f458299c616
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.5.10
2
+
3
+ * Removed only_for_export flag. No longer used and did not do what people expected it to do.
4
+
5
+ # 0.5.9
6
+
7
+ * added `require 'ostruct'` since running quby-compile suddenly fails on this.
8
+
1
9
  # 0.5.8
2
10
 
3
11
  * DefinitionValidator: Add uniqueness check over all question, flags, textvars and score keys.
@@ -4,7 +4,7 @@ module Quby
4
4
  module Compiler
5
5
  module Entities
6
6
  class Flag < Struct.new(:key, :description_true, :description_false, :description, :internal, :trigger_on,
7
- :shows_questions, :hides_questions, :depends_on, :default_in_interface)
7
+ :shows_questions, :hides_questions, :depends_on, :default)
8
8
  # rubocop:disable ParameterLists
9
9
  def initialize(key:,
10
10
  description_true: nil,
@@ -15,10 +15,11 @@ module Quby
15
15
  shows_questions: [],
16
16
  hides_questions: [],
17
17
  depends_on: [], # used in interface to hide this flag unless the depended on flag is set to true
18
+ default: nil,
18
19
  default_in_interface: nil) # used in interface to set a default for the flag state,
19
20
  # does not have an effect outside of the interface
20
21
  super(key, description_true, description_false, description, internal, trigger_on, shows_questions,
21
- hides_questions, Array.wrap(depends_on).map(&:to_s), default_in_interface)
22
+ hides_questions, Array.wrap(depends_on).map(&:to_s), (default.nil? ? default_in_interface : default))
22
23
  end
23
24
  # rubocop:enable ParameterLists
24
25
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ostruct'
3
4
  require 'active_model'
4
5
  require 'quby/settings'
5
6
  require 'quby/compiler/entities/flag'
@@ -10,8 +10,6 @@ module Quby
10
10
  # The shortened key that will used as the field/column name for csv and oru exports,
11
11
  # excluding the questionnaire key part
12
12
  attribute :export_key, Types::Symbol
13
- # [Optional] Whether this score will only be exported through oru/api/data exports, but not shown in interfaces
14
- attribute :only_for_export?, Types::Bool
15
13
  # [Optional] The key of the variable definition used to calculate the subscore result.
16
14
  attribute :calculation_key?, Types::Symbol
17
15
  # [Optional argument] The name of the outcome table where this subscore should be shown. Used for cases where scores
@@ -225,7 +225,6 @@ module Quby
225
225
  key: subschema.key,
226
226
  label: subschema.label,
227
227
  export_key: subschema.export_key,
228
- only_for_export: subschema.only_for_export
229
228
  }
230
229
  end
231
230
  }
@@ -283,7 +282,7 @@ module Quby
283
282
  shows_questions: flag.shows_questions,
284
283
  hides_questions: flag.hides_questions,
285
284
  depends_on: flag.depends_on,
286
- default_in_interface: flag.default_in_interface,
285
+ default: flag.default,
287
286
  }
288
287
  end
289
288
  end
@@ -261,7 +261,6 @@ module Quby
261
261
  key: subscore.key,
262
262
  label: subscore.label,
263
263
  export_key: subscore.export_key,
264
- only_for_export: subscore.only_for_export.presence,
265
264
  type: subscore.type
266
265
  }.compact
267
266
  }
@@ -279,7 +278,8 @@ module Quby
279
278
  shows_questions: flag.shows_questions,
280
279
  hides_questions: flag.hides_questions,
281
280
  depends_on: flag.depends_on,
282
- default_in_interface: flag.default_in_interface
281
+ default: flag.default,
282
+ default_in_interface: flag.default # TODO: Remove this when Roqua supports default natively
283
283
  }
284
284
  end
285
285
  end
@@ -315,15 +315,10 @@ module Quby
315
315
  questionnaire.score_schemas.values.each do |score_schema|
316
316
  score_labels << score_schema.label
317
317
  score_keys << score_schema.subscore_schemas.map do |subschema|
318
- hash = {
318
+ {
319
319
  key: subschema.key,
320
320
  header: subschema.export_key.to_s # a shortened key used as PART OF the csv export column headers
321
321
  }
322
- if subschema.only_for_export
323
- hash.merge(hidden: true)
324
- else
325
- hash
326
- end
327
322
  end
328
323
 
329
324
  headers = score_schema.subscore_schemas.map(&:label)
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  # Copied from RoQua for default_answer_values.
2
4
  # Temporary: should change the values when quby1 is off the table
3
5
  class Quby::Compiler::Services::TransformQuby1ValuesIntoQuby2Values
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.5.8"
3
+ VERSION = "0.5.10"
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.5.8
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-05 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel