qti 2.22.0 → 2.22.1

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
  SHA256:
3
- metadata.gz: 69db54c55235becbc279f304dfb4627e3edb22a7467ab9ce311bab29b97ab09d
4
- data.tar.gz: 762bbfa69e290cff6ba71f5c1a3202594537b5c8a8cac09e7549def491fa258a
3
+ metadata.gz: 226c095ecb34ca04b13cfd9f81f39322b95317290c2e26ba4c01a1fb96fba029
4
+ data.tar.gz: 8053d9550e1a7bfca1a6b510e63bbae3ae8e57981281e2e651488addcc6361af
5
5
  SHA512:
6
- metadata.gz: 1eba7a1b6f972af2eb7698cb0dd025931f2dfff52965922b01fd0d9987b5a7cb6900978dbb22830cd6928ff98ce893c362aee94bcd8218987328bf7691dabb73
7
- data.tar.gz: bac1972140ef8df38a1a1b521d6b729911fa2a7daa7ae7cd9cc762e2f927667296fc0b563dc210bc46c578f4bc2b791137155829d39216952e0cab8f1b8366fe
6
+ metadata.gz: 7ec199fed12c9b46b9a7f7ea3ed74aaeaf2877e6202d13e4fc5da4c30ca225f38832473b13d3653a1a9ef0a4fa1e7d4fb7ac0d6a1e287c825aafa534425450ee
7
+ data.tar.gz: 7c3146c9f00d6fd745b2cd9046e0614ffb44db07484659bd2cb11099e37f719c30f03a18431b12bdf76df62072ff78f17bbbd5a594952e5a1d3916a1f95f5d93
@@ -44,6 +44,13 @@ module Qti
44
44
  end
45
45
  end
46
46
 
47
+ def scoring_algorithm
48
+ scoring_algorithm_path = './/xmlns:qtimetadatafield/xmlns:fieldlabel' \
49
+ '[text()="scoring_algorithm"]/../xmlns:fieldentry'
50
+
51
+ node.at_xpath(scoring_algorithm_path)&.text
52
+ end
53
+
47
54
  private
48
55
 
49
56
  def answer_nodes
@@ -72,8 +79,8 @@ module Qti
72
79
  scoring_options: scoring_options)
73
80
  end
74
81
  end
75
- # rubocop:enable Metrics/AbcSize
76
82
 
83
+ # rubocop:enable Metrics/AbcSize
77
84
  def setvar_nodes(choice_nodes)
78
85
  choice_nodes.select do |choice_node|
79
86
  choice_node.at_xpath('.//xmlns:setvar')&.content&.to_f&.positive?
@@ -35,6 +35,13 @@ module Qti
35
35
  all.reject { |v| correct.include? v }
36
36
  end
37
37
 
38
+ def scoring_algorithm
39
+ scoring_algorithm_path = './/xmlns:qtimetadatafield/xmlns:fieldlabel' \
40
+ '[text()="scoring_algorithm"]/../xmlns:fieldentry'
41
+
42
+ node.at_xpath(scoring_algorithm_path)&.text
43
+ end
44
+
38
45
  private
39
46
 
40
47
  def parse_scoring_data
@@ -43,6 +50,7 @@ module Qti
43
50
  matches = node.xpath(path).map do |node|
44
51
  [node.attributes['respident'].value, answers_map[node.content]]
45
52
  end
53
+
46
54
  [Models::ScoringData.new(Hash[matches], rcardinality)]
47
55
  end
48
56
 
data/lib/qti/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '2.22.0'.freeze
2
+ VERSION = '2.22.1'.freeze
3
3
  end
@@ -220,6 +220,10 @@
220
220
  <fieldentry>i50a52b1e8b3e61e8e4f56b30182a3f6f</fieldentry>
221
221
  </qtimetadatafield>
222
222
  </qtimetadata>
223
+ <qtimetadatafield>
224
+ <fieldlabel>scoring_algorithm</fieldlabel>
225
+ <fieldentry>AllOrNothing</fieldentry>
226
+ </qtimetadatafield>
223
227
  </itemmetadata>
224
228
  <presentation>
225
229
  <material>
@@ -70,5 +70,25 @@
70
70
  <setvar varname="SCORE" action="Add">50.00</setvar>
71
71
  </respcondition>
72
72
  </resprocessing>
73
+ <itemmetadata>
74
+ <qtimetadata>
75
+ <qtimetadatafield>
76
+ <fieldlabel>question_type</fieldlabel>
77
+ <fieldentry>multiple_answers_question</fieldentry>
78
+ </qtimetadatafield>
79
+ <qtimetadatafield>
80
+ <fieldlabel>points_possible</fieldlabel>
81
+ <fieldentry>1.0</fieldentry>
82
+ </qtimetadatafield>
83
+ <qtimetadatafield>
84
+ <fieldlabel>assessment_question_identifierref</fieldlabel>
85
+ <fieldentry>i50a52b1e8b3e61e8e4f56b30182a3f6f</fieldentry>
86
+ </qtimetadatafield>
87
+ </qtimetadata>
88
+ <qtimetadatafield>
89
+ <fieldlabel>scoring_algorithm</fieldlabel>
90
+ <fieldentry>AllOrNothing</fieldentry>
91
+ </qtimetadatafield>
92
+ </itemmetadata>
73
93
  </item>
74
94
  </questestinterop>
@@ -94,6 +94,26 @@
94
94
  <setvar varname="que_score" action="Add">25.00</setvar>
95
95
  </respcondition>
96
96
  </resprocessing>
97
+ <itemmetadata>
98
+ <qtimetadata>
99
+ <qtimetadatafield>
100
+ <fieldlabel>question_type</fieldlabel>
101
+ <fieldentry>multiple_answers_question</fieldentry>
102
+ </qtimetadatafield>
103
+ <qtimetadatafield>
104
+ <fieldlabel>points_possible</fieldlabel>
105
+ <fieldentry>1.0</fieldentry>
106
+ </qtimetadatafield>
107
+ <qtimetadatafield>
108
+ <fieldlabel>assessment_question_identifierref</fieldlabel>
109
+ <fieldentry>i50a52b1e8b3e61e8e4f56b30182a3f6f</fieldentry>
110
+ </qtimetadatafield>
111
+ </qtimetadata>
112
+ <qtimetadatafield>
113
+ <fieldlabel>scoring_algorithm</fieldlabel>
114
+ <fieldentry>AllOrNothing</fieldentry>
115
+ </qtimetadatafield>
116
+ </itemmetadata>
97
117
  </item>
98
118
  </section>
99
119
  </assessment>
@@ -41,6 +41,10 @@ describe Qti::V1::Models::Interactions::ChoiceInteraction do
41
41
  include_examples 'locked_choices'
42
42
  include_examples 'answers'
43
43
  include_examples 'meta_type'
44
+
45
+ it 'does not have any scoring algorithm' do
46
+ expect(loaded_class.scoring_algorithm).to eq nil
47
+ end
44
48
  end
45
49
 
46
50
  context 'true_false.xml' do
@@ -61,6 +65,10 @@ describe Qti::V1::Models::Interactions::ChoiceInteraction do
61
65
  let(:shuffle_value) { false }
62
66
  let(:locked_choices_value) { [] }
63
67
 
68
+ it 'has the correct scoring algorithm' do
69
+ expect(loaded_class.scoring_algorithm).to eq 'AllOrNothing'
70
+ end
71
+
64
72
  include_examples 'shuffled?'
65
73
  include_examples 'locked_choices'
66
74
  end
@@ -75,6 +83,10 @@ describe Qti::V1::Models::Interactions::ChoiceInteraction do
75
83
  include_examples 'shuffled?'
76
84
  include_examples 'locked_choices'
77
85
  include_examples 'meta_type'
86
+
87
+ it 'does not have any scoring algorithm' do
88
+ expect(loaded_class.scoring_algorithm).to eq nil
89
+ end
78
90
  end
79
91
 
80
92
  context 'multiple respconditions with empty setvars' do
@@ -59,6 +59,10 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
59
59
  end
60
60
  let(:expected_distractors) { ['A distractor answer.'] }
61
61
 
62
+ it 'has the correct scoring algorithm' do
63
+ expect(subject.scoring_algorithm).to eq 'AllOrNothing'
64
+ end
65
+
62
66
  include_examples('common features')
63
67
  include_examples('questions and answers')
64
68
  include_examples('#scoring_data_structs')
@@ -88,5 +92,9 @@ describe Qti::V1::Models::Interactions::MatchInteraction do
88
92
  include_examples('common features')
89
93
  include_examples('questions and answers')
90
94
  include_examples('#scoring_data_structs')
95
+
96
+ it 'does not have any scoring algorithm' do
97
+ expect(subject.scoring_algorithm).to eq nil
98
+ end
91
99
  end
92
100
  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: 2.22.0
4
+ version: 2.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Diaz