qti 1.0.10 → 1.0.11
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.rb +36 -0
- data/lib/qti/version.rb +1 -1
- data/spec/fixtures/edge_cases_1.2.xml +244 -0
- data/spec/fixtures/interaction_checks_1.2.xml +1516 -0
- data/spec/lib/qti/v1/models/interactions_spec.rb +69 -0
- metadata +8 -2
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Qti::V1::Models::Assessment do
|
4
|
+
describe 'interaction item' do
|
5
|
+
let(:fixtures_path) { File.join('spec', 'fixtures') }
|
6
|
+
shared_examples_for 'verify interactions' do
|
7
|
+
it 'has the correct iinteraction type' do
|
8
|
+
loaded_class.assessment_items.zip(expected_item_data).each do |node, itype|
|
9
|
+
item = Qti::V1::Models::AssessmentItem.new(node)
|
10
|
+
expect(item.interaction_model.class).to eq(itype)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'reference qti 1.2 quiz' do
|
16
|
+
let(:path) { File.join(fixtures_path, 'all_canvas_simple_1.2.xml') }
|
17
|
+
let(:loaded_class) { described_class.from_path!(path) }
|
18
|
+
let(:expected_item_data) do
|
19
|
+
[
|
20
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
21
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
22
|
+
Qti::V1::Models::Interactions::FillBlankInteraction,
|
23
|
+
Qti::V1::Models::Interactions::FillBlankInteraction,
|
24
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
25
|
+
Qti::V1::Models::Interactions::CanvasMultipleDropdownInteraction,
|
26
|
+
Qti::V1::Models::Interactions::MatchInteraction,
|
27
|
+
Qti::V1::Models::Interactions::NumericInteraction,
|
28
|
+
Qti::V1::Models::Interactions::FormulaInteraction,
|
29
|
+
Qti::V1::Models::Interactions::StringInteraction
|
30
|
+
]
|
31
|
+
end
|
32
|
+
include_examples('verify interactions')
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'reference qti 1.2 quiz with no metadata' do
|
36
|
+
let(:path) { File.join(fixtures_path, 'interaction_checks_1.2.xml') }
|
37
|
+
let(:loaded_class) { described_class.from_path!(path) }
|
38
|
+
let(:expected_item_data) do
|
39
|
+
[
|
40
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
41
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
42
|
+
Qti::V1::Models::Interactions::FillBlankInteraction,
|
43
|
+
Qti::V1::Models::Interactions::MatchInteraction,
|
44
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
45
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
46
|
+
Qti::V1::Models::Interactions::MatchInteraction,
|
47
|
+
Qti::V1::Models::Interactions::NumericInteraction,
|
48
|
+
Qti::V1::Models::Interactions::FormulaInteraction,
|
49
|
+
Qti::V1::Models::Interactions::StringInteraction
|
50
|
+
]
|
51
|
+
end
|
52
|
+
include_examples('verify interactions')
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'qti 1.2 edge cases' do
|
56
|
+
let(:path) { File.join(fixtures_path, 'edge_cases_1.2.xml') }
|
57
|
+
let(:loaded_class) { described_class.from_path!(path) }
|
58
|
+
let(:expected_item_data) do
|
59
|
+
[
|
60
|
+
Qti::V1::Models::Interactions::MatchInteraction,
|
61
|
+
Qti::V1::Models::Interactions::ChoiceInteraction,
|
62
|
+
Qti::V1::Models::Interactions::MatchInteraction,
|
63
|
+
Qti::V1::Models::Interactions::ChoiceInteraction
|
64
|
+
]
|
65
|
+
end
|
66
|
+
include_examples('verify interactions')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
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: 1.0.
|
4
|
+
version: 1.0.11
|
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: 2019-03-
|
12
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -354,7 +354,9 @@ files:
|
|
354
354
|
- spec/fixtures/canvas_cartridge/imsmanifest.xml
|
355
355
|
- spec/fixtures/canvas_cartridge/non_cc_assessments/i2ae4df242d342169dae37f9f08dfc5a6.xml.qti
|
356
356
|
- spec/fixtures/canvas_cartridge/non_cc_assessments/ib5281f3537a06f58877107a2501a4e2d.xml.qti
|
357
|
+
- spec/fixtures/edge_cases_1.2.xml
|
357
358
|
- spec/fixtures/feedback_quiz_1.2.xml
|
359
|
+
- spec/fixtures/interaction_checks_1.2.xml
|
358
360
|
- spec/fixtures/items_1.2/canvas_multiple_dropdown.xml
|
359
361
|
- spec/fixtures/items_1.2/canvas_multiple_dropdowns.xml
|
360
362
|
- spec/fixtures/items_1.2/canvas_multiple_fib.xml
|
@@ -626,6 +628,7 @@ files:
|
|
626
628
|
- spec/lib/qti/v1/models/interactions/ordering_interaction_spec.rb
|
627
629
|
- spec/lib/qti/v1/models/interactions/string_interaction_spec.rb
|
628
630
|
- spec/lib/qti/v1/models/interactions/upload_interaction_spec.rb
|
631
|
+
- spec/lib/qti/v1/models/interactions_spec.rb
|
629
632
|
- spec/lib/qti/v1/models/numerics/exact_match_spec.rb
|
630
633
|
- spec/lib/qti/v1/models/numerics/margin_error_spec.rb
|
631
634
|
- spec/lib/qti/v1/models/numerics/precision_spec.rb
|
@@ -688,7 +691,9 @@ test_files:
|
|
688
691
|
- spec/fixtures/canvas_cartridge/imsmanifest.xml
|
689
692
|
- spec/fixtures/canvas_cartridge/non_cc_assessments/i2ae4df242d342169dae37f9f08dfc5a6.xml.qti
|
690
693
|
- spec/fixtures/canvas_cartridge/non_cc_assessments/ib5281f3537a06f58877107a2501a4e2d.xml.qti
|
694
|
+
- spec/fixtures/edge_cases_1.2.xml
|
691
695
|
- spec/fixtures/feedback_quiz_1.2.xml
|
696
|
+
- spec/fixtures/interaction_checks_1.2.xml
|
692
697
|
- spec/fixtures/items_1.2/canvas_multiple_dropdown.xml
|
693
698
|
- spec/fixtures/items_1.2/canvas_multiple_dropdowns.xml
|
694
699
|
- spec/fixtures/items_1.2/canvas_multiple_fib.xml
|
@@ -960,6 +965,7 @@ test_files:
|
|
960
965
|
- spec/lib/qti/v1/models/interactions/ordering_interaction_spec.rb
|
961
966
|
- spec/lib/qti/v1/models/interactions/string_interaction_spec.rb
|
962
967
|
- spec/lib/qti/v1/models/interactions/upload_interaction_spec.rb
|
968
|
+
- spec/lib/qti/v1/models/interactions_spec.rb
|
963
969
|
- spec/lib/qti/v1/models/numerics/exact_match_spec.rb
|
964
970
|
- spec/lib/qti/v1/models/numerics/margin_error_spec.rb
|
965
971
|
- spec/lib/qti/v1/models/numerics/precision_spec.rb
|