qti 2.22.1 → 2.22.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qti/v1/models/interactions/fill_blank_interaction.rb +3 -3
- data/lib/qti/v1/models/interactions/match_interaction.rb +1 -1
- data/lib/qti/version.rb +1 -1
- data/spec/fixtures/items_1.2/nq_multiple_fib_answer_types.xml +26 -3
- data/spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb +37 -8
- data/spec/lib/qti/v1/models/interactions/match_interaction_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42c63611259820188bc8dec017059b4677254551abfba0e35b170887839b719
|
4
|
+
data.tar.gz: 2a980a3ee7152342694ec380a9bdbc44fe76a52fc19c0de7c1bb909d8fe96194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e494dd40e060fa1f06ac31651a9ca0d60a96f334f4a7740582ba7909dcd7ba2392084f75845b7fa9b7d0824330a24e318ac655acd6d003ceb5d08f9681ed525
|
7
|
+
data.tar.gz: cbf7b1158da32cbd4c262fd24dd41ab9e850c52b72759731c8e3e89c3dcc6681ea0c254c6ddd7b59e2b6d74a7e731f2e30b331bd1ddd81411d0a6769c998634b
|
@@ -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.
|
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
|
@@ -21,7 +21,7 @@ module Qti
|
|
21
21
|
mattext = lid_node.at_xpath('.//xmlns:mattext')
|
22
22
|
inner_content = return_inner_content!(mattext)
|
23
23
|
item_body = sanitize_content!(inner_content)
|
24
|
-
{ id: lid_node.attributes['ident'].value,
|
24
|
+
{ id: lid_node.attributes['ident'].value, item_body: item_body }
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/lib/qti/version.rb
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
</itemmetadata>
|
24
24
|
<presentation>
|
25
25
|
<material>
|
26
|
-
<mattext texttype="text/html"><p>Roses are [a20629ed-0c0b-4959-b565-a80c0f199602] and [ab37a945-ebad-4787-a356-
|
26
|
+
<mattext texttype="text/html"><p>Roses are [a20629ed-0c0b-4959-b565-a80c0f199602], [ab37a945-ebad-4787-a356-66c3c91efcc6], and [ab37a945-ebad-4787-a356-66c3c91efcc7].</p></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">
|
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">
|
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)
|
327
|
-
|
328
|
-
|
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: '
|
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: '
|
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'
|
@@ -47,8 +47,8 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
|
|
47
47
|
end
|
48
48
|
let(:expected_questions) do
|
49
49
|
[
|
50
|
-
{ id: 'question_1',
|
51
|
-
{ id: 'question_2',
|
50
|
+
{ id: 'question_1', item_body: 'Light Microscope' },
|
51
|
+
{ id: 'question_2', item_body: 'Electron Microscopes' }
|
52
52
|
]
|
53
53
|
end
|
54
54
|
let(:expected_scoring_data) do
|
@@ -73,10 +73,10 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
|
|
73
73
|
let(:expected_answers) { '1,2,,C,D,E,F,3,4,5,6'.split(',') }
|
74
74
|
let(:expected_questions) do
|
75
75
|
[
|
76
|
-
{ id: 'response_6831',
|
77
|
-
{ id: 'response_6259',
|
78
|
-
{ id: 'response_743',
|
79
|
-
{ id: 'response_1943',
|
76
|
+
{ id: 'response_6831', item_body: 'A' },
|
77
|
+
{ id: 'response_6259', item_body: 'B' },
|
78
|
+
{ id: 'response_743', item_body: '' },
|
79
|
+
{ id: 'response_1943', item_body: '' }
|
80
80
|
]
|
81
81
|
end
|
82
82
|
let(:expected_scoring_data) do
|
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.
|
4
|
+
version: 2.22.3
|
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-
|
15
|
+
date: 2023-09-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: actionview
|