Skip to content

Commit

Permalink
Fixed issue #05804: Equation question type does not work in all templ…
Browse files Browse the repository at this point in the history
…ates

Dev it will now work properly in any existing or customized template

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@12434 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
tmswhite committed Feb 10, 2012
1 parent 15d8952 commit 5ed87d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -871,6 +871,7 @@ function checkconditions(value, name, type)
$question['sgq'] = $qa[7];
$question['aid'] = !empty($qinfo['info']['aid']) ? $qinfo['info']['aid'] : 0;
$question['sqid'] = !empty($qinfo['info']['sqid']) ? $qinfo['info']['sqid'] : 0;
$question['type']=$qinfo['info']['type'];
//===================================================================
$answer = $qa[1];
$help = $qinfo['info']['help']; // $qa[2];
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/expressions/em_manager_helper.php
Expand Up @@ -5199,7 +5199,7 @@ static function GetRelevanceAndTailoringJavaScript()
{
$relParts[] = " // Write value from the question into the answer field\n";
$jsResultVar = $LEM->em->GetJsVarFor($arg['jsResultVar']);
$relParts[] = " $('#" . substr($jsResultVar,1,-1) . "').val(escape(jQuery.trim(LEMstrip_tags($('#question" . $arg['qid'] . " .questiontext').find('span').next().next().html()))).replace(/%20/g,' '));\n";
$relParts[] = " $('#" . substr($jsResultVar,1,-1) . "').val(escape(jQuery.trim(LEMstrip_tags($('#question" . $arg['qid'] . " .em_equation').find('span').html()))).replace(/%20/g,' '));\n";
}
$relParts[] = " relChange" . $arg['qid'] . "=true;\n";
$relParts[] = " $('#relevance" . $arg['qid'] . "').val('1');\n";
Expand Down
11 changes: 11 additions & 0 deletions application/helpers/replacements_helper.php
Expand Up @@ -224,6 +224,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$_question_input_error_class = $question['input_error_class'];
$_question_number = $question['number'];
$_question_code = $question['code'];
$_question_type = $question['type'];
}
else
{
Expand All @@ -241,8 +242,18 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$_question_input_error_class = '';
$_question_number = '';
$_question_code = '';
$_question_type = '';
};

if ($_question_type == 'N' || $_question_type == 'U' || $_question_type == 'T' || $_question_type == 'S')
{
$_question_text = '<label for="answer'.$answer_id.'" >'.$_question_text.'</label>';
}
else if ($_question_type == '*')
{
$_question_text = '<span class="em_equation">' .$_question_text. '</span>';
}

if (!(
$showqnumcode == 'both' ||
$showqnumcode == 'number' ||
Expand Down

0 comments on commit 5ed87d4

Please sign in to comment.