qti 0.9.5 → 0.9.6

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: de684c7b536b54f0d000744e4a03fc3a494f079c
4
- data.tar.gz: 56c2f6785e80667f0cc03a60cc5320f4510427dd
3
+ metadata.gz: 2f8a13e1d1f49ef977d0e9fcffca98899e0b59d5
4
+ data.tar.gz: cebe7aac11f9e878f87fc05a398ecb32a1043406
5
5
  SHA512:
6
- metadata.gz: 2b8550bb9fda07b6c28ed06b41af6ccfdd41b7f32eff9eb8debc504bea21f752760177bd30a10c6cf6bfda9d4a6bdb324fa20f3dd700b7622e04939cb8206609
7
- data.tar.gz: 58af2b57565082b646a19ecaa55e6eb1a59e7946f6b5b32034395b5d377764d6a6b3678b10fa96acd88869dd7f0b6a281543550912e18314ac159d328f16da2c
6
+ metadata.gz: 28eaf16eb8cb13ea332e08c51b6a8e0a7e5bfd70a28c6e1fdf0fbe7d0e4ffba0944b0e0ae941b52c14524b4bea904b6b9534af7c82dffad7432f5c456a94192a
7
+ data.tar.gz: 548f9d865e9e0a44443bea2c3e8d6a8777d491eb46b553f0393984bfb92da051b96b936f1ff1aa8b799abc35d1ef8eb5a2445505b8e48abfe6977a612291ac87
@@ -32,6 +32,10 @@ module Qti
32
32
  end
33
33
  end
34
34
 
35
+ def single_fill_in_blank?
36
+ blanks.count == 1
37
+ end
38
+
35
39
  def blanks
36
40
  node.xpath('.//xmlns:response_str').map do |blank|
37
41
  { id: blank.attributes['ident'].value }
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '0.9.5'.freeze
2
+ VERSION = '0.9.6'.freeze
3
3
  end
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
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="i9cdc232fbc191041b993a1444cfd18ae" title="Fill in the Blank">
4
+ <itemmetadata>
5
+ <qtimetadata>
6
+ <qtimetadatafield>
7
+ <fieldlabel>question_type</fieldlabel>
8
+ <fieldentry>short_answer_question</fieldentry>
9
+ </qtimetadatafield>
10
+ <qtimetadatafield>
11
+ <fieldlabel>points_possible</fieldlabel>
12
+ <fieldentry>1.0</fieldentry>
13
+ </qtimetadatafield>
14
+ <qtimetadatafield>
15
+ <fieldlabel>assessment_question_identifierref</fieldlabel>
16
+ <fieldentry>ibe92d900bebedbaa4ec0e7230cc258ad</fieldentry>
17
+ </qtimetadatafield>
18
+ </qtimetadata>
19
+ </itemmetadata>
20
+ <presentation>
21
+ <material>
22
+ <mattext texttype="text/html">&lt;div&gt;&lt;p&gt;Chicago is in what state?&lt;/p&gt;&lt;/div&gt;</mattext>
23
+ </material>
24
+ <response_str ident="response1" rcardinality="Single">
25
+ <render_fib>
26
+ <response_label ident="answer1" rshuffle="No"/>
27
+ </render_fib>
28
+ </response_str>
29
+ </presentation>
30
+ <resprocessing>
31
+ <outcomes>
32
+ <decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
33
+ </outcomes>
34
+ <respcondition continue="No">
35
+ <conditionvar>
36
+ <varequal respident="response1">Illinois</varequal>
37
+ <varequal respident="response1">illinois</varequal>
38
+ </conditionvar>
39
+ <setvar action="Set" varname="SCORE">100</setvar>
40
+ </respcondition>
41
+ </resprocessing>
42
+ </item>
43
+ </questestinterop>
@@ -14,7 +14,7 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
14
14
 
15
15
  shared_examples_for 'blanks' do
16
16
  it 'returns the blanks' do
17
- expect(loaded_class.blanks).to eq [{ id: 'FIB01' }, { id: 'FIB02' }, { id: 'FIB03' }]
17
+ expect(loaded_class.blanks).to eq(expected_blanks)
18
18
  end
19
19
  end
20
20
 
@@ -39,6 +39,30 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
39
39
  end
40
40
  end
41
41
 
42
+ context 'single_fib.xml' do
43
+ let(:file_path) { File.join(fixtures_path, 'single_fib.xml') }
44
+ let(:scoring_data_ids) { %w[response1 response1] }
45
+ let(:scoring_data_values) { %w[Illinois illinois] }
46
+ let(:scoring_data_case) { %w[no no] }
47
+ let(:answer_count) { 2 }
48
+ let(:expected_blanks) {[{ id: 'response1' }]}
49
+ let(:expected_stem_items) do
50
+ [
51
+ {:id=>"stem_0", :position=>1, :type=>"text", :value=>"<div><p>Chicago is in what state?</p></div>"},
52
+ {:id=>"stem_1", :position=>2, :type=>"blank", :blank_id=>"response1"}
53
+ ]
54
+ end
55
+
56
+ include_examples 'answers'
57
+ include_examples 'scoring_data_structs'
58
+ include_examples 'blanks'
59
+ include_examples 'stem_items'
60
+
61
+ it 'returns true for #single_fill_in_blank?' do
62
+ expect(loaded_class.single_fill_in_blank?).to eq true
63
+ end
64
+ end
65
+
42
66
  context 'fib_str.xml' do
43
67
  let(:file_path) { File.join(fixtures_path, 'fib_str.xml') }
44
68
  let(:shuffle_value) { false }
@@ -46,6 +70,7 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
46
70
  let(:scoring_data_values) { %w[Winter Summer York] }
47
71
  let(:scoring_data_case) { %w[Yes Yes Yes] }
48
72
  let(:answer_count) { 3 }
73
+ let(:expected_blanks) {[{ id: 'FIB01' }, { id: 'FIB02' }, { id: 'FIB03' }]}
49
74
  let(:expected_stem_items) do
50
75
  [
51
76
  { id: 'stem_0', position: 1, type: 'text', value: 'Fill-in-the blanks in this text from Richard III: ' },
@@ -61,7 +86,12 @@ describe Qti::V1::Models::Interactions::FillBlankInteraction do
61
86
  include_examples 'shuffled?'
62
87
  include_examples 'answers'
63
88
  include_examples 'scoring_data_structs'
89
+ include_examples 'blanks'
64
90
  include_examples 'stem_items'
91
+
92
+ it 'returns false for #single_fill_in_blank?' do
93
+ expect(loaded_class.single_fill_in_blank?).to eq false
94
+ end
65
95
  end
66
96
 
67
97
  describe '#scoring_data_structs' do
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.9.5
4
+ version: 0.9.6
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-12-11 00:00:00.000000000 Z
12
+ date: 2017-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -305,6 +305,7 @@ files:
305
305
  - spec/fixtures/items_1.2/multiple_answer_canvas.xml
306
306
  - spec/fixtures/items_1.2/multiple_choice.xml
307
307
  - spec/fixtures/items_1.2/ordering.xml
308
+ - spec/fixtures/items_1.2/single_fib.xml
308
309
  - spec/fixtures/items_1.2/true_false.xml
309
310
  - spec/fixtures/items_2.1/Example02-feedbackInline.xml
310
311
  - spec/fixtures/items_2.1/categorization.xml
@@ -581,6 +582,7 @@ test_files:
581
582
  - spec/fixtures/items_1.2/multiple_answer_canvas.xml
582
583
  - spec/fixtures/items_1.2/multiple_choice.xml
583
584
  - spec/fixtures/items_1.2/ordering.xml
585
+ - spec/fixtures/items_1.2/single_fib.xml
584
586
  - spec/fixtures/items_1.2/true_false.xml
585
587
  - spec/fixtures/items_2.1/Example02-feedbackInline.xml
586
588
  - spec/fixtures/items_2.1/categorization.xml