Skip to content

Commit

Permalink
Fixed issue #07714: multi numeric slider broken
Browse files Browse the repository at this point in the history
Dev: use same HTML than without slider (then can be updated without js)
Dev: is no min/max is set for question, set it to min/max slider (without js)
Dev: Have to hide the tip in js if min/max is the same
  • Loading branch information
Shnoulle committed Apr 29, 2013
1 parent 8da6be7 commit 3c56da8
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 298 deletions.
8 changes: 7 additions & 1 deletion application/helpers/expressions/em_manager_helper.php
Expand Up @@ -1757,6 +1757,9 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$max_answers='';
}

// Fix min_num_value_n and max_num_value_n for multinumeric with slider: see bug #7798
if($type=="K" && isset($qattr['slider_min']) && ( !isset($qattr['min_num_value_n']) || trim($qattr['min_num_value_n'])==''))
$qattr['min_num_value_n']=$qattr['slider_min'];
// min_num_value_n
// Validation:= N >= value (which could be an expression).
if (isset($qattr['min_num_value_n']) && trim($qattr['min_num_value_n']) != '')
Expand Down Expand Up @@ -1840,6 +1843,9 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$min_num_value_n='';
}

// Fix min_num_value_n and max_num_value_n for multinumeric with slider: see bug #7798
if($type=="K" && isset($qattr['slider_max']) && ( !isset($qattr['max_num_value_n']) || trim($qattr['max_num_value_n'])==''))
$qattr['max_num_value_n']=$qattr['slider_max'];
// max_num_value_n
// Validation:= N <= value (which could be an expression).
if (isset($qattr['max_num_value_n']) && trim($qattr['max_num_value_n']) != '')
Expand Down Expand Up @@ -6427,7 +6433,7 @@ static function GetRelevanceAndTailoringJavaScript()
$allJsVarsUsed = array_merge($allJsVarsUsed,$_sqValidVars);
$valJsVarsUsed = array_merge($valJsVarsUsed,$_sqValidVars);
$validationJS = $LEM->em->GetJavaScriptEquivalentOfExpression();
if($_validationJS!='')
if($validationJS!='')
{
$valParts[] = "\n if(" . $validationJS . "){\n";
$valParts[] = " $('#" . $_veq['subqValidSelector'] . "').addClass('em_sq_validation').removeClass('error').addClass('good');;\n";
Expand Down

0 comments on commit 3c56da8

Please sign in to comment.