qti 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63fa9b2b81047aaee938481bce68da3d899eb32d
4
- data.tar.gz: 831b6f6b6c000a64b416e61b26076b13a93e02bf
3
+ metadata.gz: 6686af9d58d90589b2baea3b71df64c5756f0005
4
+ data.tar.gz: ca77e3ec61770d76abc97f2845c20be2691c4bb2
5
5
  SHA512:
6
- metadata.gz: a019845b24220624a376864611519e20e1a814b042dda11c9807962d8d517c30beaaa62022745ebffbdbf718125d1c0f286a8d597716d9341fa0cd50410708d4
7
- data.tar.gz: 5461bcbc16d58ed31b7e88211b286e6b709696cd5b22b74a84541a9e9c299d3916580eb0d6ac84a78d24d4d820219297cdf0475d15e80cd08c7afeebbb7d9fdf
6
+ metadata.gz: 27ed10aecd6266e80bcec275f339e7efda8297342ff4f99bf7c9552f5d5f6e821be8e3a33d63ad97e2f8c17ee455bca69eddf382f720b7a8c18d1e94af20377c
7
+ data.tar.gz: 4c117a998c662c7220304991de3524b50f8c75de05e7461c48eadbd514a74147035958a5bf2d9495dff687405bdf8aa8bb2f4d09d2514e6097373ca650346661
@@ -47,11 +47,16 @@ module Qti
47
47
  points_possible_label = qti_metadata_children.children.find {|node| node.text == "points_possible"}
48
48
  points_possible_node = points_possible_label.next.text
49
49
  else
50
- @doc.at_xpath('.//xmlns:decvar/@maxvalue')&.value || @doc.at_xpath('.//xmlns:decvar/@defaultval')&.value
50
+ decvar_maxvalue
51
51
  end
52
52
  end
53
53
  end
54
54
 
55
+ def decvar_maxvalue
56
+ @doc.at_xpath('.//xmlns:decvar/@maxvalue')&.value&.to_i ||
57
+ @doc.at_xpath('.//xmlns:decvar/@defaultval')&.value&.to_i || 0
58
+ end
59
+
55
60
  def rcardinality
56
61
  @rcardinality ||= @doc.at_xpath('.//xmlns:response_lid/@rcardinality').value
57
62
  end
@@ -1,105 +1,100 @@
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="Quiz" ident="A1001">
6
- <section title="Main" ident="S1002">
7
-
8
- <item title="Discussion - content." ident="QUE_1022">
9
- <presentation>
10
- <material>
11
- <mattext texttype="text/html"><![CDATA[A good discussion posting includes which of the following (select all that apply):]]></mattext>
12
- </material>
13
- <response_lid ident="QUE_1023_RL" rcardinality="Multiple" rtiming="No">
14
- <render_choice>
15
- <response_label ident="QUE_1024_A1">
16
- <material>
17
- <mattext texttype="text/html"><![CDATA[Poses a question or invites additional comment from others]]></mattext>
18
- </material>
19
- </response_label>
20
- <response_label ident="QUE_1025_A2">
21
- <material>
22
- <mattext texttype="text/html"><![CDATA[Attacks another's post to generate controversy]]></mattext>
23
- </material>
24
- </response_label>
25
- <response_label ident="QUE_1026_A3">
26
- <material>
27
- <mattext texttype="text/html"><![CDATA[Expresses an opinion which may be controversial so that others can agree or disagree]]></mattext>
28
- </material>
29
- </response_label>
30
- <response_label ident="QUE_1027_A4">
31
- <material>
32
- <mattext texttype="text/html"><![CDATA[Adds information, ideas or suggestions that expand everyone's thinking about the topic]]></mattext>
33
- </material>
34
- </response_label>
35
- <response_label ident="QUE_1028_A5">
36
- <material>
37
- <mattext texttype="text/html"><![CDATA[Reiterates the consensus or restates the ideas of others without adding independent thought]]></mattext>
38
- </material>
39
- </response_label>
40
- <response_label ident="QUE_1029_A6">
41
- <material>
42
- <mattext texttype="text/html"><![CDATA[Provides non-specific praise for fellow learners like "good job" or "I loved your idea"]]></mattext>
43
- </material>
44
- </response_label>
45
- <response_label ident="QUE_1030_A7">
46
- <material>
47
- <mattext texttype="text/html"><![CDATA[Responds positively to a person's comment and includes their name or quote from the original posting that supports your expanded idea]]></mattext>
48
- </material>
49
- </response_label>
50
- </render_choice>
51
- </response_lid>
52
- </presentation>
53
- <resprocessing>
54
- <outcomes>
55
- <decvar vartype="Decimal" defaultval="0" varname="que_score" maxvalue="10.00" minvalue="0"/>
56
- </outcomes>
57
- <respcondition>
58
- <conditionvar>
59
- <varequal respident="QUE_1023_RL">QUE_1024_A1</varequal>
60
- </conditionvar>
61
- <setvar varname="que_score" action="Add">25.00</setvar>
62
- </respcondition>
63
- <respcondition>
64
- <conditionvar>
65
- <varequal respident="QUE_1023_RL">QUE_1025_A2</varequal>
66
- </conditionvar>
67
- <setvar varname="que_score" action="Add">-10.00</setvar>
68
- </respcondition>
69
- <respcondition>
70
- <conditionvar>
71
- <varequal respident="QUE_1023_RL">QUE_1026_A3</varequal>
72
- </conditionvar>
73
- <setvar varname="que_score" action="Add">25.00</setvar>
74
- </respcondition>
75
- <respcondition>
76
- <conditionvar>
77
- <varequal respident="QUE_1023_RL">QUE_1027_A4</varequal>
78
- </conditionvar>
79
- <setvar varname="que_score" action="Add">25.00</setvar>
80
- </respcondition>
81
- <respcondition>
82
- <conditionvar>
83
- <varequal respident="QUE_1023_RL">QUE_1028_A5</varequal>
84
- </conditionvar>
85
- <setvar varname="que_score" action="Add">-10.00</setvar>
86
- </respcondition>
87
- <respcondition>
88
- <conditionvar>
89
- <varequal respident="QUE_1023_RL">QUE_1029_A6</varequal>
90
- </conditionvar>
91
- <setvar varname="que_score" action="Add">-10.00</setvar>
92
- </respcondition>
93
- <respcondition>
94
- <conditionvar>
95
- <varequal respident="QUE_1023_RL">QUE_1030_A7</varequal>
96
- </conditionvar>
97
- <setvar varname="que_score" action="Add">25.00</setvar>
98
- </respcondition>
99
- </resprocessing>
100
- </item>
101
-
102
- </section>
103
- </assessment>
104
-
3
+ <assessment title="Quiz" ident="A1001">
4
+ <section title="Main" ident="S1002">
5
+ <item title="Discussion - content." ident="QUE_1022">
6
+ <presentation>
7
+ <material>
8
+ <mattext texttype="text/html"><![CDATA[A good discussion posting includes which of the following (select all that apply):]]></mattext>
9
+ </material>
10
+ <response_lid ident="QUE_1023_RL" rcardinality="Multiple" rtiming="No">
11
+ <render_choice>
12
+ <response_label ident="QUE_1024_A1">
13
+ <material>
14
+ <mattext texttype="text/html"><![CDATA[Poses a question or invites additional comment from others]]></mattext>
15
+ </material>
16
+ </response_label>
17
+ <response_label ident="QUE_1025_A2">
18
+ <material>
19
+ <mattext texttype="text/html"><![CDATA[Attacks another's post to generate controversy]]></mattext>
20
+ </material>
21
+ </response_label>
22
+ <response_label ident="QUE_1026_A3">
23
+ <material>
24
+ <mattext texttype="text/html"><![CDATA[Expresses an opinion which may be controversial so that others can agree or disagree]]></mattext>
25
+ </material>
26
+ </response_label>
27
+ <response_label ident="QUE_1027_A4">
28
+ <material>
29
+ <mattext texttype="text/html"><![CDATA[Adds information, ideas or suggestions that expand everyone's thinking about the topic]]></mattext>
30
+ </material>
31
+ </response_label>
32
+ <response_label ident="QUE_1028_A5">
33
+ <material>
34
+ <mattext texttype="text/html"><![CDATA[Reiterates the consensus or restates the ideas of others without adding independent thought]]></mattext>
35
+ </material>
36
+ </response_label>
37
+ <response_label ident="QUE_1029_A6">
38
+ <material>
39
+ <mattext texttype="text/html"><![CDATA[Provides non-specific praise for fellow learners like "good job" or "I loved your idea"]]></mattext>
40
+ </material>
41
+ </response_label>
42
+ <response_label ident="QUE_1030_A7">
43
+ <material>
44
+ <mattext texttype="text/html"><![CDATA[Responds positively to a person's comment and includes their name or quote from the original posting that supports your expanded idea]]></mattext>
45
+ </material>
46
+ </response_label>
47
+ </render_choice>
48
+ </response_lid>
49
+ </presentation>
50
+ <resprocessing>
51
+ <outcomes>
52
+ <decvar vartype="Decimal" defaultval="0" varname="que_score" minvalue="0"/>
53
+ </outcomes>
54
+ <respcondition>
55
+ <conditionvar>
56
+ <varequal respident="QUE_1023_RL">QUE_1024_A1</varequal>
57
+ </conditionvar>
58
+ <setvar varname="que_score" action="Add">25.00</setvar>
59
+ </respcondition>
60
+ <respcondition>
61
+ <conditionvar>
62
+ <varequal respident="QUE_1023_RL">QUE_1025_A2</varequal>
63
+ </conditionvar>
64
+ <setvar varname="que_score" action="Add">-10.00</setvar>
65
+ </respcondition>
66
+ <respcondition>
67
+ <conditionvar>
68
+ <varequal respident="QUE_1023_RL">QUE_1026_A3</varequal>
69
+ </conditionvar>
70
+ <setvar varname="que_score" action="Add">25.00</setvar>
71
+ </respcondition>
72
+ <respcondition>
73
+ <conditionvar>
74
+ <varequal respident="QUE_1023_RL">QUE_1027_A4</varequal>
75
+ </conditionvar>
76
+ <setvar varname="que_score" action="Add">25.00</setvar>
77
+ </respcondition>
78
+ <respcondition>
79
+ <conditionvar>
80
+ <varequal respident="QUE_1023_RL">QUE_1028_A5</varequal>
81
+ </conditionvar>
82
+ <setvar varname="que_score" action="Add">-10.00</setvar>
83
+ </respcondition>
84
+ <respcondition>
85
+ <conditionvar>
86
+ <varequal respident="QUE_1023_RL">QUE_1029_A6</varequal>
87
+ </conditionvar>
88
+ <setvar varname="que_score" action="Add">-10.00</setvar>
89
+ </respcondition>
90
+ <respcondition>
91
+ <conditionvar>
92
+ <varequal respident="QUE_1023_RL">QUE_1030_A7</varequal>
93
+ </conditionvar>
94
+ <setvar varname="que_score" action="Add">25.00</setvar>
95
+ </respcondition>
96
+ </resprocessing>
97
+ </item>
98
+ </section>
99
+ </assessment>
105
100
  </questestinterop>
@@ -1,50 +1,45 @@
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="Grading - specific - 3 pt score" ident="QUE_1003">
9
- <presentation>
10
- <material>
11
- <mattext texttype="text/html"><![CDATA[If I get a 3, I must have done something wrong. <img align="bottom" alt="image.png" src="org0/images/image.png" border="0"/>]]></mattext>
12
- </material>
13
- <response_lid ident="QUE_1004_RL" rcardinality="Single" rtiming="No">
14
- <render_choice shuffle= "Yes">
15
- <response_label ident="QUE_1005_A1">
16
- <material>
17
- <mattext texttype="text/html"><![CDATA[True]]></mattext>
18
- </material>
19
- </response_label>
20
- <response_label ident="QUE_1006_A2">
21
- <material>
22
- <mattext texttype="text/html"><![CDATA[False]]></mattext>
23
- </material>
24
- </response_label>
25
- </render_choice>
26
- </response_lid>
27
- </presentation>
28
- <resprocessing>
29
- <outcomes>
30
- <decvar vartype="Decimal" defaultval="0" varname="que_score"/>
31
- </outcomes>
32
- <respcondition>
33
- <conditionvar>
34
- <varequal respident="QUE_1004_RL">QUE_1005_A1</varequal>
35
- </conditionvar>
36
- <setvar varname="que_score" action="Add">0</setvar>
37
- </respcondition>
38
- <respcondition>
39
- <conditionvar>
40
- <varequal respident="QUE_1004_RL">QUE_1006_A2</varequal>
41
- </conditionvar>
42
- <setvar varname="que_score" action="Set">10.00</setvar>
43
- </respcondition>
44
- </resprocessing>
45
- </item>
46
-
47
- </section>
48
- </assessment>
49
-
3
+ <assessment title="1.2 Import Quiz" ident="A1001">
4
+ <section title="Main" ident="S1002">
5
+ <item title="Grading - specific - 3 pt score" ident="QUE_1003">
6
+ <presentation>
7
+ <material>
8
+ <mattext texttype="text/html"><![CDATA[If I get a 3, I must have done something wrong. <img align="bottom" alt="image.png" src="org0/images/image.png" border="0"/>]]></mattext>
9
+ </material>
10
+ <response_lid ident="QUE_1004_RL" rcardinality="Single" rtiming="No">
11
+ <render_choice shuffle="Yes">
12
+ <response_label ident="QUE_1005_A1">
13
+ <material>
14
+ <mattext texttype="text/html"><![CDATA[True]]></mattext>
15
+ </material>
16
+ </response_label>
17
+ <response_label ident="QUE_1006_A2">
18
+ <material>
19
+ <mattext texttype="text/html"><![CDATA[False]]></mattext>
20
+ </material>
21
+ </response_label>
22
+ </render_choice>
23
+ </response_lid>
24
+ </presentation>
25
+ <resprocessing>
26
+ <outcomes>
27
+ <decvar vartype="Decimal" defaultval="0" varname="que_score"/>
28
+ </outcomes>
29
+ <respcondition>
30
+ <conditionvar>
31
+ <varequal respident="QUE_1004_RL">QUE_1005_A1</varequal>
32
+ </conditionvar>
33
+ <setvar varname="que_score" action="Add">0</setvar>
34
+ </respcondition>
35
+ <respcondition>
36
+ <conditionvar>
37
+ <varequal respident="QUE_1004_RL">QUE_1006_A2</varequal>
38
+ </conditionvar>
39
+ <setvar varname="que_score" action="Set">10.00</setvar>
40
+ </respcondition>
41
+ </resprocessing>
42
+ </item>
43
+ </section>
44
+ </assessment>
50
45
  </questestinterop>
@@ -22,8 +22,25 @@ describe Qti::V1::Models::AssessmentItem do
22
22
  expect(loaded_class.item_body).to include 'If I get a 3, I must have done something wrong.'
23
23
  end
24
24
 
25
- it 'grabs the points possible' do
26
- expect(loaded_class.points_possible).to eq '0'
25
+ describe '#points_possible' do
26
+ it 'grabs the points possible' do
27
+ expect(loaded_class.points_possible).to eq 0
28
+ end
29
+
30
+ it 'returns 0 by default' do
31
+ doc =
32
+ <<-XML.strip_heredoc
33
+ <?xml version="1.0" encoding="ISO-8859-1"?>
34
+ <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">
35
+ <outcomes>
36
+ <decvar vartype="Decimal" varname="que_score"/>
37
+ </outcomes>
38
+ </questestinterop>
39
+ XML
40
+ node = Nokogiri.XML(doc, &:noblanks)
41
+ assessment_item = described_class.new(node)
42
+ expect(assessment_item.points_possible). to eq 0
43
+ end
27
44
  end
28
45
 
29
46
  describe '#scoring_data_structs' do
@@ -59,7 +76,7 @@ describe Qti::V1::Models::AssessmentItem do
59
76
  it 'collects all the correct answers' do
60
77
  struct = loaded_class.scoring_data_structs
61
78
  expect(struct.size).to eq 3
62
- expect(struct.map(&:values)).to eq ["4155", "6991", "1939"]
79
+ expect(struct.map(&:values)).to eq %w[4155 6991 1939]
63
80
  end
64
81
  end
65
82
 
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.5
4
+ version: 0.7.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-07-06 00:00:00.000000000 Z
12
+ date: 2017-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -483,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
483
483
  version: '0'
484
484
  requirements: []
485
485
  rubyforge_project:
486
- rubygems_version: 2.5.1
486
+ rubygems_version: 2.6.11
487
487
  signing_key:
488
488
  specification_version: 4
489
489
  summary: QTI 1.2 and 2.1 import and export models