qti 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qti/v1/models/interactions/base_interaction.rb +1 -1
- data/lib/qti/v1/models/interactions/choice_interaction.rb +0 -4
- data/lib/qti/v2/models/interactions/base_interaction.rb +1 -1
- data/lib/qti/v2/models/interactions/extended_text_interaction.rb +1 -2
- data/spec/fixtures/items_2.1/choice.xml +1 -1
- data/spec/fixtures/test_qti_2.2/text-entry/text-entry.xml +22 -325
- data/spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb +36 -8
- data/spec/lib/qti/v2/models/interactions/choice_interaction_spec.rb +1 -1
- data/spec/lib/qti/v2/models/interactions/extended_text_interaction_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46f07dd942e7712d82929de86e9395708c3087f
|
4
|
+
data.tar.gz: 15c49825fa8070669857bfbfa9fd9d2823cbf082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c88b7a12660eb03b7baa4b9e9c43c9029e92bba89c6fc062300b03fab96e2952d78b395280ec8c059256ae22aea3cf928ac02bcc68ce94f515639cc51f03cb27
|
7
|
+
data.tar.gz: 4c96921d1016701f69077824a3bb5ac928a7abd48179f4a8860976b8cdcbc5a6342a496f5c43e05aa4a7c0a3c33ef4d59e4ec243be3e9635b95d5692adb09c9b
|
@@ -3,10 +3,9 @@ module Qti
|
|
3
3
|
module Models
|
4
4
|
module Interactions
|
5
5
|
class ExtendedTextInteraction < BaseInteraction
|
6
|
-
@node_name = 'extendedTextInteraction'.freeze
|
7
6
|
# This will know if a class matches
|
8
7
|
def self.matches(node)
|
9
|
-
matches = node.
|
8
|
+
matches = node.xpath('.//xmlns:extendedTextInteraction')
|
10
9
|
return false if matches.empty?
|
11
10
|
|
12
11
|
raise Qti::UnsupportedSchema if matches.size > 1
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<p>
|
20
20
|
<img src="images/sign.png" alt="NEVER LEAVE LUGGAGE UNATTENDED"/>
|
21
21
|
</p>
|
22
|
-
<choiceInteraction responseIdentifier="RESPONSE" shuffle="
|
22
|
+
<choiceInteraction responseIdentifier="RESPONSE" shuffle="TRUE" maxChoices="1">
|
23
23
|
<prompt>What does it say?</prompt>
|
24
24
|
<simpleChoice identifier="ChoiceA">You must stay with your luggage at all times.</simpleChoice>
|
25
25
|
<simpleChoice identifier="ChoiceB">Do not let someone else look after your luggage.</simpleChoice>
|
@@ -1,330 +1,27 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"
|
2
|
-
<assessmentItem
|
3
|
-
|
4
|
-
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2
|
5
|
-
|
6
|
-
|
7
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
8
|
-
<responseDeclaration identifier="RESPONSE1" cardinality="single" baseType="identifier"/>
|
9
|
-
<responseDeclaration identifier="RESPONSE21" cardinality="single" baseType="identifier">
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2"
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
+
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd"
|
5
|
+
identifier="textEntry" title="Richard III (Take 3)" adaptive="false" timeDependent="false">
|
6
|
+
<responseDeclaration identifier="RESPONSE" cardinality="single" baseType="string">
|
10
7
|
<correctResponse>
|
11
|
-
<value>
|
8
|
+
<value>York</value>
|
12
9
|
</correctResponse>
|
10
|
+
<mapping defaultValue="0">
|
11
|
+
<mapEntry mapKey="York" mappedValue="1"/>
|
12
|
+
<mapEntry mapKey="york" mappedValue="0.5"/>
|
13
|
+
</mapping>
|
13
14
|
</responseDeclaration>
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
</
|
23
|
-
</responseDeclaration>
|
24
|
-
<responseDeclaration identifier="RESPONSE24" cardinality="single" baseType="identifier">
|
25
|
-
<correctResponse>
|
26
|
-
<value>OPTION241</value>
|
27
|
-
</correctResponse>
|
28
|
-
</responseDeclaration>
|
29
|
-
<responseDeclaration identifier="RESPONSE25" cardinality="single" baseType="string">
|
30
|
-
<correctResponse>
|
31
|
-
<value>cooks</value>
|
32
|
-
</correctResponse>
|
33
|
-
</responseDeclaration>
|
34
|
-
<responseDeclaration identifier="RESPONSE26" cardinality="single" baseType="string">
|
35
|
-
<correctResponse>
|
36
|
-
<value>spoil</value>
|
37
|
-
</correctResponse>
|
38
|
-
</responseDeclaration>
|
39
|
-
<responseDeclaration identifier="RESPONSE27" cardinality="single" baseType="string">
|
40
|
-
<correctResponse>
|
41
|
-
<value>broth</value>
|
42
|
-
</correctResponse>
|
43
|
-
</responseDeclaration>
|
44
|
-
<outcomeDeclaration baseType="float" cardinality="single" identifier="SCORE"
|
45
|
-
normalMaximum="10.0" normalMinimum="0.0">
|
46
|
-
<defaultValue>
|
47
|
-
<value>0.0</value>
|
48
|
-
</defaultValue>
|
49
|
-
</outcomeDeclaration>
|
50
|
-
<outcomeDeclaration baseType="identifier" cardinality="single" identifier="FEEDBACK"/>
|
51
|
-
<outcomeDeclaration baseType="identifier" cardinality="multiple" identifier="BODY">
|
52
|
-
<defaultValue>
|
53
|
-
<value>part1</value>
|
54
|
-
</defaultValue>
|
55
|
-
</outcomeDeclaration>
|
56
|
-
<itemBody class="">
|
57
|
-
<div class="">
|
58
|
-
<feedbackBlock id="feedbackBlock0" identifier="part1" outcomeIdentifier="BODY" showHide="show">
|
59
|
-
<p>This is the first part of this question: Which of these input methods do you wish to use?</p>
|
60
|
-
<choiceInteraction id="choiceInteraction0" maxChoices="1" responseIdentifier="RESPONSE1" shuffle="true">
|
61
|
-
<simpleChoice id="simpleChoice0" identifier="OPTION1">Multiple choice </simpleChoice>
|
62
|
-
<simpleChoice id="simpleChoice1" identifier="OPTION2">Drop-down menu </simpleChoice>
|
63
|
-
<simpleChoice id="simpleChoice2" identifier="OPTION3">Typed input </simpleChoice>
|
64
|
-
</choiceInteraction>
|
65
|
-
</feedbackBlock>
|
66
|
-
<feedbackBlock identifier="part2" outcomeIdentifier="BODY" showHide="show">
|
67
|
-
<p>OK, this is the type of input you have chosen. Now please answer this, the second part of the question.</p>
|
68
|
-
</feedbackBlock>
|
69
|
-
<feedbackBlock identifier="option1" outcomeIdentifier="BODY" showHide="show">
|
70
|
-
<p class="">Choose the correct saying:</p>
|
71
|
-
<choiceInteraction maxChoices="1" responseIdentifier="RESPONSE21" shuffle="true">
|
72
|
-
<simpleChoice identifier="OPTION210">Too many cooks spoil the broth</simpleChoice>
|
73
|
-
<simpleChoice identifier="OPTION211">Too many cooks burn the dinner</simpleChoice>
|
74
|
-
<simpleChoice identifier="OPTION212">Too many children spill the broth</simpleChoice>
|
75
|
-
<simpleChoice identifier="OPTION213">Too many hands spill the beans</simpleChoice>
|
76
|
-
<simpleChoice identifier="OPTION214">Too many children spoil the broth</simpleChoice>
|
77
|
-
</choiceInteraction>
|
78
|
-
</feedbackBlock>
|
79
|
-
<feedbackBlock identifier="option2" outcomeIdentifier="BODY" showHide="show">
|
80
|
-
<p class="">Complete the saying below by selecting from the lists:</p>
|
81
|
-
<p class="">Too many 
|
82
|
-
<inlineChoiceInteraction responseIdentifier="RESPONSE22" shuffle="true">
|
83
|
-
<inlineChoice identifier="OPTION221">cooks</inlineChoice>
|
84
|
-
<inlineChoice identifier="OPTION222">children</inlineChoice>
|
85
|
-
<inlineChoice identifier="OPTION223">hands</inlineChoice>
|
86
|
-
</inlineChoiceInteraction> 
|
87
|
-
<inlineChoiceInteraction responseIdentifier="RESPONSE23" shuffle="true">
|
88
|
-
<inlineChoice identifier="OPTION231">spoil</inlineChoice>
|
89
|
-
<inlineChoice identifier="OPTION232">spill</inlineChoice>
|
90
|
-
<inlineChoice identifier="OPTION233">burn</inlineChoice>
|
91
|
-
</inlineChoiceInteraction> the 
|
92
|
-
<inlineChoiceInteraction responseIdentifier="RESPONSE24" shuffle="true">
|
93
|
-
<inlineChoice identifier="OPTION241">broth</inlineChoice>
|
94
|
-
<inlineChoice identifier="OPTION242">dinner</inlineChoice>
|
95
|
-
<inlineChoice identifier="OPTION243">beans</inlineChoice>
|
96
|
-
</inlineChoiceInteraction>.
|
97
|
-
</p>
|
98
|
-
</feedbackBlock>
|
99
|
-
<feedbackBlock identifier="option3" outcomeIdentifier="BODY" showHide="show">
|
100
|
-
<p class="">Complete the saying below:</p>
|
101
|
-
<p class="">Too many 
|
102
|
-
<textEntryInteraction expectedLength="20" responseIdentifier="RESPONSE25"/> 
|
103
|
-
<textEntryInteraction expectedLength="20" responseIdentifier="RESPONSE26"/> the 
|
104
|
-
<textEntryInteraction expectedLength="20" responseIdentifier="RESPONSE27"/>.
|
105
|
-
</p>
|
106
|
-
</feedbackBlock>
|
107
|
-
<div class="">
|
108
|
-
<feedbackInline id="feedbackInline1" identifier="CORRECT" outcomeIdentifier="FEEDBACK"
|
109
|
-
showHide="show"> That's the correct answer. </feedbackInline>
|
110
|
-
<feedbackInline id="feedbackInline2" identifier="PARTIAL" outcomeIdentifier="FEEDBACK"
|
111
|
-
showHide="show"> Your answer is partially correct; the correct answer is "Too many <b>cooks</b> <b>spoil</b> the <b>broth</b>". </feedbackInline>
|
112
|
-
<feedbackInline id="feedbackInline3" identifier="INCORRECT" outcomeIdentifier="FEEDBACK"
|
113
|
-
showHide="show"> Sorry, that's not correct; the correct answer is "Too many <b>cooks</b> <b>spoil</b> the <b>broth</b>". </feedbackInline>
|
114
|
-
</div>
|
115
|
-
</div>
|
15
|
+
<outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float"/>
|
16
|
+
<itemBody>
|
17
|
+
<p>Identify the missing word in this famous quote from Shakespeare's Richard III.</p>
|
18
|
+
<blockquote>
|
19
|
+
<p>Now is the winter of our discontent<br/> Made glorious summer by this sun of
|
20
|
+
<textEntryInteraction responseIdentifier="RESPONSE" expectedLength="15"/>;<br/>
|
21
|
+
And all the clouds that lour'd upon our house<br/> In the deep bosom of the ocean
|
22
|
+
buried.</p>
|
23
|
+
</blockquote>
|
116
24
|
</itemBody>
|
117
|
-
<responseProcessing
|
118
|
-
|
119
|
-
<responseIf>
|
120
|
-
<member>
|
121
|
-
<baseValue baseType="identifier">part1</baseValue>
|
122
|
-
<variable identifier="BODY"/>
|
123
|
-
</member>
|
124
|
-
<setOutcomeValue identifier="BODY">
|
125
|
-
<multiple>
|
126
|
-
<baseValue baseType="identifier">part2</baseValue>
|
127
|
-
</multiple>
|
128
|
-
</setOutcomeValue>
|
129
|
-
<responseCondition>
|
130
|
-
<responseIf>
|
131
|
-
<match>
|
132
|
-
<variable identifier="RESPONSE1"/>
|
133
|
-
<baseValue baseType="identifier">OPTION1</baseValue>
|
134
|
-
</match>
|
135
|
-
<setOutcomeValue identifier="BODY">
|
136
|
-
<multiple>
|
137
|
-
<variable identifier="BODY"/>
|
138
|
-
<baseValue baseType="identifier">option1</baseValue>
|
139
|
-
</multiple>
|
140
|
-
</setOutcomeValue>
|
141
|
-
</responseIf>
|
142
|
-
<responseElseIf>
|
143
|
-
<match>
|
144
|
-
<variable identifier="RESPONSE1"/>
|
145
|
-
<baseValue baseType="identifier">OPTION2</baseValue>
|
146
|
-
</match>
|
147
|
-
<setOutcomeValue identifier="BODY">
|
148
|
-
<multiple>
|
149
|
-
<variable identifier="BODY"/>
|
150
|
-
<baseValue baseType="identifier">option2</baseValue>
|
151
|
-
</multiple>
|
152
|
-
</setOutcomeValue>
|
153
|
-
</responseElseIf>
|
154
|
-
<responseElseIf>
|
155
|
-
<match>
|
156
|
-
<variable identifier="RESPONSE1"/>
|
157
|
-
<baseValue baseType="identifier">OPTION3</baseValue>
|
158
|
-
</match>
|
159
|
-
<setOutcomeValue identifier="BODY">
|
160
|
-
<multiple>
|
161
|
-
<variable identifier="BODY"/>
|
162
|
-
<baseValue baseType="identifier">option3</baseValue>
|
163
|
-
</multiple>
|
164
|
-
</setOutcomeValue>
|
165
|
-
</responseElseIf>
|
166
|
-
</responseCondition>
|
167
|
-
</responseIf>
|
168
|
-
<responseElseIf>
|
169
|
-
<member>
|
170
|
-
<baseValue baseType="identifier">part2</baseValue>
|
171
|
-
<variable identifier="BODY"/>
|
172
|
-
</member>
|
173
|
-
<responseCondition>
|
174
|
-
<responseIf>
|
175
|
-
<member>
|
176
|
-
<baseValue baseType="identifier">option1</baseValue>
|
177
|
-
<variable identifier="BODY"/>
|
178
|
-
</member>
|
179
|
-
<responseCondition>
|
180
|
-
<responseIf>
|
181
|
-
<match>
|
182
|
-
<variable identifier="RESPONSE21"/>
|
183
|
-
<correct identifier="RESPONSE21"/>
|
184
|
-
</match>
|
185
|
-
<setOutcomeValue identifier="FEEDBACK">
|
186
|
-
<baseValue baseType="identifier">CORRECT</baseValue>
|
187
|
-
</setOutcomeValue>
|
188
|
-
<setOutcomeValue identifier="SCORE">
|
189
|
-
<baseValue baseType="float">10.0</baseValue>
|
190
|
-
</setOutcomeValue>
|
191
|
-
</responseIf>
|
192
|
-
<responseElse>
|
193
|
-
<setOutcomeValue identifier="FEEDBACK">
|
194
|
-
<baseValue baseType="identifier">INCORRECT</baseValue>
|
195
|
-
</setOutcomeValue>
|
196
|
-
<setOutcomeValue identifier="SCORE">
|
197
|
-
<baseValue baseType="float">0.0</baseValue>
|
198
|
-
</setOutcomeValue>
|
199
|
-
</responseElse>
|
200
|
-
</responseCondition>
|
201
|
-
</responseIf>
|
202
|
-
<responseElseIf>
|
203
|
-
<member>
|
204
|
-
<baseValue baseType="identifier">option2</baseValue>
|
205
|
-
<variable identifier="BODY"/>
|
206
|
-
</member>
|
207
|
-
<responseCondition>
|
208
|
-
<responseIf>
|
209
|
-
<and>
|
210
|
-
<match>
|
211
|
-
<variable identifier="RESPONSE22"/>
|
212
|
-
<correct identifier="RESPONSE22"/>
|
213
|
-
</match>
|
214
|
-
<match>
|
215
|
-
<variable identifier="RESPONSE23"/>
|
216
|
-
<correct identifier="RESPONSE23"/>
|
217
|
-
</match>
|
218
|
-
<match>
|
219
|
-
<variable identifier="RESPONSE24"/>
|
220
|
-
<correct identifier="RESPONSE24"/>
|
221
|
-
</match>
|
222
|
-
</and>
|
223
|
-
<setOutcomeValue identifier="FEEDBACK">
|
224
|
-
<baseValue baseType="identifier">CORRECT</baseValue>
|
225
|
-
</setOutcomeValue>
|
226
|
-
<setOutcomeValue identifier="SCORE">
|
227
|
-
<baseValue baseType="float">10.0</baseValue>
|
228
|
-
</setOutcomeValue>
|
229
|
-
</responseIf>
|
230
|
-
<responseElseIf>
|
231
|
-
<or>
|
232
|
-
<match>
|
233
|
-
<variable identifier="RESPONSE22"/>
|
234
|
-
<correct identifier="RESPONSE22"/>
|
235
|
-
</match>
|
236
|
-
<match>
|
237
|
-
<variable identifier="RESPONSE23"/>
|
238
|
-
<correct identifier="RESPONSE23"/>
|
239
|
-
</match>
|
240
|
-
<match>
|
241
|
-
<variable identifier="RESPONSE24"/>
|
242
|
-
<correct identifier="RESPONSE24"/>
|
243
|
-
</match>
|
244
|
-
</or>
|
245
|
-
<setOutcomeValue identifier="FEEDBACK">
|
246
|
-
<baseValue baseType="identifier">PARTIAL</baseValue>
|
247
|
-
</setOutcomeValue>
|
248
|
-
<setOutcomeValue identifier="SCORE">
|
249
|
-
<baseValue baseType="float">5.0</baseValue>
|
250
|
-
</setOutcomeValue>
|
251
|
-
</responseElseIf>
|
252
|
-
<responseElse>
|
253
|
-
<setOutcomeValue identifier="FEEDBACK">
|
254
|
-
<baseValue baseType="identifier">INCORRECT</baseValue>
|
255
|
-
</setOutcomeValue>
|
256
|
-
<setOutcomeValue identifier="SCORE">
|
257
|
-
<baseValue baseType="float">0.0</baseValue>
|
258
|
-
</setOutcomeValue>
|
259
|
-
</responseElse>
|
260
|
-
</responseCondition>
|
261
|
-
</responseElseIf>
|
262
|
-
<responseElseIf>
|
263
|
-
<member>
|
264
|
-
<baseValue baseType="identifier">option3</baseValue>
|
265
|
-
<variable identifier="BODY"/>
|
266
|
-
</member>
|
267
|
-
<responseCondition>
|
268
|
-
<responseIf>
|
269
|
-
<and>
|
270
|
-
<match>
|
271
|
-
<variable identifier="RESPONSE25"/>
|
272
|
-
<correct identifier="RESPONSE25"/>
|
273
|
-
</match>
|
274
|
-
<match>
|
275
|
-
<variable identifier="RESPONSE26"/>
|
276
|
-
<correct identifier="RESPONSE26"/>
|
277
|
-
</match>
|
278
|
-
<match>
|
279
|
-
<variable identifier="RESPONSE27"/>
|
280
|
-
<correct identifier="RESPONSE27"/>
|
281
|
-
</match>
|
282
|
-
</and>
|
283
|
-
<setOutcomeValue identifier="FEEDBACK">
|
284
|
-
<baseValue baseType="identifier">CORRECT</baseValue>
|
285
|
-
</setOutcomeValue>
|
286
|
-
<setOutcomeValue identifier="SCORE">
|
287
|
-
<baseValue baseType="float">10.0</baseValue>
|
288
|
-
</setOutcomeValue>
|
289
|
-
</responseIf>
|
290
|
-
<responseElseIf>
|
291
|
-
<or>
|
292
|
-
<match>
|
293
|
-
<variable identifier="RESPONSE25"/>
|
294
|
-
<correct identifier="RESPONSE25"/>
|
295
|
-
</match>
|
296
|
-
<match>
|
297
|
-
<variable identifier="RESPONSE26"/>
|
298
|
-
<correct identifier="RESPONSE26"/>
|
299
|
-
</match>
|
300
|
-
<match>
|
301
|
-
<variable identifier="RESPONSE27"/>
|
302
|
-
<correct identifier="RESPONSE27"/>
|
303
|
-
</match>
|
304
|
-
</or>
|
305
|
-
<setOutcomeValue identifier="FEEDBACK">
|
306
|
-
<baseValue baseType="identifier">PARTIAL</baseValue>
|
307
|
-
</setOutcomeValue>
|
308
|
-
<setOutcomeValue identifier="SCORE">
|
309
|
-
<baseValue baseType="float">5.0</baseValue>
|
310
|
-
</setOutcomeValue>
|
311
|
-
</responseElseIf>
|
312
|
-
<responseElse>
|
313
|
-
<setOutcomeValue identifier="FEEDBACK">
|
314
|
-
<baseValue baseType="identifier">INCORRECT</baseValue>
|
315
|
-
</setOutcomeValue>
|
316
|
-
<setOutcomeValue identifier="SCORE">
|
317
|
-
<baseValue baseType="float">0.0</baseValue>
|
318
|
-
</setOutcomeValue>
|
319
|
-
</responseElse>
|
320
|
-
</responseCondition>
|
321
|
-
</responseElseIf>
|
322
|
-
</responseCondition>
|
323
|
-
<!-- completionStatus must be specifically set to completed in adaptive questions -->
|
324
|
-
<setOutcomeValue identifier="completionStatus">
|
325
|
-
<baseValue baseType="identifier">completed</baseValue>
|
326
|
-
</setOutcomeValue>
|
327
|
-
</responseElseIf>
|
328
|
-
</responseCondition>
|
329
|
-
</responseProcessing>
|
25
|
+
<responseProcessing
|
26
|
+
template="http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response"/>
|
330
27
|
</assessmentItem>
|
@@ -1,20 +1,48 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Qti::V1::Models::Interactions::ChoiceInteraction do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
let(:assessment_item_refs) { test_object.assessment_items }
|
9
|
-
let(:loaded_class) { described_class.new(assessment_item_refs.first) }
|
4
|
+
let(:fixtures_path) { File.join('spec', 'fixtures', 'items_1.2') }
|
5
|
+
let(:test_object) { Qti::V1::Models::Assessment.from_path!(file_path) }
|
6
|
+
let(:assessment_item_refs) { test_object.assessment_items }
|
7
|
+
let(:loaded_class) { described_class.new(assessment_item_refs.first) }
|
10
8
|
|
9
|
+
shared_examples_for 'shuffled?' do
|
11
10
|
it 'returns shuffle setting' do
|
12
|
-
expect(loaded_class.shuffled?).to eq
|
11
|
+
expect(loaded_class.shuffled?).to eq shuffle_value
|
13
12
|
end
|
13
|
+
end
|
14
14
|
|
15
|
+
shared_examples_for 'answers' do
|
15
16
|
it 'returns the answers' do
|
16
|
-
expect(loaded_class.answers.count).to eq
|
17
|
+
expect(loaded_class.answers.count).to eq answer_count
|
17
18
|
expect(loaded_class.answers.first).to be_an_instance_of(Qti::V1::Models::Choices::LogicalIdentifierChoice)
|
18
19
|
end
|
19
20
|
end
|
21
|
+
|
22
|
+
context 'multiple_choice.xml' do
|
23
|
+
let(:file_path) { File.join(fixtures_path, 'multiple_choice.xml') }
|
24
|
+
let(:shuffle_value) { false }
|
25
|
+
let(:answer_count) { 5 }
|
26
|
+
|
27
|
+
include_examples 'shuffled?'
|
28
|
+
include_examples 'answers'
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'true_false.xml' do
|
32
|
+
let(:file_path) { File.join(fixtures_path, 'true_false.xml') }
|
33
|
+
let(:shuffle_value) { true }
|
34
|
+
let(:answer_count) { 2 }
|
35
|
+
|
36
|
+
include_examples 'shuffled?'
|
37
|
+
include_examples 'answers'
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'true_false.xml' do
|
41
|
+
let(:file_path) { File.join(fixtures_path, 'multiple_answer.xml') }
|
42
|
+
let(:shuffle_value) { false }
|
43
|
+
let(:answer_count) { 7 }
|
44
|
+
|
45
|
+
include_examples 'shuffled?'
|
46
|
+
include_examples 'answers'
|
47
|
+
end
|
20
48
|
end
|
@@ -8,7 +8,7 @@ describe Qti::V2::Models::Interactions::ChoiceInteraction do
|
|
8
8
|
let(:loaded_class) { described_class.new(node) }
|
9
9
|
|
10
10
|
it 'returns shuffle setting' do
|
11
|
-
expect(loaded_class.shuffled?).to eq
|
11
|
+
expect(loaded_class.shuffled?).to eq true
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'returns the max choices count' do
|
@@ -7,6 +7,10 @@ describe Qti::V2::Models::Interactions::ExtendedTextInteraction do
|
|
7
7
|
|
8
8
|
let(:loaded_class) { described_class.new(node) }
|
9
9
|
|
10
|
+
it 'returns shuffle setting' do
|
11
|
+
expect(loaded_class.shuffled?).to eq false
|
12
|
+
end
|
13
|
+
|
10
14
|
it 'returns the expected lines' do
|
11
15
|
expect(loaded_class.expected_lines).to eq 0
|
12
16
|
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: 0.2.
|
4
|
+
version: 0.2.15
|
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: 2017-04-
|
12
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|