Skip to content

Commit

Permalink
Fixed issue #9574: Conditions page is huge and slow when rendering co…
Browse files Browse the repository at this point in the history
…ndition options for Array (Number) questions
  • Loading branch information
c-schmitz committed Jun 14, 2016
1 parent 7dc3e38 commit 2f5bd30
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -826,13 +826,9 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
{
$shortquestion=$rows['title'].":{$yrow['title']}:$key: [".strip_tags($yrow['question']). "][" .strip_tags($val). "] " . flattenText($rows['question']);
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$yrow['title']."_".$key);

if ($rows['type'] == ":")
if ($rows['mandatory'] != 'Y')
{
for($ii=$minvalue; $ii<=$maxvalue; $ii+=$stepvalue)
{
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$yrow['title']."_".$key, $ii, $ii);
}
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$yrow['title']."_".$key, "", gT("No answer"));
}
}
}
Expand Down Expand Up @@ -1106,9 +1102,9 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
foreach($canswers as $can)
{
$an = ls_json_encode(flattenText($can[2]));
$javascriptpre .= "Fieldnames[$jn]='$can[0]';\n"
. "Codes[$jn]='$can[1]';\n"
. "Answers[$jn]={$an};\n";
$javascriptpre .= "Fieldnames[{$jn}]='{$can[0]}';\n"
. "Codes[{$jn}]='{$can[1]}';\n"
. "Answers[{$jn}]={$an};\n";
$jn++;
}
}
Expand Down

0 comments on commit 2f5bd30

Please sign in to comment.