qti 1.0.11 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/qti.rb +72 -19
- data/lib/qti/content_packaging.rb +0 -8
- data/lib/qti/models/assessment_meta.rb +0 -2
- data/lib/qti/models/base.rb +0 -5
- data/lib/qti/models/manifest.rb +1 -7
- data/lib/qti/models/metadata.rb +0 -7
- data/lib/qti/models/resource.rb +4 -10
- data/lib/qti/sanitizer.rb +0 -4
- data/lib/qti/v1/models/assessment.rb +1 -3
- data/lib/qti/v1/models/assessment_item.rb +0 -3
- data/lib/qti/v1/models/base.rb +0 -2
- data/lib/qti/v1/models/choices/fill_blank_choice.rb +0 -2
- data/lib/qti/v1/models/choices/logical_identifier_choice.rb +0 -2
- data/lib/qti/v1/models/interactions.rb +0 -4
- data/lib/qti/v1/models/interactions/base_fill_blank_interaction.rb +1 -1
- data/lib/qti/v1/models/interactions/formula_interaction.rb +2 -4
- data/lib/qti/v1/models/interactions/match_interaction.rb +2 -2
- data/lib/qti/v1/models/numerics/exact_match.rb +0 -2
- data/lib/qti/v1/models/numerics/margin_error.rb +0 -2
- data/lib/qti/v1/models/numerics/precision.rb +1 -3
- data/lib/qti/v1/models/numerics/within_range.rb +0 -2
- data/lib/qti/v1/models/question_group.rb +0 -3
- data/lib/qti/v2/models/assessment_item.rb +0 -3
- data/lib/qti/v2/models/assessment_test.rb +2 -5
- data/lib/qti/v2/models/base.rb +0 -2
- data/lib/qti/v2/models/choices/gap_match_choice.rb +0 -2
- data/lib/qti/v2/models/choices/simple_associable_choice.rb +0 -2
- data/lib/qti/v2/models/choices/simple_choice.rb +0 -2
- data/lib/qti/v2/models/interactions.rb +0 -3
- data/lib/qti/v2/models/interactions/ordering_interaction.rb +0 -2
- data/lib/qti/v2/models/non_assessment_test.rb +2 -4
- data/lib/qti/version.rb +1 -1
- data/spec/gemfiles/nokogiri-1.6.gemfile.lock +149 -0
- data/spec/gemfiles/nokogiri-1.8.gemfile.lock +149 -0
- data/spec/gemfiles/rails-5.2.gemfile.lock +222 -0
- data/spec/gemfiles/{rails-5.0.gemfile → rails-6.0.gemfile} +1 -1
- data/spec/lib/qti/assessment_item_exporter_spec.rb +17 -21
- data/spec/lib/qti/exporter_spec.rb +73 -81
- data/spec/lib/qti/models/assessment_meta_spec.rb +0 -2
- data/spec/lib/qti/models/base_spec.rb +20 -15
- data/spec/lib/qti/models/manifest_spec.rb +0 -2
- data/spec/lib/qti/models/metadata_spec.rb +0 -2
- data/spec/lib/qti/models/resource_spec.rb +0 -2
- data/spec/lib/qti/v1/models/assessment_item_spec.rb +9 -13
- data/spec/lib/qti/v1/models/assessment_spec.rb +3 -6
- data/spec/lib/qti/v1/models/choices/fill_blank_choice_spec.rb +0 -2
- data/spec/lib/qti/v1/models/choices/logical_identifier_choice_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/base_interaction_spec.rb +1 -3
- data/spec/lib/qti/v1/models/interactions/canvas_multiple_dropdown_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/formula_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/match_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/numeric_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/ordering_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/string_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions/upload_interaction_spec.rb +0 -2
- data/spec/lib/qti/v1/models/interactions_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/exact_match_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/margin_error_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/precision_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/scoring_base_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/scoring_node_spec.rb +0 -2
- data/spec/lib/qti/v1/models/numerics/within_range_spec.rb +0 -2
- data/spec/lib/qti/v1/models/question_group_spec.rb +0 -2
- data/spec/lib/qti/v1/models/stimulus_item_spec.rb +0 -2
- data/spec/lib/qti/v2/models/assessment_item_spec.rb +0 -2
- data/spec/lib/qti/v2/models/assessment_test_spec.rb +1 -4
- data/spec/lib/qti/v2/models/choices/gap_match_choice_spec.rb +0 -2
- data/spec/lib/qti/v2/models/choices/simple_associable_choice_spec.rb +0 -2
- data/spec/lib/qti/v2/models/choices/simple_choice_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/categorization_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/choice_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/extended_text_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/gap_match_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/match_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/ordering_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/interactions/short_text_interaction_spec.rb +0 -2
- data/spec/lib/qti/v2/models/non_assessment_test_spec.rb +0 -2
- data/spec/lib/qti/v2/models/object_element_spec.rb +0 -2
- data/spec/lib/qti/v2/models/stimulus_item_spec.rb +0 -2
- data/spec/lib/qti_spec.rb +0 -2
- data/spec/spec_helper.rb +5 -7
- data/spec/support/custom_matchers.rb +0 -2
- metadata +70 -70
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::AssessmentItemExporter do
|
4
2
|
let(:assessment_item) do
|
5
3
|
Qti::ContentPackaging::AssessmentItem.new(
|
@@ -24,25 +22,23 @@ describe Qti::AssessmentItemExporter do
|
|
24
22
|
exporter = Qti::AssessmentItemExporter.new(assessment_item, package_root_path: dir)
|
25
23
|
exporter.export
|
26
24
|
|
27
|
-
expect(exporter.exported_file_path).to have_file_content(
|
28
|
-
|
29
|
-
|
30
|
-
<
|
31
|
-
<
|
32
|
-
<
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
XML
|
45
|
-
)
|
25
|
+
expect(exporter.exported_file_path).to have_file_content(<<~XML)
|
26
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
27
|
+
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd" timeDependent="false" identifier="Item-1" title="Question 1">
|
28
|
+
<responseDeclaration identifier="RESPONSE" cardinality="single" baseType="identifier">
|
29
|
+
<correctResponse>
|
30
|
+
<value>true</value>
|
31
|
+
</correctResponse>
|
32
|
+
</responseDeclaration>
|
33
|
+
<itemBody>
|
34
|
+
<choiceInteraction responseIdentifier="RESPONSE" shuffle="false" maxChoices="1">
|
35
|
+
<prompt>Is 1+1 equals 2?</prompt>
|
36
|
+
<simpleChoice identifier="true" fixed="true">True</simpleChoice>
|
37
|
+
<simpleChoice identifier="false" fixed="true">False</simpleChoice>
|
38
|
+
</choiceInteraction>
|
39
|
+
</itemBody>
|
40
|
+
</assessmentItem>
|
41
|
+
XML
|
46
42
|
end
|
47
43
|
end
|
48
44
|
end
|
@@ -1,10 +1,8 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::Exporter do
|
4
2
|
describe '#export' do
|
5
3
|
let(:dir) { Dir.mktmpdir }
|
6
|
-
let(:test_identifier) {
|
7
|
-
let(:item_identifier) {
|
4
|
+
let(:test_identifier) { 'd87c42ec-9174-4685-8aba-cb95815b1cd4' }
|
5
|
+
let(:item_identifier) { 'ddf41010-79e4-4268-8aac-3a7e83c4cc97' }
|
8
6
|
let(:assessment_test) do
|
9
7
|
Qti::ContentPackaging::AssessmentTest.new(
|
10
8
|
identifier: test_identifier,
|
@@ -52,91 +50,85 @@ describe Qti::Exporter do
|
|
52
50
|
end
|
53
51
|
|
54
52
|
it 'generates the xml for the empty assessment' do
|
55
|
-
expect(exporter.exported_file_path).to have_zip_entry('assessment.xml').with_content(
|
56
|
-
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
|
61
|
-
XML
|
62
|
-
)
|
53
|
+
expect(exporter.exported_file_path).to have_zip_entry('assessment.xml').with_content(<<~XML)
|
54
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
55
|
+
<assessmentTest xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2p1" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd" title="Empty test">
|
56
|
+
<testPart identifier="Main" navigationMode="linear" submissionMode="individual"/>
|
57
|
+
</assessmentTest>
|
58
|
+
XML
|
63
59
|
end
|
64
60
|
end
|
65
61
|
|
66
62
|
it 'generates the xml for an assessment with an item' do
|
67
63
|
expect(exporter.exported_file_path).to contain_zip_entry("#{item_identifier}.xml")
|
68
|
-
expect(exporter.exported_file_path).to have_zip_entry('assessment.xml').with_content(
|
69
|
-
|
70
|
-
|
71
|
-
<
|
72
|
-
<
|
73
|
-
<
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
<
|
78
|
-
<
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
<
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
XML
|
89
|
-
)
|
64
|
+
expect(exporter.exported_file_path).to have_zip_entry('assessment.xml').with_content(<<~XML)
|
65
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
66
|
+
<assessmentTest xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2p1" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd" title="Example test">
|
67
|
+
<outcomeDeclaration baseType="float" cardinality="single" identifier="TEST_total">
|
68
|
+
<defaultValue>
|
69
|
+
<value>0</value>
|
70
|
+
</defaultValue>
|
71
|
+
</outcomeDeclaration>
|
72
|
+
<outcomeDeclaration baseType="float" cardinality="single" identifier="S1">
|
73
|
+
<defaultValue>
|
74
|
+
<value>0</value>
|
75
|
+
</defaultValue>
|
76
|
+
</outcomeDeclaration>
|
77
|
+
<testPart identifier="Main" navigationMode="linear" submissionMode="individual">
|
78
|
+
<assessmentSection identifier="S1" visible="true" title="Section 1">
|
79
|
+
<assessmentItemRef identifier="#{item_identifier}" href="#{item_identifier}.xml"/>
|
80
|
+
</assessmentSection>
|
81
|
+
</testPart>
|
82
|
+
</assessmentTest>
|
83
|
+
XML
|
90
84
|
end
|
91
85
|
|
92
86
|
it 'generates the xml for the manifest' do
|
93
|
-
expect(exporter.exported_file_path).to have_zip_entry('imsmanifest.xml').with_content(
|
94
|
-
|
95
|
-
|
96
|
-
<
|
97
|
-
<
|
98
|
-
|
99
|
-
|
100
|
-
<imsmd:
|
101
|
-
<imsmd:
|
102
|
-
<imsmd:
|
103
|
-
|
104
|
-
|
105
|
-
<imsmd:
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<imsmd:
|
110
|
-
|
111
|
-
|
112
|
-
<imsmd:
|
113
|
-
|
114
|
-
|
115
|
-
<imsmd:
|
116
|
-
|
117
|
-
|
118
|
-
<imsmd:
|
119
|
-
|
120
|
-
|
121
|
-
<imsmd:
|
122
|
-
|
123
|
-
|
124
|
-
<imsmd:
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<
|
132
|
-
<
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
XML
|
139
|
-
)
|
87
|
+
expect(exporter.exported_file_path).to have_zip_entry('imsmanifest.xml').with_content(<<~XML)
|
88
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
89
|
+
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://ltsc.ieee.org/xsd/LOM" xmlns:imsqti="http://www.imsglobal.org/xsd/imsqti_v2p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd http://ltsc.ieee.org/xsd/LOM http://www.imsglobal.org/xsd/imsmd_loose_v1p3p2.xsdhttp://www.imsglobal.org/xsd/imscp_v1p1 http://www.imsglobal.org/xsd/qti/qtiv2p2/qtiv2p2_imscpv1p2_v1p0.xsd" identifier="#{test_identifier}">
|
90
|
+
<metadata>
|
91
|
+
<schema>QTIv2.2 Package</schema>
|
92
|
+
<schemaversion>1.0.0</schemaversion>
|
93
|
+
<imsmd:lom>
|
94
|
+
<imsmd:general>
|
95
|
+
<imsmd:identifier>
|
96
|
+
<imsmd:entry>FB-02</imsmd:entry>
|
97
|
+
</imsmd:identifier>
|
98
|
+
<imsmd:title>
|
99
|
+
<imsmd:string language="en">Example test</imsmd:string>
|
100
|
+
</imsmd:title>
|
101
|
+
<imsmd:language>en</imsmd:language>
|
102
|
+
<imsmd:description>
|
103
|
+
<imsmd:string language="en">Instructure QTI package.Feedback XML used as an example of unprocessable entity</imsmd:string>
|
104
|
+
</imsmd:description>
|
105
|
+
<imsmd:keyword>
|
106
|
+
<imsmd:string language="en">feedback</imsmd:string>
|
107
|
+
</imsmd:keyword>
|
108
|
+
<imsmd:keyword>
|
109
|
+
<imsmd:string language="en">modal</imsmd:string>
|
110
|
+
</imsmd:keyword>
|
111
|
+
<imsmd:keyword>
|
112
|
+
<imsmd:string language="en">test</imsmd:string>
|
113
|
+
</imsmd:keyword>
|
114
|
+
<imsmd:keyword>
|
115
|
+
<imsmd:string language="en">inline</imsmd:string>
|
116
|
+
</imsmd:keyword>
|
117
|
+
<imsmd:keyword>
|
118
|
+
<imsmd:string language="en">block</imsmd:string>
|
119
|
+
</imsmd:keyword>
|
120
|
+
</imsmd:general>
|
121
|
+
</imsmd:lom>
|
122
|
+
</metadata>
|
123
|
+
<organizations/>
|
124
|
+
<resources>
|
125
|
+
<resource href="assessment.xml" type="imsqti_test_xmlv2p2" identifier="TEST">
|
126
|
+
<file href="assessment.xml"/>
|
127
|
+
<file href="#{item_identifier}.xml"/>
|
128
|
+
</resource>
|
129
|
+
</resources>
|
130
|
+
</manifest>
|
131
|
+
XML
|
140
132
|
end
|
141
133
|
end
|
142
134
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::Models::Base do
|
4
2
|
context 'specified as single content node matching helpers' do
|
5
3
|
let(:loaded_class) do
|
@@ -63,48 +61,55 @@ describe Qti::Models::Base do
|
|
63
61
|
let(:ftp) { 'ftp://foo.bar/' }
|
64
62
|
let(:http) { 'http://foo.bar/' }
|
65
63
|
let(:https) { 'https://foo.bar' }
|
64
|
+
let(:closing_tag) { true }
|
66
65
|
|
67
66
|
shared_examples_for 'specific html elements' do
|
68
67
|
it 'removes a src with a bad protocol' do
|
69
|
-
ftp_tag = "<#{tag_name} #{src_attr}=\"#{ftp}\"
|
70
|
-
|
68
|
+
ftp_tag = "<#{tag_name} #{src_attr}=\"#{ftp}\">"
|
69
|
+
ftp_tag += "</#{tag_name}>" if closing_tag
|
70
|
+
expected_tag = "<#{tag_name}>"
|
71
|
+
expected_tag += "</#{tag_name}>" if closing_tag
|
72
|
+
expect(loaded_class.sanitize_content!(ftp_tag)).to eq(expected_tag)
|
71
73
|
end
|
72
74
|
|
73
75
|
it 'removes a src with a valid http protocol' do
|
74
|
-
http_tag = "<#{tag_name} #{src_attr}=\"#{http}\"
|
76
|
+
http_tag = "<#{tag_name} #{src_attr}=\"#{http}\">"
|
77
|
+
http_tag += "</#{tag_name}>" if closing_tag
|
75
78
|
expect(loaded_class.sanitize_content!(http_tag)).to eq(http_tag)
|
76
79
|
end
|
77
80
|
|
78
81
|
it 'removes a src with a valid https protocol' do
|
79
|
-
https_tag = "<#{tag_name} #{src_attr}=\"#{https}\"
|
82
|
+
https_tag = "<#{tag_name} #{src_attr}=\"#{https}\">"
|
83
|
+
https_tag += "</#{tag_name}>" if closing_tag
|
80
84
|
expect(loaded_class.sanitize_content!(https_tag)).to eq(https_tag)
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
84
|
-
describe '
|
85
|
-
let(:tag_name) { '
|
88
|
+
describe 'embed elements' do
|
89
|
+
let(:tag_name) { 'embed' }
|
86
90
|
let(:src_attr) { 'src' }
|
91
|
+
let(:closing_tag) { false }
|
87
92
|
|
88
93
|
include_examples('specific html elements')
|
89
94
|
end
|
90
95
|
|
91
|
-
describe '
|
92
|
-
let(:tag_name) { '
|
96
|
+
describe 'iframe elements' do
|
97
|
+
let(:tag_name) { 'iframe' }
|
93
98
|
let(:src_attr) { 'src' }
|
94
99
|
|
95
100
|
include_examples('specific html elements')
|
96
101
|
end
|
97
102
|
|
98
|
-
describe '
|
99
|
-
let(:tag_name) { '
|
100
|
-
let(:src_attr) { '
|
103
|
+
describe 'object elements with data' do
|
104
|
+
let(:tag_name) { 'object' }
|
105
|
+
let(:src_attr) { 'data' }
|
101
106
|
|
102
107
|
include_examples('specific html elements')
|
103
108
|
end
|
104
109
|
|
105
|
-
describe 'object elements' do
|
110
|
+
describe 'object elements with src' do
|
106
111
|
let(:tag_name) { 'object' }
|
107
|
-
let(:src_attr) { '
|
112
|
+
let(:src_attr) { 'src' }
|
108
113
|
|
109
114
|
include_examples('specific html elements')
|
110
115
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::V1::Models::AssessmentItem do
|
4
2
|
context 'multiple_fib' do
|
5
3
|
let(:file_path) { File.join('spec', 'fixtures', 'items_1.2', 'single_fib.xml') }
|
@@ -39,18 +37,16 @@ describe Qti::V1::Models::AssessmentItem do
|
|
39
37
|
end
|
40
38
|
|
41
39
|
it 'returns 0 by default' do
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
XML
|
51
|
-
node = Nokogiri.XML(doc, &:noblanks)
|
40
|
+
node = Nokogiri.XML(<<~XML, &:noblanks)
|
41
|
+
<?xml version="1.0" encoding="ISO-8859-1"?>
|
42
|
+
<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">
|
43
|
+
<outcomes>
|
44
|
+
<decvar vartype="Decimal" varname="que_score"/>
|
45
|
+
</outcomes>
|
46
|
+
</questestinterop>
|
47
|
+
XML
|
52
48
|
assessment_item = described_class.new(node)
|
53
|
-
expect(assessment_item.points_possible).
|
49
|
+
expect(assessment_item.points_possible).to eq 1
|
54
50
|
end
|
55
51
|
end
|
56
52
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::V1::Models::Assessment do
|
4
2
|
describe 'interaction item' do
|
5
3
|
let(:fixtures_path) { File.join('spec', 'fixtures') }
|
@@ -53,12 +51,12 @@ describe Qti::V1::Models::Assessment do
|
|
53
51
|
{
|
54
52
|
interaction_class: Qti::V1::Models::Interactions::StringInteraction,
|
55
53
|
title: 'Question',
|
56
|
-
feedback:
|
54
|
+
feedback: { neutral: '<p>General Feedback</p>' }
|
57
55
|
},
|
58
56
|
{
|
59
57
|
interaction_class: Qti::V1::Models::Interactions::ChoiceInteraction,
|
60
58
|
title: 'Question',
|
61
|
-
feedback:
|
59
|
+
feedback: { neutral: '<p>Neutral</p>', correct: '<p>Correct</p>', incorrect: '<p>Incorrect</p>' }
|
62
60
|
},
|
63
61
|
{
|
64
62
|
interaction_class: Qti::V1::Models::Interactions::ChoiceInteraction,
|
@@ -173,14 +171,13 @@ describe Qti::V1::Models::Assessment do
|
|
173
171
|
|
174
172
|
context '<assessmentTest> has no title property' do
|
175
173
|
it 'sets the title to the filename by default' do
|
176
|
-
|
174
|
+
allow(File).to receive(:read).and_return(<<~XML)
|
177
175
|
<?xml version="1.0" encoding="UTF-8"?>
|
178
176
|
<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">
|
179
177
|
<assessment ident="A1001">
|
180
178
|
</assessment>
|
181
179
|
</questestinterop>
|
182
180
|
XML
|
183
|
-
allow(File).to receive(:read).and_return(empty_test_string)
|
184
181
|
assessment_test = described_class.new path: '/a/b/c/Test123.xml'
|
185
182
|
expect(assessment_test.title).to eq 'Test123'
|
186
183
|
end
|
@@ -1,8 +1,6 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Qti::V1::Models::Interactions::BaseInteraction do
|
4
2
|
let(:doc) do
|
5
|
-
|
3
|
+
<<~XML
|
6
4
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
7
5
|
<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
6
|
<response_lid ident="QUE_1008_RL" rtiming="No">
|