Skip to content

Commit

Permalink
Fixed issue #05690: Logic File does not show sub-question level defau…
Browse files Browse the repository at this point in the history
…lt values

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@12250 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
tmswhite committed Jan 30, 2012
1 parent 831b712 commit 154fdef
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions classes/eval/LimeExpressionManager.php
Expand Up @@ -5920,7 +5920,20 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
$type = $q['info']['type'];
$typedesc = $qtypes[$type]['description'];

$default = (is_null($q['info']['default']) ? '' : '<p>(DEFAULT: ' . $q['info']['default'] . ')</p>');
$sgqas = explode('|',$q['sgqa']);
if (count($sgqas) == 1 && !is_null($q['info']['default']))
{
$LEM->ProcessString($q['info']['default'], $qid,NULL,false,1,1,false,false);
$_default = $LEM->GetLastPrettyPrintExpression();
if ($LEM->em->HasErrors()) {
++$errorCount;
}
$default = '<br/>(' . $LEM->gT('DEFAULT:') . ' ' . $_default . ')';
}
else
{
$default = '';
}

$qtext = (($q['info']['qtext'] != '') ? $q['info']['qtext'] : '&nbsp');
$help = (($q['info']['help'] != '') ? '<hr/>[HELP: ' . $q['info']['help'] . ']': '');
Expand Down Expand Up @@ -6074,7 +6087,6 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
//////
// SHOW ALL SUB-QUESTIONS
//////
$sgqas = explode('|',$q['sgqa']);
$sqRows='';
$i=0;
$sawthis = array(); // array of rowdivids already seen so only show them once
Expand Down Expand Up @@ -6134,6 +6146,16 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
$sgqaInfo = $LEM->knownVars[$sgqa];
$subqText = $sgqaInfo['subqtext'];

if (isset($sgqaInfo['default']) && $sgqaInfo['default'] !== '')
{
$LEM->ProcessString($sgqaInfo['default'], $qid,NULL,false,1,1,false,false);
$_default = $LEM->GetLastPrettyPrintExpression();
if ($LEM->em->HasErrors()) {
++$errorCount;
}
$subQeqn .= '<br/>(' . $LEM->gT('DEFAULT:') . ' ' . $_default . ')';
}

$sqRows .= "<tr class='LEMsubq'>"
. "<td>SQ-$i</td>"
. "<td><b>" . $varName . "</b></td>"
Expand Down

0 comments on commit 154fdef

Please sign in to comment.