qti 0.2.4 → 0.2.5

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: dd33b4803b62ee20dd54906d7e9ede2eb0c08478
4
- data.tar.gz: 09e13d1614ef4bfe59261803e70e4ecd9bdb9a85
3
+ metadata.gz: cbc6006e634a3ac856e98842fdfc7fb1849f04b2
4
+ data.tar.gz: 3ca4f8ddf812e9b2fe555a2bb27d9ec0139a10fb
5
5
  SHA512:
6
- metadata.gz: f82cb2ea9fb62dc18b6f9bf6cab9cb0c7aa17fde8637554f212e3a13bfc8a4494c94a6f667b3003de547e053ed82efbace8ed26f70f5717194f152932e88bf09
7
- data.tar.gz: 0e97e44ab1ffa104de2f437ca9f2b43a3eabdd11b9ec3a20cf869c9230ffc735d8e9dc9f3ac8c6be326256186d70b1a0d6ac6cfc47a7084d340640706516cf20
6
+ metadata.gz: 5f7d7fd845c67e9da054f585f9d13ab3caec518a085941eff6d69e61689e98d62dd65b732dcf36af0023020edf8f58a5140aa9a5fc4b1fdd42de3132cffc9929
7
+ data.tar.gz: 037968b23187f73b21f125b48c2fbb86bb19cf0474c5d1afc41e236c4523089d98b87bd0793aa18f3083721dbdd5d07cde050bab1cd635a33f0ed7287b56f39e
@@ -6,10 +6,10 @@ module Qti
6
6
  module Models
7
7
  module Interactions
8
8
  class LogicalIdentifierInteraction < Qti::V1::Models::Base
9
- NODE_NAME = 'response_lid'.freeze
9
+ @node_name = 'response_lid'.freeze
10
10
  # This will know if a class matches
11
11
  def self.matches(node)
12
- matches = node.children.children.select { |n| n.name == NODE_NAME }
12
+ matches = node.children.children.select { |n| n.name == @node_name }
13
13
  return false if matches.empty?
14
14
 
15
15
  raise Qti::UnsupportedSchema if matches.size > 1
@@ -3,10 +3,10 @@ module Qti
3
3
  module Models
4
4
  module Interactions
5
5
  class StringInteraction < Qti::V1::Models::Base
6
- NODE_NAME = 'response_str'.freeze
6
+ @node_name = 'response_str'.freeze
7
7
  # This will know if a class matches
8
8
  def self.matches(node)
9
- matches = node.children.children.select { |n| n.name == NODE_NAME }
9
+ matches = node.children.children.select { |n| n.name == @node_name }
10
10
  return false if matches.empty?
11
11
 
12
12
  raise Qti::UnsupportedSchema if matches.size > 1
@@ -6,10 +6,10 @@ module Qti
6
6
  module Models
7
7
  module Interactions
8
8
  class ChoiceInteraction < Qti::V2::Models::Base
9
- NODE_NAME = 'choiceInteraction'.freeze
9
+ @node_name = 'choiceInteraction'.freeze
10
10
  # This will know if a class matches
11
11
  def self.matches(node)
12
- matches = node.children.filter(INTERACTION_ELEMENTS_CSS).select { |n| n.name == NODE_NAME }
12
+ matches = node.children.filter(INTERACTION_ELEMENTS_CSS).select { |n| n.name == @node_name }
13
13
  return false if matches.empty?
14
14
 
15
15
  raise Qti::UnsupportedSchema if matches.size > 1
@@ -3,10 +3,10 @@ module Qti
3
3
  module Models
4
4
  module Interactions
5
5
  class ExtendedTextInteraction < Qti::V2::Models::Base
6
- NODE_NAME = 'extendedTextInteraction'.freeze
6
+ @node_name = 'extendedTextInteraction'.freeze
7
7
  # This will know if a class matches
8
8
  def self.matches(node)
9
- matches = node.children.filter(INTERACTION_ELEMENTS_CSS).select { |n| n.name == NODE_NAME }
9
+ matches = node.children.filter(INTERACTION_ELEMENTS_CSS).select { |n| n.name == @node_name }
10
10
  return false if matches.empty?
11
11
 
12
12
  raise Qti::UnsupportedSchema if matches.size > 1
@@ -20,7 +20,7 @@ describe Qti::Models::Base do
20
20
  it 'raises if node count is more than 1' do
21
21
  expect do
22
22
  loaded_class.xpath_with_single_check(bad_xpath)
23
- end.to raise_error
23
+ end.to raise_error(Qti::ParseError)
24
24
  end
25
25
 
26
26
  it 'doesn\'t raise with a single node count' do
@@ -34,7 +34,7 @@ describe Qti::Models::Base do
34
34
  it 'raises if node count is more than 1' do
35
35
  expect do
36
36
  loaded_class.css_with_single_check(bad_css_path)
37
- end.to raise_error
37
+ end.to raise_error(Qti::ParseError)
38
38
  end
39
39
 
40
40
  it 'doesn\'t raise with a single node count' do
@@ -9,8 +9,8 @@ describe Qti::V1::Models::AssessmentItem do
9
9
 
10
10
  it 'loads an AssessmentItem ref' do
11
11
  expect do
12
- described_class.new(assessment_item_ref)
13
- end.to_not raise_error(Qti::ParseError)
12
+ described_class.new(assessment_item_refs)
13
+ end.to_not raise_error
14
14
  end
15
15
 
16
16
  it 'has the title' do
@@ -9,7 +9,7 @@ describe Qti::V2::Models::AssessmentItem do
9
9
  it 'loads an AssessmentItem XML file' do
10
10
  expect do
11
11
  described_class.from_path!(file_path)
12
- end.to_not raise_error(Qti::ParseError)
12
+ end.to_not raise_error
13
13
  end
14
14
 
15
15
  it 'has the title' 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.2.4
4
+ version: 0.2.5
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-03-09 00:00:00.000000000 Z
12
+ date: 2017-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -416,7 +416,7 @@ rubyforge_project:
416
416
  rubygems_version: 2.5.1
417
417
  signing_key:
418
418
  specification_version: 4
419
- summary: QTI 1.2 and 2.1 import models
419
+ summary: QTI 1.2 and 2.1 import and export models
420
420
  test_files:
421
421
  - spec/fixtures/items_1.2/multiple_answer.xml
422
422
  - spec/fixtures/items_1.2/multiple_choice.xml