Skip to content

Commit

Permalink
Added some comments to retrieve_Answer function, explaining its purpose.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1017 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed May 9, 2004
1 parent b1a8262 commit 070b468
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion qanda.php
Expand Up @@ -1418,11 +1418,21 @@ function do_array_flexiblecolumns($ia)

function retrieve_Answer($code)
{
//This function checks to see if there is an answer saved in the survey session
//data that matches the $code. If it does, it returns that data.
//It is used when building a questions text to allow incorporating the answer
//to an earlier question into the text of a later question.
//IE: Q1: What is your name? [Jason]
// Q2: Hi [Jason] how are you ?
//This function is called from the retriveAnswers function.
global $dbprefix;
//Find question details
if (isset($_SESSION[$code]))
{
$questiondetails=getsidgidqid($code);
$questiondetails=getsidgidqid($code);
//the getsidgidqid function is in common.php and returns
//a SurveyID, GroupID, QuestionID and an Answer code
//extracted from a "fieldname" - ie: 1X2X3a
$query="SELECT type FROM {$dbprefix}questions WHERE qid=".$questiondetails['qid'];
$result=mysql_query($query) or die("Error getting reference question type<br />$query<br />".mysql_error());
while($row=mysql_fetch_array($result))
Expand Down

0 comments on commit 070b468

Please sign in to comment.