qti 0.9.2 → 0.9.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: 9278a5814a878f23f53159c3adb0c64e7d7a8e69
4
- data.tar.gz: 8892e930ffbf68ef68b5f08fddd5ed3fa63f34da
3
+ metadata.gz: 26dd56f6f4a742de61725175a7e2dbbcf3510a04
4
+ data.tar.gz: 98a18ecd7e9afadd74dae4ba93311eee8e159cca
5
5
  SHA512:
6
- metadata.gz: 25f42764b0ac0109aa2ab6edf7e3e814fd4150b94b195684f856acaa6faaa859712287a6262141352456b1e341e6d1caef0e037fdfce476d2742cc67d53f3203
7
- data.tar.gz: e3cda7d07238a30879125895ef9b73bb1283d2776803ace6489e5226e0ddd736ebf09321e8f65a7fe5cb01a1783ba8a01d0ddb9476be4724b8b34a79d07146b2
6
+ metadata.gz: 535479a70f5ef7db7c65562676cd49ace6cd463d5898de543c7406f09d884b4829408a55ea3afaadf52fcdc0c4ed744a5cfeea48aebe5d15d284599ae0c6ef0f
7
+ data.tar.gz: d1e56b2caef825ae13ad66d50a4e616ffdc6f89b69ad6830b9cb6459a08ffcd072071fe5675c0cb09a9483c9c87c31cfeecface4446aa49ac3e32c69be06a5a2
@@ -17,7 +17,8 @@ module Qti
17
17
  @item_body ||= begin
18
18
  node = @doc.dup
19
19
  presentation = node.at_xpath('.//xmlns:presentation')
20
- prompt = presentation.at_xpath('.//xmlns:mattext').to_html
20
+ mattext = presentation.at_xpath('.//xmlns:mattext')
21
+ prompt = return_inner_content!(mattext)
21
22
  sanitize_content!(prompt)
22
23
  end
23
24
  end
@@ -7,6 +7,14 @@ module Qti
7
7
  def qti_version
8
8
  1
9
9
  end
10
+
11
+ def return_inner_content!(node)
12
+ if node.child.cdata? || node.inner_html.include?('&gt' || '&lt')
13
+ node.text
14
+ else
15
+ node.inner_html
16
+ end
17
+ end
10
18
  end
11
19
  end
12
20
  end
@@ -18,7 +18,8 @@ module Qti
18
18
  def item_body
19
19
  @item_body ||= begin
20
20
  node = @node.dup
21
- sanitize_content!(node.to_html)
21
+ inner_content = return_inner_content!(node)
22
+ sanitize_content!(inner_content)
22
23
  end
23
24
  end
24
25
  end
@@ -17,7 +17,8 @@ module Qti
17
17
  def item_body
18
18
  @item_body ||= begin
19
19
  node = @node.dup
20
- sanitize_content!(node.to_html)
20
+ inner_content = return_inner_content!(node)
21
+ sanitize_content!(inner_content)
21
22
  end
22
23
  end
23
24
  end
@@ -17,7 +17,9 @@ module Qti
17
17
 
18
18
  def questions
19
19
  node.xpath('.//xmlns:response_lid').map do |lid_node|
20
- item_body = sanitize_content!(lid_node.at_xpath('.//xmlns:mattext').to_html)
20
+ mattext = lid_node.at_xpath('.//xmlns:mattext')
21
+ inner_content = return_inner_content!(mattext)
22
+ item_body = sanitize_content!(inner_content)
21
23
  { id: lid_node.attributes['ident'].value, itemBody: item_body }
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '0.9.2'.freeze
2
+ VERSION = '0.9.3'.freeze
3
3
  end
@@ -3,7 +3,9 @@
3
3
  <item ident="if15fb877c2cde9a14437aa7429360ac6" title="First Essay">
4
4
  <presentation>
5
5
  <material>
6
- <mattext texttype="text/html">Here is an essay question</mattext>
6
+ <mattext texttype="text/html">
7
+ &lt;div&gt;&lt;p&gt;Here is an essay question.&lt;/p&gt;&lt;/div&gt;
8
+ </mattext>
7
9
  </material>
8
10
  <response_str ident="response1" rcardinality="Single">
9
11
  <render_fib>
@@ -11,7 +11,7 @@
11
11
  </itemmetadata>
12
12
  <presentation>
13
13
  <material>
14
- <mattext texttype="text/html">Match the statements with the correct type of microscope</mattext>
14
+ <mattext texttype="text/html"><div><strong>Match the statements with the correct type of microscope</strong></div></mattext>
15
15
  </material>
16
16
  <response_lid ident="question_1" rcardinality="Single">
17
17
  <material>
@@ -0,0 +1,127 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ qti (0.9.3)
5
+ activesupport (>= 4.2.9, < 5.2)
6
+ dry-struct (~> 0.2.1)
7
+ dry-types (~> 0.12.0)
8
+ nokogiri (>= 1.6.8, < 1.9)
9
+ rubyzip (~> 1.2)
10
+ sanitize (>= 4.2.0, < 5.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activesupport (5.1.4)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (~> 0.7)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ ast (2.3.0)
21
+ byebug (9.1.0)
22
+ coderay (1.1.2)
23
+ concurrent-ruby (1.0.5)
24
+ crass (1.0.2)
25
+ diff-lcs (1.3)
26
+ docile (1.1.5)
27
+ dry-configurable (0.7.0)
28
+ concurrent-ruby (~> 1.0)
29
+ dry-container (0.6.0)
30
+ concurrent-ruby (~> 1.0)
31
+ dry-configurable (~> 0.1, >= 0.1.3)
32
+ dry-core (0.3.4)
33
+ concurrent-ruby (~> 1.0)
34
+ dry-equalizer (0.2.0)
35
+ dry-logic (0.4.2)
36
+ dry-container (~> 0.2, >= 0.2.6)
37
+ dry-core (~> 0.2)
38
+ dry-equalizer (~> 0.2)
39
+ dry-struct (0.2.1)
40
+ dry-configurable (~> 0.1)
41
+ dry-equalizer (~> 0.2)
42
+ dry-types (~> 0.9, >= 0.9.0)
43
+ ice_nine (~> 0.11)
44
+ dry-types (0.12.0)
45
+ concurrent-ruby (~> 1.0)
46
+ dry-configurable (~> 0.1)
47
+ dry-container (~> 0.3)
48
+ dry-core (~> 0.2, >= 0.2.1)
49
+ dry-equalizer (~> 0.2)
50
+ dry-logic (~> 0.4, >= 0.4.2)
51
+ inflecto (~> 0.0.0, >= 0.0.2)
52
+ i18n (0.8.6)
53
+ ice_nine (0.11.2)
54
+ inflecto (0.0.2)
55
+ json (2.1.0)
56
+ method_source (0.9.0)
57
+ mini_portile2 (2.1.0)
58
+ minitest (5.10.3)
59
+ nokogiri (1.6.8.1)
60
+ mini_portile2 (~> 2.1.0)
61
+ nokogumbo (1.4.13)
62
+ nokogiri
63
+ parallel (1.12.0)
64
+ parser (2.4.0.0)
65
+ ast (~> 2.2)
66
+ powerpack (0.1.1)
67
+ pry (0.11.1)
68
+ coderay (~> 1.1.0)
69
+ method_source (~> 0.9.0)
70
+ rainbow (2.2.2)
71
+ rake
72
+ rake (0.9.6)
73
+ rspec (3.6.0)
74
+ rspec-core (~> 3.6.0)
75
+ rspec-expectations (~> 3.6.0)
76
+ rspec-mocks (~> 3.6.0)
77
+ rspec-core (3.6.0)
78
+ rspec-support (~> 3.6.0)
79
+ rspec-expectations (3.6.0)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.6.0)
82
+ rspec-mocks (3.6.0)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.6.0)
85
+ rspec-support (3.6.0)
86
+ rubocop (0.50.0)
87
+ parallel (~> 1.10)
88
+ parser (>= 2.3.3.1, < 3.0)
89
+ powerpack (~> 0.1)
90
+ rainbow (>= 2.2.2, < 3.0)
91
+ ruby-progressbar (~> 1.7)
92
+ unicode-display_width (~> 1.0, >= 1.0.1)
93
+ ruby-progressbar (1.8.3)
94
+ rubyzip (1.2.1)
95
+ sanitize (4.5.0)
96
+ crass (~> 1.0.2)
97
+ nokogiri (>= 1.4.4)
98
+ nokogumbo (~> 1.4.1)
99
+ simplecov (0.15.1)
100
+ docile (~> 1.1.0)
101
+ json (>= 1.8, < 3)
102
+ simplecov-html (~> 0.10.0)
103
+ simplecov-html (0.10.2)
104
+ thread_safe (0.3.6)
105
+ tzinfo (1.2.3)
106
+ thread_safe (~> 0.1)
107
+ unicode-display_width (1.3.0)
108
+ wwtd (1.3.0)
109
+
110
+ PLATFORMS
111
+ ruby
112
+
113
+ DEPENDENCIES
114
+ bundler (~> 1.15)
115
+ byebug (~> 9.0)
116
+ nokogiri (~> 1.6.8)
117
+ pry (~> 0)
118
+ qti!
119
+ rake (~> 0)
120
+ rspec (~> 3.6)
121
+ rspec-mocks (~> 3.6)
122
+ rubocop (~> 0.50.0)
123
+ simplecov (~> 0)
124
+ wwtd (~> 1.3)
125
+
126
+ BUNDLED WITH
127
+ 1.15.4
@@ -0,0 +1,127 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ qti (0.9.3)
5
+ activesupport (>= 4.2.9, < 5.2)
6
+ dry-struct (~> 0.2.1)
7
+ dry-types (~> 0.12.0)
8
+ nokogiri (>= 1.6.8, < 1.9)
9
+ rubyzip (~> 1.2)
10
+ sanitize (>= 4.2.0, < 5.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activesupport (5.1.4)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (~> 0.7)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ ast (2.3.0)
21
+ byebug (9.1.0)
22
+ coderay (1.1.2)
23
+ concurrent-ruby (1.0.5)
24
+ crass (1.0.2)
25
+ diff-lcs (1.3)
26
+ docile (1.1.5)
27
+ dry-configurable (0.7.0)
28
+ concurrent-ruby (~> 1.0)
29
+ dry-container (0.6.0)
30
+ concurrent-ruby (~> 1.0)
31
+ dry-configurable (~> 0.1, >= 0.1.3)
32
+ dry-core (0.3.4)
33
+ concurrent-ruby (~> 1.0)
34
+ dry-equalizer (0.2.0)
35
+ dry-logic (0.4.2)
36
+ dry-container (~> 0.2, >= 0.2.6)
37
+ dry-core (~> 0.2)
38
+ dry-equalizer (~> 0.2)
39
+ dry-struct (0.2.1)
40
+ dry-configurable (~> 0.1)
41
+ dry-equalizer (~> 0.2)
42
+ dry-types (~> 0.9, >= 0.9.0)
43
+ ice_nine (~> 0.11)
44
+ dry-types (0.12.0)
45
+ concurrent-ruby (~> 1.0)
46
+ dry-configurable (~> 0.1)
47
+ dry-container (~> 0.3)
48
+ dry-core (~> 0.2, >= 0.2.1)
49
+ dry-equalizer (~> 0.2)
50
+ dry-logic (~> 0.4, >= 0.4.2)
51
+ inflecto (~> 0.0.0, >= 0.0.2)
52
+ i18n (0.8.6)
53
+ ice_nine (0.11.2)
54
+ inflecto (0.0.2)
55
+ json (2.1.0)
56
+ method_source (0.9.0)
57
+ mini_portile2 (2.3.0)
58
+ minitest (5.10.3)
59
+ nokogiri (1.8.1)
60
+ mini_portile2 (~> 2.3.0)
61
+ nokogumbo (1.4.13)
62
+ nokogiri
63
+ parallel (1.12.0)
64
+ parser (2.4.0.0)
65
+ ast (~> 2.2)
66
+ powerpack (0.1.1)
67
+ pry (0.11.1)
68
+ coderay (~> 1.1.0)
69
+ method_source (~> 0.9.0)
70
+ rainbow (2.2.2)
71
+ rake
72
+ rake (0.9.6)
73
+ rspec (3.6.0)
74
+ rspec-core (~> 3.6.0)
75
+ rspec-expectations (~> 3.6.0)
76
+ rspec-mocks (~> 3.6.0)
77
+ rspec-core (3.6.0)
78
+ rspec-support (~> 3.6.0)
79
+ rspec-expectations (3.6.0)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.6.0)
82
+ rspec-mocks (3.6.0)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.6.0)
85
+ rspec-support (3.6.0)
86
+ rubocop (0.50.0)
87
+ parallel (~> 1.10)
88
+ parser (>= 2.3.3.1, < 3.0)
89
+ powerpack (~> 0.1)
90
+ rainbow (>= 2.2.2, < 3.0)
91
+ ruby-progressbar (~> 1.7)
92
+ unicode-display_width (~> 1.0, >= 1.0.1)
93
+ ruby-progressbar (1.8.3)
94
+ rubyzip (1.2.1)
95
+ sanitize (4.5.0)
96
+ crass (~> 1.0.2)
97
+ nokogiri (>= 1.4.4)
98
+ nokogumbo (~> 1.4.1)
99
+ simplecov (0.15.1)
100
+ docile (~> 1.1.0)
101
+ json (>= 1.8, < 3)
102
+ simplecov-html (~> 0.10.0)
103
+ simplecov-html (0.10.2)
104
+ thread_safe (0.3.6)
105
+ tzinfo (1.2.3)
106
+ thread_safe (~> 0.1)
107
+ unicode-display_width (1.3.0)
108
+ wwtd (1.3.0)
109
+
110
+ PLATFORMS
111
+ ruby
112
+
113
+ DEPENDENCIES
114
+ bundler (~> 1.15)
115
+ byebug (~> 9.0)
116
+ nokogiri (~> 1.8.1)
117
+ pry (~> 0)
118
+ qti!
119
+ rake (~> 0)
120
+ rspec (~> 3.6)
121
+ rspec-mocks (~> 3.6)
122
+ rubocop (~> 0.50.0)
123
+ simplecov (~> 0)
124
+ wwtd (~> 1.3)
125
+
126
+ BUNDLED WITH
127
+ 1.15.4
@@ -0,0 +1,204 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ qti (0.9.3)
5
+ activesupport (>= 4.2.9, < 5.2)
6
+ dry-struct (~> 0.2.1)
7
+ dry-types (~> 0.12.0)
8
+ nokogiri (>= 1.6.8, < 1.9)
9
+ rubyzip (~> 1.2)
10
+ sanitize (>= 4.2.0, < 5.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ actionmailer (4.2.9)
16
+ actionpack (= 4.2.9)
17
+ actionview (= 4.2.9)
18
+ activejob (= 4.2.9)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 1.0, >= 1.0.5)
21
+ actionpack (4.2.9)
22
+ actionview (= 4.2.9)
23
+ activesupport (= 4.2.9)
24
+ rack (~> 1.6)
25
+ rack-test (~> 0.6.2)
26
+ rails-dom-testing (~> 1.0, >= 1.0.5)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (4.2.9)
29
+ activesupport (= 4.2.9)
30
+ builder (~> 3.1)
31
+ erubis (~> 2.7.0)
32
+ rails-dom-testing (~> 1.0, >= 1.0.5)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (4.2.9)
35
+ activesupport (= 4.2.9)
36
+ globalid (>= 0.3.0)
37
+ activemodel (4.2.9)
38
+ activesupport (= 4.2.9)
39
+ builder (~> 3.1)
40
+ activerecord (4.2.9)
41
+ activemodel (= 4.2.9)
42
+ activesupport (= 4.2.9)
43
+ arel (~> 6.0)
44
+ activesupport (4.2.9)
45
+ i18n (~> 0.7)
46
+ minitest (~> 5.1)
47
+ thread_safe (~> 0.3, >= 0.3.4)
48
+ tzinfo (~> 1.1)
49
+ arel (6.0.4)
50
+ ast (2.3.0)
51
+ builder (3.2.3)
52
+ byebug (9.1.0)
53
+ coderay (1.1.2)
54
+ concurrent-ruby (1.0.5)
55
+ crass (1.0.2)
56
+ diff-lcs (1.3)
57
+ docile (1.1.5)
58
+ dry-configurable (0.7.0)
59
+ concurrent-ruby (~> 1.0)
60
+ dry-container (0.6.0)
61
+ concurrent-ruby (~> 1.0)
62
+ dry-configurable (~> 0.1, >= 0.1.3)
63
+ dry-core (0.3.4)
64
+ concurrent-ruby (~> 1.0)
65
+ dry-equalizer (0.2.0)
66
+ dry-logic (0.4.2)
67
+ dry-container (~> 0.2, >= 0.2.6)
68
+ dry-core (~> 0.2)
69
+ dry-equalizer (~> 0.2)
70
+ dry-struct (0.2.1)
71
+ dry-configurable (~> 0.1)
72
+ dry-equalizer (~> 0.2)
73
+ dry-types (~> 0.9, >= 0.9.0)
74
+ ice_nine (~> 0.11)
75
+ dry-types (0.12.0)
76
+ concurrent-ruby (~> 1.0)
77
+ dry-configurable (~> 0.1)
78
+ dry-container (~> 0.3)
79
+ dry-core (~> 0.2, >= 0.2.1)
80
+ dry-equalizer (~> 0.2)
81
+ dry-logic (~> 0.4, >= 0.4.2)
82
+ inflecto (~> 0.0.0, >= 0.0.2)
83
+ erubis (2.7.0)
84
+ globalid (0.4.0)
85
+ activesupport (>= 4.2.0)
86
+ i18n (0.8.6)
87
+ ice_nine (0.11.2)
88
+ inflecto (0.0.2)
89
+ json (2.1.0)
90
+ loofah (2.1.1)
91
+ crass (~> 1.0.2)
92
+ nokogiri (>= 1.5.9)
93
+ mail (2.6.6)
94
+ mime-types (>= 1.16, < 4)
95
+ method_source (0.9.0)
96
+ mime-types (3.1)
97
+ mime-types-data (~> 3.2015)
98
+ mime-types-data (3.2016.0521)
99
+ mini_portile2 (2.3.0)
100
+ minitest (5.10.3)
101
+ nokogiri (1.8.1)
102
+ mini_portile2 (~> 2.3.0)
103
+ nokogumbo (1.4.13)
104
+ nokogiri
105
+ parallel (1.12.0)
106
+ parser (2.4.0.0)
107
+ ast (~> 2.2)
108
+ powerpack (0.1.1)
109
+ pry (0.11.1)
110
+ coderay (~> 1.1.0)
111
+ method_source (~> 0.9.0)
112
+ rack (1.6.8)
113
+ rack-test (0.6.3)
114
+ rack (>= 1.0)
115
+ rails (4.2.9)
116
+ actionmailer (= 4.2.9)
117
+ actionpack (= 4.2.9)
118
+ actionview (= 4.2.9)
119
+ activejob (= 4.2.9)
120
+ activemodel (= 4.2.9)
121
+ activerecord (= 4.2.9)
122
+ activesupport (= 4.2.9)
123
+ bundler (>= 1.3.0, < 2.0)
124
+ railties (= 4.2.9)
125
+ sprockets-rails
126
+ rails-deprecated_sanitizer (1.0.3)
127
+ activesupport (>= 4.2.0.alpha)
128
+ rails-dom-testing (1.0.8)
129
+ activesupport (>= 4.2.0.beta, < 5.0)
130
+ nokogiri (~> 1.6)
131
+ rails-deprecated_sanitizer (>= 1.0.1)
132
+ rails-html-sanitizer (1.0.3)
133
+ loofah (~> 2.0)
134
+ railties (4.2.9)
135
+ actionpack (= 4.2.9)
136
+ activesupport (= 4.2.9)
137
+ rake (>= 0.8.7)
138
+ thor (>= 0.18.1, < 2.0)
139
+ rainbow (2.2.2)
140
+ rake
141
+ rake (0.9.6)
142
+ rspec (3.6.0)
143
+ rspec-core (~> 3.6.0)
144
+ rspec-expectations (~> 3.6.0)
145
+ rspec-mocks (~> 3.6.0)
146
+ rspec-core (3.6.0)
147
+ rspec-support (~> 3.6.0)
148
+ rspec-expectations (3.6.0)
149
+ diff-lcs (>= 1.2.0, < 2.0)
150
+ rspec-support (~> 3.6.0)
151
+ rspec-mocks (3.6.0)
152
+ diff-lcs (>= 1.2.0, < 2.0)
153
+ rspec-support (~> 3.6.0)
154
+ rspec-support (3.6.0)
155
+ rubocop (0.50.0)
156
+ parallel (~> 1.10)
157
+ parser (>= 2.3.3.1, < 3.0)
158
+ powerpack (~> 0.1)
159
+ rainbow (>= 2.2.2, < 3.0)
160
+ ruby-progressbar (~> 1.7)
161
+ unicode-display_width (~> 1.0, >= 1.0.1)
162
+ ruby-progressbar (1.8.3)
163
+ rubyzip (1.2.1)
164
+ sanitize (4.5.0)
165
+ crass (~> 1.0.2)
166
+ nokogiri (>= 1.4.4)
167
+ nokogumbo (~> 1.4.1)
168
+ simplecov (0.15.1)
169
+ docile (~> 1.1.0)
170
+ json (>= 1.8, < 3)
171
+ simplecov-html (~> 0.10.0)
172
+ simplecov-html (0.10.2)
173
+ sprockets (3.7.1)
174
+ concurrent-ruby (~> 1.0)
175
+ rack (> 1, < 3)
176
+ sprockets-rails (3.2.1)
177
+ actionpack (>= 4.0)
178
+ activesupport (>= 4.0)
179
+ sprockets (>= 3.0.0)
180
+ thor (0.20.0)
181
+ thread_safe (0.3.6)
182
+ tzinfo (1.2.3)
183
+ thread_safe (~> 0.1)
184
+ unicode-display_width (1.3.0)
185
+ wwtd (1.3.0)
186
+
187
+ PLATFORMS
188
+ ruby
189
+
190
+ DEPENDENCIES
191
+ bundler (~> 1.15)
192
+ byebug (~> 9.0)
193
+ pry (~> 0)
194
+ qti!
195
+ rails (~> 4.2.9)
196
+ rake (~> 0)
197
+ rspec (~> 3.6)
198
+ rspec-mocks (~> 3.6)
199
+ rubocop (~> 0.50.0)
200
+ simplecov (~> 0)
201
+ wwtd (~> 1.3)
202
+
203
+ BUNDLED WITH
204
+ 1.15.4