helena_administration 0.0.7 → 0.1.0
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: 7be513ec2267b6335e0f51c946d1776b6a4e5995
|
4
|
+
data.tar.gz: 5e3461b71bfd28bf5d8757a83d798ecc1452c0a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6dfbf876750414e6619017e7bad58abeeef46244c64ade522c9e0180537904e64a5a0d715530e8c9cca67a416ac46c743a5cf101a2432e0551459fcb29e706b
|
7
|
+
data.tar.gz: 143a094be49257991abf317e3c2c11fd8b66f957969b73cc5b0a412d64b2b2847c24102861c6c56cd26359fc98050dff7a6590dbeb5d731d3c3625168f31aaa9
|
data/Gemfile.lock
CHANGED
@@ -54,7 +54,7 @@ module HelenaAdministration
|
|
54
54
|
|
55
55
|
# .. and generate a line for each session.
|
56
56
|
@sessions.each do |session|
|
57
|
-
response.stream.write CSV.generate_line(session_values(session) + [session.version.version] + answer_values(session
|
57
|
+
response.stream.write CSV.generate_line(session_values(session) + [session.version.version] + answer_values(session))
|
58
58
|
end
|
59
59
|
ensure
|
60
60
|
response.stream.close
|
@@ -64,8 +64,9 @@ module HelenaAdministration
|
|
64
64
|
session_fields.map { |field| session.attributes[field] }
|
65
65
|
end
|
66
66
|
|
67
|
-
def answer_values(session
|
68
|
-
|
67
|
+
def answer_values(session)
|
68
|
+
answers = Hash[session.answers.map { |answer| [answer.code, answer.value] }]
|
69
|
+
question_codes.map { |code| answers[code] }
|
69
70
|
end
|
70
71
|
|
71
72
|
def add_breadcrumbs
|
@@ -98,7 +99,7 @@ module HelenaAdministration
|
|
98
99
|
end
|
99
100
|
|
100
101
|
def session_fields
|
101
|
-
Helena::Session.fields.keys
|
102
|
+
@session_fields ||= Helena::Session.fields.keys
|
102
103
|
end
|
103
104
|
end
|
104
105
|
end
|