Skip to content

Commit

Permalink
Fixed issue #6035: Insertans not working in multiple options with com…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
c-schmitz committed Apr 20, 2012
1 parent 1e702fa commit b92a1d9
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions classes/expressions/LimeExpressionManager.php
Expand Up @@ -218,7 +218,7 @@ class LimeExpressionManager {
* @example ['0~4'] = "4|Child" // this means that code 4 in scale 0 has a coded value of 4 and a display value of 'Child'
* @example (for [705]): ['1~2'] = '2|Sometimes' // this means that the second scale for this question uses the coded value of 2 to represent 'Sometimes'
* @example // TODO - add example from survey using assessments
*
*
* @var type
*/
private $qans;
Expand Down Expand Up @@ -366,7 +366,7 @@ class LimeExpressionManager {
* 'sumEqn' => '' //
* 'sumRemainingEqn' => '' //
* );
*
*
* @var type
*/
private $currentQset=NULL;
Expand All @@ -383,7 +383,7 @@ class LimeExpressionManager {
* 'unansweredSQs' => // pipe-separated list of any sub-questions that were not answered
* 'invalidSQs' => // pipe-separated list of any sub-questions that failed validation constraints
* );
*
*
* @var type
*/
private $lastMoveResult=NULL;
Expand All @@ -406,7 +406,7 @@ class LimeExpressionManager {
* 'mandViolation' => 0 // 1 if the question as a whole fails the mandatory criteria
* 'valid' => 1 // 0 if any part of the question fails validation criteria.
* );
*
*
* @var type
*/
private $indexQseq;
Expand All @@ -424,7 +424,7 @@ class LimeExpressionManager {
* 'mandViolation' => 0 // 1 if at least one relevant, non-hidden question in the group fails mandatory constraints
* 'show' => 1 // 1 if there is at least one relevant, non-hidden question within the group
* );
*
*
* @var type
*/
private $indexGseq;
Expand All @@ -439,7 +439,7 @@ class LimeExpressionManager {
* 'description' => // the description of the group (e.g. gtitle)
* 'grelevance' => '' // the group-level relevance
* );
*
*
* @var type
*/
private $gseq2info;
Expand Down Expand Up @@ -523,7 +523,7 @@ class LimeExpressionManager {
* 'relevanceVars' => '' // the pipe-delimited list of on-page javascript variable names used within the group-level relevance equation
* 'prettyPrint' => '' // a pretty-print version of the group-level relevance equation, only if there are errors
* );
*
*
* @var type
*/
private $gRelInfo=array();
Expand Down Expand Up @@ -566,7 +566,7 @@ class LimeExpressionManager {
* 'prettyPrint' => '' // syntax-highlighted version of equation if there are any errors
* 'hasErrors' => 0 // 1 if there are any syntax errors
* );
*
*
* @var type
*/
private $ParseResultCache;
Expand All @@ -588,7 +588,7 @@ class LimeExpressionManager {
* used to specify whether to generate equations using SGQA codes or qcodes
* Default is to convert all qcode naming to sgqa naming when generating javascript, as that provides the greatest backwards compatibility
* Excel export of survey structure sets this to false so as to force use of qcode naming
*
*
* @var Boolean
*/
private $sgqaNaming = true;
Expand Down Expand Up @@ -6912,10 +6912,13 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
break;
case 'M': //Multiple choice checkbox
case 'P': //Multiple choice with comments checkbox + text
if ($code == 'Y' && isset($var['question']))
if ($code == 'Y' && isset($var['question']) && !preg_match('/comment$/',$sgqa))
{
$shown = $var['question'];
}
elseif (preg_match('/comment$/',$sgqa) && isset($_SESSION[$sgqa])) {
$shown = $_SESSION[$sgqa];
}
else
{
$shown = $default;
Expand Down

0 comments on commit b92a1d9

Please sign in to comment.