qti 2.22.5 → 2.22.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
  SHA256:
3
- metadata.gz: 30052eb8b376ccde4e42a859c75d817c7844a066d008afe70884456fbb88c432
4
- data.tar.gz: 7daaa441ebfd637728d44dd255f9aefd2e89e306f9e1966c8ee4ff35aabcbdd5
3
+ metadata.gz: a72b532cd51607d749d519695eedd195baa829425689fb89651a240fe2ce6f74
4
+ data.tar.gz: f4ca8d029a779c5f5b4b80c782238271647cee5d7cb15a4c221ffe5f5d53b1f7
5
5
  SHA512:
6
- metadata.gz: dbc8366473d50ef8dcbe8e823ac93077af426107e72f8bf03257f4037f9a5baeefac737c1fd4c4976f81aaa155a76b9833e132c07f1c0f8b4d55cd3123a3981b
7
- data.tar.gz: b2f8606881c6481a16404f885fbd920e1372b6534c4dcd94142d8a34803145c74926b3e0f7841c2ad7e05face6bb64ed76e634ae64141dddd6ebab737f448324
6
+ metadata.gz: 97053ee0f769f90b7148271a7ecf0fe309adb72e48adb6feea2c823225c0a7c27a9bc4adae09b7f2fd812b063a7197a77fe316598e5539aff74c7d66471d207e
7
+ data.tar.gz: 3ca0b4a412a6573fc530693e301bafca22e636742d069713b0be51e3ff923d302bfaee84792bbc72812553b8fb59eefe7e1eaaea67803634445ced172157d04f
@@ -2,6 +2,7 @@ module Qti
2
2
  module V1
3
3
  module Models
4
4
  module Interactions
5
+ # This is the Interaction for Essay question type
5
6
  class StringInteraction < BaseInteraction
6
7
  # This will know if a class matches
7
8
  def self.matches(node, parent)
@@ -35,6 +36,10 @@ module Qti
35
36
  @word_limit_min ||= @node.at_xpath('.//xmlns:response_str/@word_limit_min')&.value
36
37
  end
37
38
 
39
+ def scoring_data_structs
40
+ { value: grading_notes }
41
+ end
42
+
38
43
  private
39
44
 
40
45
  def rcardinality
@@ -44,6 +49,12 @@ module Qti
44
49
  def rce_raw
45
50
  @rce_raw ||= @node.at_xpath('.//xmlns:response_str/@rce')&.value
46
51
  end
52
+
53
+ def grading_notes
54
+ path = './/xmlns:qtimetadatafield/xmlns:fieldlabel' \
55
+ '[text()="grading_notes"]/../xmlns:fieldentry'
56
+ @grading_notes ||= @node.at_xpath(path)&.text || ''
57
+ end
47
58
  end
48
59
  end
49
60
  end
data/lib/qti/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Qti
2
- VERSION = '2.22.5'.freeze
2
+ VERSION = '2.22.6'.freeze
3
3
  end
@@ -1,6 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
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
3
  <item ident="if15fb877c2cde9a14437aa7429360ac6" title="First Essay">
4
+ <itemmetadata>
5
+ <qtimetadata>
6
+ <qtimetadatafield>
7
+ <fieldlabel>grading_notes</fieldlabel>
8
+ <fieldentry>this is the remix</fieldentry>
9
+ </qtimetadatafield>
10
+ </qtimetadata>
11
+ </itemmetadata>
4
12
  <presentation>
5
13
  <material>
6
14
  <mattext texttype="text/html">
@@ -19,6 +19,10 @@ describe Qti::V1::Models::Interactions::StringInteraction do
19
19
  expect(loaded_class.word_limit_max).to be_nil
20
20
  expect(loaded_class.word_limit_min).to be_nil
21
21
  end
22
+
23
+ it 'does not return any grading notes' do
24
+ expect(loaded_class.scoring_data_structs).to eq({ value: '' })
25
+ end
22
26
  end
23
27
 
24
28
  context 'essay.xml question with custom settings' do
@@ -31,5 +35,9 @@ describe Qti::V1::Models::Interactions::StringInteraction do
31
35
  expect(loaded_class.word_limit_max).to eq('500')
32
36
  expect(loaded_class.word_limit_min).to eq('140')
33
37
  end
38
+
39
+ it 'has grading notes' do
40
+ expect(loaded_class.scoring_data_structs).to eq({ value: 'this is the remix' })
41
+ end
34
42
  end
35
43
  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.5
4
+ version: 2.22.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Diaz
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2023-10-13 00:00:00.000000000 Z
15
+ date: 2024-01-18 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: actionview