qti 2.4.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/qti/models/assessment_meta.rb +6 -2
- data/lib/qti/v1/models/assessment.rb +4 -0
- data/lib/qti/v1/models/assessment_item.rb +4 -0
- data/lib/qti/v1/models/interactions/base_fill_blank_interaction.rb +33 -1
- data/lib/qti/v1/models/interactions/canvas_multiple_dropdown.rb +2 -29
- data/lib/qti/v1/models/object_bank.rb +4 -0
- data/lib/qti/v2/models/assessment_test.rb +4 -0
- data/lib/qti/version.rb +1 -1
- data/spec/fixtures/items_1.2/canvas_multiple_fib_extra_brackets.xml +244 -0
- data/spec/lib/qti/models/assessment_meta_spec.rb +5 -0
- data/spec/lib/qti/v1/models/assessment_spec.rb +9 -0
- data/spec/lib/qti/v1/models/interactions/base_fill_blank_interaction_spec.rb +146 -0
- data/spec/lib/qti/v1/models/interactions/canvas_multiple_dropdown_spec.rb +0 -27
- data/spec/lib/qti/v1/models/object_bank_spec.rb +25 -13
- data/spec/lib/qti/v2/models/assessment_test_spec.rb +4 -0
- metadata +7 -10
- data/spec/gemfiles/rails-5.1.gemfile.lock +0 -212
- data/spec/gemfiles/rails-5.2.gemfile.lock +0 -220
- data/spec/gemfiles/rails-6.0.gemfile.lock +0 -236
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cb32e14ee86e7c85cf22b461d411e17321ebe7a96c5727fd78df4f70adee12f0
|
4
|
+
data.tar.gz: 40d79b54aa1c73109512a9b40761ca2d9af1e71bfddca3881d4a8bd921dad381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14938cdfe0af943580f0d6af4429b0942a57e8f2b6c5083a65efa49832b6b01fd063444ab5a7a5b51416f12603698d799e62f00cc1aacfb120580e2ca31cf7fd
|
7
|
+
data.tar.gz: bce723b2da53fa956f2ae7b7f76d8ce6ae24fd253e991016ddfc049ff7c9618255e6e9979b0e0d233ff6176d1b2a4d65ae2744e36b108f59dab9e4be2db8892a
|
@@ -37,10 +37,14 @@ module Qti
|
|
37
37
|
points_possible_raw.to_f
|
38
38
|
end
|
39
39
|
|
40
|
-
def
|
40
|
+
def show_correct_answers
|
41
41
|
tag_under_quiz('show_correct_answers')
|
42
42
|
end
|
43
43
|
|
44
|
+
def show_correct_answers?
|
45
|
+
string_true?(show_correct_answers)
|
46
|
+
end
|
47
|
+
|
44
48
|
def anonymous_submissions
|
45
49
|
tag_under_quiz('anonymous_submissions')
|
46
50
|
end
|
@@ -217,7 +221,7 @@ module Qti
|
|
217
221
|
:show_correct_answers_at, :hide_correct_answers_at,
|
218
222
|
:lock_at, :unlock_at, :due_at, :require_lockdown_browser?,
|
219
223
|
:require_lockdown_browser_for_results?,
|
220
|
-
:require_lockdown_browser_monitor?,
|
224
|
+
:require_lockdown_browser_monitor?, :show_correct_answers?,
|
221
225
|
:lockdown_browser_monitor_data,
|
222
226
|
to: :@canvas_meta_data, prefix: :canvas, allow_nil: true
|
223
227
|
|
@@ -6,6 +6,10 @@ module Qti
|
|
6
6
|
|
7
7
|
GROUP_ID = 'xmlns:section/xmlns:selection_ordering'.freeze
|
8
8
|
|
9
|
+
def identifier
|
10
|
+
@identifier ||= xpath_with_single_check('.//xmlns:assessment/@ident')&.content
|
11
|
+
end
|
12
|
+
|
9
13
|
def title
|
10
14
|
@title ||= xpath_with_single_check('.//xmlns:assessment/@title')&.content || File.basename(@path, '.xml')
|
11
15
|
end
|
@@ -7,7 +7,7 @@ module Qti
|
|
7
7
|
|
8
8
|
def canvas_stem_items(item_prompt)
|
9
9
|
item_prompt.split(CANVAS_REGEX).map.with_index do |stem_item, index|
|
10
|
-
if stem_item
|
10
|
+
if canvas_fib_response_ids.include?(stem_item)
|
11
11
|
# Strip the brackets before searching
|
12
12
|
stem_blank(index, canvas_blank_id(stem_item[1..-2]))
|
13
13
|
else
|
@@ -43,6 +43,38 @@ module Qti
|
|
43
43
|
end
|
44
44
|
blank_id
|
45
45
|
end
|
46
|
+
|
47
|
+
def canvas_fib_responses
|
48
|
+
@base_canvas_blanks ||= node.xpath('.//xmlns:response_lid').map do |resp|
|
49
|
+
index = 0
|
50
|
+
{
|
51
|
+
id: resp[:ident],
|
52
|
+
choices:
|
53
|
+
resp.xpath('.//xmlns:response_label').map do |bnode|
|
54
|
+
canvas_blank_choice(bnode, index += 1)
|
55
|
+
end
|
56
|
+
}
|
57
|
+
end
|
58
|
+
@base_canvas_blanks
|
59
|
+
end
|
60
|
+
|
61
|
+
def canvas_fib_response_ids
|
62
|
+
@canvas_fib_response_ids ||= canvas_fib_responses.map { |b| "[#{b[:id].sub(/^response_/, '')}]" }
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def canvas_blank_choice(bnode, index)
|
68
|
+
bnode_id = bnode[:ident]
|
69
|
+
choice = {
|
70
|
+
id: bnode_id,
|
71
|
+
position: index + 1,
|
72
|
+
item_body: bnode.at_xpath('.//xmlns:mattext').text
|
73
|
+
}
|
74
|
+
@blank_choices ||= {}
|
75
|
+
@blank_choices[bnode_id] = choice
|
76
|
+
choice
|
77
|
+
end
|
46
78
|
end
|
47
79
|
end
|
48
80
|
end
|
@@ -14,19 +14,6 @@ module Qti
|
|
14
14
|
canvas_stem_items(node.at_xpath('.//xmlns:presentation/xmlns:material/xmlns:mattext').text)
|
15
15
|
end
|
16
16
|
|
17
|
-
def blanks
|
18
|
-
@blanks = node.xpath('.//xmlns:response_lid').map do |resp|
|
19
|
-
index = 0
|
20
|
-
{
|
21
|
-
id: resp[:ident],
|
22
|
-
choices:
|
23
|
-
resp.xpath('.//xmlns:response_label').map do |bnode|
|
24
|
-
blank_choice(bnode, index += 1)
|
25
|
-
end
|
26
|
-
}
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
17
|
def scoring_data_structs
|
31
18
|
answers.map do |answer|
|
32
19
|
ScoringData.new(
|
@@ -42,12 +29,12 @@ module Qti
|
|
42
29
|
end
|
43
30
|
|
44
31
|
def text_for_entry(entry_id)
|
45
|
-
|
32
|
+
canvas_fib_responses
|
46
33
|
@blank_choices[entry_id][:item_body]
|
47
34
|
end
|
48
35
|
|
49
36
|
def position_for_entry(entry_id)
|
50
|
-
|
37
|
+
canvas_fib_responses
|
51
38
|
@blank_choices[entry_id][:position]
|
52
39
|
end
|
53
40
|
|
@@ -63,20 +50,6 @@ module Qti
|
|
63
50
|
}
|
64
51
|
end
|
65
52
|
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def blank_choice(bnode, index)
|
70
|
-
bnode_id = bnode[:ident]
|
71
|
-
choice = {
|
72
|
-
id: bnode_id,
|
73
|
-
position: index + 1,
|
74
|
-
item_body: bnode.at_xpath('.//xmlns:mattext').text
|
75
|
-
}
|
76
|
-
@blank_choices ||= {}
|
77
|
-
@blank_choices[bnode_id] = choice
|
78
|
-
choice
|
79
|
-
end
|
80
53
|
end
|
81
54
|
end
|
82
55
|
end
|
@@ -8,6 +8,10 @@ module Qti
|
|
8
8
|
'.//xmlns:qtimetadatafield/xmlns:fieldlabel[text()="bank_title"]/../xmlns:fieldentry'
|
9
9
|
)&.content || File.basename(@path, '.xml')
|
10
10
|
end
|
11
|
+
|
12
|
+
def identifier
|
13
|
+
@identifier ||= xpath_with_single_check('.//xmlns:objectbank/@ident')&.content
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
@@ -5,6 +5,10 @@ module Qti
|
|
5
5
|
include Qti::Models::AssessmentMetaBase
|
6
6
|
include Qti::XPathHelpers
|
7
7
|
|
8
|
+
def identifier
|
9
|
+
@identifier ||= xpath_with_single_check('//xmlns:assessmentTest/@identifier')&.content
|
10
|
+
end
|
11
|
+
|
8
12
|
def title
|
9
13
|
@title ||= xpath_with_single_check('//xmlns:assessmentTest/@title')&.content || File.basename(@path, '.xml')
|
10
14
|
end
|
data/lib/qti/version.rb
CHANGED
@@ -0,0 +1,244 @@
|
|
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="gdc445634f8b3e063eb009700326194e9" title="L2Q2RUnit8q1">
|
4
|
+
<itemmetadata>
|
5
|
+
<qtimetadata>
|
6
|
+
<qtimetadatafield>
|
7
|
+
<fieldlabel>question_type</fieldlabel>
|
8
|
+
<fieldentry>multiple_dropdowns_question</fieldentry>
|
9
|
+
</qtimetadatafield>
|
10
|
+
<qtimetadatafield>
|
11
|
+
<fieldlabel>points_possible</fieldlabel>
|
12
|
+
<fieldentry>7.0</fieldentry>
|
13
|
+
</qtimetadatafield>
|
14
|
+
<qtimetadatafield>
|
15
|
+
<fieldlabel>original_answer_ids</fieldlabel>
|
16
|
+
<fieldentry>8464,265,3002,1356,5614,4002,8630,7844,3602,9525,8390,8745,3760,7542,1523,3317,6768,5823,2492,4494,6742,794,4259,4851,8574</fieldentry>
|
17
|
+
</qtimetadatafield>
|
18
|
+
<qtimetadatafield>
|
19
|
+
<fieldlabel>assessment_question_identifierref</fieldlabel>
|
20
|
+
<fieldentry>gf47b767d37e06559ff801f2d253307ba</fieldentry>
|
21
|
+
</qtimetadatafield>
|
22
|
+
</qtimetadata>
|
23
|
+
</itemmetadata>
|
24
|
+
<presentation>
|
25
|
+
<material>
|
26
|
+
<mattext texttype="text/html"><div>
|
27
|
+
<p><strong><span data-contrast="none">LOREM </span></strong></p>
|
28
|
+
<p><strong><span data-contrast="none">Lorem ipsum dolor sit amet consecteur</span></strong><strong><span data-contrast="none">to</span></strong><strong><span data-contrast="none">? Write the letter of the correct paragraph</span></strong></p>
|
29
|
+
<p> </p>
|
30
|
+
<p><span data-contrast="none"><strong>A.</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in. </span></p>
|
31
|
+
<p><span data-contrast="none"><strong>B</strong>. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in. </span></p>
|
32
|
+
<p><span data-contrast="none"><strong>C</strong>. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </span></p>
|
33
|
+
<p><span data-contrast="none"><strong>D</strong>. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt. </span></p>
|
34
|
+
<p><span data-contrast="none"><strong>E</strong>. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in. </span></p>
|
35
|
+
<p><span data-ccp-props='{"201341983":0,"335559739":160,"335559740":240}'> </span><span data-contrast="none">1</span><span data-contrast="none">. L</span><i><span data-contrast="none">orem</span></i><i><span data-contrast="none"> impsum dolor / </span></i><i><span data-contrast="none">ppl</span></i><i><span data-contrast="none"> sit amet consectetur </span></i><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559685":1080,"335559739":160,"335559740":240,"335559991":1080}'> </span></p>
|
36
|
+
<p><span data-contrast="auto"> </span><span data-contrast="none">This note refers to paragraph </span><strong><span data-contrast="none">[1]</span></strong><strong><span data-contrast="auto"> </span></strong><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559685":1080,"335559739":160,"335559740":240}'> </span></p>
|
37
|
+
<p><span data-contrast="none">2</span><span data-contrast="none">. L</span><i><span data-contrast="none">orem</span></i><i><span data-contrast="none"> ipsum dolor sit amet / </span></i><i><span data-contrast="none">ppl</span></i><i><span data-contrast="none"> consectetur adipiscing</span></i><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559739":160,"335559740":240}'> </span></p>
|
38
|
+
<p><span data-contrast="auto"> </span><span data-contrast="none">This note refers to paragraph </span> <strong><span data-contrast="none">[2]</span></strong><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559685":1080,"335559739":160,"335559740":240}'> </span></p>
|
39
|
+
<p><span data-contrast="none">3</span><span data-contrast="none">. </span><i><span data-contrast="none">Lorem</span></i><i><span data-contrast="none"> ipsum dolor sit amet</span></i><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559685":1080,"335559739":160,"335559740":240,"335559991":1080}'> </span></p>
|
40
|
+
<p><span data-contrast="auto"> </span><span data-contrast="none">This note refers to paragraph </span><strong><span data-contrast="none">[3]</span></strong><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559685":1080,"335559739":160,"335559740":240}'> </span></p>
|
41
|
+
<p><span data-contrast="none">4</span><span data-contrast="none">. L</span><i><span data-contrast="none">orem</span></i><i><span data-contrast="none"> ipsum dolor sit amet consectetur</span></i><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559739":160,"335559740":240}'> </span></p>
|
42
|
+
<p><span data-contrast="auto"> </span><span data-contrast="none">This note refers to paragraph </span><strong><span data-contrast="none">[4]</span></strong></p>
|
43
|
+
<p><span data-contrast="none">5</span><span data-contrast="none">. L</span><i><span data-contrast="none">irst</span></i><i><span data-contrast="none"> orem ipsum dolor sit </span></i><i><span data-contrast="none">ppl</span></i><span data-contrast="auto"> </span><span data-ccp-props='{"134233117":true,"134233118":true,"201341983":0,"335559739":160,"335559740":240}'> </span></p>
|
44
|
+
<p><span data-contrast="auto"> </span><span data-contrast="none">This note refers to paragraph </span><strong><span data-contrast="none">[5]</span></strong></p>
|
45
|
+
</div></mattext>
|
46
|
+
</material>
|
47
|
+
<response_lid ident="response_1">
|
48
|
+
<material>
|
49
|
+
<mattext>1</mattext>
|
50
|
+
</material>
|
51
|
+
<render_choice>
|
52
|
+
<response_label ident="8464">
|
53
|
+
<material>
|
54
|
+
<mattext texttype="text/plain">A</mattext>
|
55
|
+
</material>
|
56
|
+
</response_label>
|
57
|
+
<response_label ident="265">
|
58
|
+
<material>
|
59
|
+
<mattext texttype="text/plain">B</mattext>
|
60
|
+
</material>
|
61
|
+
</response_label>
|
62
|
+
<response_label ident="3002">
|
63
|
+
<material>
|
64
|
+
<mattext texttype="text/plain">C</mattext>
|
65
|
+
</material>
|
66
|
+
</response_label>
|
67
|
+
<response_label ident="1356">
|
68
|
+
<material>
|
69
|
+
<mattext texttype="text/plain">D</mattext>
|
70
|
+
</material>
|
71
|
+
</response_label>
|
72
|
+
<response_label ident="5614">
|
73
|
+
<material>
|
74
|
+
<mattext texttype="text/plain">E</mattext>
|
75
|
+
</material>
|
76
|
+
</response_label>
|
77
|
+
</render_choice>
|
78
|
+
</response_lid>
|
79
|
+
<response_lid ident="response_2">
|
80
|
+
<material>
|
81
|
+
<mattext>2</mattext>
|
82
|
+
</material>
|
83
|
+
<render_choice>
|
84
|
+
<response_label ident="4002">
|
85
|
+
<material>
|
86
|
+
<mattext texttype="text/plain">A</mattext>
|
87
|
+
</material>
|
88
|
+
</response_label>
|
89
|
+
<response_label ident="8630">
|
90
|
+
<material>
|
91
|
+
<mattext texttype="text/plain">B</mattext>
|
92
|
+
</material>
|
93
|
+
</response_label>
|
94
|
+
<response_label ident="7844">
|
95
|
+
<material>
|
96
|
+
<mattext texttype="text/plain">C</mattext>
|
97
|
+
</material>
|
98
|
+
</response_label>
|
99
|
+
<response_label ident="3602">
|
100
|
+
<material>
|
101
|
+
<mattext texttype="text/plain">D</mattext>
|
102
|
+
</material>
|
103
|
+
</response_label>
|
104
|
+
<response_label ident="9525">
|
105
|
+
<material>
|
106
|
+
<mattext texttype="text/plain">E</mattext>
|
107
|
+
</material>
|
108
|
+
</response_label>
|
109
|
+
</render_choice>
|
110
|
+
</response_lid>
|
111
|
+
<response_lid ident="response_3">
|
112
|
+
<material>
|
113
|
+
<mattext>3</mattext>
|
114
|
+
</material>
|
115
|
+
<render_choice>
|
116
|
+
<response_label ident="8390">
|
117
|
+
<material>
|
118
|
+
<mattext texttype="text/plain">A</mattext>
|
119
|
+
</material>
|
120
|
+
</response_label>
|
121
|
+
<response_label ident="8745">
|
122
|
+
<material>
|
123
|
+
<mattext texttype="text/plain">B</mattext>
|
124
|
+
</material>
|
125
|
+
</response_label>
|
126
|
+
<response_label ident="3760">
|
127
|
+
<material>
|
128
|
+
<mattext texttype="text/plain">C</mattext>
|
129
|
+
</material>
|
130
|
+
</response_label>
|
131
|
+
<response_label ident="7542">
|
132
|
+
<material>
|
133
|
+
<mattext texttype="text/plain">D</mattext>
|
134
|
+
</material>
|
135
|
+
</response_label>
|
136
|
+
<response_label ident="1523">
|
137
|
+
<material>
|
138
|
+
<mattext texttype="text/plain">E</mattext>
|
139
|
+
</material>
|
140
|
+
</response_label>
|
141
|
+
</render_choice>
|
142
|
+
</response_lid>
|
143
|
+
<response_lid ident="response_4">
|
144
|
+
<material>
|
145
|
+
<mattext>4</mattext>
|
146
|
+
</material>
|
147
|
+
<render_choice>
|
148
|
+
<response_label ident="3317">
|
149
|
+
<material>
|
150
|
+
<mattext texttype="text/plain">A</mattext>
|
151
|
+
</material>
|
152
|
+
</response_label>
|
153
|
+
<response_label ident="6768">
|
154
|
+
<material>
|
155
|
+
<mattext texttype="text/plain">B</mattext>
|
156
|
+
</material>
|
157
|
+
</response_label>
|
158
|
+
<response_label ident="5823">
|
159
|
+
<material>
|
160
|
+
<mattext texttype="text/plain">C</mattext>
|
161
|
+
</material>
|
162
|
+
</response_label>
|
163
|
+
<response_label ident="2492">
|
164
|
+
<material>
|
165
|
+
<mattext texttype="text/plain">D</mattext>
|
166
|
+
</material>
|
167
|
+
</response_label>
|
168
|
+
<response_label ident="4494">
|
169
|
+
<material>
|
170
|
+
<mattext texttype="text/plain">E</mattext>
|
171
|
+
</material>
|
172
|
+
</response_label>
|
173
|
+
</render_choice>
|
174
|
+
</response_lid>
|
175
|
+
<response_lid ident="response_5">
|
176
|
+
<material>
|
177
|
+
<mattext>5</mattext>
|
178
|
+
</material>
|
179
|
+
<render_choice>
|
180
|
+
<response_label ident="6742">
|
181
|
+
<material>
|
182
|
+
<mattext texttype="text/plain">A</mattext>
|
183
|
+
</material>
|
184
|
+
</response_label>
|
185
|
+
<response_label ident="794">
|
186
|
+
<material>
|
187
|
+
<mattext texttype="text/plain">B</mattext>
|
188
|
+
</material>
|
189
|
+
</response_label>
|
190
|
+
<response_label ident="4259">
|
191
|
+
<material>
|
192
|
+
<mattext texttype="text/plain">C</mattext>
|
193
|
+
</material>
|
194
|
+
</response_label>
|
195
|
+
<response_label ident="4851">
|
196
|
+
<material>
|
197
|
+
<mattext texttype="text/plain">D</mattext>
|
198
|
+
</material>
|
199
|
+
</response_label>
|
200
|
+
<response_label ident="8574">
|
201
|
+
<material>
|
202
|
+
<mattext texttype="text/plain">E</mattext>
|
203
|
+
</material>
|
204
|
+
</response_label>
|
205
|
+
</render_choice>
|
206
|
+
</response_lid>
|
207
|
+
</presentation>
|
208
|
+
<resprocessing>
|
209
|
+
<outcomes>
|
210
|
+
<decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/>
|
211
|
+
</outcomes>
|
212
|
+
<respcondition>
|
213
|
+
<conditionvar>
|
214
|
+
<varequal respident="response_1">1356</varequal>
|
215
|
+
</conditionvar>
|
216
|
+
<setvar varname="SCORE" action="Add">20.00</setvar>
|
217
|
+
</respcondition>
|
218
|
+
<respcondition>
|
219
|
+
<conditionvar>
|
220
|
+
<varequal respident="response_2">9525</varequal>
|
221
|
+
</conditionvar>
|
222
|
+
<setvar varname="SCORE" action="Add">20.00</setvar>
|
223
|
+
</respcondition>
|
224
|
+
<respcondition>
|
225
|
+
<conditionvar>
|
226
|
+
<varequal respident="response_3">8745</varequal>
|
227
|
+
</conditionvar>
|
228
|
+
<setvar varname="SCORE" action="Add">20.00</setvar>
|
229
|
+
</respcondition>
|
230
|
+
<respcondition>
|
231
|
+
<conditionvar>
|
232
|
+
<varequal respident="response_4">5823</varequal>
|
233
|
+
</conditionvar>
|
234
|
+
<setvar varname="SCORE" action="Add">20.00</setvar>
|
235
|
+
</respcondition>
|
236
|
+
<respcondition>
|
237
|
+
<conditionvar>
|
238
|
+
<varequal respident="response_5">6742</varequal>
|
239
|
+
</conditionvar>
|
240
|
+
<setvar varname="SCORE" action="Add">20.00</setvar>
|
241
|
+
</respcondition>
|
242
|
+
</resprocessing>
|
243
|
+
</item>
|
244
|
+
</questestinterop>
|
@@ -27,6 +27,7 @@ context 'Canvas Assessment Meta Data' do
|
|
27
27
|
expect(assessment.canvas_access_code).to eq(access_code)
|
28
28
|
expect(assessment.canvas_ip_filter).to eq(ip_filter)
|
29
29
|
expect(assessment.canvas_time_limit).to eq(time_limit)
|
30
|
+
expect(assessment.canvas_show_correct_answers?).to eq(show_answers)
|
30
31
|
expect(assessment.canvas_show_correct_answers_at).to eq(show_answers_at)
|
31
32
|
expect(assessment.canvas_hide_correct_answers_at).to eq(hide_answers_at)
|
32
33
|
expect(assessment.canvas_require_lockdown_browser?).to eq(rlb)
|
@@ -59,6 +60,7 @@ context 'Canvas Assessment Meta Data' do
|
|
59
60
|
let(:access_code) { nil }
|
60
61
|
let(:ip_filter) { nil }
|
61
62
|
let(:time_limit) { nil }
|
63
|
+
let(:show_answers) { true }
|
62
64
|
let(:show_answers_at) { nil }
|
63
65
|
let(:hide_answers_at) { nil }
|
64
66
|
let(:rlb) { false }
|
@@ -92,6 +94,7 @@ context 'Canvas Assessment Meta Data' do
|
|
92
94
|
let(:access_code) { '98aAlfmxtw#!£$s' }
|
93
95
|
let(:ip_filter) { '192.168.217.1/24' }
|
94
96
|
let(:time_limit) { 187 }
|
97
|
+
let(:show_answers) { true }
|
95
98
|
let(:show_answers_at) { '2041-02-17 06:00:00 UTC' }
|
96
99
|
let(:hide_answers_at) { '2042-12-26 06:00:00 UTC' }
|
97
100
|
let(:rlb) { false }
|
@@ -125,6 +128,7 @@ context 'Canvas Assessment Meta Data' do
|
|
125
128
|
let(:access_code) { nil }
|
126
129
|
let(:ip_filter) { nil }
|
127
130
|
let(:time_limit) { nil }
|
131
|
+
let(:show_answers) { false }
|
128
132
|
let(:show_answers_at) { nil }
|
129
133
|
let(:hide_answers_at) { nil }
|
130
134
|
let(:rlb) { false }
|
@@ -158,6 +162,7 @@ context 'Canvas Assessment Meta Data' do
|
|
158
162
|
let(:access_code) { nil }
|
159
163
|
let(:ip_filter) { nil }
|
160
164
|
let(:time_limit) { nil }
|
165
|
+
let(:show_answers) { true }
|
161
166
|
let(:show_answers_at) { nil }
|
162
167
|
let(:hide_answers_at) { nil }
|
163
168
|
let(:rlb) { false }
|
@@ -19,6 +19,12 @@ describe Qti::V1::Models::Assessment do
|
|
19
19
|
expect(loaded_class.assessment_items.count).to eq(expected_item_count)
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
describe '#identifier' do
|
24
|
+
it 'has the identifier' do
|
25
|
+
expect(loaded_class.identifier).to eq(expected_identifier)
|
26
|
+
end
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
30
|
shared_examples_for 'verify quiz items' do
|
@@ -36,6 +42,7 @@ describe Qti::V1::Models::Assessment do
|
|
36
42
|
let(:path) { File.join(fixtures_path, 'test_qti_1.2', 'quiz.xml') }
|
37
43
|
let(:loaded_class) { described_class.from_path!(path) }
|
38
44
|
let(:expected_title) { '1.2 Import Quiz' }
|
45
|
+
let(:expected_identifier) { 'A1001' }
|
39
46
|
let(:expected_item_count) { 5 }
|
40
47
|
|
41
48
|
include_examples('basic quiz fields')
|
@@ -45,6 +52,7 @@ describe Qti::V1::Models::Assessment do
|
|
45
52
|
let(:path) { File.join(fixtures_path, 'feedback_quiz_1.2.xml') }
|
46
53
|
let(:loaded_class) { described_class.from_path!(path) }
|
47
54
|
let(:expected_title) { 'I Can Haz Feedback' }
|
55
|
+
let(:expected_identifier) { 'i618e88580f76f70a1ed28804f497df9c' }
|
48
56
|
let(:expected_item_count) { 3 }
|
49
57
|
let(:expected_item_data) do
|
50
58
|
[
|
@@ -74,6 +82,7 @@ describe Qti::V1::Models::Assessment do
|
|
74
82
|
let(:path) { File.join(fixtures_path, 'all_canvas_simple_1.2.xml') }
|
75
83
|
let(:loaded_class) { described_class.from_path!(path) }
|
76
84
|
let(:expected_title) { 'Every Canvas Interaction' }
|
85
|
+
let(:expected_identifier) { 'ie09bc528e6ecd1cb9ebfafd940c20215' }
|
77
86
|
let(:expected_item_count) { 10 }
|
78
87
|
let(:expected_item_data) do
|
79
88
|
[
|