Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue #7309: Placeholders referring to dual scale question do n…
…ot work

Fixed issue #4638: Array Dual Scale - Dual Dropdown - id contains #
Dev: remove # in answer id, but leave it in name: no need table updating like this
Dev: remove # in EM input name (hidden id="java....")
Dev: Lauch ExprMgr_process_relevance_and_tailoring in external javascript (think it's the way to do)
Dev: some fix for specific attributes in array_dual
Dev: all to be redone for 2.1/Plugin ...
  • Loading branch information
Shnoulle committed Feb 21, 2013
1 parent 4faa2ae commit 9c0ce00
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 410 deletions.
16 changes: 10 additions & 6 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -1508,7 +1508,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
if ($this->sgqaNaming)
{
$base = substr(substr($sq['jsVarName'],4),0,-1);
$base = $sq['rowdivid']."#";
$sq_name = "if(count(" . $base . "0.NAOK," . $base . "1.NAOK)==2,1,'')";
}
else
Expand Down Expand Up @@ -1594,7 +1594,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
if ($this->sgqaNaming)
{
$base = substr(substr($sq['jsVarName'],4),0,-1);
$base = $sq['rowdivid']."#";
$sq_name = "if(count(" . $base . "0.NAOK," . $base . "1.NAOK)==2,1,'')";
}
else
Expand Down Expand Up @@ -2730,7 +2730,7 @@ private function _recursivelyFindAntecdentArrayFilters($qroot, $aflist, $afelist

private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forceRefresh=false,$anonymized=false,$allOnOnePage=false)
{
if (isset($_SESSION['LEMforceRefresh'])) {
if (isset($_SESSION['LEMforceRefresh']) || true) {
unset($_SESSION['LEMforceRefresh']);
$forceRefresh=true;
}
Expand Down Expand Up @@ -3112,7 +3112,6 @@ private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forc
case 'I': //Language Question
case 'Y': //YES/NO radio-buttons
case '*': //Equation
case '1': //Array (Flexible Labels) dual scale
case 'A': //ARRAY (5 POINT CHOICE) radio-buttons
case 'B': //ARRAY (10 POINT CHOICE) radio-buttons
case 'C': //ARRAY (YES/UNCERTAIN/NO) radio-buttons
Expand All @@ -3131,6 +3130,10 @@ private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forc
}
$jsVarName = 'java' . $sgqa;
break;
case '1': //Array (Flexible Labels) dual scale
$jsVarName = 'java' . str_replace('#','_',$sgqa);
$jsVarName_on = $jsVarName;
break;
case ':': //ARRAY (Multi Flexi) 1 to 10
case ';': //ARRAY (Multi Flexi) Text
$jsVarName = 'java' . $sgqa;
Expand Down Expand Up @@ -6526,7 +6529,8 @@ static function GetRelevanceAndTailoringJavaScript()
{
$qrelJS .= " if(" . implode(' || ', $qrelgseqs) . "){\n ;\n }\n else";
}
$qrelJS .= " if (typeof sgqa !== 'undefined' && !LEMregexMatch('/ java' + sgqa + ' /', UsesVars)) {\n return;\n }\n";
$qrelJS .= " if (typeof sgqa !== 'undefined' && !LEMregexMatch('/ java' + sgqa + ' /', UsesVars)) {\n";
$qrelJS .= " return;\n }\n";
$qrelJS .= implode("",$relParts);
$qrelJS .= "}\n";
$relEqns[] = $qrelJS;
Expand Down Expand Up @@ -7029,7 +7033,7 @@ static function UnitTestRelevance()
$rel = LimeExpressionManager::QuestionIsRelevant($i);
$question = LimeExpressionManager::ProcessString($testArg[3], $i, NULL, true, 1, 1);

$jsVarName='java' . $testArg[0];
$jsVarName='java' . str_replace('#','_',$testArg[0]);

$argInfo[] = array(
'num' => $i,
Expand Down

0 comments on commit 9c0ce00

Please sign in to comment.