qti 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0adc4925447bc8f267876ac0281d6db34b9b3835
4
- data.tar.gz: ba17b261d862806bb52a55308355c9e9f6833c8a
3
+ metadata.gz: bca00e3ced1649d9c45a507e11f8834b989f1792
4
+ data.tar.gz: 25f6fc89f8e60cae72d06f8e68ef548adae14f62
5
5
  SHA512:
6
- metadata.gz: d948f1c7714d5d813b2b09e8716c5177204583a9e677024a8a8f24fdcb6f1f4c30821bcf8a30b2854f2ab5b4a989d2ea94b4ce7d06181b00317ddce185e1c089
7
- data.tar.gz: f9dd17a0ef7b3be6c216fdf117a54ff26b90806da649b6cf432218bedfb1d813c1fe9f70e315b31cae856ec2e5e12815d810bfed25a0ff6ed5213933d6736ff3
6
+ metadata.gz: 8755835f90b0cad59633b9911c20e9f0c206860c7e439fadd2c745ae62f63b54224138844c8a8c0ae2469bd9e076b5a10af031dcf6484276913e560e80bd3599
7
+ data.tar.gz: ecd4c1d067f58aba092288032ea306d87a9afe800919d26fdd0ee1f0ecf78a7f2358b25360b0aa8612bdce666ba9decfc1071a74344b93b74cd0f616dc47213e
@@ -9,12 +9,20 @@ module Qti
9
9
  end
10
10
 
11
11
  def return_inner_content!(node)
12
- if node.attributes['texttype']&.value == 'text/plain' ||
13
- node.child.cdata? || node.inner_html.include?('&gt' || '&lt')
14
- node.text
15
- else
16
- node.inner_html
17
- end
12
+ return CGI.unescapeHTML(node.inner_html).html_safe if html_node?(node)
13
+ return node.text if text_node?(node)
14
+ node.inner_html
15
+ end
16
+
17
+ private
18
+
19
+ def text_node?(node)
20
+ node.attributes['texttype']&.value == 'text/plain' ||
21
+ node.child&.cdata? || node.inner_html.include?('&gt' || '&lt')
22
+ end
23
+
24
+ def html_node?(node)
25
+ node.attributes['texttype']&.value == 'text/html'
18
26
  end
19
27
  end
20
28
  end
@@ -16,11 +16,26 @@ module Qti
16
16
 
17
17
  def item_body
18
18
  @item_body ||= begin
19
- node = @node.dup
20
- inner_content = return_inner_content!(node)
19
+ inner_content = return_inner_content!(content_node)
21
20
  sanitize_content!(inner_content)
22
21
  end
23
22
  end
23
+
24
+ private
25
+
26
+ # @node is answer node queried in callers by:
27
+ # node.xpath('.//xmlns:response_label')
28
+ # inner content should be in child node (mattext ...)
29
+ # `texttype` is an attribute of mattext element.
30
+ # Possible child node types of response_label include:
31
+ # mattext, matmtext, matimage, mataudio ... ...
32
+ # from the code context, obviously we don't cover the full
33
+ # specification. We only consider mattext here.
34
+ # If there is no mattext, we basically go through original
35
+ # logic
36
+ def content_node
37
+ (@node.at_xpath('.//xmlns:mattext') || @node).dup
38
+ end
24
39
  end
25
40
  end
26
41
  end
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
@@ -204,6 +204,64 @@
204
204
  </respcondition>
205
205
  </resprocessing>
206
206
  </item>
207
+ <item ident="i3953bf354b7f585d5a3fcfcf5223cb33" title="Question1">
208
+ <itemmetadata>
209
+ <qtimetadata>
210
+ <qtimetadatafield>
211
+ <fieldlabel>question_type</fieldlabel>
212
+ <fieldentry>multiple_choice_question</fieldentry>
213
+ </qtimetadatafield>
214
+ <qtimetadatafield>
215
+ <fieldlabel>points_possible</fieldlabel>
216
+ <fieldentry>1.0</fieldentry>
217
+ </qtimetadatafield>
218
+ <qtimetadatafield>
219
+ <fieldlabel>assessment_question_identifierref</fieldlabel>
220
+ <fieldentry>i50a52b1e8b3e61e8e4f56b30182a3f6f</fieldentry>
221
+ </qtimetadatafield>
222
+ </qtimetadata>
223
+ </itemmetadata>
224
+ <presentation>
225
+ <material>
226
+ <mattext texttype="text/html">&lt;div&gt;&lt;p&gt;dasv dfsb gsfd13234321&lt;/p&gt;&lt;/div&gt;</mattext>
227
+ </material>
228
+ <response_lid ident="response1" rcardinality="Single">
229
+ <render_choice>
230
+ <response_label ident="3858">
231
+ <material>
232
+ <mattext texttype="text/plain">a&amp;b</mattext>
233
+ </material>
234
+ </response_label>
235
+ <response_label ident="1479">
236
+ <material>
237
+ <mattext texttype="text/html">a &amp;amp;&amp;amp; b</mattext>
238
+ </material>
239
+ </response_label>
240
+ <response_label ident="8790">
241
+ <material>
242
+ <mattext texttype="text/plain">aaa &amp; bbb</mattext>
243
+ </material>
244
+ </response_label>
245
+ <response_label ident="4930">
246
+ <material>
247
+ <mattext texttype="text/plain">&amp; aabbb</mattext>
248
+ </material>
249
+ </response_label>
250
+ </render_choice>
251
+ </response_lid>
252
+ </presentation>
253
+ <resprocessing>
254
+ <outcomes>
255
+ <decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
256
+ </outcomes>
257
+ <respcondition continue="No">
258
+ <conditionvar>
259
+ <varequal respident="response1">3858</varequal>
260
+ </conditionvar>
261
+ <setvar action="Set" varname="SCORE">100</setvar>
262
+ </respcondition>
263
+ </resprocessing>
264
+ </item>
207
265
  </section>
208
266
  </assessment>
209
267
  </questestinterop>
@@ -0,0 +1,149 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ mathml2latex (0.1.1)
5
+ activesupport (>= 4.2.9, < 5.2)
6
+ nokogiri (>= 1.6.8)
7
+ qti (0.9.12)
8
+ actionview (>= 4.2.0)
9
+ activesupport (>= 4.2.9, < 5.2)
10
+ dry-struct (~> 0.2.1)
11
+ dry-types (~> 0.12.0)
12
+ mathml2latex (>= 0.1.0)
13
+ nokogiri (>= 1.6.8, < 1.9)
14
+ rubyzip (~> 1.2)
15
+ sanitize (>= 4.2.0, < 5.0)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actionview (5.1.5)
21
+ activesupport (= 5.1.5)
22
+ builder (~> 3.1)
23
+ erubi (~> 1.4)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
26
+ activesupport (5.1.5)
27
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
+ i18n (~> 0.7)
29
+ minitest (~> 5.1)
30
+ tzinfo (~> 1.1)
31
+ ast (2.4.0)
32
+ builder (3.2.3)
33
+ byebug (9.1.0)
34
+ coderay (1.1.2)
35
+ concurrent-ruby (1.0.5)
36
+ crass (1.0.3)
37
+ diff-lcs (1.3)
38
+ docile (1.3.0)
39
+ dry-configurable (0.7.0)
40
+ concurrent-ruby (~> 1.0)
41
+ dry-container (0.6.0)
42
+ concurrent-ruby (~> 1.0)
43
+ dry-configurable (~> 0.1, >= 0.1.3)
44
+ dry-core (0.4.5)
45
+ concurrent-ruby (~> 1.0)
46
+ dry-equalizer (0.2.0)
47
+ dry-logic (0.4.2)
48
+ dry-container (~> 0.2, >= 0.2.6)
49
+ dry-core (~> 0.2)
50
+ dry-equalizer (~> 0.2)
51
+ dry-struct (0.2.1)
52
+ dry-configurable (~> 0.1)
53
+ dry-equalizer (~> 0.2)
54
+ dry-types (~> 0.9, >= 0.9.0)
55
+ ice_nine (~> 0.11)
56
+ dry-types (0.12.2)
57
+ concurrent-ruby (~> 1.0)
58
+ dry-configurable (~> 0.1)
59
+ dry-container (~> 0.3)
60
+ dry-core (~> 0.2, >= 0.2.1)
61
+ dry-equalizer (~> 0.2)
62
+ dry-logic (~> 0.4, >= 0.4.2)
63
+ inflecto (~> 0.0.0, >= 0.0.2)
64
+ erubi (1.7.1)
65
+ i18n (0.9.5)
66
+ concurrent-ruby (~> 1.0)
67
+ ice_nine (0.11.2)
68
+ inflecto (0.0.2)
69
+ json (2.1.0)
70
+ loofah (2.2.2)
71
+ crass (~> 1.0.2)
72
+ nokogiri (>= 1.5.9)
73
+ method_source (0.9.0)
74
+ mini_portile2 (2.1.0)
75
+ minitest (5.11.3)
76
+ nokogiri (1.6.8.1)
77
+ mini_portile2 (~> 2.1.0)
78
+ nokogumbo (1.5.0)
79
+ nokogiri
80
+ parallel (1.12.1)
81
+ parser (2.5.0.5)
82
+ ast (~> 2.4.0)
83
+ powerpack (0.1.1)
84
+ pry (0.11.3)
85
+ coderay (~> 1.1.0)
86
+ method_source (~> 0.9.0)
87
+ rails-dom-testing (2.0.3)
88
+ activesupport (>= 4.2.0)
89
+ nokogiri (>= 1.6)
90
+ rails-html-sanitizer (1.0.4)
91
+ loofah (~> 2.2, >= 2.2.2)
92
+ rainbow (2.2.2)
93
+ rake
94
+ rake (0.9.6)
95
+ rspec (3.7.0)
96
+ rspec-core (~> 3.7.0)
97
+ rspec-expectations (~> 3.7.0)
98
+ rspec-mocks (~> 3.7.0)
99
+ rspec-core (3.7.1)
100
+ rspec-support (~> 3.7.0)
101
+ rspec-expectations (3.7.0)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.7.0)
104
+ rspec-mocks (3.7.0)
105
+ diff-lcs (>= 1.2.0, < 2.0)
106
+ rspec-support (~> 3.7.0)
107
+ rspec-support (3.7.1)
108
+ rubocop (0.50.0)
109
+ parallel (~> 1.10)
110
+ parser (>= 2.3.3.1, < 3.0)
111
+ powerpack (~> 0.1)
112
+ rainbow (>= 2.2.2, < 3.0)
113
+ ruby-progressbar (~> 1.7)
114
+ unicode-display_width (~> 1.0, >= 1.0.1)
115
+ ruby-progressbar (1.9.0)
116
+ rubyzip (1.2.1)
117
+ sanitize (4.6.4)
118
+ crass (~> 1.0.2)
119
+ nokogiri (>= 1.4.4)
120
+ nokogumbo (~> 1.4)
121
+ simplecov (0.16.1)
122
+ docile (~> 1.1)
123
+ json (>= 1.8, < 3)
124
+ simplecov-html (~> 0.10.0)
125
+ simplecov-html (0.10.2)
126
+ thread_safe (0.3.6)
127
+ tzinfo (1.2.5)
128
+ thread_safe (~> 0.1)
129
+ unicode-display_width (1.3.0)
130
+ wwtd (1.3.0)
131
+
132
+ PLATFORMS
133
+ ruby
134
+
135
+ DEPENDENCIES
136
+ bundler (~> 1.15)
137
+ byebug (~> 9.0)
138
+ nokogiri (~> 1.6.8)
139
+ pry (~> 0)
140
+ qti!
141
+ rake (~> 0)
142
+ rspec (~> 3.6)
143
+ rspec-mocks (~> 3.6)
144
+ rubocop (~> 0.50.0)
145
+ simplecov (~> 0)
146
+ wwtd (~> 1.3)
147
+
148
+ BUNDLED WITH
149
+ 1.16.1
@@ -0,0 +1,149 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ mathml2latex (0.1.2)
5
+ activesupport (>= 4.2.9, < 5.2)
6
+ nokogiri (>= 1.6.8)
7
+ qti (0.9.15)
8
+ actionview (>= 4.2.0)
9
+ activesupport (>= 4.2.9, < 5.2)
10
+ dry-struct (~> 0.2.1)
11
+ dry-types (~> 0.12.0)
12
+ mathml2latex (>= 0.1.0)
13
+ nokogiri (>= 1.6.8, < 1.9)
14
+ rubyzip (~> 1.2)
15
+ sanitize (>= 4.2.0, < 5.0)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actionview (5.1.6)
21
+ activesupport (= 5.1.6)
22
+ builder (~> 3.1)
23
+ erubi (~> 1.4)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
26
+ activesupport (5.1.6)
27
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
+ i18n (>= 0.7, < 2)
29
+ minitest (~> 5.1)
30
+ tzinfo (~> 1.1)
31
+ ast (2.4.0)
32
+ builder (3.2.3)
33
+ byebug (9.1.0)
34
+ coderay (1.1.2)
35
+ concurrent-ruby (1.0.5)
36
+ crass (1.0.4)
37
+ diff-lcs (1.3)
38
+ docile (1.3.0)
39
+ dry-configurable (0.7.0)
40
+ concurrent-ruby (~> 1.0)
41
+ dry-container (0.6.0)
42
+ concurrent-ruby (~> 1.0)
43
+ dry-configurable (~> 0.1, >= 0.1.3)
44
+ dry-core (0.4.5)
45
+ concurrent-ruby (~> 1.0)
46
+ dry-equalizer (0.2.0)
47
+ dry-logic (0.4.2)
48
+ dry-container (~> 0.2, >= 0.2.6)
49
+ dry-core (~> 0.2)
50
+ dry-equalizer (~> 0.2)
51
+ dry-struct (0.2.1)
52
+ dry-configurable (~> 0.1)
53
+ dry-equalizer (~> 0.2)
54
+ dry-types (~> 0.9, >= 0.9.0)
55
+ ice_nine (~> 0.11)
56
+ dry-types (0.12.2)
57
+ concurrent-ruby (~> 1.0)
58
+ dry-configurable (~> 0.1)
59
+ dry-container (~> 0.3)
60
+ dry-core (~> 0.2, >= 0.2.1)
61
+ dry-equalizer (~> 0.2)
62
+ dry-logic (~> 0.4, >= 0.4.2)
63
+ inflecto (~> 0.0.0, >= 0.0.2)
64
+ erubi (1.7.1)
65
+ i18n (1.0.1)
66
+ concurrent-ruby (~> 1.0)
67
+ ice_nine (0.11.2)
68
+ inflecto (0.0.2)
69
+ json (2.1.0)
70
+ loofah (2.2.2)
71
+ crass (~> 1.0.2)
72
+ nokogiri (>= 1.5.9)
73
+ method_source (0.9.0)
74
+ mini_portile2 (2.3.0)
75
+ minitest (5.11.3)
76
+ nokogiri (1.8.2)
77
+ mini_portile2 (~> 2.3.0)
78
+ nokogumbo (1.5.0)
79
+ nokogiri
80
+ parallel (1.12.1)
81
+ parser (2.5.0.5)
82
+ ast (~> 2.4.0)
83
+ powerpack (0.1.1)
84
+ pry (0.11.3)
85
+ coderay (~> 1.1.0)
86
+ method_source (~> 0.9.0)
87
+ rails-dom-testing (2.0.3)
88
+ activesupport (>= 4.2.0)
89
+ nokogiri (>= 1.6)
90
+ rails-html-sanitizer (1.0.4)
91
+ loofah (~> 2.2, >= 2.2.2)
92
+ rainbow (2.2.2)
93
+ rake
94
+ rake (0.9.6)
95
+ rspec (3.7.0)
96
+ rspec-core (~> 3.7.0)
97
+ rspec-expectations (~> 3.7.0)
98
+ rspec-mocks (~> 3.7.0)
99
+ rspec-core (3.7.1)
100
+ rspec-support (~> 3.7.0)
101
+ rspec-expectations (3.7.0)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.7.0)
104
+ rspec-mocks (3.7.0)
105
+ diff-lcs (>= 1.2.0, < 2.0)
106
+ rspec-support (~> 3.7.0)
107
+ rspec-support (3.7.1)
108
+ rubocop (0.50.0)
109
+ parallel (~> 1.10)
110
+ parser (>= 2.3.3.1, < 3.0)
111
+ powerpack (~> 0.1)
112
+ rainbow (>= 2.2.2, < 3.0)
113
+ ruby-progressbar (~> 1.7)
114
+ unicode-display_width (~> 1.0, >= 1.0.1)
115
+ ruby-progressbar (1.9.0)
116
+ rubyzip (1.2.1)
117
+ sanitize (4.6.4)
118
+ crass (~> 1.0.2)
119
+ nokogiri (>= 1.4.4)
120
+ nokogumbo (~> 1.4)
121
+ simplecov (0.16.1)
122
+ docile (~> 1.1)
123
+ json (>= 1.8, < 3)
124
+ simplecov-html (~> 0.10.0)
125
+ simplecov-html (0.10.2)
126
+ thread_safe (0.3.6)
127
+ tzinfo (1.2.5)
128
+ thread_safe (~> 0.1)
129
+ unicode-display_width (1.3.0)
130
+ wwtd (1.3.0)
131
+
132
+ PLATFORMS
133
+ ruby
134
+
135
+ DEPENDENCIES
136
+ bundler (~> 1.15)
137
+ byebug (~> 9.0)
138
+ nokogiri (~> 1.8.1)
139
+ pry (~> 0)
140
+ qti!
141
+ rake (~> 0)
142
+ rspec (~> 3.6)
143
+ rspec-mocks (~> 3.6)
144
+ rubocop (~> 0.50.0)
145
+ simplecov (~> 0)
146
+ wwtd (~> 1.3)
147
+
148
+ BUNDLED WITH
149
+ 1.16.1
@@ -0,0 +1,222 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ mathml2latex (1.0.0)
5
+ activesupport (>= 5.0.7, < 5.3)
6
+ nokogiri (>= 1.7.2)
7
+ qti (1.0.3)
8
+ actionview (>= 5.0.7, < 5.3)
9
+ activesupport (>= 5.0.7, < 5.3)
10
+ dry-struct (~> 0.2.1)
11
+ dry-types (~> 0.12.0)
12
+ mathml2latex (~> 1.0)
13
+ nokogiri (~> 1.8)
14
+ rubyzip (~> 1.2)
15
+ sanitize (~> 4.6, >= 4.6.3)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actioncable (5.2.1)
21
+ actionpack (= 5.2.1)
22
+ nio4r (~> 2.0)
23
+ websocket-driver (>= 0.6.1)
24
+ actionmailer (5.2.1)
25
+ actionpack (= 5.2.1)
26
+ actionview (= 5.2.1)
27
+ activejob (= 5.2.1)
28
+ mail (~> 2.5, >= 2.5.4)
29
+ rails-dom-testing (~> 2.0)
30
+ actionpack (5.2.1)
31
+ actionview (= 5.2.1)
32
+ activesupport (= 5.2.1)
33
+ rack (~> 2.0)
34
+ rack-test (>= 0.6.3)
35
+ rails-dom-testing (~> 2.0)
36
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
37
+ actionview (5.2.1)
38
+ activesupport (= 5.2.1)
39
+ builder (~> 3.1)
40
+ erubi (~> 1.4)
41
+ rails-dom-testing (~> 2.0)
42
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
43
+ activejob (5.2.1)
44
+ activesupport (= 5.2.1)
45
+ globalid (>= 0.3.6)
46
+ activemodel (5.2.1)
47
+ activesupport (= 5.2.1)
48
+ activerecord (5.2.1)
49
+ activemodel (= 5.2.1)
50
+ activesupport (= 5.2.1)
51
+ arel (>= 9.0)
52
+ activestorage (5.2.1)
53
+ actionpack (= 5.2.1)
54
+ activerecord (= 5.2.1)
55
+ marcel (~> 0.3.1)
56
+ activesupport (5.2.1)
57
+ concurrent-ruby (~> 1.0, >= 1.0.2)
58
+ i18n (>= 0.7, < 2)
59
+ minitest (~> 5.1)
60
+ tzinfo (~> 1.1)
61
+ arel (9.0.0)
62
+ ast (2.4.0)
63
+ builder (3.2.3)
64
+ byebug (9.1.0)
65
+ coderay (1.1.2)
66
+ concurrent-ruby (1.0.5)
67
+ crass (1.0.4)
68
+ diff-lcs (1.3)
69
+ docile (1.3.1)
70
+ dry-configurable (0.7.0)
71
+ concurrent-ruby (~> 1.0)
72
+ dry-container (0.6.0)
73
+ concurrent-ruby (~> 1.0)
74
+ dry-configurable (~> 0.1, >= 0.1.3)
75
+ dry-core (0.4.7)
76
+ concurrent-ruby (~> 1.0)
77
+ dry-equalizer (0.2.1)
78
+ dry-logic (0.4.2)
79
+ dry-container (~> 0.2, >= 0.2.6)
80
+ dry-core (~> 0.2)
81
+ dry-equalizer (~> 0.2)
82
+ dry-struct (0.2.1)
83
+ dry-configurable (~> 0.1)
84
+ dry-equalizer (~> 0.2)
85
+ dry-types (~> 0.9, >= 0.9.0)
86
+ ice_nine (~> 0.11)
87
+ dry-types (0.12.3)
88
+ concurrent-ruby (~> 1.0)
89
+ dry-configurable (~> 0.1)
90
+ dry-container (~> 0.3)
91
+ dry-core (~> 0.2, >= 0.2.1)
92
+ dry-equalizer (~> 0.2)
93
+ dry-logic (~> 0.4, >= 0.4.2)
94
+ inflecto (~> 0.0.0, >= 0.0.2)
95
+ erubi (1.7.1)
96
+ globalid (0.4.1)
97
+ activesupport (>= 4.2.0)
98
+ i18n (1.1.0)
99
+ concurrent-ruby (~> 1.0)
100
+ ice_nine (0.11.2)
101
+ inflecto (0.0.2)
102
+ json (2.1.0)
103
+ loofah (2.2.2)
104
+ crass (~> 1.0.2)
105
+ nokogiri (>= 1.5.9)
106
+ mail (2.7.0)
107
+ mini_mime (>= 0.1.1)
108
+ marcel (0.3.2)
109
+ mimemagic (~> 0.3.2)
110
+ method_source (0.9.0)
111
+ mimemagic (0.3.2)
112
+ mini_mime (1.0.0)
113
+ mini_portile2 (2.3.0)
114
+ minitest (5.11.3)
115
+ nio4r (2.3.1)
116
+ nokogiri (1.8.4)
117
+ mini_portile2 (~> 2.3.0)
118
+ nokogumbo (1.5.0)
119
+ nokogiri
120
+ parallel (1.12.1)
121
+ parser (2.5.1.2)
122
+ ast (~> 2.4.0)
123
+ powerpack (0.1.2)
124
+ pry (0.11.3)
125
+ coderay (~> 1.1.0)
126
+ method_source (~> 0.9.0)
127
+ rack (2.0.5)
128
+ rack-test (1.1.0)
129
+ rack (>= 1.0, < 3)
130
+ rails (5.2.1)
131
+ actioncable (= 5.2.1)
132
+ actionmailer (= 5.2.1)
133
+ actionpack (= 5.2.1)
134
+ actionview (= 5.2.1)
135
+ activejob (= 5.2.1)
136
+ activemodel (= 5.2.1)
137
+ activerecord (= 5.2.1)
138
+ activestorage (= 5.2.1)
139
+ activesupport (= 5.2.1)
140
+ bundler (>= 1.3.0)
141
+ railties (= 5.2.1)
142
+ sprockets-rails (>= 2.0.0)
143
+ rails-dom-testing (2.0.3)
144
+ activesupport (>= 4.2.0)
145
+ nokogiri (>= 1.6)
146
+ rails-html-sanitizer (1.0.4)
147
+ loofah (~> 2.2, >= 2.2.2)
148
+ railties (5.2.1)
149
+ actionpack (= 5.2.1)
150
+ activesupport (= 5.2.1)
151
+ method_source
152
+ rake (>= 0.8.7)
153
+ thor (>= 0.19.0, < 2.0)
154
+ rainbow (2.2.2)
155
+ rake
156
+ rake (0.9.6)
157
+ rspec (3.8.0)
158
+ rspec-core (~> 3.8.0)
159
+ rspec-expectations (~> 3.8.0)
160
+ rspec-mocks (~> 3.8.0)
161
+ rspec-core (3.8.0)
162
+ rspec-support (~> 3.8.0)
163
+ rspec-expectations (3.8.1)
164
+ diff-lcs (>= 1.2.0, < 2.0)
165
+ rspec-support (~> 3.8.0)
166
+ rspec-mocks (3.8.0)
167
+ diff-lcs (>= 1.2.0, < 2.0)
168
+ rspec-support (~> 3.8.0)
169
+ rspec-support (3.8.0)
170
+ rubocop (0.50.0)
171
+ parallel (~> 1.10)
172
+ parser (>= 2.3.3.1, < 3.0)
173
+ powerpack (~> 0.1)
174
+ rainbow (>= 2.2.2, < 3.0)
175
+ ruby-progressbar (~> 1.7)
176
+ unicode-display_width (~> 1.0, >= 1.0.1)
177
+ ruby-progressbar (1.10.0)
178
+ rubyzip (1.2.1)
179
+ sanitize (4.6.6)
180
+ crass (~> 1.0.2)
181
+ nokogiri (>= 1.4.4)
182
+ nokogumbo (~> 1.4)
183
+ simplecov (0.16.1)
184
+ docile (~> 1.1)
185
+ json (>= 1.8, < 3)
186
+ simplecov-html (~> 0.10.0)
187
+ simplecov-html (0.10.2)
188
+ sprockets (3.7.2)
189
+ concurrent-ruby (~> 1.0)
190
+ rack (> 1, < 3)
191
+ sprockets-rails (3.2.1)
192
+ actionpack (>= 4.0)
193
+ activesupport (>= 4.0)
194
+ sprockets (>= 3.0.0)
195
+ thor (0.20.0)
196
+ thread_safe (0.3.6)
197
+ tzinfo (1.2.5)
198
+ thread_safe (~> 0.1)
199
+ unicode-display_width (1.4.0)
200
+ websocket-driver (0.7.0)
201
+ websocket-extensions (>= 0.1.0)
202
+ websocket-extensions (0.1.3)
203
+ wwtd (1.3.0)
204
+
205
+ PLATFORMS
206
+ ruby
207
+
208
+ DEPENDENCIES
209
+ bundler (~> 1.15)
210
+ byebug (~> 9.0)
211
+ pry (~> 0)
212
+ qti!
213
+ rails (~> 5.2.0)
214
+ rake (~> 0)
215
+ rspec (~> 3.6)
216
+ rspec-mocks (~> 3.6)
217
+ rubocop (~> 0.50.0)
218
+ simplecov (~> 0)
219
+ wwtd (~> 1.3)
220
+
221
+ BUNDLED WITH
222
+ 1.16.3
@@ -9,7 +9,7 @@ describe Qti::V1::Models::Choices::LogicalIdentifierChoice do
9
9
  let(:choices) { nodes.map { |node| described_class.new(node, test_object) } }
10
10
 
11
11
  it 'returns the right identifier' do
12
- expect(choices.map(&:identifier)).to eq %w[QUE_1003 QUE_1007 QUE_1022]
12
+ expect(choices.map(&:identifier)).to eq %w[QUE_1003 QUE_1007 QUE_1022 i3953bf354b7f585d5a3fcfcf5223cb33]
13
13
  end
14
14
 
15
15
  it 'returns the item body text' do
@@ -79,4 +79,15 @@ describe Qti::V1::Models::Interactions::ChoiceInteraction do
79
79
  expect(loaded_class.scoring_data_structs.count).to eq 1
80
80
  end
81
81
  end
82
+
83
+ context 'encoded html text in answers' do
84
+ let(:file_path) do
85
+ File.join(fixtures_path, 'choice.xml')
86
+ end
87
+ let(:loaded_class) { described_class.new(assessment_item_refs.last, test_object) }
88
+
89
+ it 'correctly processes decode html text' do
90
+ expect(loaded_class.answers.second.item_body).to eq('a &amp;&amp; b')
91
+ end
92
+ end
82
93
  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.2
4
+ version: 1.0.3
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: 2018-09-04 00:00:00.000000000 Z
12
+ date: 2018-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -597,9 +597,12 @@ files:
597
597
  - spec/fixtures/tests/tests/rtest26.xml
598
598
  - spec/fixtures/tests/tests/rtest27.xml
599
599
  - spec/fixtures/unsupported_version/imsmanifest.xml
600
+ - spec/gemfiles/nokogiri-1.6.gemfile.lock
601
+ - spec/gemfiles/nokogiri-1.8.gemfile.lock
600
602
  - spec/gemfiles/rails-5.0.gemfile
601
603
  - spec/gemfiles/rails-5.1.gemfile
602
604
  - spec/gemfiles/rails-5.2.gemfile
605
+ - spec/gemfiles/rails-5.2.gemfile.lock
603
606
  - spec/lib/qti/assessment_item_exporter_spec.rb
604
607
  - spec/lib/qti/exporter_spec.rb
605
608
  - spec/lib/qti/models/assessment_meta_spec.rb
@@ -665,7 +668,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
665
668
  version: '0'
666
669
  requirements: []
667
670
  rubyforge_project:
668
- rubygems_version: 2.6.14
671
+ rubygems_version: 2.6.13
669
672
  signing_key:
670
673
  specification_version: 4
671
674
  summary: QTI 1.2 and 2.1 import and export models
@@ -927,9 +930,12 @@ test_files:
927
930
  - spec/fixtures/tests/tests/rtest26.xml
928
931
  - spec/fixtures/tests/tests/rtest27.xml
929
932
  - spec/fixtures/unsupported_version/imsmanifest.xml
933
+ - spec/gemfiles/nokogiri-1.6.gemfile.lock
934
+ - spec/gemfiles/nokogiri-1.8.gemfile.lock
930
935
  - spec/gemfiles/rails-5.0.gemfile
931
936
  - spec/gemfiles/rails-5.1.gemfile
932
937
  - spec/gemfiles/rails-5.2.gemfile
938
+ - spec/gemfiles/rails-5.2.gemfile.lock
933
939
  - spec/lib/qti/assessment_item_exporter_spec.rb
934
940
  - spec/lib/qti/exporter_spec.rb
935
941
  - spec/lib/qti/models/assessment_meta_spec.rb