Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:LimeSurvey/LimeSurvey.git int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
Shnoulle committed Dec 7, 2016
2 parents 2cf6b0d + b914052 commit 7c1a5a8
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -6604,16 +6604,23 @@ function _ValidateQuestion($questionSeq,$force=false)
if (isset($LEM->qid2validationEqn[$qid]))
{
$hasValidationEqn=true;
if (!$qhidden) // do this even is starts irrelevant, else will never show this information.

// do this even is starts irrelevant, else will never show this information.
if (!$qhidden)
{
$validationEqns = $LEM->qid2validationEqn[$qid]['eqn'];
$validationEqn = implode(' and ', $validationEqns);
$qvalid = $LEM->em->ProcessBooleanExpression($validationEqn,$qInfo['gseq'], $qInfo['qseq']);
$hasErrors = $LEM->em->HasErrors();
if (!$hasErrors)
{
$validationJS = $LEM->em->GetJavaScriptEquivalentOfExpression();
// Prevent to validate equation when empty. Only affect question type with default qtip but no validation equation
// @see: https://bugs.limesurvey.org/view.php?id=11867#c42419
if ($validationEqn!=''){
$validationEqns = $LEM->qid2validationEqn[$qid]['eqn'];
$validationEqn = implode(' and ', $validationEqns);
$qvalid = $LEM->em->ProcessBooleanExpression($validationEqn,$qInfo['gseq'], $qInfo['qseq']);
$hasErrors = $LEM->em->HasErrors();

if (!$hasErrors){
$validationJS = $LEM->em->GetJavaScriptEquivalentOfExpression();
}
}

$prettyPrintValidEqn = $validationEqn;
if ((($this->debugLevel & LEM_PRETTY_PRINT_ALL_SYNTAX) == LEM_PRETTY_PRINT_ALL_SYNTAX))
{
Expand Down

0 comments on commit 7c1a5a8

Please sign in to comment.