canvas_cc 0.0.6 → 0.0.7

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: 265b94fef90835f9cacbed0bb2b18735ff0a92c9
4
- data.tar.gz: 14ded48931133ba06efa51cf756fee1dafd9eaea
3
+ metadata.gz: df4b07c232a5a8159af168cb34204e147620d55a
4
+ data.tar.gz: f4c0a1d7f7c7f63c41a5f1fdc850823b416c93ee
5
5
  SHA512:
6
- metadata.gz: 098e7953b9bc2935cd0365429183b11012930d5f65cd838c5b74a818d04455ede9b68f7e8370c524fa7cdc708139658d3b6d79495d54f1eea42efe4bf6e4b732
7
- data.tar.gz: 09f6a6b774a80285fa11ceca80b5388ddd37881be1d88de4a7759a5d3aecce1da08fe1cdaee4961163e8b57d639c63e5947723c81c4ecc3354485021c641619b
6
+ metadata.gz: 2f959882d3e30073bbfc74a970cea56790b66d08ed18f77680400a4c2e6baef0e87024990680fd5a7860b4500df5ec0c5c27ba2cf55c4e961dec8c9d5248dc4a
7
+ data.tar.gz: 41eea0cc5c0ab5c8803bb613ab9860a4d554110d4e753978311de63af73242dbfe34cfd214cff8b8b2b4051dd37e7dbcb6cd3ffb32d339f4fdaeb5b7a5e2719d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- canvas_cc (0.0.6)
4
+ canvas_cc (0.0.7)
5
5
  builder
6
6
  happymapper
7
7
  nokogiri
@@ -49,10 +49,10 @@ GEM
49
49
  rb-inotify (>= 0.9)
50
50
  lumberjack (1.0.9)
51
51
  method_source (0.8.2)
52
- mini_portile (0.6.1)
52
+ mini_portile (0.6.0)
53
53
  minitest (5.4.1)
54
- nokogiri (1.6.4)
55
- mini_portile (~> 0.6.0)
54
+ nokogiri (1.6.3.1)
55
+ mini_portile (= 0.6.0)
56
56
  pry (0.10.1)
57
57
  coderay (~> 1.1.0)
58
58
  method_source (~> 0.8.1)
@@ -20,6 +20,18 @@ module CanvasCc::CanvasCC
20
20
 
21
21
  def self.write_response_conditions(processing_node, question)
22
22
  return unless question.answers.count > 0
23
+
24
+ #Feedback
25
+ question.answers.each do |answer|
26
+ next unless answer.feedback && answer.feedback.strip.length > 0
27
+ processing_node.respcondition(:continue => 'Yes') do |resp_condition_node|
28
+ resp_condition_node.conditionvar do |var_node|
29
+ var_node.varequal answer.id, :respident => 'response1'
30
+ end
31
+ resp_condition_node.displayfeedback(:feedbacktype => 'Response', :linkrefid => "#{answer.id}_fb")
32
+ end
33
+ end
34
+
23
35
  processing_node.respcondition(:continue => 'No') do |condition_node|
24
36
  condition_node.conditionvar do |var_node|
25
37
  var_node.and do |and_node|
@@ -35,7 +47,13 @@ module CanvasCc::CanvasCC
35
47
  end
36
48
  end
37
49
  condition_node.setvar('100', :varname => 'SCORE', :action => 'Set')
50
+
38
51
  end
39
52
  end
53
+
54
+ def self.write_additional_nodes(item_node, question)
55
+ write_standard_answer_feedbacks(item_node, question)
56
+ end
57
+
40
58
  end
41
- end
59
+ end
@@ -1,3 +1,3 @@
1
1
  module CanvasCc
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -15,6 +15,7 @@ module CanvasCc::CanvasCC
15
15
  answer1.id = '1'
16
16
  answer1.answer_text = 'something'
17
17
  answer1.fraction = '0.5'
18
+ answer1.feedback = 'feedback1'
18
19
  answer2 = CanvasCc::CanvasCC::Models::Answer.new
19
20
  answer2.id = '2'
20
21
  answer2.answer_text = 'something else'
@@ -45,6 +46,9 @@ module CanvasCc::CanvasCC
45
46
  expect(condition.at_xpath("conditionvar/and/varequal[@respident=\"response1\" and text()=\"#{answer1.id}\"]")).not_to be_nil
46
47
  expect(condition.at_xpath("conditionvar/and/not/varequal[@respident=\"response1\" and text()=\"#{answer2.id}\"]")).not_to be_nil
47
48
  expect(condition.at_xpath("conditionvar/and/varequal[@respident=\"response1\" and text()=\"#{answer3.id}\"]")).not_to be_nil
49
+
50
+ feedback = xml.at_xpath("item/itemfeedback[@ident=\"#{answer1.id}_fb\"]/flow_mat/material/mattext[@texttype=\"text/html\"]")
51
+ expect(feedback.text).to eq answer1.feedback
48
52
  end
49
53
  end
50
- end
54
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-07 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip