qti 0.7.3 → 0.7.4
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 +4 -4
- data/lib/qti/v1/models/interactions/base_interaction.rb +1 -3
- data/lib/qti/v1/models/interactions/match_interaction.rb +2 -2
- data/lib/qti/v2/models/interactions/match_item_tag_processors/associate_interaction_tag_processor.rb +1 -1
- data/lib/qti/v2/models/interactions/match_item_tag_processors/match_interaction_tag_processor.rb +1 -1
- data/spec/fixtures/items_1.2/multiple_choice.xml +75 -80
- data/spec/lib/qti/v1/models/interactions/base_interaction_spec.rb +20 -0
- data/spec/lib/qti/v1/models/interactions/match_interaction_spec.rb +2 -2
- data/spec/lib/qti/v2/models/interactions/match_interaction_spec.rb +8 -8
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deda071ecd40bdcf24677df2f9cdbeda08122011
|
4
|
+
data.tar.gz: 2c85623e45851776e8297faff563d0c0e34bb794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 661ed1cf8ca710215e862e2d208229cc8f84cfaf2992ddfa24eb9e8f70f33386089e148a937b0d50497550710c1020f17f75f0084158d90507fd900f3555c332
|
7
|
+
data.tar.gz: e67a91a599e8c5b2cd86cbfe66151bf74261d7bc0d5fc1f76d6b34363d4acea09178c4ac7b3e703085bb6c2667b8d24fe7d6897a7c75f6d8d35963a02ec560a9
|
@@ -21,10 +21,8 @@ module Qti
|
|
21
21
|
raise NotImplementedError
|
22
22
|
end
|
23
23
|
|
24
|
-
private
|
25
|
-
|
26
24
|
def rcardinality
|
27
|
-
@rcardinality ||= @node.at_xpath('.//xmlns:response_lid/@rcardinality')
|
25
|
+
@rcardinality ||= @node.at_xpath('.//xmlns:response_lid/@rcardinality')&.value || 'Single'
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
@@ -17,8 +17,8 @@ module Qti
|
|
17
17
|
|
18
18
|
def questions
|
19
19
|
node.xpath('.//xmlns:response_lid').map do |lid_node|
|
20
|
-
|
21
|
-
{ id: lid_node.attributes['ident'].value,
|
20
|
+
item_body = lid_node.at_xpath('.//xmlns:mattext').text
|
21
|
+
{ id: lid_node.attributes['ident'].value, itemBody: item_body }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -1,83 +1,78 @@
|
|
1
1
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2
|
-
|
3
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">
|
4
|
-
|
5
|
-
<
|
6
|
-
<
|
7
|
-
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
<
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
<
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<
|
36
|
-
|
37
|
-
|
38
|
-
</
|
39
|
-
</
|
40
|
-
</
|
41
|
-
|
42
|
-
|
43
|
-
<
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
</
|
51
|
-
<
|
52
|
-
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
</
|
57
|
-
<
|
58
|
-
|
59
|
-
<
|
60
|
-
|
61
|
-
|
62
|
-
</
|
63
|
-
<
|
64
|
-
|
65
|
-
<
|
66
|
-
|
67
|
-
|
68
|
-
</
|
69
|
-
<
|
70
|
-
|
71
|
-
<
|
72
|
-
|
73
|
-
|
74
|
-
</
|
75
|
-
|
76
|
-
</
|
77
|
-
</
|
78
|
-
</
|
79
|
-
|
80
|
-
</section>
|
81
|
-
</assessment>
|
82
|
-
|
3
|
+
<assessment title="1.2 Import Quiz" ident="A1001">
|
4
|
+
<section title="Main" ident="S1002">
|
5
|
+
<item title="How much time each week?" ident="QUE_1007">
|
6
|
+
<presentation>
|
7
|
+
<material>
|
8
|
+
<mattext texttype="text/html"><![CDATA[How much time should you spend working on your online course each week in order to earn credit? <img align="bottom" alt="image.png" src="$IMS_CC_FILE_BASE$org1/images/image.png" border="0"/>]]></mattext>
|
9
|
+
</material>
|
10
|
+
<response_lid ident="QUE_1008_RL" rcardinality="Single" rtiming="No">
|
11
|
+
<render_choice>
|
12
|
+
<response_label ident="QUE_1009_A1">
|
13
|
+
<material>
|
14
|
+
<mattext texttype="text/html"><![CDATA[However long it takes]]></mattext>
|
15
|
+
</material>
|
16
|
+
</response_label>
|
17
|
+
<response_label ident="QUE_1010_A2">
|
18
|
+
<material>
|
19
|
+
<mattext texttype="text/html"><![CDATA[30 - 90 minutes]]></mattext>
|
20
|
+
</material>
|
21
|
+
</response_label>
|
22
|
+
<response_label ident="QUE_1011_A3">
|
23
|
+
<material>
|
24
|
+
<mattext texttype="text/html"><![CDATA[1 - 2 hours]]></mattext>
|
25
|
+
</material>
|
26
|
+
</response_label>
|
27
|
+
<response_label ident="QUE_1012_A4">
|
28
|
+
<material>
|
29
|
+
<mattext texttype="text/html"><![CDATA[At least 3 hours]]></mattext>
|
30
|
+
</material>
|
31
|
+
</response_label>
|
32
|
+
<response_label ident="QUE_1013_A5">
|
33
|
+
<material>
|
34
|
+
<mattext texttype="text/html"><![CDATA[6 or more hours]]></mattext>
|
35
|
+
</material>
|
36
|
+
</response_label>
|
37
|
+
</render_choice>
|
38
|
+
</response_lid>
|
39
|
+
</presentation>
|
40
|
+
<resprocessing>
|
41
|
+
<outcomes>
|
42
|
+
<decvar vartype="Decimal" defaultval="0" varname="que_score"/>
|
43
|
+
</outcomes>
|
44
|
+
<respcondition>
|
45
|
+
<conditionvar>
|
46
|
+
<varequal respident="QUE_1008_RL">QUE_1009_A1</varequal>
|
47
|
+
</conditionvar>
|
48
|
+
<setvar varname="que_score" action="Add">0</setvar>
|
49
|
+
</respcondition>
|
50
|
+
<respcondition>
|
51
|
+
<conditionvar>
|
52
|
+
<varequal respident="QUE_1008_RL">QUE_1010_A2</varequal>
|
53
|
+
</conditionvar>
|
54
|
+
<setvar varname="que_score" action="Add">0</setvar>
|
55
|
+
</respcondition>
|
56
|
+
<respcondition>
|
57
|
+
<conditionvar>
|
58
|
+
<varequal respident="QUE_1008_RL">QUE_1011_A3</varequal>
|
59
|
+
</conditionvar>
|
60
|
+
<setvar varname="que_score" action="Add">0</setvar>
|
61
|
+
</respcondition>
|
62
|
+
<respcondition>
|
63
|
+
<conditionvar>
|
64
|
+
<varequal respident="QUE_1008_RL">QUE_1012_A4</varequal>
|
65
|
+
</conditionvar>
|
66
|
+
<setvar varname="que_score" action="Set">10.00</setvar>
|
67
|
+
</respcondition>
|
68
|
+
<respcondition>
|
69
|
+
<conditionvar>
|
70
|
+
<varequal respident="QUE_1008_RL">QUE_1013_A5</varequal>
|
71
|
+
</conditionvar>
|
72
|
+
<setvar varname="que_score" action="Add">0</setvar>
|
73
|
+
</respcondition>
|
74
|
+
</resprocessing>
|
75
|
+
</item>
|
76
|
+
</section>
|
77
|
+
</assessment>
|
83
78
|
</questestinterop>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Qti::V1::Models::Interactions::BaseInteraction do
|
4
|
+
let(:doc) do
|
5
|
+
<<-XML.strip_heredoc
|
6
|
+
<?xml version="1.0" encoding="ISO-8859-1"?>
|
7
|
+
<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">
|
8
|
+
<response_lid ident="QUE_1008_RL" rtiming="No">
|
9
|
+
</response_lid>
|
10
|
+
</questestinterop>
|
11
|
+
XML
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:node) { Nokogiri.XML(doc, &:noblanks) }
|
15
|
+
|
16
|
+
it 'returns "Single" rcardinality by default' do
|
17
|
+
interaction = described_class.new(node)
|
18
|
+
expect(interaction.rcardinality).to eq 'Single'
|
19
|
+
end
|
20
|
+
end
|
@@ -36,8 +36,8 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
|
|
36
36
|
describe '#questions' do
|
37
37
|
it 'returns the questions' do
|
38
38
|
expect(subject.questions).to eq(
|
39
|
-
[{ id: 'question_1',
|
40
|
-
{ id: 'question_2',
|
39
|
+
[{ id: 'question_1', itemBody: 'Light Microscope' },
|
40
|
+
{ id: 'question_2', itemBody: 'Electron Microscopes' }]
|
41
41
|
)
|
42
42
|
end
|
43
43
|
end
|
@@ -30,9 +30,9 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
|
|
30
30
|
describe '#questions' do
|
31
31
|
it 'returns the questions' do
|
32
32
|
expect(subject.questions).to eq(
|
33
|
-
[{ id: 'A',
|
34
|
-
{ id: 'C',
|
35
|
-
{ id: 'D',
|
33
|
+
[{ id: 'A', itemBody: 'Antonio' },
|
34
|
+
{ id: 'C', itemBody: 'Capulet' },
|
35
|
+
{ id: 'D', itemBody: 'Demetrius' }]
|
36
36
|
)
|
37
37
|
end
|
38
38
|
end
|
@@ -53,7 +53,7 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
|
|
53
53
|
expect(subject.scoring_data_structs).to eq [
|
54
54
|
Qti::V2::Models::ScoringData.new('Dresden', 'Pair', id: 'Match2675678', question_id: 'Match28433682'),
|
55
55
|
Qti::V2::Models::ScoringData.new('Leipzig', 'Pair', id: 'Match9372581', question_id: 'Match7191791'),
|
56
|
-
Qti::V2::Models::ScoringData.new('Halle'
|
56
|
+
Qti::V2::Models::ScoringData.new('Halle', 'Pair', id: 'Match22744006', question_id: 'Match20473010'),
|
57
57
|
Qti::V2::Models::ScoringData.new('Bautzen', 'Pair', id: 'Match17943221', question_id: 'Match6429655')
|
58
58
|
]
|
59
59
|
end
|
@@ -68,10 +68,10 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
|
|
68
68
|
describe '#questions' do
|
69
69
|
it 'returns the questions' do
|
70
70
|
expect(subject.questions).to eq(
|
71
|
-
[{ id: 'Match28433682',
|
72
|
-
{ id: 'Match7191791',
|
73
|
-
{ id: 'Match20473010',
|
74
|
-
{ id: 'Match6429655',
|
71
|
+
[{ id: 'Match28433682', itemBody: 'Weißeritz' },
|
72
|
+
{ id: 'Match7191791', itemBody: 'Mulde' },
|
73
|
+
{ id: 'Match20473010', itemBody: 'Saale' },
|
74
|
+
{ id: 'Match6429655', itemBody: 'Spree' }]
|
75
75
|
)
|
76
76
|
end
|
77
77
|
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: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannah Bottalla
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-06-
|
12
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -444,6 +444,7 @@ files:
|
|
444
444
|
- spec/lib/qti/v1/models/assessment_spec.rb
|
445
445
|
- spec/lib/qti/v1/models/choices/fill_blank_choice_spec.rb
|
446
446
|
- spec/lib/qti/v1/models/choices/logical_identifier_choice_spec.rb
|
447
|
+
- spec/lib/qti/v1/models/interactions/base_interaction_spec.rb
|
447
448
|
- spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb
|
448
449
|
- spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb
|
449
450
|
- spec/lib/qti/v1/models/interactions/match_interaction_spec.rb
|
@@ -685,6 +686,7 @@ test_files:
|
|
685
686
|
- spec/lib/qti/v1/models/assessment_spec.rb
|
686
687
|
- spec/lib/qti/v1/models/choices/fill_blank_choice_spec.rb
|
687
688
|
- spec/lib/qti/v1/models/choices/logical_identifier_choice_spec.rb
|
689
|
+
- spec/lib/qti/v1/models/interactions/base_interaction_spec.rb
|
688
690
|
- spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb
|
689
691
|
- spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb
|
690
692
|
- spec/lib/qti/v1/models/interactions/match_interaction_spec.rb
|