qti 2.22.1 → 2.22.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 226c095ecb34ca04b13cfd9f81f39322b95317290c2e26ba4c01a1fb96fba029
4
- data.tar.gz: 8053d9550e1a7bfca1a6b510e63bbae3ae8e57981281e2e651488addcc6361af
3
+ metadata.gz: 741703a8337d31961ab9ce07b394f6c9bb3484d2672f79f13a75ccd56234ad8e
4
+ data.tar.gz: 534f9d8da9a9e427cefb09765856fe7308e1d23c7710329358751cab3f48a713
5
5
  SHA512:
6
- metadata.gz: 7ec199fed12c9b46b9a7f7ea3ed74aaeaf2877e6202d13e4fc5da4c30ca225f38832473b13d3653a1a9ef0a4fa1e7d4fb7ac0d6a1e287c825aafa534425450ee
7
- data.tar.gz: 7c3146c9f00d6fd745b2cd9046e0614ffb44db07484659bd2cb11099e37f719c30f03a18431b12bdf76df62072ff78f17bbbd5a594952e5a1d3916a1f95f5d93
6
+ metadata.gz: bc88bd3ff406a0283589bcdb992506fe6994fa7cdae1a26422c3f24edd15a7c4a4041e6915c96d7e2a9cbc0a2ea8289e103df8baa2e2ccffe893b3ed9cbac7ee
7
+ data.tar.gz: 3a2cf6f3599f66f1e8ca178af12e1115d267bcccbdf1145401f127e923aa5d6bd35976885f892ff4f576de7291a366d7044bbc48d8b70f53b807f2a369f59275
@@ -112,17 +112,17 @@ module Qti
112
112
  def wordbank_choices
113
113
  return unless wordbank_answer_present?
114
114
 
115
- choices = []
115
+ choices = Set.new
116
116
 
117
117
  wordbank_answers = all_wordbank_answers.map do |node|
118
118
  V1::Models::Choices::FillBlankChoice.new(node, self)
119
119
  end
120
120
 
121
121
  wordbank_answers.each do |wordbank_answer|
122
- choices.push({ id: wordbank_answer.identifier, item_body: wordbank_answer.item_body })
122
+ choices.add({ id: wordbank_answer.identifier, item_body: wordbank_answer.item_body })
123
123
  end
124
124
 
125
- choices
125
+ choices.to_a
126
126
  end
127
127
 
128
128
  def correct_answer_map
data/lib/qti/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '2.22.1'.freeze
2
+ VERSION = '2.22.2'.freeze
3
3
  end
@@ -23,7 +23,7 @@
23
23
  </itemmetadata>
24
24
  <presentation>
25
25
  <material>
26
- <mattext texttype="text/html">&lt;p&gt;Roses are [a20629ed-0c0b-4959-b565-a80c0f199602] and [ab37a945-ebad-4787-a356-66c3c91efcc6].&lt;/p&gt;</mattext>
26
+ <mattext texttype="text/html">&lt;p&gt;Roses are [a20629ed-0c0b-4959-b565-a80c0f199602], [ab37a945-ebad-4787-a356-66c3c91efcc6], and [ab37a945-ebad-4787-a356-66c3c91efcc7].&lt;/p&gt;</mattext>
27
27
  </material>
28
28
  <response_lid ident="response_a20629ed-0c0b-4959-b565-a80c0f199602">
29
29
  <material>
@@ -64,6 +64,23 @@
64
64
  </response_label>
65
65
  </render_choice>
66
66
  </response_lid>
67
+ <response_lid ident="response_ab37a945-ebad-4787-a356-66c3c91efcc7">
68
+ <material>
69
+ <mattext>brown</mattext>
70
+ </material>
71
+ <render_choice>
72
+ <response_label ident="cd11d826-906d-4dc4-b78d-d66516eb94ce" scoring_algorithm='TextEquivalence' answer_type='wordbank' allow_reuse='true'>
73
+ <material>
74
+ <mattext texttype="text/plain">brown</mattext>
75
+ </material>
76
+ </response_label>
77
+ <response_label ident="bae0bd4f-2327-4a3e-b29f-199e1e279e91" scoring_algorithm='TextEquivalence' answer_type='wordbank' allow_reuse='true'>
78
+ <material>
79
+ <mattext texttype="text/plain">white</mattext>
80
+ </material>
81
+ </response_label>
82
+ </render_choice>
83
+ </response_lid>
67
84
  </presentation>
68
85
  <resprocessing>
69
86
  <outcomes>
@@ -73,13 +90,19 @@
73
90
  <conditionvar>
74
91
  <varequal respident="response_a20629ed-0c0b-4959-b565-a80c0f199602">378646a8-b823-4e5b-beb8-19ca63f1f355</varequal>
75
92
  </conditionvar>
76
- <setvar action="Add" varname="SCORE">50.00</setvar>
93
+ <setvar action="Add" varname="SCORE">33.33</setvar>
77
94
  </respcondition>
78
95
  <respcondition>
79
96
  <conditionvar>
80
97
  <varequal respident="response_ab37a945-ebad-4787-a356-66c3c91efcc6">bae0bd4f-2327-4a3e-b29f-199e1e279e91</varequal>
81
98
  </conditionvar>
82
- <setvar action="Add" varname="SCORE">50.00</setvar>
99
+ <setvar action="Add" varname="SCORE">33.33</setvar>
100
+ </respcondition>
101
+ <respcondition>
102
+ <conditionvar>
103
+ <varequal respident="response_ab37a945-ebad-4787-a356-66c3c91efcc7">cd11d826-906d-4dc4-b78d-d66516eb94ce</varequal>
104
+ </conditionvar>
105
+ <setvar action="Add" varname="SCORE">33.33</setvar>
83
106
  </respcondition>
84
107
  </resprocessing>
85
108
  </item>
@@ -319,20 +319,43 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
319
319
  c9400bfb-78ea-45b6-b5a5-e3311f6d5ed0
320
320
  76350749-49ac-4094-966b-c4e1f12d54bc
321
321
  cd11d826-906d-4dc4-b78d-d66516eb94ce
322
+ bae0bd4f-2327-4a3e-b29f-199e1e279e91
323
+ cd11d826-906d-4dc4-b78d-d66516eb94ce
322
324
  bae0bd4f-2327-4a3e-b29f-199e1e279e91]
323
325
  end
324
- let(:scoring_data_values) { %w[black violet grey brown white] }
325
- let(:scoring_data_case) { %w[no no no no no] }
326
- let(:scoring_data_algorithm) { %w[Equivalence Equivalence Equivalence TextEquivalence TextEquivalence] }
327
- let(:scoring_data_answer_type) { %w[dropdown dropdown dropdown wordbank wordbank] }
328
- let(:scoring_data_options) { [{}, {}, {}, { 'allow_reuse' => 'true' }, { 'allow_reuse' => 'true' }] }
326
+ let(:scoring_data_values) { %w[black violet grey brown white brown white] }
327
+ let(:scoring_data_case) { %w[no no no no no no no] }
328
+ let(:scoring_data_algorithm) do
329
+ %w[
330
+ Equivalence
331
+ Equivalence
332
+ Equivalence
333
+ TextEquivalence
334
+ TextEquivalence
335
+ TextEquivalence
336
+ TextEquivalence
337
+ ]
338
+ end
339
+ let(:scoring_data_answer_type) { %w[dropdown dropdown dropdown wordbank wordbank wordbank wordbank] }
340
+ let(:scoring_data_options) do
341
+ [
342
+ {},
343
+ {},
344
+ {},
345
+ { 'allow_reuse' => 'true' },
346
+ { 'allow_reuse' => 'true' },
347
+ { 'allow_reuse' => 'true' },
348
+ { 'allow_reuse' => 'true' }
349
+ ]
350
+ end
329
351
  let(:wordbank_choices) do
330
352
  [{ id: 'cd11d826-906d-4dc4-b78d-d66516eb94ce', item_body: 'brown' },
331
353
  { id: 'bae0bd4f-2327-4a3e-b29f-199e1e279e91', item_body: 'white' }]
332
354
  end
333
355
  let(:correct_answer_map) do
334
356
  { 'response_a20629ed-0c0b-4959-b565-a80c0f199602' => '378646a8-b823-4e5b-beb8-19ca63f1f355',
335
- 'response_ab37a945-ebad-4787-a356-66c3c91efcc6' => 'bae0bd4f-2327-4a3e-b29f-199e1e279e91' }
357
+ 'response_ab37a945-ebad-4787-a356-66c3c91efcc6' => 'bae0bd4f-2327-4a3e-b29f-199e1e279e91',
358
+ 'response_ab37a945-ebad-4787-a356-66c3c91efcc7' => 'cd11d826-906d-4dc4-b78d-d66516eb94ce' }
336
359
  end
337
360
  let(:expected_stem_items) do
338
361
  [{ id: 'stem_0', position: 1, type: 'text', value: '<p>Roses are ' },
@@ -341,13 +364,19 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
341
364
  id: 'stem_1',
342
365
  position: 2,
343
366
  type: 'blank' },
344
- { id: 'stem_2', position: 3, type: 'text', value: ' and ' },
367
+ { id: 'stem_2', position: 3, type: 'text', value: ', ' },
345
368
  { blank_id: 'response_ab37a945-ebad-4787-a356-66c3c91efcc6',
346
369
  blank_name: 'white',
347
370
  id: 'stem_3',
348
371
  position: 4,
349
372
  type: 'blank' },
350
- { id: 'stem_4', position: 5, type: 'text', value: '.</p>' }]
373
+ { id: 'stem_4', position: 5, type: 'text', value: ', and ' },
374
+ { blank_id: 'response_ab37a945-ebad-4787-a356-66c3c91efcc7',
375
+ blank_name: 'brown',
376
+ id: 'stem_5',
377
+ position: 6,
378
+ type: 'blank' },
379
+ { id: 'stem_6', position: 7, type: 'text', value: '.</p>' }]
351
380
  end
352
381
 
353
382
  include_examples 'scoring_data_structs'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qti
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.1
4
+ version: 2.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Diaz
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2023-08-15 00:00:00.000000000 Z
15
+ date: 2023-08-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: actionview