Skip to content

Commit

Permalink
Fixed issue #7998: Underscore character in subqestion code breaks exp…
Browse files Browse the repository at this point in the history
…ort of Array (numerical) questions - patch by lucass
  • Loading branch information
c-schmitz committed Sep 27, 2013
1 parent 18eee42 commit afa7e18
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions application/helpers/admin/exportresults_helper.php
Expand Up @@ -994,7 +994,7 @@ public function getCodeFieldSubHeading(SurveyObj $survey, FormattingOptions $oOp
}
break;

case ':':
case ':':
case ';':
list($scaleZeroTitle, $scaleOneTitle) = explode('_', $answerCode);
$subHeading .= ' ['.$scaleZeroTitle.']['.$scaleOneTitle.']';
Expand Down Expand Up @@ -1095,28 +1095,8 @@ public function getFullFieldSubHeading(SurveyObj $survey, FormattingOptions $oOp

case ':':
case ';':
//The headers created by this section of code are significantly different from
//the old code. I believe that they are more accurate. - elameno
list($scaleZeroTitle, $scaleOneTitle) = explode('_', $answerCode);
$sqs = $survey->getSubQuestionArrays($questionId);

$scaleZeroText = '';
$scaleOneText = '';
foreach ($sqs as $sq)
{
if ($sq['title'] == $scaleZeroTitle && $sq['scale_id'] == 0)
{
$scaleZeroText = $sq['question'];
}
elseif ($sq['title'] == $scaleOneTitle && $sq['scale_id'] == 1)
{
$scaleOneText = $sq['question'];
}
}

$subHeading .= ' ['.$this->stripTagsFull($scaleZeroText).']['.$this->stripTagsFull($scaleOneText).']';
$subHeading .= ' ['.$this->stripTagsFull($field['subquestion1']).']['.$this->stripTagsFull($field['subquestion2']).']';
break;

case '1':
$answerScale = substr($fieldName, -1) + 1;
$subQuestions = $survey->getSubQuestionArrays($questionId);
Expand Down

0 comments on commit afa7e18

Please sign in to comment.