diff --git a/index.php b/index.php
index 0122b035554..fef495392eb 100644
--- a/index.php
+++ b/index.php
@@ -99,7 +99,7 @@
exit;
}
-// NOW LETS GATHER SOME INFORMATION ABOUT THIS PARTICULAR SURVEY
+// NOW LETS GATHER SOME INFORMATION ABOUT THIS PARTICULAR SURVEY (This happens on every page)
if ($sid)
{
$desquery = "SELECT * FROM surveys WHERE sid=$sid";
@@ -127,6 +127,7 @@
$surveywelcome = $desrow['welcome'];
$surveyadminname = $desrow['admin'];
$surveyadminemail = $desrow['adminemail'];
+ $surveyprivate = $desrow['private'];
}
$surveyheader = "
\n";
$surveyheader .= "\t
\n";
@@ -161,7 +162,7 @@
}
-//THIS IS THE LAST POINT. HERE, WE GATHER ALL THE SESSION VARIABLES AND INSERT THEM INTO THE DATABASE.
+// This is the LAST POINT. The survey is completed and saved and now we're just letting the user close the window
if ($move == "completed")
{
echo "
\n";
@@ -184,6 +185,7 @@
exit;
}
+// Here we present the user with the option to submit their responses and provide general information about stopping, and privacy (if appropriate)
if ($move == " last ")
{
echo $surveyheader;
@@ -218,19 +220,26 @@
echo "clicking on the \" << prev \" button and browsing through your responses. \n";
echo " \n";
echo " \n";
- echo "\t\t\t\t\t\t
\n";
- echo "\t\t\t\t\t\t\t
\n";
- echo "\t\t\t\t\t\t\t\t
\n";
- echo "$setfontA note on privacy \n";
- echo "The record kept of this survey does not contain any identifying information about you unless ";
- echo "a specific question in the survey has asked for this. If you have responded to a survey that ";
- echo "used an identifying token to allow you to access the survey, you can rest assured that the ";
- echo "identifying token is not kept with your responses. It is managed in a seperate database, and will ";
- echo "only be updated to indicate that you have (or haven't) completed this survey. There is no way of ";
- echo "relating identification tokens with responses in this system.\n";
- echo "\t\t\t\t\t\t\t\t
\n";
+ echo "$setfontA note on privacy \n";
+ echo "The record kept of this survey does not contain any identifying information about you unless ";
+ echo "a specific question in the survey has asked for this. If you have responded to a survey that ";
+ echo "used an identifying token to allow you to access the survey, you can rest assured that the ";
+ echo "identifying token is not kept with your responses. It is managed in a seperate database, and will ";
+ echo "only be updated to indicate that you have (or haven't) completed this survey. There is no way of ";
+ echo "relating identification tokens with responses in this system.\n";
+ echo "\t\t\t\t\t\t\t\t
\n";
+ echo "\t\t\t\t\t\t\t
\n";
+ echo "\t\t\t\t\t\t
\n";
+ }
+ else
+ {
+ // Just in case we want to add a comment for non-private surveys
+ }
echo " \nIf you do not wish to submit responses to this survey, ";
echo "and you would like to delete all records on your computer that may have saved your responses, ";
echo "click here \n";
@@ -247,6 +256,7 @@
exit;
}
+//THIS IS THE SECOND LAST POINT. HERE, WE GATHER ALL THE SESSION VARIABLES AND INSERT THEM INTO THE DATABASE.
if ($move == " submit ")
{
echo "$surveyheader";
@@ -312,10 +322,17 @@
$message = "Dear {$cnfrow['firstname']},\n\n";
$message .= "This email is to confirm that you have completed the survey titled \"$surveyname\" ";
$message .= "and your response has been saved. Thank you for participating.\n\n";
- $message .= "Please note that your survey submission does not contain any link to your personal ";
- $message .= "information used to send you this confirmation or the original invitation.\n";
- $message .= "The information you submitted in the survey is anonymous unless a question in the ";
- $message .= "survey itself actually asks for such information.\n\n";
+ if ($surveyprivate != "N")
+ {
+ $message .= "Please note that your survey submission does not contain any link to your personal ";
+ $message .= "information used to send you this confirmation or the original invitation.\n";
+ $message .= "The information you submitted in the survey is anonymous unless a question in the ";
+ $message .= "survey itself actually asks for such information.\n\n";
+ }
+ else
+ {
+ //just in case we want to add info about it not being private
+ }
$message .= "If you have any questions about this survey please contact $surveyadminname on ";
$message .= "$surveyadminemail.\n\n";
$message .= "Sincerely,\n\n";
@@ -438,6 +455,13 @@
// Perform a case insensitive natural sort on group name then question title of a multidimensional array
usort($arows, 'CompareGroupThenTitle');
+ if ($surveyprivate == "N")
+ {
+ session_register("Ftoken");
+ $Ftoken=$token;
+ $insertarray[]= "Ftoken";
+ }
+
foreach ($arows as $arow)
{
//WE ARE CREATING A SESSION VARIABLE FOR EVERY FIELD IN THE SURVEY