qti 2.20.2 → 2.22.0
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 +4 -4
- data/lib/qti/v1/models/interactions/choice_interaction.rb +17 -4
- data/lib/qti/v1/models/interactions/ordering_interaction.rb +25 -0
- data/lib/qti/v1/models/interactions/string_interaction.rb +29 -0
- data/lib/qti/v1/models/interactions/upload_interaction.rb +8 -0
- data/lib/qti/version.rb +1 -1
- data/spec/fixtures/items_1.2/choice_vary_points_by_answer.xml +69 -0
- data/spec/fixtures/items_1.2/essay_custom_settings.xml +27 -0
- data/spec/fixtures/items_1.2/ordering.row.xml +85 -0
- data/spec/fixtures/items_1.2/ordering.xml +1 -1
- data/spec/fixtures/items_1.2/ordering_with_labels.xml +91 -0
- data/spec/fixtures/items_1.2/upload_with_custom_settings.xml +34 -0
- data/spec/lib/qti/v1/models/assessment_item_spec.rb +22 -0
- data/spec/lib/qti/v1/models/interactions/ordering_interaction_spec.rb +48 -0
- data/spec/lib/qti/v1/models/interactions/string_interaction_spec.rb +21 -1
- data/spec/lib/qti/v1/models/interactions/upload_interaction_spec.rb +14 -0
- metadata +11 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69db54c55235becbc279f304dfb4627e3edb22a7467ab9ce311bab29b97ab09d
|
4
|
+
data.tar.gz: 762bbfa69e290cff6ba71f5c1a3202594537b5c8a8cac09e7549def491fa258a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eba7a1b6f972af2eb7698cb0dd025931f2dfff52965922b01fd0d9987b5a7cb6900978dbb22830cd6928ff98ce893c362aee94bcd8218987328bf7691dabb73
|
7
|
+
data.tar.gz: bac1972140ef8df38a1a1b521d6b729911fa2a7daa7ae7cd9cc762e2f927667296fc0b563dc210bc46c578f4bc2b791137155829d39216952e0cab8f1b8366fe
|
@@ -58,12 +58,25 @@ module Qti
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
# rubocop:disable Metrics/AbcSize
|
61
62
|
def scoring_data(choice_nodes)
|
62
|
-
|
63
|
-
|
63
|
+
setvar_nodes(choice_nodes).map do |value_node|
|
64
|
+
scoring_options = {}
|
65
|
+
scoring_options['points'] = value_node.at_xpath('.//xmlns:setvar')&.content&.to_f
|
66
|
+
|
67
|
+
if value_node.attributes['correctanswer']&.value&.downcase == 'yes'
|
68
|
+
scoring_options['correct_answer'] = true
|
69
|
+
end
|
70
|
+
|
71
|
+
ScoringData.new(value_node.at_xpath('.//xmlns:varequal').content, rcardinality,
|
72
|
+
scoring_options: scoring_options)
|
64
73
|
end
|
65
|
-
|
66
|
-
|
74
|
+
end
|
75
|
+
# rubocop:enable Metrics/AbcSize
|
76
|
+
|
77
|
+
def setvar_nodes(choice_nodes)
|
78
|
+
choice_nodes.select do |choice_node|
|
79
|
+
choice_node.at_xpath('.//xmlns:setvar')&.content&.to_f&.positive?
|
67
80
|
end
|
68
81
|
end
|
69
82
|
end
|
@@ -12,10 +12,35 @@ module Qti
|
|
12
12
|
new(node, parent)
|
13
13
|
end
|
14
14
|
|
15
|
+
def top_label
|
16
|
+
@top_label ||= label_at_position('top')
|
17
|
+
end
|
18
|
+
|
19
|
+
def bottom_label
|
20
|
+
@bottom_label ||= label_at_position('bottom')
|
21
|
+
end
|
22
|
+
|
15
23
|
def scoring_data_structs
|
16
24
|
correct_order = node.xpath('.//xmlns:varequal').map(&:content)
|
17
25
|
correct_order.map { |id| ScoringData.new(id, rcardinality) }
|
18
26
|
end
|
27
|
+
|
28
|
+
def display_answers_paragraph
|
29
|
+
render_extension = node.at_xpath('.//xmlns:render_extension')
|
30
|
+
ims_render_object = render_extension&.at_xpath('.//xmlns:ims_render_object')
|
31
|
+
|
32
|
+
ims_render_object&.attributes&.[]('orientation')&.value&.downcase == 'row' || false
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def label_at_position(position)
|
38
|
+
render_extension = node.at_xpath('.//xmlns:render_extension')
|
39
|
+
label_material = render_extension&.at_xpath(".//xmlns:material[@position='#{position}']")
|
40
|
+
label_mattext = label_material&.at_xpath('.//xmlns:mattext')
|
41
|
+
|
42
|
+
label_mattext&.content
|
43
|
+
end
|
19
44
|
end
|
20
45
|
end
|
21
46
|
end
|
@@ -10,11 +10,40 @@ module Qti
|
|
10
10
|
new(node, parent)
|
11
11
|
end
|
12
12
|
|
13
|
+
def rce
|
14
|
+
@rce ||= (rce_raw.nil? || rce_raw.downcase == 'yes')
|
15
|
+
end
|
16
|
+
|
17
|
+
def word_count
|
18
|
+
@word_count ||= @node.at_xpath('.//xmlns:response_str/@word_count')&.value&.downcase == 'yes'
|
19
|
+
end
|
20
|
+
|
21
|
+
def spell_check
|
22
|
+
@spell_check ||= @node.at_xpath('.//xmlns:response_str/@spell_check')&.value&.downcase == 'yes'
|
23
|
+
end
|
24
|
+
|
25
|
+
def word_limit_enabled
|
26
|
+
@word_limit_enabled ||=
|
27
|
+
@node.at_xpath('.//xmlns:response_str/@word_limit_enabled')&.value&.downcase == 'yes'
|
28
|
+
end
|
29
|
+
|
30
|
+
def word_limit_max
|
31
|
+
@word_limit_max ||= @node.at_xpath('.//xmlns:response_str/@word_limit_max')&.value
|
32
|
+
end
|
33
|
+
|
34
|
+
def word_limit_min
|
35
|
+
@word_limit_min ||= @node.at_xpath('.//xmlns:response_str/@word_limit_min')&.value
|
36
|
+
end
|
37
|
+
|
13
38
|
private
|
14
39
|
|
15
40
|
def rcardinality
|
16
41
|
@rcardinality ||= @node.at_xpath('.//xmlns:response_str/@rcardinality').value
|
17
42
|
end
|
43
|
+
|
44
|
+
def rce_raw
|
45
|
+
@rce_raw ||= @node.at_xpath('.//xmlns:response_str/@rce')&.value
|
46
|
+
end
|
18
47
|
end
|
19
48
|
end
|
20
49
|
end
|
@@ -27,6 +27,14 @@ module Qti
|
|
27
27
|
def scoring_data_structs
|
28
28
|
{ value: '' }
|
29
29
|
end
|
30
|
+
|
31
|
+
def allowed_types
|
32
|
+
@allowed_types ||= @node.at_xpath('.//xmlns:presentation/@allowed_types')&.value
|
33
|
+
end
|
34
|
+
|
35
|
+
def files_count
|
36
|
+
@files_count ||= @node.at_xpath('.//xmlns:presentation/@files_count')&.value
|
37
|
+
end
|
30
38
|
end
|
31
39
|
end
|
32
40
|
end
|
data/lib/qti/version.rb
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
<?xml version="1.0"encoding="UTF-8"?>
|
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
|
+
<assessment title="1.2 Import Quiz" ident="A1001">
|
4
|
+
<section title="Main" ident="S1002">
|
5
|
+
<item ident="d74b47a4abeeed159e030bfecbcecea2" title="My question title">
|
6
|
+
<itemmetadata>
|
7
|
+
<qtimetadata>
|
8
|
+
<qtimetadatafield>
|
9
|
+
<fieldlabel>question_type</fieldlabel>
|
10
|
+
<fieldentry>multiple_choice_question</fieldentry>
|
11
|
+
</qtimetadatafield>
|
12
|
+
<qtimetadatafield>
|
13
|
+
<fieldlabel>points_possible</fieldlabel>
|
14
|
+
<fieldentry>10.0</fieldentry>
|
15
|
+
</qtimetadatafield>
|
16
|
+
<qtimetadatafield>
|
17
|
+
<fieldlabel>original_answer_ids</fieldlabel>
|
18
|
+
<fieldentry>93bbcb84-3281-4d99-b243-79ba4051e654,3cd6d311-07cd-4ec0-b2db-3048e6cf1128</fieldentry>
|
19
|
+
</qtimetadatafield>
|
20
|
+
<qtimetadatafield>
|
21
|
+
<fieldlabel>assessment_question_identifierref</fieldlabel>
|
22
|
+
<fieldentry>9f47365e112840d80a79a960b1b0b6a7</fieldentry>
|
23
|
+
</qtimetadatafield>
|
24
|
+
<qtimetadatafield>
|
25
|
+
<fieldlabel>calculator_type</fieldlabel>
|
26
|
+
<fieldentry>none</fieldentry>
|
27
|
+
</qtimetadatafield>
|
28
|
+
</qtimetadata>
|
29
|
+
</itemmetadata>
|
30
|
+
<presentation>
|
31
|
+
<material>
|
32
|
+
<mattext texttype="text/html"><p>the correct answer is letter A</p></mattext>
|
33
|
+
</material>
|
34
|
+
<response_lid ident="response1" rcardinality="Single">
|
35
|
+
<render_choice>
|
36
|
+
<response_label ident="93bbcb84-3281-4d99-b243-79ba4051e654">
|
37
|
+
<material>
|
38
|
+
<mattext texttype="text/html">A</mattext>
|
39
|
+
</material>
|
40
|
+
</response_label>
|
41
|
+
<response_label ident="3cd6d311-07cd-4ec0-b2db-3048e6cf1128">
|
42
|
+
<material>
|
43
|
+
<mattext texttype="text/html">B</mattext>
|
44
|
+
</material>
|
45
|
+
</response_label>
|
46
|
+
</render_choice>
|
47
|
+
</response_lid>
|
48
|
+
</presentation>
|
49
|
+
<resprocessing>
|
50
|
+
<outcomes>
|
51
|
+
<decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
|
52
|
+
</outcomes>
|
53
|
+
<respcondition>
|
54
|
+
<conditionvar>
|
55
|
+
<varequal respident="response1">93bbcb84-3281-4d99-b243-79ba4051e654</varequal>
|
56
|
+
</conditionvar>
|
57
|
+
<setvar action="Set" varname="SCORE">10.0</setvar>
|
58
|
+
</respcondition>
|
59
|
+
<respcondition correctanswer="Yes">
|
60
|
+
<conditionvar>
|
61
|
+
<varequal respident="response1">3cd6d311-07cd-4ec0-b2db-3048e6cf1128</varequal>
|
62
|
+
</conditionvar>
|
63
|
+
<setvar action="Set" varname="SCORE">5.0</setvar>
|
64
|
+
</respcondition>
|
65
|
+
</resprocessing>
|
66
|
+
</item>
|
67
|
+
</section>
|
68
|
+
</assessment>
|
69
|
+
</questestinterop>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
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
|
+
<item ident="if15fb877c2cde9a14437aa7429360ac6" title="First Essay">
|
4
|
+
<presentation>
|
5
|
+
<material>
|
6
|
+
<mattext texttype="text/html">
|
7
|
+
<div><p>Here is an essay question.</p></div>
|
8
|
+
</mattext>
|
9
|
+
</material>
|
10
|
+
<response_str ident="response1" rcardinality="Single" rce="No" word_count="Yes" spell_check="Yes" word_limit_max="500" word_limit_min="140" word_limit_enabled="Yes">
|
11
|
+
<render_fib>
|
12
|
+
<response_label ident="answer1" rshuffle="No"/>
|
13
|
+
</render_fib>
|
14
|
+
</response_str>
|
15
|
+
</presentation>
|
16
|
+
<resprocessing>
|
17
|
+
<outcomes>
|
18
|
+
<decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
|
19
|
+
</outcomes>
|
20
|
+
<respcondition continue="No">
|
21
|
+
<conditionvar>
|
22
|
+
<other/>
|
23
|
+
</conditionvar>
|
24
|
+
</respcondition>
|
25
|
+
</resprocessing>
|
26
|
+
</item>
|
27
|
+
</questestinterop>
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
|
2
|
+
<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv1p2.dtd" [
|
3
|
+
<!-- This is an IMS test extension for OBJECT rendering. -->
|
4
|
+
<!ELEMENT ims_render_object (flow_label+)>
|
5
|
+
<!ATTLIST ims_render_object
|
6
|
+
shuffle (Yes|No) 'No'
|
7
|
+
orientation (Row|Column) #REQUIRED >
|
8
|
+
]>
|
9
|
+
|
10
|
+
<!-- Author: Colin Smythe -->
|
11
|
+
|
12
|
+
<!-- Date: 22nd January, 2002 -->
|
13
|
+
|
14
|
+
<!-- Version 1.2 Compliant Example: BasicExample009b -->
|
15
|
+
|
16
|
+
<!-- Basic Example with response processing. -->
|
17
|
+
<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">
|
18
|
+
<qticomment>This is a standard ordering of a list of words. Ordered response processing is demonstrated.</qticomment>
|
19
|
+
<item title = "Standard Object Ordering of text Item" ident = "IMS_V01_I_BasicExample009b">
|
20
|
+
<presentation label = "BasicExample009b">
|
21
|
+
<flow>
|
22
|
+
<material>
|
23
|
+
<mattext>What is the correct order for the days of the week ?</mattext>
|
24
|
+
</material>
|
25
|
+
<response_lid ident = "OB01" rcardinality = "Ordered" rtiming = "No">
|
26
|
+
<render_extension>
|
27
|
+
<ims_render_object shuffle = "No" orientation = "Row">
|
28
|
+
<flow_label>
|
29
|
+
<response_label ident = "A">
|
30
|
+
<material>
|
31
|
+
<mattext>Monday</mattext>
|
32
|
+
</material>
|
33
|
+
</response_label>
|
34
|
+
<response_label ident = "B">
|
35
|
+
<material>
|
36
|
+
<mattext>Tuesday</mattext>
|
37
|
+
</material>
|
38
|
+
</response_label>
|
39
|
+
<response_label ident = "C">
|
40
|
+
<material>
|
41
|
+
<mattext>Friday</mattext>
|
42
|
+
</material>
|
43
|
+
</response_label>
|
44
|
+
<response_label ident = "D">
|
45
|
+
<material>
|
46
|
+
<mattext>Thursday</mattext>
|
47
|
+
</material>
|
48
|
+
</response_label>
|
49
|
+
<response_label ident = "E">
|
50
|
+
<material>
|
51
|
+
<mattext>Wednesday</mattext>
|
52
|
+
</material>
|
53
|
+
</response_label>
|
54
|
+
</flow_label>
|
55
|
+
</ims_render_object>
|
56
|
+
</render_extension>
|
57
|
+
</response_lid>
|
58
|
+
</flow>
|
59
|
+
</presentation>
|
60
|
+
<resprocessing>
|
61
|
+
<outcomes>
|
62
|
+
<decvar varname = "ORDERSCORE" vartype = "Integer" defaultval = "1"/>
|
63
|
+
</outcomes>
|
64
|
+
<respcondition>
|
65
|
+
<qticomment>Scoring for the correct answer where the order is important.</qticomment>
|
66
|
+
<conditionvar>
|
67
|
+
<varequal respident = "OB01">A</varequal>
|
68
|
+
<varequal respident = "OB01">B</varequal>
|
69
|
+
<varequal respident = "OB01">E</varequal>
|
70
|
+
<varequal respident = "OB01">D</varequal>
|
71
|
+
<varequal respident = "OB01">C</varequal>
|
72
|
+
</conditionvar>
|
73
|
+
<setvar action = "Add" varname = "SCORE1"> 5 </setvar>
|
74
|
+
<displayfeedback feedbacktype = "Response" linkrefid = "Correct"/>
|
75
|
+
</respcondition>
|
76
|
+
</resprocessing>
|
77
|
+
<itemfeedback ident = "Correct" view = "Candidate">
|
78
|
+
<flow_mat>
|
79
|
+
<material>
|
80
|
+
<mattext>Yes, the correct order.</mattext>
|
81
|
+
</material>
|
82
|
+
</flow_mat>
|
83
|
+
</itemfeedback>
|
84
|
+
</item>
|
85
|
+
</questestinterop>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
</material>
|
25
25
|
<response_lid ident = "OB01" rcardinality = "Ordered" rtiming = "No">
|
26
26
|
<render_extension>
|
27
|
-
<ims_render_object shuffle = "No"
|
27
|
+
<ims_render_object shuffle = "No">
|
28
28
|
<flow_label>
|
29
29
|
<response_label ident = "A">
|
30
30
|
<material>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
|
2
|
+
<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv1p2.dtd" [
|
3
|
+
<!-- This is an IMS test extension for OBJECT rendering. -->
|
4
|
+
<!ELEMENT ims_render_object (flow_label+)>
|
5
|
+
<!ATTLIST ims_render_object
|
6
|
+
shuffle (Yes|No) 'No'
|
7
|
+
orientation (Row|Column) #REQUIRED >
|
8
|
+
]>
|
9
|
+
|
10
|
+
<!-- Author: Colin Smythe -->
|
11
|
+
|
12
|
+
<!-- Date: 22nd January, 2002 -->
|
13
|
+
|
14
|
+
<!-- Version 1.2 Compliant Example: BasicExample009b -->
|
15
|
+
|
16
|
+
<!-- Basic Example with response processing. -->
|
17
|
+
<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">
|
18
|
+
<qticomment>This is a standard ordering of a list of words. Ordered response processing is demonstrated.</qticomment>
|
19
|
+
<item title = "Standard Object Ordering of text Item" ident = "IMS_V01_I_BasicExample009b">
|
20
|
+
<presentation label = "BasicExample009b">
|
21
|
+
<flow>
|
22
|
+
<material>
|
23
|
+
<mattext>What is the correct order for the days of the week ?</mattext>
|
24
|
+
</material>
|
25
|
+
<response_lid ident = "OB01" rcardinality = "Ordered" rtiming = "No">
|
26
|
+
<render_extension>
|
27
|
+
<material position="top">
|
28
|
+
<mattext>This is the top label</mattext>
|
29
|
+
</material>
|
30
|
+
<ims_render_object shuffle = "No" orientation = "Row">
|
31
|
+
<flow_label>
|
32
|
+
<response_label ident = "A">
|
33
|
+
<material>
|
34
|
+
<mattext>Monday</mattext>
|
35
|
+
</material>
|
36
|
+
</response_label>
|
37
|
+
<response_label ident = "B">
|
38
|
+
<material>
|
39
|
+
<mattext>Tuesday</mattext>
|
40
|
+
</material>
|
41
|
+
</response_label>
|
42
|
+
<response_label ident = "C">
|
43
|
+
<material>
|
44
|
+
<mattext>Friday</mattext>
|
45
|
+
</material>
|
46
|
+
</response_label>
|
47
|
+
<response_label ident = "D">
|
48
|
+
<material>
|
49
|
+
<mattext>Thursday</mattext>
|
50
|
+
</material>
|
51
|
+
</response_label>
|
52
|
+
<response_label ident = "E">
|
53
|
+
<material>
|
54
|
+
<mattext>Wednesday</mattext>
|
55
|
+
</material>
|
56
|
+
</response_label>
|
57
|
+
</flow_label>
|
58
|
+
</ims_render_object>
|
59
|
+
<material position="bottom">
|
60
|
+
<mattext>This is the bottom label</mattext>
|
61
|
+
</material>
|
62
|
+
</render_extension>
|
63
|
+
</response_lid>
|
64
|
+
</flow>
|
65
|
+
</presentation>
|
66
|
+
<resprocessing>
|
67
|
+
<outcomes>
|
68
|
+
<decvar varname = "ORDERSCORE" vartype = "Integer" defaultval = "1"/>
|
69
|
+
</outcomes>
|
70
|
+
<respcondition>
|
71
|
+
<qticomment>Scoring for the correct answer where the order is important.</qticomment>
|
72
|
+
<conditionvar>
|
73
|
+
<varequal respident = "OB01">A</varequal>
|
74
|
+
<varequal respident = "OB01">B</varequal>
|
75
|
+
<varequal respident = "OB01">E</varequal>
|
76
|
+
<varequal respident = "OB01">D</varequal>
|
77
|
+
<varequal respident = "OB01">C</varequal>
|
78
|
+
</conditionvar>
|
79
|
+
<setvar action = "Add" varname = "SCORE1"> 5 </setvar>
|
80
|
+
<displayfeedback feedbacktype = "Response" linkrefid = "Correct"/>
|
81
|
+
</respcondition>
|
82
|
+
</resprocessing>
|
83
|
+
<itemfeedback ident = "Correct" view = "Candidate">
|
84
|
+
<flow_mat>
|
85
|
+
<material>
|
86
|
+
<mattext>Yes, the correct order.</mattext>
|
87
|
+
</material>
|
88
|
+
</flow_mat>
|
89
|
+
</itemfeedback>
|
90
|
+
</item>
|
91
|
+
</questestinterop>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
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
|
+
<qtimetadata>
|
4
|
+
<qtimetadatafield>
|
5
|
+
<fieldlabel>cc_maxattempts</fieldlabel>
|
6
|
+
<fieldentry>1</fieldentry>
|
7
|
+
</qtimetadatafield>
|
8
|
+
</qtimetadata>
|
9
|
+
<section ident="root_section">
|
10
|
+
<item ident="i53d46f6a4edbfcefd662489e9f2a970a" title="Question">
|
11
|
+
<itemmetadata>
|
12
|
+
<qtimetadata>
|
13
|
+
<qtimetadatafield>
|
14
|
+
<fieldlabel>question_type</fieldlabel>
|
15
|
+
<fieldentry>file_upload_question</fieldentry>
|
16
|
+
</qtimetadatafield>
|
17
|
+
<qtimetadatafield>
|
18
|
+
<fieldlabel>points_possible</fieldlabel>
|
19
|
+
<fieldentry>1.0</fieldentry>
|
20
|
+
</qtimetadatafield>
|
21
|
+
<qtimetadatafield>
|
22
|
+
<fieldlabel>assessment_question_identifierref</fieldlabel>
|
23
|
+
<fieldentry>i2b5557c31dcad5441b956ebb83d06915</fieldentry>
|
24
|
+
</qtimetadatafield>
|
25
|
+
</qtimetadata>
|
26
|
+
</itemmetadata>
|
27
|
+
<presentation allowed_types="png,jpeg" files_count="2">
|
28
|
+
<material>
|
29
|
+
<mattext texttype="text/html">Upload a file that is a CSV</mattext>
|
30
|
+
</material>
|
31
|
+
</presentation>
|
32
|
+
</item>
|
33
|
+
</section>
|
34
|
+
</questestinterop>
|
@@ -244,4 +244,26 @@ describe Qti::V1::Models::AssessmentItem do
|
|
244
244
|
end
|
245
245
|
end
|
246
246
|
end
|
247
|
+
|
248
|
+
context 'multiple choice with "vary points by answer"' do
|
249
|
+
let(:file_path) { File.join('spec', 'fixtures', 'items_1.2', 'choice_vary_points_by_answer.xml') }
|
250
|
+
let(:test_object) { Qti::V1::Models::Assessment.from_path!(file_path) }
|
251
|
+
let(:assessment_item_refs) { test_object.assessment_items }
|
252
|
+
let(:loaded_class) { described_class.new(assessment_item_refs.first) }
|
253
|
+
|
254
|
+
describe '#scoring_data_structs' do
|
255
|
+
it 'collects all the correct answers' do
|
256
|
+
struct = loaded_class.scoring_data_structs
|
257
|
+
expect(struct.size).to eq 2
|
258
|
+
expect(struct.map(&:values)).to eq %w[93bbcb84-3281-4d99-b243-79ba4051e654 3cd6d311-07cd-4ec0-b2db-3048e6cf1128]
|
259
|
+
end
|
260
|
+
|
261
|
+
it 'collect all the points answer points' do
|
262
|
+
struct = loaded_class.scoring_data_structs
|
263
|
+
expect(struct.size).to eq 2
|
264
|
+
expect(struct.map(&:scoring_options)).to eq([{ 'points' => 10.0 },
|
265
|
+
{ 'points' => 5.0, 'correct_answer' => true }])
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
247
269
|
end
|
@@ -10,6 +10,54 @@ describe Qti::V1::Models::Interactions::OrderingInteraction do
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
describe '.top_label' do
|
14
|
+
context 'when the item does not have a top label' do
|
15
|
+
it 'returns nil' do
|
16
|
+
expect(subject.top_label).to be_nil
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when the item has a top label' do
|
21
|
+
let(:file) { File.join('spec', 'fixtures', 'items_1.2', 'ordering_with_labels.xml') }
|
22
|
+
|
23
|
+
it 'returns the right bottom label' do
|
24
|
+
expect(subject.top_label).to eq('This is the top label')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '.bottom label' do
|
30
|
+
context 'when the item does not have a bottom label' do
|
31
|
+
it 'returns the right bottom label' do
|
32
|
+
expect(subject.bottom_label).to be_nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'when the item has a bottom label' do
|
37
|
+
let(:file) { File.join('spec', 'fixtures', 'items_1.2', 'ordering_with_labels.xml') }
|
38
|
+
|
39
|
+
it 'returns the right bottom label' do
|
40
|
+
expect(subject.bottom_label).to eq('This is the bottom label')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '.display_answers_paragraph' do
|
46
|
+
context 'when the ordering item orientation is set to "Row"' do
|
47
|
+
let(:file) { File.join('spec', 'fixtures', 'items_1.2', 'ordering.row.xml') }
|
48
|
+
|
49
|
+
it 'returns true' do
|
50
|
+
expect(subject.display_answers_paragraph).to eq(true)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when the ordering item orientation is not set to "Row"' do
|
55
|
+
it 'returns false' do
|
56
|
+
expect(subject.display_answers_paragraph).to eq(false)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
13
61
|
describe '#scoring_data_structs' do
|
14
62
|
it 'grabs scoring data value for ordering questions' do
|
15
63
|
assessment_item = described_class.new(assessment.assessment_items.first, assessment)
|
@@ -8,8 +8,28 @@ describe Qti::V1::Models::Interactions::StringInteraction do
|
|
8
8
|
let(:file_path) { File.join(fixtures_path, 'essay.xml') }
|
9
9
|
let(:cardinality) { 'Single' }
|
10
10
|
|
11
|
-
it 'returns
|
11
|
+
it 'returns the correct cardinality' do
|
12
12
|
expect(loaded_class.send(:rcardinality)).to eq(cardinality)
|
13
13
|
end
|
14
|
+
|
15
|
+
it 'returns the correct settings' do
|
16
|
+
expect(loaded_class.rce).to eq(true)
|
17
|
+
expect(loaded_class.word_count).to eq(false)
|
18
|
+
expect(loaded_class.spell_check).to eq(false)
|
19
|
+
expect(loaded_class.word_limit_max).to be_nil
|
20
|
+
expect(loaded_class.word_limit_min).to be_nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'essay.xml question with custom settings' do
|
25
|
+
let(:file_path) { File.join(fixtures_path, 'essay_custom_settings.xml') }
|
26
|
+
|
27
|
+
it 'returns the correct settings' do
|
28
|
+
expect(loaded_class.rce).to eq(false)
|
29
|
+
expect(loaded_class.word_count).to eq(true)
|
30
|
+
expect(loaded_class.spell_check).to eq(true)
|
31
|
+
expect(loaded_class.word_limit_max).to eq('500')
|
32
|
+
expect(loaded_class.word_limit_min).to eq('140')
|
33
|
+
end
|
14
34
|
end
|
15
35
|
end
|
@@ -26,5 +26,19 @@ describe Qti::V1::Models::Interactions::UploadInteraction do
|
|
26
26
|
)
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
it 'returns the correct settings' do
|
31
|
+
expect(loaded_class.allowed_types).to be_nil
|
32
|
+
expect(loaded_class.files_count).to be_nil
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with custom settings' do
|
36
|
+
let(:file_path) { File.join(fixtures_path, 'upload_with_custom_settings.xml') }
|
37
|
+
|
38
|
+
it 'returns the correct settings' do
|
39
|
+
expect(loaded_class.allowed_types).to eq('png,jpeg')
|
40
|
+
expect(loaded_class.files_count).to eq('2')
|
41
|
+
end
|
42
|
+
end
|
29
43
|
end
|
30
44
|
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.
|
4
|
+
version: 2.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Diaz
|
@@ -402,7 +402,9 @@ files:
|
|
402
402
|
- spec/fixtures/items_1.2/canvas_multiple_fib_extra_brackets.xml
|
403
403
|
- spec/fixtures/items_1.2/categorization.xml
|
404
404
|
- spec/fixtures/items_1.2/choice.xml
|
405
|
+
- spec/fixtures/items_1.2/choice_vary_points_by_answer.xml
|
405
406
|
- spec/fixtures/items_1.2/essay.xml
|
407
|
+
- spec/fixtures/items_1.2/essay_custom_settings.xml
|
406
408
|
- spec/fixtures/items_1.2/fib.xml
|
407
409
|
- spec/fixtures/items_1.2/fib_feedback.xml
|
408
410
|
- spec/fixtures/items_1.2/fib_str.xml
|
@@ -426,7 +428,9 @@ files:
|
|
426
428
|
- spec/fixtures/items_1.2/numeric_precision.xml
|
427
429
|
- spec/fixtures/items_1.2/numeric_precision_decimals.xml
|
428
430
|
- spec/fixtures/items_1.2/numeric_within_range.xml
|
431
|
+
- spec/fixtures/items_1.2/ordering.row.xml
|
429
432
|
- spec/fixtures/items_1.2/ordering.xml
|
433
|
+
- spec/fixtures/items_1.2/ordering_with_labels.xml
|
430
434
|
- spec/fixtures/items_1.2/question_group.xml
|
431
435
|
- spec/fixtures/items_1.2/single_fib.xml
|
432
436
|
- spec/fixtures/items_1.2/stimulus.xml
|
@@ -435,6 +439,7 @@ files:
|
|
435
439
|
- spec/fixtures/items_1.2/true_false.xml
|
436
440
|
- spec/fixtures/items_1.2/true_false_with_calculator.xml
|
437
441
|
- spec/fixtures/items_1.2/upload.xml
|
442
|
+
- spec/fixtures/items_1.2/upload_with_custom_settings.xml
|
438
443
|
- spec/fixtures/items_2.1/Example02-feedbackInline.xml
|
439
444
|
- spec/fixtures/items_2.1/categorization.xml
|
440
445
|
- spec/fixtures/items_2.1/choice.xml
|
@@ -777,7 +782,9 @@ test_files:
|
|
777
782
|
- spec/fixtures/items_1.2/canvas_multiple_fib_extra_brackets.xml
|
778
783
|
- spec/fixtures/items_1.2/categorization.xml
|
779
784
|
- spec/fixtures/items_1.2/choice.xml
|
785
|
+
- spec/fixtures/items_1.2/choice_vary_points_by_answer.xml
|
780
786
|
- spec/fixtures/items_1.2/essay.xml
|
787
|
+
- spec/fixtures/items_1.2/essay_custom_settings.xml
|
781
788
|
- spec/fixtures/items_1.2/fib.xml
|
782
789
|
- spec/fixtures/items_1.2/fib_feedback.xml
|
783
790
|
- spec/fixtures/items_1.2/fib_str.xml
|
@@ -801,7 +808,9 @@ test_files:
|
|
801
808
|
- spec/fixtures/items_1.2/numeric_precision.xml
|
802
809
|
- spec/fixtures/items_1.2/numeric_precision_decimals.xml
|
803
810
|
- spec/fixtures/items_1.2/numeric_within_range.xml
|
811
|
+
- spec/fixtures/items_1.2/ordering.row.xml
|
804
812
|
- spec/fixtures/items_1.2/ordering.xml
|
813
|
+
- spec/fixtures/items_1.2/ordering_with_labels.xml
|
805
814
|
- spec/fixtures/items_1.2/question_group.xml
|
806
815
|
- spec/fixtures/items_1.2/single_fib.xml
|
807
816
|
- spec/fixtures/items_1.2/stimulus.xml
|
@@ -810,6 +819,7 @@ test_files:
|
|
810
819
|
- spec/fixtures/items_1.2/true_false.xml
|
811
820
|
- spec/fixtures/items_1.2/true_false_with_calculator.xml
|
812
821
|
- spec/fixtures/items_1.2/upload.xml
|
822
|
+
- spec/fixtures/items_1.2/upload_with_custom_settings.xml
|
813
823
|
- spec/fixtures/items_2.1/Example02-feedbackInline.xml
|
814
824
|
- spec/fixtures/items_2.1/categorization.xml
|
815
825
|
- spec/fixtures/items_2.1/choice.xml
|