diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 9de5e75567f..4a20896d0d9 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -1442,7 +1442,11 @@ private function getErrorHtmlMessage() //Mandatory question(s) with unanswered answer if ($this->aStepInfo['mandViolation'] && $this->okToShowErrors) { - $aErrorsMandatory[] = gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed."); + if ($this->aStepInfo['mandNonSoft']) { + $aErrorsMandatory[] = gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed."); + } else { + $aErrorsMandatory[] = gT("One or more mandatory questions have not been answered. If possible, please complete them before continuing to the next page."); + } } // Question(s) with not valid answer(s) diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 2bdea33643d..4f5a20ebdfb 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -5752,6 +5752,7 @@ public function _ValidateGroup($groupSeq, $force = false) 'valid' => $gvalid, 'mandViolation' => $gmandViolation, 'mandSoft' => $gmandSoft, + 'mandNonSoft' => $gmandNonSoft, 'show' => (($grel && !$ghidden) ? true : false), ]; diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index 3b82ec63e49..cd3f1aaa50f 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -310,7 +310,13 @@ function mandatory_popup($ia, $notanswered = null) //ADD WARNINGS TO QUESTIONS IF THEY WERE MANDATORY BUT NOT ANSWERED global $mandatorypopup, $popup; //POPUP WARNING - if (!isset($mandatorypopup) && ($ia[4] == 'T' || $ia[4] == 'S' || $ia[4] == 'U')) { + // If there is no "hard" mandatory violation (both current and previous violations belong to Soft Mandatory questions), + // we show the soft mandatory message. + if ($ia[6] == 'S' && (!isset($mandatorypopup) || $mandatorypopup == 'S')) { + $popup = gT("One or more mandatory questions have not been answered. If possible, please complete them before continuing to the next page."); + $mandatorypopup = "S"; + } elseif (!isset($mandatorypopup) && ($ia[4] == 'T' || $ia[4] == 'S' || $ia[4] == 'U')) { + // If $popup = gT("You cannot proceed until you enter some text for one or more questions."); $mandatorypopup = "Y"; } else {