2006-07-11 03:44:14 +00:00
|
|
|
<?php
|
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
// stuff that's particular to the "BOINC user survey"
|
|
|
|
|
|
|
|
// miscellaneous field names
|
|
|
|
|
|
|
|
$run_boinc="run_boinc";
|
|
|
|
$factor_other_text = "factor_other_text";
|
|
|
|
$country = "country";
|
|
|
|
$lother_text = "lother_text";
|
|
|
|
$fother_text = "fother_text";
|
|
|
|
$wother_text = "wother_text";
|
|
|
|
$nother_text = "nother_text";
|
2006-07-12 23:18:57 +00:00
|
|
|
$cother_text = "cother_text";
|
|
|
|
$vother_text = "vother_text";
|
|
|
|
$improved = "improved_text";
|
2006-07-11 19:24:12 +00:00
|
|
|
|
2006-07-11 03:44:14 +00:00
|
|
|
$choice0 = array(
|
2006-07-24 16:25:23 +00:00
|
|
|
"text" => tr(POLL_CURRENT),
|
2006-07-11 03:44:14 +00:00
|
|
|
"rname" => "current",
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"tweek" => tr(POLL_TWEEK),
|
|
|
|
"tmonth" => tr(POLL_TMONTH),
|
|
|
|
"tyear" => tr(POLL_TYEAR),
|
|
|
|
"tmoreyear" => tr(POLL_TMOREYEAR),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name" => "duration",
|
|
|
|
"other_name" => null,
|
2006-07-11 03:44:14 +00:00
|
|
|
);
|
|
|
|
$choice1 = array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text" => tr(POLL_LAPSED),
|
2006-07-11 03:44:14 +00:00
|
|
|
"rname" => "lapsed",
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"linterest" => tr(POLL_LINTEREST),
|
|
|
|
"lcomplicated" => tr(POLL_LCOMPLICATED),
|
|
|
|
"lstopped" => tr(POLL_LSTOPPED),
|
|
|
|
"lproblems" => tr(POLL_LPROBLEMS),
|
|
|
|
"lpower" => tr(POLL_LPOWER),
|
|
|
|
"lnonboinc" => tr(POLL_LNONBOINC),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name" => false,
|
|
|
|
"other_name" => "lother_text",
|
2006-07-11 03:44:14 +00:00
|
|
|
);
|
|
|
|
$choice2 = array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text" => tr(POLL_FAILED),
|
2006-07-11 03:44:14 +00:00
|
|
|
"rname" => "failed",
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"finstall" => tr(POLL_FINSTALL),
|
|
|
|
"ffigure" => tr(POLL_FFIGURE),
|
|
|
|
"fnetwork" => tr(POLL_FNETWORK),
|
|
|
|
"fattach" => tr(POLL_FATTACH),
|
|
|
|
"fwork" => tr(POLL_FWORK),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name" => false,
|
|
|
|
"other_name" => "fother_text",
|
2006-07-11 03:44:14 +00:00
|
|
|
);
|
|
|
|
$choice3 = array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text" => tr(POLL_NEVER),
|
2006-07-11 03:44:14 +00:00
|
|
|
"rname" => "never",
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"nsecurity" => tr(POLL_NSECURITY),
|
|
|
|
"nproject" => tr(POLL_NPROJECT),
|
|
|
|
"npermission" => tr(POLL_NPERMISSION),
|
|
|
|
"nversion" => tr(POLL_NVERSION),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name" => false,
|
|
|
|
"other_name" => "nother_text",
|
2006-07-11 03:44:14 +00:00
|
|
|
);
|
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
$overall_choices = array($choice0, $choice1, $choice2, $choice3);
|
|
|
|
|
2006-07-11 03:44:14 +00:00
|
|
|
|
|
|
|
$comp_items = array(
|
|
|
|
array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_KIND),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-11 03:44:14 +00:00
|
|
|
"windows"=>"Windows",
|
|
|
|
"mac"=>"Macintosh",
|
|
|
|
"linux"=>"Linux",
|
|
|
|
),
|
2006-07-12 23:18:57 +00:00
|
|
|
"radio_name"=>false,
|
|
|
|
"other_name"=>"cother_text",
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
|
|
|
array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_WHERE),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"home"=>tr(POLL_HOME),
|
|
|
|
"work"=>tr(POLL_WORK),
|
|
|
|
"school"=>tr(POLL_SCHOOL),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-12 23:18:57 +00:00
|
|
|
"radio_name"=>false,
|
|
|
|
"other_name"=>"vother_text",
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
|
|
|
array(
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name"=>"ncomputers",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_HOW_MANY),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-11 03:44:14 +00:00
|
|
|
"n1"=>"1",
|
|
|
|
"n2"=>"2-4",
|
|
|
|
"n59"=>"5-9",
|
2006-07-13 03:04:45 +00:00
|
|
|
"n10"=>"10-99",
|
|
|
|
"n100"=>"100+",
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name"=>"turned_on",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_TURNED_ON),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options" => array(
|
2006-07-11 03:44:14 +00:00
|
|
|
"t08"=>"0-8",
|
|
|
|
"t823"=>"8-23",
|
|
|
|
"t24"=>"24",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
$you_items = array(
|
|
|
|
array(
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name"=>"age",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_AGE),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options"=>array(
|
2006-07-11 03:44:14 +00:00
|
|
|
"age019"=>"0-19",
|
|
|
|
"age2039"=>"20-39",
|
|
|
|
"age4059"=>"40-59",
|
|
|
|
"age60"=>"60+",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name"=>"sex",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_SEX),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"sexm"=>tr(POLL_MALE),
|
|
|
|
"sexf"=>tr(POLL_FEMALE),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2006-07-11 19:24:12 +00:00
|
|
|
"radio_name"=>"level",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_EXPERTISE),
|
2006-07-11 19:24:12 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"levb"=>tr(POLL_LEVB),
|
|
|
|
"levi"=>tr(POLL_LEVI),
|
|
|
|
"leva"=>tr(POLL_LEVA),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2006-07-13 03:04:45 +00:00
|
|
|
$project_items = array(
|
2006-07-13 04:01:04 +00:00
|
|
|
array(
|
|
|
|
"name"=>"where",
|
2006-07-24 16:25:23 +00:00
|
|
|
"text"=>tr(POLL_LEARN_WHERE),
|
2006-07-13 04:01:04 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"wtv"=>tr(POLL_WTV),
|
|
|
|
"wpers"=>tr(POLL_WPERS),
|
|
|
|
"wteam"=>tr(POLL_WTEAM),
|
|
|
|
"wboinc"=>tr(POLL_WBOINC),
|
|
|
|
"wweb"=>tr(POLL_WWEB),
|
2006-07-13 04:01:04 +00:00
|
|
|
),
|
|
|
|
"radio_name" => false,
|
|
|
|
"other_name" => "wother_text",
|
|
|
|
),
|
2006-07-13 03:04:45 +00:00
|
|
|
array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text" => tr(POLL_FACTOR),
|
2006-07-13 03:04:45 +00:00
|
|
|
"options" => array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"factor_graphics"=>tr(POLL_GRAPHICS),
|
|
|
|
"factor_credit_fair"=>tr(POLL_CREDIT_FAIR),
|
|
|
|
"factor_credit_more"=>tr(POLL_CREDIT_MORE),
|
|
|
|
"factor_mb_friendly"=>tr(POLL_MB_FRIENDLY),
|
|
|
|
"factor_mb_staff"=>tr(POLL_MB_STAFF),
|
|
|
|
"factor_web_site"=>tr(POLL_WEB_SITE),
|
|
|
|
"factor_science_important"=>tr(POLL_SCIENCE_IMPORTANT),
|
|
|
|
"factor_science_public"=>tr(POLL_SCIENCE_PUBLIC),
|
|
|
|
"factor_recognize"=>tr(POLL_RECOGNIZE),
|
|
|
|
"factor_publish"=>tr(POLL_PUBLISH),
|
|
|
|
"factor_email"=>tr(POLL_EMAIL),
|
2006-07-13 03:04:45 +00:00
|
|
|
),
|
|
|
|
"radio_name" => false,
|
|
|
|
"other_name" => "factor_other_text",
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
"radio_name"=>"nprojects",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_NPROJECTS),
|
2006-07-13 03:04:45 +00:00
|
|
|
"options"=>array(
|
|
|
|
"p1"=>"1",
|
|
|
|
"p25"=>"2-5",
|
|
|
|
"p510"=>"5-10",
|
2006-07-22 18:24:01 +00:00
|
|
|
"pmore10"=>"11+",
|
2006-07-13 03:04:45 +00:00
|
|
|
),
|
2006-07-11 03:44:14 +00:00
|
|
|
),
|
2006-07-17 16:38:53 +00:00
|
|
|
array(
|
|
|
|
"radio_name"=>"ssaver",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_SSAVER),
|
2006-07-17 16:38:53 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"ss_yes"=>tr(POLL_YES),
|
|
|
|
"ss_no"=>tr(POLL_NO),
|
2006-07-17 16:38:53 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
"radio_name"=>"mboards",
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_MBOARDS),
|
2006-07-17 16:38:53 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"mboard_r"=>tr(POLL_MBR),
|
|
|
|
"mboard_rw"=>tr(POLL_MBRW),
|
|
|
|
"mboard_none"=>tr(POLL_NONE),
|
2006-07-17 16:38:53 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"text"=>tr(POLL_HELP),
|
2006-07-17 16:38:53 +00:00
|
|
|
"options"=>array(
|
2006-07-22 18:24:01 +00:00
|
|
|
"help_pmb"=>tr(POLL_HELP_PMB),
|
|
|
|
"help_bmb"=>tr(POLL_HELP_BMB),
|
|
|
|
"help_bdoc"=>tr(POLL_HELP_BDOC),
|
|
|
|
"help_bmlist"=>tr(POLL_HELP_BMLIST),
|
|
|
|
"help_wiki"=>tr(POLL_HELP_WIKI),
|
|
|
|
"help_team"=>tr(POLL_HELP_TEAM),
|
|
|
|
"help_google"=>tr(POLL_HELP_GOOGLE),
|
2006-07-17 16:38:53 +00:00
|
|
|
),
|
|
|
|
"radio_name"=>false,
|
|
|
|
"other_name"=>help_other_text,
|
|
|
|
),
|
2006-07-11 03:44:14 +00:00
|
|
|
);
|
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
function parse_form() {
|
|
|
|
global $run_boinc;
|
|
|
|
global $overall_choices;
|
2006-07-13 03:04:45 +00:00
|
|
|
global $project_items;
|
2006-07-11 19:24:12 +00:00
|
|
|
global $comp_items;
|
|
|
|
global $you_items;
|
|
|
|
global $country;
|
|
|
|
global $improved;
|
|
|
|
$x = array();
|
|
|
|
$x[$run_boinc] = get_str($run_boinc);
|
|
|
|
$x = parse_form_choices($x, $overall_choices);
|
2006-07-13 03:04:45 +00:00
|
|
|
$x = parse_form_choices($x, $project_items);
|
2006-07-11 19:24:12 +00:00
|
|
|
$x = parse_form_choices($x, $comp_items);
|
|
|
|
$x = parse_form_choices($x, $you_items);
|
|
|
|
$x[$country] = get_str($country);
|
|
|
|
$x[$improved] = get_str($improved);
|
|
|
|
return $x;
|
|
|
|
}
|
|
|
|
|
|
|
|
function generate_xml($x) {
|
|
|
|
global $run_boinc;
|
|
|
|
global $overall_choices;
|
2006-07-13 03:04:45 +00:00
|
|
|
global $project_items;
|
2006-07-11 19:24:12 +00:00
|
|
|
global $comp_items;
|
|
|
|
global $you_items;
|
|
|
|
global $country;
|
|
|
|
global $improved;
|
|
|
|
$xml = "";
|
|
|
|
$xml .= "<$run_boinc>".$x[$run_boinc]."</$run_boinc>\n";
|
|
|
|
$xml .= gen_xml_choices($x, $overall_choices);
|
2006-07-13 03:04:45 +00:00
|
|
|
$xml .= gen_xml_choices($x, $project_items);
|
2006-07-11 19:24:12 +00:00
|
|
|
$xml .= gen_xml_choices($x, $comp_items);
|
|
|
|
$xml .= gen_xml_choices($x, $you_items);
|
2006-07-12 23:18:57 +00:00
|
|
|
$xml .= "<$country>".urlencode($x[$country])."</$country>\n";
|
|
|
|
$xml .= "<$improved>".urlencode($x[$improved])."</$improved>\n";
|
2006-07-11 19:24:12 +00:00
|
|
|
return $xml;
|
|
|
|
}
|
|
|
|
|
2006-07-11 03:44:14 +00:00
|
|
|
?>
|