Skip to content

Commit

Permalink
Modified to handle 'Ranked' question type
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@222 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 14, 2003
1 parent 9740e04 commit 012241b
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions admin/export.php
Expand Up @@ -135,7 +135,7 @@
{
if ($style == "abrev")
{
if ($crow['type'] != "M" && $crow['type'] != "A" && $crow['type'] != "B" && $crow['type'] != "C" && $crow['type'] != "P" && $crow['type'] != "O")
if ($crow['type'] != "M" && $crow['type'] != "A" && $crow['type'] != "B" && $crow['type'] != "C" && $crow['type'] != "P" && $crow['type'] != "O" && $crow['type'] != "R")
{
$firstline .= "Grp{$crow['sid']}Qst{$crow['title']}$s ";
}
Expand All @@ -144,6 +144,16 @@
$firstline .= "Grp{$crow['sid']}Qst{$crow['title']}$s ";
$firstline .= "Grp{$crow['sid']}Qst{$crow['title']}[comment]$s ";
}
elseif ($crow['type'] == "R")
{
$i2query = "SELECT answers.*, questions.other FROM answers, questions WHERE answers.qid=questions.qid AND questions.qid={$crow['qid']} AND questions.sid=$sid ORDER BY code";
$i2result = mysql_query($i2query);
$i2count = mysql_num_rows($i2result);
for ($i=1; $i<=$i2count; $i++)
{
$firstline .= "Grp{$crow['sid']}Qst{$crow['title']}No$i $s";
}
}
else
{
$i2query = "SELECT answers.*, questions.other FROM answers, questions WHERE answers.qid=questions.qid AND questions.qid={$crow['qid']} AND questions.sid=$sid ORDER BY code";
Expand All @@ -162,7 +172,7 @@
}
elseif ($style == "full")
{
if ($crow['type'] != "M" && $crow['type'] != "A" && $crow['type'] != "B" && $crow['type'] != "C" && $crow['type'] != "P" && $crow['type'] != "O")
if ($crow['type'] != "M" && $crow['type'] != "A" && $crow['type'] != "B" && $crow['type'] != "C" && $crow['type'] != "P" && $crow['type'] != "O" && $crow['type'] != "R")
{
$firstline .= str_replace("<BR>", " ", str_replace("\r\n", " ", $crow['question']))."$s ";
}
Expand All @@ -171,6 +181,16 @@
$firstline .= str_replace("<BR>", " ", str_replace("\r\n", " ", $crow['question']))."$s ";
$firstline .= str_replace("<BR>", " ", str_replace("\r\n", " ", $crow['question']))."[Comment]$s ";
}
elseif ($crow['type'] == "R")
{
$i2query = "SELECT answers.*, questions.other FROM answers, questions WHERE answers.qid=questions.qid AND questions.qid={$crow['qid']} AND questions.sid=$sid ORDER BY code";
$i2result = mysql_query($i2query);
$i2count = mysql_num_rows($i2result);
for ($i=1; $i<=$i2count; $i++)
{
$firstline .= str_replace("<BR>", " ", str_replace("\r\n", " ", $crow['question'])).": $i$s ";
}
}
else
{
$i2query = "SELECT answers.*, questions.other FROM answers, questions WHERE answers.qid=questions.qid AND questions.qid={$crow['qid']} AND questions.sid=$sid ORDER BY code";
Expand Down Expand Up @@ -242,6 +262,14 @@
{$ftype = $qrow['type'];}
switch ($ftype)
{
case "R": //RANKING TYPE
$lq = "SELECT * FROM answers WHERE qid=$fqid AND code = '$drow[$i]'";
$lr = mysql_query($lq);
while ($lrow = mysql_fetch_array($lr, MYSQL_ASSOC))
{
echo $lrow['answer'];
}
break;
case "L": //DROPDOWN LIST
$lq = "SELECT * FROM answers WHERE qid=$fqid AND code ='$drow[$i]'";
$lr = mysql_query($lq);
Expand Down

0 comments on commit 012241b

Please sign in to comment.