Skip to content

Commit

Permalink
Fixed issue #14276: Validation for multiple numeric input is missing …
Browse files Browse the repository at this point in the history
…details about "equals sum value"

Dev: this don't fix User error …
Dev: using (min|max)_sum_value with equals_num_value is silly
Dev: currently js for  equals happen after (min|max) then totalvalue class respect equals
  • Loading branch information
Shnoulle committed Nov 23, 2018
1 parent 9869167 commit 789c1d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -1807,7 +1807,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$validationEqn[$questionNum][] = array(
'qtype' => $type,
'type' => 'equals_num_value',
'class' => 'sum_range',
'class' => 'sum_equals',
'eqn' => ($qinfo['mandatory']=='Y')?'(' . $mainEqn . ' == (' . $equals_num_value . '))':'(' . $mainEqn . ' == (' . $equals_num_value . ')' . $noanswer_option . ')',
'qid' => $questionNum,
'sumEqn' => $sumEqn,
Expand Down Expand Up @@ -3212,7 +3212,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
// equals_num_value
if ($equals_num_value!='')
{
$qtips['sum_range']=sprintf($this->gT("The sum must equal %s."),'{fixnum('.$equals_num_value.')}');
$qtips['sum_equals']=sprintf($this->gT("The sum must equal %s."),'{fixnum('.$equals_num_value.')}');
}

if($input_boxes)
Expand Down Expand Up @@ -7626,6 +7626,7 @@ public static function GetRelevanceAndTailoringJavaScript($bReturnArray=false)
switch ($vclass)
{
case 'sum_range':
case 'sum_equals':
$valParts[] = " isValidSum" . $arg['qid'] . "=false;\n";
break;
case 'other_comment_mandatory':
Expand Down

0 comments on commit 789c1d3

Please sign in to comment.