Skip to content

Commit

Permalink
Fixed issue #05707: Users won't understand regular expression and equ…
Browse files Browse the repository at this point in the history
…ation-based validation tips

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@12238 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
TMSWhite committed Jan 27, 2012
1 parent d324244 commit 1a396b3
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions classes/eval/LimeExpressionManager.php
Expand Up @@ -1473,25 +1473,25 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
}

// regular expression validation
if ($preg!='')
{
// do string replacement here so that curly braces within the regular expression don't trigger an EM error
$qtips[]=sprintf($this->gT('Each answer must conform to this regular expression: %s'), str_replace(array('{','}'),array('{ ',' }'), $preg));
}
// if ($preg!='')
// {
// // do string replacement here so that curly braces within the regular expression don't trigger an EM error
// $qtips[]=sprintf($this->gT('Each answer must conform to this regular expression: %s'), str_replace(array('{','}'),array('{ ',' }'), $preg));
// }

if ($em_validation_sq!='')
{
if ($em_validation_sq_tip =='')
{
$stringToParse = htmlspecialchars_decode($em_validation_sq,ENT_QUOTES);
$gseq = $this->questionId2groupSeq[$qinfo['qid']];
$result = $this->em->ProcessBooleanExpression($stringToParse,$gseq, $qinfo['qseq']);
$_validation_tip = $this->em->GetPrettyPrintString();
$qtips[]=sprintf($this->gT('Each answer must conform to this expression: %s'),$_validation_tip);
// $stringToParse = htmlspecialchars_decode($em_validation_sq,ENT_QUOTES);
// $gseq = $this->questionId2groupSeq[$qinfo['qid']];
// $result = $this->em->ProcessBooleanExpression($stringToParse,$gseq, $qinfo['qseq']);
// $_validation_tip = $this->em->GetPrettyPrintString();
// $qtips[]=sprintf($this->gT('Each answer must conform to this expression: %s'),$_validation_tip);
}
else
{
$qtips[]=sprintf($this->gT('Each answer must meet these criteria: %s'), $em_validation_sq_tip);
$qtips[]=$em_validation_sq_tip;
}

}
Expand All @@ -1501,15 +1501,15 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
if ($em_validation_q_tip =='')
{
$stringToParse = htmlspecialchars_decode($em_validation_q,ENT_QUOTES);
$gseq = $this->questionId2groupSeq[$qinfo['qid']];
$result = $this->em->ProcessBooleanExpression($stringToParse,$gseq, $qinfo['qseq']);
$_validation_tip = $this->em->GetPrettyPrintString();
$qtips[]=sprintf($this->gT('The question must conform to this expression: %s'), $_validation_tip);
// $stringToParse = htmlspecialchars_decode($em_validation_q,ENT_QUOTES);
// $gseq = $this->questionId2groupSeq[$qinfo['qid']];
// $result = $this->em->ProcessBooleanExpression($stringToParse,$gseq, $qinfo['qseq']);
// $_validation_tip = $this->em->GetPrettyPrintString();
// $qtips[]=sprintf($this->gT('The question must conform to this expression: %s'), $_validation_tip);
}
else
{
$qtips[]=sprintf($this->gT('The question must meet these criteria: %s'), $em_validation_q_tip);
$qtips[]=$em_validation_q_tip;
}
}

Expand Down

0 comments on commit 1a396b3

Please sign in to comment.