qti 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63fa9b2b81047aaee938481bce68da3d899eb32d
|
4
|
+
data.tar.gz: 831b6f6b6c000a64b416e61b26076b13a93e02bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a019845b24220624a376864611519e20e1a814b042dda11c9807962d8d517c30beaaa62022745ebffbdbf718125d1c0f286a8d597716d9341fa0cd50410708d4
|
7
|
+
data.tar.gz: 5461bcbc16d58ed31b7e88211b286e6b709696cd5b22b74a84541a9e9c299d3916580eb0d6ac84a78d24d4d820219297cdf0475d15e80cd08c7afeebbb7d9fdf
|
@@ -28,9 +28,27 @@ module Qti
|
|
28
28
|
@title ||= @doc.attribute('title').value
|
29
29
|
end
|
30
30
|
|
31
|
+
def qti_metadata_children
|
32
|
+
@doc.at_xpath('.//xmlns:qtimetadata')&.children
|
33
|
+
end
|
34
|
+
|
35
|
+
def has_points_possible_qti_metadata?
|
36
|
+
if @doc.at_xpath('.//xmlns:qtimetadata').present?
|
37
|
+
points_possible_label = qti_metadata_children.children.find {|node| node.text == "points_possible"}
|
38
|
+
points_possible_label.present?
|
39
|
+
else
|
40
|
+
false
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
31
44
|
def points_possible
|
32
45
|
@points_possible ||= begin
|
33
|
-
|
46
|
+
if has_points_possible_qti_metadata?
|
47
|
+
points_possible_label = qti_metadata_children.children.find {|node| node.text == "points_possible"}
|
48
|
+
points_possible_node = points_possible_label.next.text
|
49
|
+
else
|
50
|
+
@doc.at_xpath('.//xmlns:decvar/@maxvalue')&.value || @doc.at_xpath('.//xmlns:decvar/@defaultval')&.value
|
51
|
+
end
|
34
52
|
end
|
35
53
|
end
|
36
54
|
|
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.
|
4
|
+
version: 0.7.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-06
|
12
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|