From 00707be1ad4f853742568408e3d6fe1fbf6eb39f Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Wed, 20 Feb 2019 12:15:58 -0500 Subject: [PATCH] Improve code readability - refs BT#15281 --- main/survey/survey.lib.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 4dc23cc3fa..a91200944e 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -2254,24 +2254,20 @@ class SurveyManager survey_id = $surveyId"; $result = Database::query($sql); $countOfQuestions = Database::result($result, 0, 0); - $count = 1; - if (!empty($numberPageBreaks) && !empty($countOfQuestions)) { - $count = $countOfQuestions; - } if ($survey['one_question_per_page'] == 1) { - $count = 1; if (!empty($countOfQuestions)) { - $count = $countOfQuestions; - } - } else { - $count = $numberPageBreaks + 1; - if (empty($numberPageBreaks)) { - $count = 1; + return $countOfQuestions; } + + return 1; + } + + if (empty($numberPageBreaks)) { + return 1; } - return $count; + return $numberPageBreaks + 1; } /**