Skip to content

Commit

Permalink
Fixed issue #09892: Ranking filter + on element not filtered : reset …
Browse files Browse the repository at this point in the history
…the last possibility

Dev: subQrelInfo return ONLY sub question with "relevance".
Dev; without any relevance set : _ProcessSubQRelevance don't fill subQrelInfo
Dev: must fill with 1 (only true) ?
Dev: see https://bugs.limesurvey.org/view.php?id=9892#c33125
Dev: then count 'answers' and remove unrelevant
  • Loading branch information
Shnoulle committed Sep 22, 2015
1 parent f6cc313 commit 95d33e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/helpers/expressions/em_manager_helper.php
Expand Up @@ -6066,7 +6066,8 @@ function _ValidateQuestion($questionSeq,$force=false)
{
// Relevance of subquestion for ranking question depend of the count of relevance of answers.
$iCountRank=(isset($iCountRank) ? $iCountRank+1 : 1);
$iCountRelevant=isset($iCountRelevant) ? $iCountRelevant : count(array_filter($LEM->subQrelInfo[$qid],function($sqRankAnwsers){ return $sqRankAnwsers['result']; }));
// Relevant count is : Total answers less Unrelevant answers. subQrelInfo give only array with relevance equation, not this without any relevance.
$iCountRelevant=isset($iCountRelevant) ? $iCountRelevant : count($sgqas)-count(array_filter($LEM->subQrelInfo[$qid],function($sqRankAnwsers){ return !$sqRankAnwsers['result']; }));
if($iCountRank > $iCountRelevant)
{
$foundSQrelevance=true;
Expand All @@ -6076,6 +6077,7 @@ function _ValidateQuestion($questionSeq,$force=false)
{
$relevantSQs[] = $sgqa;
}
// This just remove the last ranking : don't control validity of answers done: user can rank unrelevant answers .... See Bug #09774
continue;
}

Expand Down

0 comments on commit 95d33e5

Please sign in to comment.