Skip to content

Commit

Permalink
New Feature: array_filter for ranking questions
Browse files Browse the repository at this point in the history
Dev: Works for question-by-question now

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@6785 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed May 6, 2009
1 parent ebbcde3 commit b0c44a9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion qanda.php
Expand Up @@ -2075,6 +2075,7 @@ function do_ranking($ia)
//CREATE A SECRET HIDDEN ELEMENT WITH THE ID FOR ARRAY_FILTER CONTROLS!
// SO FAR THIS JUST STOPS A JAVASCRIPT ERROR OCCURRING
. "\t\t\t\t\t\t\tcurrentElement=document.createElement('input');\n"
. "\t\t\t\t\t\t\tcurrentElement.setAttribute('type', 'hidden');\n"
. "\t\t\t\t\t\t\tcurrentElement.setAttribute('id', 'javatbd{$ia[1]}'+\$code);\n"
. "\t\t\t\t\t\t\tcurrentElement.setAttribute('name', 'javatbd{$ia[1]}'+\$code);\n"
. "\t\t\t\t\t\t\tcurrentElement.setAttribute('value', \$value);\n"
Expand Down Expand Up @@ -2201,7 +2202,16 @@ function do_ranking($ia)
($htmltbody=arraySearchByKey('array_filter', $qidattributes, 'attribute', 1) && $thissurvey['format'] == 'A'))
{
$choicelist .= " style='display: none'";
}
} elseif (($htmltbody=arraySearchByKey('array_filter', $qidattributes, 'attribute', 1) && $thissurvey['format'] == 'S') ||
($htmltbody=arraySearchByKey('array_filter', $qidattributes, 'attribute', 1) && $thissurvey['format'] == 'G' &&
getArrayFiltersOutGroup($ia[0]) == true))
{
$selected = getArrayFiltersForQuestion($ia[0]);
if (!in_array($ans[0],$selected))
{
$choicelist .= " style='display: none'";
}
}
$choicelist .= ">{$ans[1]}</option>\n";
if (isset($maxselectlength) && strlen($ans[1]) > $maxselectlength) {$maxselectlength = strlen($ans[1]);}
}
Expand Down

0 comments on commit b0c44a9

Please sign in to comment.