qti 0.7.3 → 0.7.4

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: 235b2d085b857b27a1af24c4baa2039abecd70b2
4
- data.tar.gz: f84f0ed70ba4e39b05d1814d956833c9feb63344
3
+ metadata.gz: deda071ecd40bdcf24677df2f9cdbeda08122011
4
+ data.tar.gz: 2c85623e45851776e8297faff563d0c0e34bb794
5
5
  SHA512:
6
- metadata.gz: 3891f873495ff08c9930edc282ade6e80e0206f3f993e26acea3f9821da3048a01d0f0a2f39bf3544e138230bf10f7928172b4b027758bc9b2fe9eb54a36d4c6
7
- data.tar.gz: 8842a46871705a74ffc0efef9823629aa285dd47a4bc13ebaeab60b66796877d31f1fc5660ee15d638a67064b88de9df86e33fbeeae987e427ed4f9182364e0d
6
+ metadata.gz: 661ed1cf8ca710215e862e2d208229cc8f84cfaf2992ddfa24eb9e8f70f33386089e148a937b0d50497550710c1020f17f75f0084158d90507fd900f3555c332
7
+ data.tar.gz: e67a91a599e8c5b2cd86cbfe66151bf74261d7bc0d5fc1f76d6b34363d4acea09178c4ac7b3e703085bb6c2667b8d24fe7d6897a7c75f6d8d35963a02ec560a9
@@ -21,10 +21,8 @@ module Qti
21
21
  raise NotImplementedError
22
22
  end
23
23
 
24
- private
25
-
26
24
  def rcardinality
27
- @rcardinality ||= @node.at_xpath('.//xmlns:response_lid/@rcardinality').value
25
+ @rcardinality ||= @node.at_xpath('.//xmlns:response_lid/@rcardinality')&.value || 'Single'
28
26
  end
29
27
  end
30
28
  end
@@ -17,8 +17,8 @@ module Qti
17
17
 
18
18
  def questions
19
19
  node.xpath('.//xmlns:response_lid').map do |lid_node|
20
- question_body = lid_node.at_xpath('.//xmlns:mattext').text
21
- { id: lid_node.attributes['ident'].value, question_body: question_body }
20
+ item_body = lid_node.at_xpath('.//xmlns:mattext').text
21
+ { id: lid_node.attributes['ident'].value, itemBody: item_body }
22
22
  end
23
23
  end
24
24
 
@@ -24,7 +24,7 @@ module Qti
24
24
  end
25
25
 
26
26
  def questions
27
- questions_ids.map { |id| { id: id, question_body: choices_by_identifier[id].content } }
27
+ questions_ids.map { |id| { id: id, itemBody: choices_by_identifier[id].content } }
28
28
  end
29
29
 
30
30
  def answers
@@ -16,7 +16,7 @@ module Qti
16
16
  end
17
17
 
18
18
  def questions
19
- questions_ids.map { |id| { id: id, question_body: choices_by_identifier[id].content } }
19
+ questions_ids.map { |id| { id: id, itemBody: choices_by_identifier[id].content } }
20
20
  end
21
21
 
22
22
  def shuffled?
@@ -1,83 +1,78 @@
1
1
  <?xml version="1.0" encoding="ISO-8859-1"?>
2
-
3
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">
4
-
5
- <assessment title="1.2 Import Quiz" ident="A1001">
6
- <section title="Main" ident="S1002">
7
-
8
- <item title="How much time each week?" ident="QUE_1007">
9
- <presentation>
10
- <material>
11
- <mattext texttype="text/html"><![CDATA[How much time should you spend working on your online course each week in order to earn credit? <img align="bottom" alt="image.png" src="$IMS_CC_FILE_BASE$org1/images/image.png" border="0"/>]]></mattext>
12
- </material>
13
- <response_lid ident="QUE_1008_RL" rcardinality="Single" rtiming="No">
14
- <render_choice>
15
- <response_label ident="QUE_1009_A1">
16
- <material>
17
- <mattext texttype="text/html"><![CDATA[However long it takes]]></mattext>
18
- </material>
19
- </response_label>
20
- <response_label ident="QUE_1010_A2">
21
- <material>
22
- <mattext texttype="text/html"><![CDATA[30 - 90 minutes]]></mattext>
23
- </material>
24
- </response_label>
25
- <response_label ident="QUE_1011_A3">
26
- <material>
27
- <mattext texttype="text/html"><![CDATA[1 - 2 hours]]></mattext>
28
- </material>
29
- </response_label>
30
- <response_label ident="QUE_1012_A4">
31
- <material>
32
- <mattext texttype="text/html"><![CDATA[At least 3 hours]]></mattext>
33
- </material>
34
- </response_label>
35
- <response_label ident="QUE_1013_A5">
36
- <material>
37
- <mattext texttype="text/html"><![CDATA[6 or more hours]]></mattext>
38
- </material>
39
- </response_label>
40
- </render_choice>
41
- </response_lid>
42
- </presentation>
43
- <resprocessing>
44
- <outcomes>
45
- <decvar vartype="Decimal" defaultval="0" varname="que_score"/>
46
- </outcomes>
47
- <respcondition>
48
- <conditionvar>
49
- <varequal respident="QUE_1008_RL">QUE_1009_A1</varequal>
50
- </conditionvar>
51
- <setvar varname="que_score" action="Add">0</setvar>
52
- </respcondition>
53
- <respcondition>
54
- <conditionvar>
55
- <varequal respident="QUE_1008_RL">QUE_1010_A2</varequal>
56
- </conditionvar>
57
- <setvar varname="que_score" action="Add">0</setvar>
58
- </respcondition>
59
- <respcondition>
60
- <conditionvar>
61
- <varequal respident="QUE_1008_RL">QUE_1011_A3</varequal>
62
- </conditionvar>
63
- <setvar varname="que_score" action="Add">0</setvar>
64
- </respcondition>
65
- <respcondition>
66
- <conditionvar>
67
- <varequal respident="QUE_1008_RL">QUE_1012_A4</varequal>
68
- </conditionvar>
69
- <setvar varname="que_score" action="Set">10.00</setvar>
70
- </respcondition>
71
- <respcondition>
72
- <conditionvar>
73
- <varequal respident="QUE_1008_RL">QUE_1013_A5</varequal>
74
- </conditionvar>
75
- <setvar varname="que_score" action="Add">0</setvar>
76
- </respcondition>
77
- </resprocessing>
78
- </item>
79
-
80
- </section>
81
- </assessment>
82
-
3
+ <assessment title="1.2 Import Quiz" ident="A1001">
4
+ <section title="Main" ident="S1002">
5
+ <item title="How much time each week?" ident="QUE_1007">
6
+ <presentation>
7
+ <material>
8
+ <mattext texttype="text/html"><![CDATA[How much time should you spend working on your online course each week in order to earn credit? <img align="bottom" alt="image.png" src="$IMS_CC_FILE_BASE$org1/images/image.png" border="0"/>]]></mattext>
9
+ </material>
10
+ <response_lid ident="QUE_1008_RL" rcardinality="Single" rtiming="No">
11
+ <render_choice>
12
+ <response_label ident="QUE_1009_A1">
13
+ <material>
14
+ <mattext texttype="text/html"><![CDATA[However long it takes]]></mattext>
15
+ </material>
16
+ </response_label>
17
+ <response_label ident="QUE_1010_A2">
18
+ <material>
19
+ <mattext texttype="text/html"><![CDATA[30 - 90 minutes]]></mattext>
20
+ </material>
21
+ </response_label>
22
+ <response_label ident="QUE_1011_A3">
23
+ <material>
24
+ <mattext texttype="text/html"><![CDATA[1 - 2 hours]]></mattext>
25
+ </material>
26
+ </response_label>
27
+ <response_label ident="QUE_1012_A4">
28
+ <material>
29
+ <mattext texttype="text/html"><![CDATA[At least 3 hours]]></mattext>
30
+ </material>
31
+ </response_label>
32
+ <response_label ident="QUE_1013_A5">
33
+ <material>
34
+ <mattext texttype="text/html"><![CDATA[6 or more hours]]></mattext>
35
+ </material>
36
+ </response_label>
37
+ </render_choice>
38
+ </response_lid>
39
+ </presentation>
40
+ <resprocessing>
41
+ <outcomes>
42
+ <decvar vartype="Decimal" defaultval="0" varname="que_score"/>
43
+ </outcomes>
44
+ <respcondition>
45
+ <conditionvar>
46
+ <varequal respident="QUE_1008_RL">QUE_1009_A1</varequal>
47
+ </conditionvar>
48
+ <setvar varname="que_score" action="Add">0</setvar>
49
+ </respcondition>
50
+ <respcondition>
51
+ <conditionvar>
52
+ <varequal respident="QUE_1008_RL">QUE_1010_A2</varequal>
53
+ </conditionvar>
54
+ <setvar varname="que_score" action="Add">0</setvar>
55
+ </respcondition>
56
+ <respcondition>
57
+ <conditionvar>
58
+ <varequal respident="QUE_1008_RL">QUE_1011_A3</varequal>
59
+ </conditionvar>
60
+ <setvar varname="que_score" action="Add">0</setvar>
61
+ </respcondition>
62
+ <respcondition>
63
+ <conditionvar>
64
+ <varequal respident="QUE_1008_RL">QUE_1012_A4</varequal>
65
+ </conditionvar>
66
+ <setvar varname="que_score" action="Set">10.00</setvar>
67
+ </respcondition>
68
+ <respcondition>
69
+ <conditionvar>
70
+ <varequal respident="QUE_1008_RL">QUE_1013_A5</varequal>
71
+ </conditionvar>
72
+ <setvar varname="que_score" action="Add">0</setvar>
73
+ </respcondition>
74
+ </resprocessing>
75
+ </item>
76
+ </section>
77
+ </assessment>
83
78
  </questestinterop>
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Qti::V1::Models::Interactions::BaseInteraction do
4
+ let(:doc) do
5
+ <<-XML.strip_heredoc
6
+ <?xml version="1.0" encoding="ISO-8859-1"?>
7
+ <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">
8
+ <response_lid ident="QUE_1008_RL" rtiming="No">
9
+ </response_lid>
10
+ </questestinterop>
11
+ XML
12
+ end
13
+
14
+ let(:node) { Nokogiri.XML(doc, &:noblanks) }
15
+
16
+ it 'returns "Single" rcardinality by default' do
17
+ interaction = described_class.new(node)
18
+ expect(interaction.rcardinality).to eq 'Single'
19
+ end
20
+ end
@@ -36,8 +36,8 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
36
36
  describe '#questions' do
37
37
  it 'returns the questions' do
38
38
  expect(subject.questions).to eq(
39
- [{ id: 'question_1', question_body: 'Light Microscope' },
40
- { id: 'question_2', question_body: 'Electron Microscopes' }]
39
+ [{ id: 'question_1', itemBody: 'Light Microscope' },
40
+ { id: 'question_2', itemBody: 'Electron Microscopes' }]
41
41
  )
42
42
  end
43
43
  end
@@ -30,9 +30,9 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
30
30
  describe '#questions' do
31
31
  it 'returns the questions' do
32
32
  expect(subject.questions).to eq(
33
- [{ id: 'A', question_body: 'Antonio' },
34
- { id: 'C', question_body: 'Capulet' },
35
- { id: 'D', question_body: 'Demetrius' }]
33
+ [{ id: 'A', itemBody: 'Antonio' },
34
+ { id: 'C', itemBody: 'Capulet' },
35
+ { id: 'D', itemBody: 'Demetrius' }]
36
36
  )
37
37
  end
38
38
  end
@@ -53,7 +53,7 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
53
53
  expect(subject.scoring_data_structs).to eq [
54
54
  Qti::V2::Models::ScoringData.new('Dresden', 'Pair', id: 'Match2675678', question_id: 'Match28433682'),
55
55
  Qti::V2::Models::ScoringData.new('Leipzig', 'Pair', id: 'Match9372581', question_id: 'Match7191791'),
56
- Qti::V2::Models::ScoringData.new('Halle' , 'Pair', id: 'Match22744006', question_id: 'Match20473010'),
56
+ Qti::V2::Models::ScoringData.new('Halle', 'Pair', id: 'Match22744006', question_id: 'Match20473010'),
57
57
  Qti::V2::Models::ScoringData.new('Bautzen', 'Pair', id: 'Match17943221', question_id: 'Match6429655')
58
58
  ]
59
59
  end
@@ -68,10 +68,10 @@ describe Qti::V2::Models::Interactions::MatchInteraction do
68
68
  describe '#questions' do
69
69
  it 'returns the questions' do
70
70
  expect(subject.questions).to eq(
71
- [{ id: 'Match28433682', question_body: 'Weißeritz' },
72
- { id: 'Match7191791', question_body: 'Mulde' },
73
- { id: 'Match20473010', question_body: 'Saale' },
74
- { id: 'Match6429655', question_body: 'Spree' }]
71
+ [{ id: 'Match28433682', itemBody: 'Weißeritz' },
72
+ { id: 'Match7191791', itemBody: 'Mulde' },
73
+ { id: 'Match20473010', itemBody: 'Saale' },
74
+ { id: 'Match6429655', itemBody: 'Spree' }]
75
75
  )
76
76
  end
77
77
  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.7.3
4
+ version: 0.7.4
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-06-29 00:00:00.000000000 Z
12
+ date: 2017-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -444,6 +444,7 @@ files:
444
444
  - spec/lib/qti/v1/models/assessment_spec.rb
445
445
  - spec/lib/qti/v1/models/choices/fill_blank_choice_spec.rb
446
446
  - spec/lib/qti/v1/models/choices/logical_identifier_choice_spec.rb
447
+ - spec/lib/qti/v1/models/interactions/base_interaction_spec.rb
447
448
  - spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb
448
449
  - spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb
449
450
  - spec/lib/qti/v1/models/interactions/match_interaction_spec.rb
@@ -685,6 +686,7 @@ test_files:
685
686
  - spec/lib/qti/v1/models/assessment_spec.rb
686
687
  - spec/lib/qti/v1/models/choices/fill_blank_choice_spec.rb
687
688
  - spec/lib/qti/v1/models/choices/logical_identifier_choice_spec.rb
689
+ - spec/lib/qti/v1/models/interactions/base_interaction_spec.rb
688
690
  - spec/lib/qti/v1/models/interactions/choice_interaction_spec.rb
689
691
  - spec/lib/qti/v1/models/interactions/fill_blank_interaction_spec.rb
690
692
  - spec/lib/qti/v1/models/interactions/match_interaction_spec.rb