Class: CanvasQtiToLearnosityConverter::MatchingQuestion
- Inherits:
-
QuizQuestion
- Object
- QuizQuestion
- CanvasQtiToLearnosityConverter::MatchingQuestion
show all
- Defined in:
- lib/canvas_qti_to_learnosity_converter/questions/matching.rb
Instance Method Summary
collapse
#convert, #dynamic_content_data, #extract_mattext, #extract_points_possible, #extract_stimulus, #initialize, #make_identifier, #process_assets!
Instance Method Details
#add_learnosity_assets(assets, path, learnosity) ⇒ Object
69
70
71
72
73
74
75
76
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 69
def add_learnosity_assets(assets, path, learnosity)
process_assets!(
assets,
path,
learnosity[:stimulus]
)
learnosity
end
|
23
24
25
26
27
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 23
def ()
@xml.css("item > presentation > response_lid").map do |node|
node.attribute("ident").text
end
end
|
61
62
63
64
65
66
67
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 61
def ()
@xml.css("item > presentation > response_lid").map do |response|
response.css("response_label mattext").map do |node|
(node)
end
end
end
|
17
18
19
20
21
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 17
def ()
@xml.css("item > presentation > response_lid > material > mattext").map do |node|
"<p>#{(node)} {{response}}</p>"
end.join("\n")
end
|
29
30
31
32
33
34
35
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 29
def (valid_response_idents)
valid_response_idents.map do |ident|
@xml.css(%{item > resprocessing > respcondition varequal[respident="#{ident}"]}).map do |node|
node.content
end
end.flatten
end
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 37
def ()
valid_response_idents = ()
valid_label_idents = (valid_response_idents)
valid_idents = Hash[valid_response_idents.zip(valid_label_idents)]
valid_responses = valid_idents.map do |response_ident, label_ident|
@xml.css(%{item > presentation >
response_lid[ident="#{response_ident}"]
response_label[ident="#{label_ident}"] > material > mattext}).map do |node|
(node)
end
end.flatten
{
"scoring_type" => "partialMatchV2",
"rounding" => "none",
"valid_response" => {
"value" => valid_responses,
"score" => ,
}
}
end
|
#to_learnosity ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/canvas_qti_to_learnosity_converter/questions/matching.rb', line 5
def to_learnosity
{
type: "clozedropdown",
stimulus: (),
template: (),
validation: (),
possible_responses: (),
duplicate_responses: true,
shuffle_options: true,
}
end
|