Skip to content

Commit

Permalink
Fixed issue #14955: Question relevance is not reassessed after group …
Browse files Browse the repository at this point in the history
…is shown (#2121)

Dev: test of condition of question must be checked if relevance of his group was updated.
  • Loading branch information
Shnoulle committed Nov 4, 2021
1 parent 6e722eb commit d864102
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -7372,13 +7372,16 @@ public static function GetRelevanceAndTailoringJavaScript($bReturnArray = false)
$qrelgseqs[] = 'relChangeG' . $knownVar['gseq'];
}
}
/* If group of current question relevance updated: must check too. See mantis #14955 */
$qrelgseqs[] = 'relChangeG' . $arg['gseq'];
$qrelgseqs = array_unique($qrelgseqs);
$qrelQIDs = array_unique($qrelQIDs);
$aQuestionsWithDependencies = array_unique($aQuestionsWithDependencies);
if ($LEM->surveyMode == 'question') {
$qrelQIDs = []; // in question-by-questin mode, should never test for dependencies on self or other questions.
}
if ($LEM->surveyMode != 'survey') {
$qrelgseqs = []; // in group by group or question by question mode, should never test for dependencies on self or other group.
$qrelgseqs = []; // javascript dependencies on groups only for survey mode
}
$qrelJS = "function LEMrel" . $arg['qid'] . "(sgqa){\n";
$qrelJS .= " var UsesVars = ' " . implode(' ', $relJsVarsUsed) . " ';\n";
Expand All @@ -7389,7 +7392,7 @@ public static function GetRelevanceAndTailoringJavaScript($bReturnArray = false)
if (!empty($qrelQIDs) > 0) {
$aCheckNeeded[] = "!(" . implode(' || ', $qrelQIDs) . ")";
}
/* If one of group relevance used in function are updated in a previous function */
/* If one of group relevance used in function are updated in a previous function OR group of this question */
if (!empty($qrelgseqs) > 0) {
$aCheckNeeded[] = "!(" . implode(' || ', $qrelgseqs) . ")";
}
Expand Down

0 comments on commit d864102

Please sign in to comment.