Browse files

further improve the selectors, move the list of countries to the punb…

…lic directory
  • Loading branch information...
1 parent 20d5bbe commit 5e27d36d481c1321c72cd89fa24c40a8e838afc4 @szabgab committed Feb 9, 2011
View
19 docs/survey/2011_01/survey.yml
@@ -309,25 +309,6 @@ pages:
- We paid to be in the featured jobs and that paid off well
- We don't use it because it is only in English
- title: Demographic
- questions:
- - question: Gender
- type: single_choice
- answers:
- - Male
- - Female
- - Other (does not want to say)
- - question: Age group
- type: single_choice
- answers:
- - Under 20
- - 20-24
- - 25-29
- - 30-39
- - 40-49
- - 50+
- - question: Country of residence
- type: single_choice
- answers: <include/list_of_countries.txt>
- question: Country of origin (birth)
type: single_choice
answers: <include/list_of_countries.txt>
View
0 ...vey/2011_01/include/list_of_countries.txt → public/js/include/list_of_countries.txt
File renamed without changes.
View
19 public/js/survey.js
@@ -84,7 +84,8 @@ function create_question(pid, qid, q) {
if (q["other"] == "yes") {
text += sprintf('<li><input type="radio" name="%s" value="%s" />%s', [pid + "_" + qid, pid + "_" + qid + "_" + a, "Other"]);
// TODO this textbox should only be enabled (or visible) if the user selects "Other"
- text += sprintf('<input name="%s" /></li>', [pid + "_" + qid + "_" + a]);
+ text += sprintf(' <input name="%s" size="40" />', [pid + "_" + qid + "_" + a]);
+ text += '</li>';
}
text += '</ul>';
} else if (q["type"] == "multiple_choice") {
@@ -103,7 +104,10 @@ function create_question(pid, qid, q) {
[pid + "_" + qid + "_" + a, "Other"]);
}
text += "</select>";
-
+ if (q["other"] == "yes") {
+ text += sprintf(' <input name="%s" size="40" />', [pid + "_" + qid + "_other"]);
+ }
+
//alert(text);
} else if (q["style"] == "default") {
text += '<ul>';
@@ -112,19 +116,18 @@ function create_question(pid, qid, q) {
[pid + "_" + qid, pid + "_" + qid + "_" + a, q["answers"][a]]);
}
if (q["other"] == "yes") {
- text += sprintf('<li>%s<input type="checkbox" name="%s" value="%s" />',
+ text += sprintf('<li><input type="checkbox" name="%s" value="%s" />%s',
[pid + "_" + qid, pid + "_" + qid + "_" + a, "Other"]);
+ text += sprintf(' <input name="%s" size="40" />', [pid + "_" + qid + "_other"]);
+ text += "</li>";
}
text += '</ul>';
} else {
throw(sprintf("Invalid style '%s'", [ q["style"] ]));
}
- // TODO this textbox should only be enabled (or visible) if the user selects "Other"
- if (q["other"] == "yes") {
- // TODO what if one of the values is other?
- text += sprintf('<input name="%s" />', [pid + "_" + qid + "_other"]);
- }
+ // TODO the other textbox should only be enabled (or visible) if the user selects "Other"
+ // TODO what if one of the values is other?
} else {
throw(sprintf("Invalid question type '%s' in question '%s'", [q["type"], q["question"]]));
View
31 public/js/survey_2011_02.json
@@ -1,12 +1,13 @@
var survey_data = {
- "title" : "Perl Ecosystem Survey",
+ "title" : "Perl Ecosystem Survey 2011 February",
"pages" : [
{
- "title" : "Perl 5",
+ "title" : "Corporate usage of Perl",
"questions" : [
{
"question" : "What are the biggest problems of the Perl Ecosystem?",
"type" : "multiple_choice",
+ "other" : "yes",
"answers" : [
"There are not enough developers with 1-2 years experience",
"There are not enough developers with 3-4 years experience",
@@ -19,6 +20,7 @@ var survey_data = {
{
"question" : "What best describes your organizations' policy towards the use of open source software?",
"type" : "multiple_choice",
+ "other" : "yes",
"answers" : [
"Does not allow the use of any open source software",
"Uses open source software, but does not interact with open source project communities in any way",
@@ -32,10 +34,11 @@ var survey_data = {
{
"question" : "What is the policy in the company regarding the use of CPAN?",
"type" : "single_choice",
+ "other" : "yes",
"answers" : [
"Not allowed at all",
"Only modules that are supplied by the vendor (e.g. Linux distribution) we use",
- "Every module need approval of management",
+ "Every module needs approval of management",
"Freely as I need it",
"Don't know"
]
@@ -71,7 +74,15 @@ var survey_data = {
},
{
"question" : "Age group",
- "type" : "single_choice"
+ "type" : "single_choice",
+ "answers" : [
+ "Under 20",
+ "20-24",
+ "25-29",
+ "30-39",
+ "40-49",
+ "50+"
+ ]
},
{
"question" : "Gender",
@@ -97,7 +108,10 @@ var survey_data = {
{
"question" : "Country of residence?",
"type" : "single_choice",
- "answers" : null
+ "style" : "selection",
+ "answers" : [
+ "include/list_of_countries.txt"
+ ]
},
{
"question" : "Where did you hear about the survey?",
@@ -107,11 +121,12 @@ var survey_data = {
"LinkedIn",
"Blog of Gabor",
"Blog of Renee",
- "Ironman",
- "TODO list other planets",
+ "Ironman Perl Planet",
+ "Planet Perl",
+ "Perlsphere",
"Twitter",
"IRC",
- "Perl Monger mailiing list",
+ "Perl Monger mailing list",
"E-mail from someone in my company",
"E-mail from someone outside my company",
"Perl Ecosystem Group mailing list"

0 comments on commit 5e27d36

Please sign in to comment.