Skip to content

Commit

Permalink
Fixed issue #05896: miscellaneous, rarely used, qcode.* attributes sh…
Browse files Browse the repository at this point in the history
…owing blank values

Dev fixed for .value and .shown for ListDropdown_other, ListRadio_other, and ListWithComment_comment
Dev still not working for .relevance and .grelevance
  • Loading branch information
TMSWhite committed Apr 16, 2012
1 parent 298c125 commit 6fc9ba3
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 28 deletions.
68 changes: 45 additions & 23 deletions classes/expressions/LimeExpressionManager.php
Expand Up @@ -6223,23 +6223,34 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
case 'H': //ARRAY (Flexible) - Column Format
case 'F': //ARRAY (Flexible) - Row Format
case 'R': //RANKING STYLE
$scale_id = $this->_GetVarAttribute($name,'scale_id','0',$gseq,$qseq);
$which_ans = $scale_id . '~' . $code;
$ansArray = $var['ansArray'];
if (is_null($ansArray))
if ($type == 'O' && preg_match('/comment\.value/',$name))
{
$value = $default;
$value = $code;
}
else if (($type == 'L' || $type == '!') && preg_match('/_other\.value/',$name))
{
$value = $code;
}
else
{
if (isset($ansArray[$which_ans])) {
$answerInfo = explode('|',$ansArray[$which_ans]);
$answer = $answerInfo[0];
$scale_id = $this->_GetVarAttribute($name,'scale_id','0',$gseq,$qseq);
$which_ans = $scale_id . '~' . $code;
$ansArray = $var['ansArray'];
if (is_null($ansArray))
{
$value = $default;
}
else {
$answer = $default;
else
{
if (isset($ansArray[$which_ans])) {
$answerInfo = explode('|',$ansArray[$which_ans]);
$answer = $answerInfo[0];
}
else {
$answer = $default;
}
$value = $answer;
}
$value = $answer;
}
break;
default:
Expand Down Expand Up @@ -6294,24 +6305,35 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
case 'H': //ARRAY (Flexible) - Column Format
case 'F': //ARRAY (Flexible) - Row Format
case 'R': //RANKING STYLE
$scale_id = $this->_GetVarAttribute($name,'scale_id','0',$gseq,$qseq);
$which_ans = $scale_id . '~' . $code;
$ansArray = $var['ansArray'];
if (is_null($ansArray))
if ($type == 'O' && preg_match('/comment$/',$name))
{
$shown=$code;
$shown = $code;
}
else if (($type == 'L' || $type == '!') && preg_match('/_other$/',$name))
{
$shown = $code;
}
else
{
if (isset($ansArray[$which_ans])) {
$answerInfo = explode('|',$ansArray[$which_ans]);
array_shift($answerInfo);
$answer = join('|',$answerInfo);
$scale_id = $this->_GetVarAttribute($name,'scale_id','0',$gseq,$qseq);
$which_ans = $scale_id . '~' . $code;
$ansArray = $var['ansArray'];
if (is_null($ansArray))
{
$shown=$code;
}
else {
$answer = $code;
else
{
if (isset($ansArray[$which_ans])) {
$answerInfo = explode('|',$ansArray[$which_ans]);
array_shift($answerInfo);
$answer = join('|',$answerInfo);
}
else {
$answer = $code;
}
$shown = $answer;
}
$shown = $answer;
}
break;
case 'A': //ARRAY (5 POINT CHOICE) radio-buttons
Expand Down
21 changes: 16 additions & 5 deletions scripts/em_javascript.js
Expand Up @@ -271,6 +271,9 @@ function LEMval(alias)
if (attr.type == 'O' && varName.match(/comment$/)) {
answer = value;
}
else if ((attr.type == 'L' || attr.type == '!') && varName.match(/_other$/)) {
answer = value;
}
else {
which_ans = '0~' + value;
if (typeof attr.answers[which_ans] === 'undefined') {
Expand Down Expand Up @@ -376,13 +379,21 @@ function LEMval(alias)
case 'H': //ARRAY (Flexible) - Column Format
case 'F': //ARRAY (Flexible) - Row Format
case 'R': //RANKING STYLE
which_ans = '0~' + value;
if (typeof attr.answers[which_ans] === 'undefined') {
value = '';
if (attr.type == 'O' && varName.match(/comment$/)) {
// value = value;
}
else if ((attr.type == 'L' || attr.type == '!') && varName.match(/_other$/)) {
// value = value;
}
else {
answerParts = attr.answers[which_ans].split('|');
value = answerParts[0];
which_ans = '0~' + value;
if (typeof attr.answers[which_ans] === 'undefined') {
value = '';
}
else {
answerParts = attr.answers[which_ans].split('|');
value = answerParts[0];
}
}
break;
case '1': //Array (Flexible Labels) dual scale // need scale
Expand Down

0 comments on commit 6fc9ba3

Please sign in to comment.