Skip to content

Commit

Permalink
Fix: Show SGQA codes for semantic differential question types (Array …
Browse files Browse the repository at this point in the history
…questions "A" and "F") if enabled at optional settings.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9749 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
maziminke committed Feb 8, 2011
1 parent c43df39 commit 5a80702
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions admin/printablesurvey.php
Expand Up @@ -1166,8 +1166,16 @@ function star_replace($input)
{
$question['ANSWER'] .= "\t\t<tr class=\"$rowclass\">\n";
$rowclass = alternation($rowclass,'row');
$answertext=$mearow['question'].addsgqacode(" (".$fieldname.$mearow['title'].")");
if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));}

//semantic differential question type?
if (strpos($mearow['question'],'|'))
{
$answertext = substr($mearow['question'],0, strpos($mearow['question'],'|')).addsgqacode(" (".$fieldname.$mearow['title'].")")." ";
}
else
{
$answertext=$mearow['question'].addsgqacode(" (".$fieldname.$mearow['title'].")");
}
$question['ANSWER'] .= "\t\t\t<th class=\"answertext\">$answertext</th>\n";

$pdfoutput[$j][0]=$answertext;
Expand All @@ -1177,11 +1185,13 @@ function star_replace($input)
$pdfoutput[$j][$i]=" o ".$i;
}

$answertext=$mearow['question'];
if (strpos($answertext,'|'))
$answertext .= $mearow['question'];

//semantic differential question type?
if (strpos($mearow['question'],'|'))
{
$answertext=substr($answertext,strpos($answertext,'|')+1);
$question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">$answertext</td>\n";
$answertext2 = substr($mearow['question'],strpos($mearow['question'],'|')+1);
$question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">$answertext2</td>\n";
}
$question['ANSWER'] .= "\t\t</tr>\n";
$j++;
Expand Down Expand Up @@ -1545,9 +1555,18 @@ function star_replace($input)
{
$question['ANSWER'] .= "\t\t<tr class=\"$rowclass\">\n";
$rowclass = alternation($rowclass,'row');
$answertext=$mearow['question'].addsgqacode(" (".$fieldname.$mearow['title'].")");
if (trim($answertext)=='') $answertext='&nbsp;';
if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));}

//semantic differential question type?
if (strpos($mearow['question'],'|'))
{
$answertext = substr($mearow['question'],0, strpos($mearow['question'],'|')).addsgqacode(" (".$fieldname.$mearow['title'].")")." ";
}
else
{
$answertext=$mearow['question'].addsgqacode(" (".$fieldname.$mearow['title'].")");
}

if (trim($qidattributes['answer_width'])!='')
{
$sInsertStyle=' style="width:'.$qidattributes['answer_width'].'%" ';
Expand All @@ -1557,23 +1576,23 @@ function star_replace($input)
$sInsertStyle='';
}
$question['ANSWER'] .= "\t\t\t<th $sInsertStyle class=\"answertext\">$answertext</th>\n";
//$printablesurveyoutput .="\t\t\t\t\t<td>";

$pdfoutput[$counter][0]=$answertext;
for ($i=1; $i<=$fcount; $i++)
{

$question['ANSWER'] .= "\t\t\t<td>".input_type_image('radio')."</td>\n";
$pdfoutput[$counter][$i] = "o";

}
$counter++;

$answertext=$mearow['question'];
if (strpos($answertext,'|'))

//semantic differential question type?
if (strpos($mearow['question'],'|'))
{
$answertext=substr($answertext,strpos($answertext,'|')+1);
$question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">$answertext</th>\n";

$answertext2=substr($mearow['question'],strpos($mearow['question'],'|')+1);
$question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">$answertext2</th>\n";
}
$question['ANSWER'] .= "\t\t</tr>\n";
}
Expand Down

0 comments on commit 5a80702

Please sign in to comment.