From 070b468532db6af2bcd54520b6f8dc07beb4a4b4 Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Sun, 9 May 2004 10:56:13 +0000 Subject: [PATCH] Added some comments to retrieve_Answer function, explaining its purpose. git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1017 b72ed6b6-b9f8-46b5-92b4-906544132732 --- qanda.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qanda.php b/qanda.php index 2999bae3609..83a4334bd37 100644 --- a/qanda.php +++ b/qanda.php @@ -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
$query
".mysql_error()); while($row=mysql_fetch_array($result))