missinglink 0.2.1 → 0.2.1.1
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/app/models/missinglink/survey_question.rb +3 -1
- data/etc/question_types.yml +45 -0
- data/lib/missinglink/version.rb +1 -1
- data/lib/missinglink.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90a8c402694e1bcfd9e36658ed6919150b546aba
|
4
|
+
data.tar.gz: 81f1d658a20f25baa96278ffe605837d93fb6512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b4a3785a7a47173db80fabe9088f3aea5f68d3c5978a4d60b7637deb2900e23432ba599a6aae88bba76b90aa4202034636c6c77e3845be3a11dc16a5e3db14f
|
7
|
+
data.tar.gz: 78315db99f9fddbe128383343678d7aca667eeeab135e2331056b3278f7b451f2f166db4ad3e67a37c8218f508b94c7eea0bcf95641029537b1c70806bf28772
|
@@ -44,20 +44,22 @@ module Missinglink
|
|
44
44
|
sa_row = (sra.row_survey_answer_id ? SurveyAnswer.find(sra.row_survey_answer_id) : nil)
|
45
45
|
sa_col = (sra.col_survey_answer_id ? SurveyAnswer.find(sra.col_survey_answer_id) : nil)
|
46
46
|
sa_col_choice = (sra.col_choice_survey_answer_id ? SurveyAnswer.find(sra.col_choice_survey_answer_id) : nil)
|
47
|
-
other_text = ((!search_other || sra.text.nil?) ? nil : "Other: #{ sra.text }")
|
48
47
|
|
49
48
|
case answer_strategy
|
50
49
|
when "first_survey_response_answer_text"
|
51
50
|
hash[sra.text] = sra.id unless (sra.text.nil? || hash[sra.text])
|
52
51
|
when "answer_row_match_for_survey_response_answer_text"
|
52
|
+
other_text = ((!search_other || sra.text.nil?) ? nil : "#{ (sa_row.try(:text) || "Other") }: #{ sra.text }")
|
53
53
|
hash[sa_row.text] = sra.id unless (sa_row.nil? || hash[sa_row.text])
|
54
54
|
hash[other_text] = sra.id unless (other_text.nil? || hash[other_text])
|
55
55
|
when "row_column_survey_response_answers_and_text"
|
56
56
|
main_text = "#{ sa_row.try(:text) }: #{ sa_col.try(:text) }"
|
57
|
+
other_text = ((!search_other || sra.text.nil? || !sa_row.nil?) ? nil : "Other: #{ sra.text }")
|
57
58
|
hash[main_text] = sra.id unless (sa_row.nil? || sa_col.nil? || hash[main_text])
|
58
59
|
hash[other_text] = sra.id unless (other_text.nil? || hash[other_text])
|
59
60
|
when "row_column_and_choice_survey_response_answers_and_text"
|
60
61
|
main_text = "#{ sa_row.try(:text) }, #{ sa_col.try(:text) }: #{ sa_col_choice.try(:text) }"
|
62
|
+
other_text = ((!search_other || sra.text.nil? || !sa_row.nil?) ? nil : "Other: #{ sra.text }")
|
61
63
|
hash[main_text] = sra.id unless (sa_row.nil? || sa_col.nil? || sa_col_choice.nil? || hash[main_text])
|
62
64
|
hash[other_text] = sra.id unless (other_text.nil? || hash[other_text])
|
63
65
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# first_survey_response_answer_text:
|
2
|
+
# pull the first SRA, and use the text
|
3
|
+
# answer_row_match_for_survey_response_answer_text:
|
4
|
+
# pull each SRA, use the row answer, and the text if present
|
5
|
+
# row_column_survey_response_answers_and_text
|
6
|
+
# pull each SRA, combo row/column search, "other" just has text
|
7
|
+
# row_column_and_choice_survey_response_answers_and_text:
|
8
|
+
# pull each SRA, combo row/column/colchoice search, "other" text
|
9
|
+
# none:
|
10
|
+
# this is not actually a question, so ignore it
|
11
|
+
|
12
|
+
|
13
|
+
open_ended:
|
14
|
+
essay: first_survey_response_answer_text
|
15
|
+
multi: answer_row_match_for_survey_response_answer_text
|
16
|
+
numerical: answer_row_match_for_survey_response_answer_text
|
17
|
+
single: first_survey_response_answer_text
|
18
|
+
single_choice:
|
19
|
+
vertical: answer_row_match_for_survey_response_answer_text
|
20
|
+
vertical_two_col: answer_row_match_for_survey_response_answer_text
|
21
|
+
vertical_three_col: answer_row_match_for_survey_response_answer_text
|
22
|
+
horiz: answer_row_match_for_survey_response_answer_text
|
23
|
+
menu: answer_row_match_for_survey_response_answer_text
|
24
|
+
multiple_choice:
|
25
|
+
vertical: answer_row_match_for_survey_response_answer_text
|
26
|
+
vertical_two_col: answer_row_match_for_survey_response_answer_text
|
27
|
+
vertical_three_col: answer_row_match_for_survey_response_answer_text
|
28
|
+
horiz: answer_row_match_for_survey_response_answer_text
|
29
|
+
matrix:
|
30
|
+
single: row_column_survey_response_answers_and_text
|
31
|
+
multi: row_column_survey_response_answers_and_text
|
32
|
+
menu: row_column_and_choice_survey_response_answers_and_text
|
33
|
+
rating: row_column_survey_response_answers_and_text
|
34
|
+
ranking: row_column_survey_response_answers_and_text
|
35
|
+
demographic:
|
36
|
+
us: answer_row_match_for_survey_response_answer_text
|
37
|
+
international: answer_row_match_for_survey_response_answer_text
|
38
|
+
datetime:
|
39
|
+
date_only: answer_row_match_for_survey_response_answer_text
|
40
|
+
time_only: answer_row_match_for_survey_response_answer_text
|
41
|
+
both: answer_row_match_for_survey_response_answer_text
|
42
|
+
presentation:
|
43
|
+
image: none
|
44
|
+
video: none
|
45
|
+
descriptive_text: none
|
data/lib/missinglink/version.rb
CHANGED
data/lib/missinglink.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: missinglink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1
|
4
|
+
version: 0.2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trey Springer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- app/views/layouts/missinglink/application.html.erb
|
134
134
|
- config/routes.rb
|
135
135
|
- db/migrate/20140308005724_add_missinglink_survey_schema.rb
|
136
|
+
- etc/question_types.yml
|
136
137
|
- lib/missinglink.rb
|
137
138
|
- lib/missinglink/connection.rb
|
138
139
|
- lib/missinglink/engine.rb
|