qti 2.15.3 → 2.15.4
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/base_fill_blank_interaction.rb +7 -1
- data/lib/qti/version.rb +1 -1
- data/spec/fixtures/items_1.2/canvas_multiple_dropdowns_correct_choice_is_not_the_first.xml +91 -0
- data/spec/lib/qti/v1/models/interactions/canvas_multiple_dropdown_spec.rb +11 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4084fe51b2f6fe08be8575473463acf9654f015d2e314ac7dc5b0cc66bbc7a0
|
4
|
+
data.tar.gz: 7aef361ec589ca5656e4bb6c0850593e3a0014e1b5e59c06a3f84cc762ca4b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fccaad1a37691535248d7f2f6c8f587c9cbf319f4db2abd918f682e4a78a9a8351ab3b42e75a2e78f38557babbd437de049bcfb8c4d6b8aea8ed3a407a6355ab
|
7
|
+
data.tar.gz: 31746c6c8de63f0d854a329b9932245c36b19fb32dbb0e1183d8ff20f04c2ca2f93bf4fd63192083c8cbdd67e749bc46c9cc07fc4b50809ba0d4015f56bf8a5e
|
@@ -44,7 +44,8 @@ module Qti
|
|
44
44
|
|
45
45
|
def blank_value(blank_id)
|
46
46
|
blank = canvas_fib_responses.find { |response| response[:id] == blank_id }
|
47
|
-
blank
|
47
|
+
correct_choice = blank[:choices].find { |c| c[:id] == correct_choice_id(blank) }
|
48
|
+
(correct_choice || {})[:item_body] || blank&.dig(:choices, 0, :item_body)
|
48
49
|
end
|
49
50
|
|
50
51
|
def canvas_custom_fitb?
|
@@ -81,6 +82,11 @@ module Qti
|
|
81
82
|
|
82
83
|
private
|
83
84
|
|
85
|
+
def correct_choice_id(blank)
|
86
|
+
node.xpath('.//xmlns:resprocessing/xmlns:respcondition/xmlns:conditionvar/xmlns:varequal')
|
87
|
+
.find { |varequal| varequal.attribute('respident').value == blank[:id] }&.text
|
88
|
+
end
|
89
|
+
|
84
90
|
def canvas_blank_choice(bnode, index)
|
85
91
|
bnode_id = bnode[:ident]
|
86
92
|
choice = {
|
data/lib/qti/version.rb
CHANGED
@@ -0,0 +1,91 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<questestinterop xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/ims_qtiasiv1p2 http://www.imsglobal.org/xsd/ims_qtiasiv1p2p1.xsd">
|
3
|
+
<assessment ident="g4b927ea0ad2ea69259ee815b178a3960" title="cquiz">
|
4
|
+
<qtimetadata>
|
5
|
+
<qtimetadatafield>
|
6
|
+
<fieldlabel>cc_maxattempts</fieldlabel>
|
7
|
+
<fieldentry>1</fieldentry>
|
8
|
+
</qtimetadatafield>
|
9
|
+
</qtimetadata>
|
10
|
+
<section ident="root_section">
|
11
|
+
<item ident="g60299365b800253608e32dc6c5126474" title="Question">
|
12
|
+
<itemmetadata>
|
13
|
+
<qtimetadata>
|
14
|
+
<qtimetadatafield>
|
15
|
+
<fieldlabel>question_type</fieldlabel>
|
16
|
+
<fieldentry>multiple_dropdowns_question</fieldentry>
|
17
|
+
</qtimetadatafield>
|
18
|
+
<qtimetadatafield>
|
19
|
+
<fieldlabel>points_possible</fieldlabel>
|
20
|
+
<fieldentry>1.0</fieldentry>
|
21
|
+
</qtimetadatafield>
|
22
|
+
<qtimetadatafield>
|
23
|
+
<fieldlabel>original_answer_ids</fieldlabel>
|
24
|
+
<fieldentry>2050,7690,3670,6742</fieldentry>
|
25
|
+
</qtimetadatafield>
|
26
|
+
<qtimetadatafield>
|
27
|
+
<fieldlabel>assessment_question_identifierref</fieldlabel>
|
28
|
+
<fieldentry>g0b6144ee2e26b58f221679802a238f36</fieldentry>
|
29
|
+
</qtimetadatafield>
|
30
|
+
</qtimetadata>
|
31
|
+
</itemmetadata>
|
32
|
+
<presentation>
|
33
|
+
<material>
|
34
|
+
<mattext texttype="text/html"><div><p>[y] [x] is</p></div></mattext>
|
35
|
+
</material>
|
36
|
+
<response_lid ident="response_x">
|
37
|
+
<material>
|
38
|
+
<mattext>x</mattext>
|
39
|
+
</material>
|
40
|
+
<render_choice>
|
41
|
+
<response_label ident="2050">
|
42
|
+
<material>
|
43
|
+
<mattext texttype="text/plain">a</mattext>
|
44
|
+
</material>
|
45
|
+
</response_label>
|
46
|
+
<response_label ident="7690">
|
47
|
+
<material>
|
48
|
+
<mattext texttype="text/plain">b</mattext>
|
49
|
+
</material>
|
50
|
+
</response_label>
|
51
|
+
</render_choice>
|
52
|
+
</response_lid>
|
53
|
+
<response_lid ident="response_y">
|
54
|
+
<material>
|
55
|
+
<mattext>y</mattext>
|
56
|
+
</material>
|
57
|
+
<render_choice>
|
58
|
+
<response_label ident="3670">
|
59
|
+
<material>
|
60
|
+
<mattext texttype="text/plain">c</mattext>
|
61
|
+
</material>
|
62
|
+
</response_label>
|
63
|
+
<response_label ident="6742">
|
64
|
+
<material>
|
65
|
+
<mattext texttype="text/plain">d</mattext>
|
66
|
+
</material>
|
67
|
+
</response_label>
|
68
|
+
</render_choice>
|
69
|
+
</response_lid>
|
70
|
+
</presentation>
|
71
|
+
<resprocessing>
|
72
|
+
<outcomes>
|
73
|
+
<decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
|
74
|
+
</outcomes>
|
75
|
+
<respcondition>
|
76
|
+
<conditionvar>
|
77
|
+
<varequal respident="response_x">2050</varequal>
|
78
|
+
</conditionvar>
|
79
|
+
<setvar varname="SCORE" action="Add">50.00</setvar>
|
80
|
+
</respcondition>
|
81
|
+
<respcondition>
|
82
|
+
<conditionvar>
|
83
|
+
<varequal respident="response_y">6742</varequal>
|
84
|
+
</conditionvar>
|
85
|
+
<setvar varname="SCORE" action="Add">50.00</setvar>
|
86
|
+
</respcondition>
|
87
|
+
</resprocessing>
|
88
|
+
</item>
|
89
|
+
</section>
|
90
|
+
</assessment>
|
91
|
+
</questestinterop>
|
@@ -74,4 +74,15 @@ describe Qti::V1::Models::Interactions::CanvasMultipleDropdownInteraction do
|
|
74
74
|
include_examples 'stem_items'
|
75
75
|
include_examples 'scoring_data_structs'
|
76
76
|
end
|
77
|
+
|
78
|
+
context 'canvas_multiple_dropdowns_correct_choice_is_not_the_first.xml' do
|
79
|
+
let(:file_path) { File.join(fixtures_path, 'canvas_multiple_dropdowns_correct_choice_is_not_the_first.xml') }
|
80
|
+
|
81
|
+
it 'returns the scoring_data_structs with item_body values and ids of the correct choice' do
|
82
|
+
expect(loaded_class.scoring_data_structs.first[:values][:id]).to eq('2050')
|
83
|
+
expect(loaded_class.scoring_data_structs.first[:values][:item_body]).to eq('a')
|
84
|
+
expect(loaded_class.scoring_data_structs.second[:values][:id]).to eq('6742')
|
85
|
+
expect(loaded_class.scoring_data_structs.second[:values][:item_body]).to eq('d')
|
86
|
+
end
|
87
|
+
end
|
77
88
|
end
|
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.15.
|
4
|
+
version: 2.15.4
|
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-06-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: actionview
|
@@ -392,6 +392,7 @@ files:
|
|
392
392
|
- spec/fixtures/interaction_checks_1.2.xml
|
393
393
|
- spec/fixtures/items_1.2/canvas_multiple_dropdown.xml
|
394
394
|
- spec/fixtures/items_1.2/canvas_multiple_dropdowns.xml
|
395
|
+
- spec/fixtures/items_1.2/canvas_multiple_dropdowns_correct_choice_is_not_the_first.xml
|
395
396
|
- spec/fixtures/items_1.2/canvas_multiple_fib.xml
|
396
397
|
- spec/fixtures/items_1.2/canvas_multiple_fib_as_single.xml
|
397
398
|
- spec/fixtures/items_1.2/canvas_multiple_fib_extra_brackets.xml
|
@@ -754,6 +755,7 @@ test_files:
|
|
754
755
|
- spec/fixtures/interaction_checks_1.2.xml
|
755
756
|
- spec/fixtures/items_1.2/canvas_multiple_dropdown.xml
|
756
757
|
- spec/fixtures/items_1.2/canvas_multiple_dropdowns.xml
|
758
|
+
- spec/fixtures/items_1.2/canvas_multiple_dropdowns_correct_choice_is_not_the_first.xml
|
757
759
|
- spec/fixtures/items_1.2/canvas_multiple_fib.xml
|
758
760
|
- spec/fixtures/items_1.2/canvas_multiple_fib_as_single.xml
|
759
761
|
- spec/fixtures/items_1.2/canvas_multiple_fib_extra_brackets.xml
|