Skip to content

Commit

Permalink
Added "other" answer to "Multiple Options with Comments" question type.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@11 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
John Richards committed Mar 11, 2003
1 parent f12a6fe commit e1cd33c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
14 changes: 12 additions & 2 deletions admin/activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,19 @@
{
$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."$abrow[1] VARCHAR(5),\n";
if ($abrow[4]=="Y") {$alsoother="Y";}
if ($arow[3] == "P") {$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."$abrow[1]comment VARCHAR(100),\n";}
if ($arow[3] == "P")
{
$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."$abrow[1]comment VARCHAR(100),\n";
}
}
if ($alsoother=="Y" && ($arow[3]=="M" || $arow[3]=="P"))
{
$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."other VARCHAR(100),\n";
if ($arow[3]=="P")
{
$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."othercomment VARCHAR(100),\n";
}
}
if ($alsoother=="Y" && $arow[3]=="M") {$createsurvey .= " $arow[1]"."X"."$arow[2]"."X"."$arow[0]"."other VARCHAR(100),\n";}

}

Expand Down
27 changes: 25 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@
{
session_register("F$fieldname"."other");
$insertarray[]="F$fieldname"."other";
if ($arow['type'] == "P")
{
session_register("F$fieldname"."othercomment");
$insertarray[]="F$fieldname"."othercomment";
}
}

}
Expand Down Expand Up @@ -550,7 +555,7 @@
echo "\t<tr>\n";
echo "\t\t<td colspan='2'>\n";
echo "<!-- THE QUESTION IS HERE -->\n";
echo "<table width='100%' border='4'>\n";
echo "<table width='100%' border='0'>\n";
echo "\t<tr><td colspan='2' height='20'></td></tr>\n";
echo "\t<tr>\n";
echo "\t\t<td colspan='2' height='4'>\n";
Expand Down Expand Up @@ -769,8 +774,26 @@
echo "\t\t\t\t\t\t\t</tr>\n";
$fn++;
}
echo "\t\t\t\t\t\t</table>\n";
$multifields = substr($multifields, 0, strlen($multifields)-1);
if ($other == "Y")
{
$myfname = $fname."other";
$myfname2 = $myfname."comment";
$multifields .= "|$fname"."other|$fname"."othercomment";
$anscount = $anscount + 2;
echo "\t\t\t\t\t\t\t<tr>\n";
echo "\t\t\t\t\t\t\t\t<td>$setfont\n";
echo "\t\t\t\t\t\t\t\t\tOther: <input type='text' name='fvalue$fn'";
if ($$myfname) {echo " value='".$$myfname."'";}
echo ">\n";
echo "\t\t\t\t\t\t\t\t</td>\n";
$fn++;
echo "\t\t\t\t\t\t\t\t<td>\n";
echo "\t\t\t\t\t\t\t\t\t<input style='background-color: #EEEEEE; height:18; font-face: verdana; font-size: 9' type='text' size='40' name='fvalue$fn' value='".$$myfname2."'>\n";
echo "\t\t\t\t\t\t\t\t</td>\n";
echo "\t\t\t\t\t\t\t</tr>\n";
}
echo "\t\t\t\t\t\t</table>\n";
echo "\t\t\t\t\t</td>\n";
echo "\t\t\t\t\t<td>&nbsp;</td>\n";
echo "\t\t\t\t</tr>\n";
Expand Down

0 comments on commit e1cd33c

Please sign in to comment.