qti 1.0.0 → 1.0.1

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: 313095edde335fad1c5f5405a86863e9de75bea3
4
- data.tar.gz: 01b7654465aa055f9e3655ba423a70af39127649
3
+ metadata.gz: 315234c90e8d65de3ac5b6b76442ee02a500cac7
4
+ data.tar.gz: d7d9a5424e10690045b3565791b717af1f9e1086
5
5
  SHA512:
6
- metadata.gz: 06571fe96c3c7188db21f033f440e0d914256de68a73e8ba29893d852f745678e3f53b6847c5867e45877ea1b0336b645635abf6d710ffd72c589db27a14d377
7
- data.tar.gz: 6f75fb4b9c57e317a50d81b083423eb85e7b9db7fec14589bde16502cae45c934960cf60fe486b93bdf5478b953acf663be8c1168e14fe0f19720aa844a4123c
6
+ metadata.gz: e7c2dbd53f2eb95fb284f81b3bc49b206ac7054613982436a28956b57d81b2261246378ff6685fa35acddaa9ee6a9c600f7ed6577f5f5ee63f5749595fe4c8bd
7
+ data.tar.gz: 00faf5b236a8d229e157c9a9b432efa451f1589b3d3d81a65ec02ed1925837c2a77dd2f3d7820e66268f1125ce816ed7fe4634a187abd1b3554920ff9ba73702
@@ -28,7 +28,7 @@ module Qti
28
28
  end
29
29
 
30
30
  def title
31
- @title ||= @doc.attribute('title').value
31
+ @title ||= @doc.attribute('title')&.value
32
32
  end
33
33
 
34
34
  def qti_metadata_children
data/lib/qti/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -0,0 +1,46 @@
1
+ <?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
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">
3
+ <item ident = "FIB_STR">
4
+ <presentation label = "BasicExample013b">
5
+ <material>
6
+ <mattext>Fill-in-the blanks in this text from Richard III: </mattext>
7
+ </material>
8
+ <material>
9
+ <mattext>Now is the </mattext>
10
+ </material>
11
+ <response_str ident = "FIB01" rcardinality = "Single" rtiming = "No">
12
+ <render_fib fibtype = "String" prompt = "Dashline" maxchars = "6">
13
+ <response_label ident = "A"/>
14
+ </render_fib>
15
+ </response_str>
16
+ <material>
17
+ <mattext> of our discontent made glorious </mattext>
18
+ </material>
19
+ <response_str ident = "FIB02" rcardinality = "Single" rtiming = "No">
20
+ <render_fib fibtype = "String" prompt = "Dashline" maxchars = "6">
21
+ <response_label ident = "A"/>
22
+ </render_fib>
23
+ </response_str>
24
+ <material>
25
+ <mattext> by these sons of </mattext>
26
+ </material>
27
+ <response_str ident = "FIB03" rcardinality = "Single" rtiming = "No">
28
+ <render_fib fibtype = "String" prompt = "Dashline" maxchars = "4">
29
+ <response_label ident = "A"/>
30
+ </render_fib>
31
+ </response_str>
32
+ </presentation>
33
+ <resprocessing>
34
+ <outcomes>
35
+ <decvar varname = "FIBSCORE1" vartype = "Integer" defaultval = "0"/>
36
+ </outcomes>
37
+ <respcondition>
38
+ <conditionvar>
39
+ <varequal respident = "FIB01" case = "Yes">Winter</varequal>
40
+ <varequal respident = "FIB02" case = "Yes">Summer</varequal>
41
+ <varequal respident = "FIB03" case = "Yes">York</varequal>
42
+ </conditionvar>
43
+ <setvar action = "Add" varname = "FIBSCORE1">3</setvar>
44
+ </respcondition>
45
+ </item>
46
+ </questestinterop>
@@ -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.0)
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
@@ -151,5 +151,16 @@ describe Qti::V1::Models::AssessmentItem do
151
151
  expect(loaded_class.item_body).to include '<img'
152
152
  end
153
153
  end
154
+
155
+ context 'without title' do
156
+ let(:file_path) { File.join('spec', 'fixtures', 'items_1.2', 'item_no_title.xml') }
157
+ let(:test_object) { Qti::V1::Models::Assessment.from_path!(file_path) }
158
+ let(:assessment_item_refs) { test_object.assessment_items }
159
+ let(:loaded_class) { described_class.new(assessment_item_refs) }
160
+
161
+ it 'returns nil title without exceptions' do
162
+ expect(loaded_class.title).to be_nil
163
+ end
164
+ end
154
165
  end
155
166
  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.0
4
+ version: 1.0.1
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-08-08 00:00:00.000000000 Z
12
+ date: 2018-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -362,6 +362,7 @@ files:
362
362
  - spec/fixtures/items_1.2/formula.xml
363
363
  - spec/fixtures/items_1.2/formula_mform.xml
364
364
  - spec/fixtures/items_1.2/formula_mvar.xml
365
+ - spec/fixtures/items_1.2/item_no_title.xml
365
366
  - spec/fixtures/items_1.2/matching.xml
366
367
  - spec/fixtures/items_1.2/matching_feedback.xml
367
368
  - spec/fixtures/items_1.2/multiple_answer.xml
@@ -599,6 +600,7 @@ files:
599
600
  - spec/gemfiles/rails-5.0.gemfile
600
601
  - spec/gemfiles/rails-5.1.gemfile
601
602
  - spec/gemfiles/rails-5.2.gemfile
603
+ - spec/gemfiles/rails-5.2.gemfile.lock
602
604
  - spec/lib/qti/assessment_item_exporter_spec.rb
603
605
  - spec/lib/qti/exporter_spec.rb
604
606
  - spec/lib/qti/models/assessment_meta_spec.rb
@@ -691,6 +693,7 @@ test_files:
691
693
  - spec/fixtures/items_1.2/formula.xml
692
694
  - spec/fixtures/items_1.2/formula_mform.xml
693
695
  - spec/fixtures/items_1.2/formula_mvar.xml
696
+ - spec/fixtures/items_1.2/item_no_title.xml
694
697
  - spec/fixtures/items_1.2/matching.xml
695
698
  - spec/fixtures/items_1.2/matching_feedback.xml
696
699
  - spec/fixtures/items_1.2/multiple_answer.xml
@@ -928,6 +931,7 @@ test_files:
928
931
  - spec/gemfiles/rails-5.0.gemfile
929
932
  - spec/gemfiles/rails-5.1.gemfile
930
933
  - spec/gemfiles/rails-5.2.gemfile
934
+ - spec/gemfiles/rails-5.2.gemfile.lock
931
935
  - spec/lib/qti/assessment_item_exporter_spec.rb
932
936
  - spec/lib/qti/exporter_spec.rb
933
937
  - spec/lib/qti/models/assessment_meta_spec.rb