Skip to content

Commit

Permalink
Fixed issue #4567: INSERTANS for multiple choice questions not working
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9113 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Sep 4, 2010
1 parent da474b8 commit 7b80619
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions common.php
Expand Up @@ -6072,15 +6072,20 @@ function retrieve_Answer($code, $phpdateformat=null)
if ($questiondetails['type'] == "M" ||
$questiondetails['type'] == "P")
{
$query="SELECT * FROM {$dbprefix}answers WHERE qid='".$questiondetails['qid']."' AND language='".$_SESSION['s_lang']."'";
$query="SELECT * FROM {$dbprefix}questions WHERE parent_qid='".$questiondetails['qid']."' AND language='".$_SESSION['s_lang']."'";
$result=db_execute_assoc($query) or safe_die("Error getting answer<br />$query<br />".$connect->ErrorMsg()); //Checked
while($row=$result->FetchRow())
{
if (isset($_SESSION[$code.$row['code']]) && $_SESSION[$code.$row['code']] == "Y")
if (isset($_SESSION[$code.$row['title']]) && $_SESSION[$code.$row['title']] == "Y")
{
$returns[] = $row['answer'];
$returns[] = $row['question'];
}
elseif (isset($_SESSION[$code]) && $_SESSION[$code] == "Y" && $questiondetails['aid']==$row['title'])
{
return $row['question'];
}
}

if (isset($_SESSION[$code."other"]) && $_SESSION[$code."other"])
{
$returns[]=$_SESSION[$code."other"];
Expand Down

0 comments on commit 7b80619

Please sign in to comment.