qti 0.8.0 → 0.8.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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e8424c7b1aa08d8050b0ed6fb82a8bfee2e7273
|
|
4
|
+
data.tar.gz: 3c2364dbb089fe7d93ba4f371694f022c09aa483
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47aa300244b6eb1b7bb9da7a195d14a5d504116806afdd7ef2272d764b2069446e4940df10f853954e5349b1438b4028458353aa75c868a13ffbe378d2159af5
|
|
7
|
+
data.tar.gz: efb24fab172368a48d0e52a6e8375cd7961e476b054382819b90a89df3fbf8ab6f83f1853b85cd9f89f0adb0acaa41d3e0082543556210fe8f9cdd61e134577f
|
data/lib/qti/models/base.rb
CHANGED
|
@@ -45,10 +45,10 @@ module Qti
|
|
|
45
45
|
new(path: path, package_root: package_root)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
def initialize(path:, package_root: nil)
|
|
48
|
+
def initialize(path:, package_root: nil, html: false)
|
|
49
49
|
@path = path
|
|
50
50
|
set_package_root(package_root || File.dirname(path))
|
|
51
|
-
@doc = parse_xml(File.read(path))
|
|
51
|
+
@doc = html ? parse_html(File.read(path)) : parse_xml(File.read(path))
|
|
52
52
|
raise ArgumentError unless @doc
|
|
53
53
|
end
|
|
54
54
|
|
|
@@ -68,6 +68,10 @@ module Qti
|
|
|
68
68
|
Nokogiri.XML(xml_string, @path.to_s, &:noblanks)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
def parse_html(html_string)
|
|
72
|
+
Nokogiri.HTML(html_string, @path.to_s, &:noblanks)
|
|
73
|
+
end
|
|
74
|
+
|
|
71
75
|
def remap_href_path(href)
|
|
72
76
|
return nil unless href
|
|
73
77
|
path = File.join(File.dirname(@path), href)
|
|
@@ -80,7 +80,7 @@ describe Qti::V2::Models::AssessmentTest do
|
|
|
80
80
|
it 'creates a stimulus from a given file' do
|
|
81
81
|
stimulus_path = File.join(fixtures_path, 'no_assessment_XML', 'passages', '0cfd5cf7-2c91-4b35-a57a-9f5d1709f68f.html')
|
|
82
82
|
stimulus = loaded_class.create_stimulus(stimulus_path)
|
|
83
|
-
expect(stimulus.title).to eq 'El equipo de hockey te necesita!'
|
|
83
|
+
expect(stimulus.title).to eq '¡El equipo de hockey te necesita!'
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
end
|
|
@@ -4,7 +4,7 @@ describe Qti::V2::Models::StimulusItem do
|
|
|
4
4
|
let(:file_path) { File.join('spec', 'fixtures', 'no_assessment_XML', 'imsmanifest.xml') }
|
|
5
5
|
let(:test_object) { Qti::V2::Models::NonAssessmentTest.from_path!(file_path) }
|
|
6
6
|
let(:stimulus_ref) { test_object.stimulus_ref(test_object.assessment_items[1]) }
|
|
7
|
-
let(:loaded_class) { described_class.
|
|
7
|
+
let(:loaded_class) { described_class.new(path: stimulus_ref, html: true) }
|
|
8
8
|
|
|
9
9
|
it 'loads a stimulus ref' do
|
|
10
10
|
expect do
|
|
@@ -13,12 +13,13 @@ describe Qti::V2::Models::StimulusItem do
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it 'has the title' do
|
|
16
|
-
expect(loaded_class.title).to eq 'El equipo de hockey te necesita!'
|
|
16
|
+
expect(loaded_class.title).to eq '¡El equipo de hockey te necesita!'
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'has sanitized item_body' do
|
|
20
20
|
expect(loaded_class.body).to include '<div'
|
|
21
21
|
expect(loaded_class.body).to include 'Listen to the audio passage.'
|
|
22
|
+
expect(loaded_class.body).to include '¡'
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
it 'has the identifier used to identify it in manifest file' 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.8.
|
|
4
|
+
version: 0.8.1
|
|
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-08-
|
|
12
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|