@ -676,6 +676,7 @@ if (1 == $survey_data['shuffle']) {
$shuffle = ' BY RAND() ';
$shuffle = ' BY RAND() ';
}
}
$pageBreakText = [];
if ((isset($_GET['show']) & & $_GET['show'] != '') ||
if ((isset($_GET['show']) & & $_GET['show'] != '') ||
isset($_POST['personality'])
isset($_POST['personality'])
) {
) {
@ -711,6 +712,7 @@ if ((isset($_GET['show']) && $_GET['show'] != '') ||
} else {
} else {
if ($row['type'] === 'pagebreak') {
if ($row['type'] === 'pagebreak') {
$counter++;
$counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else {
} else {
$paged_questions[$counter][] = $row['question_id'];
$paged_questions[$counter][] = $row['question_id'];
}
}
@ -1030,6 +1032,7 @@ if ((isset($_GET['show']) && $_GET['show'] != '') ||
$counter++;
$counter++;
} elseif ($row['type'] == 'pagebreak') {
} elseif ($row['type'] == 'pagebreak') {
$counter++;
$counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else {
} else {
// ids from question of the current survey
// ids from question of the current survey
$paged_questions_sec[$counter][] = $row['question_id'];
$paged_questions_sec[$counter][] = $row['question_id'];
@ -1134,6 +1137,7 @@ if ((isset($_GET['show']) && $_GET['show'] != '') ||
} else {
} else {
if ($row['type'] == 'pagebreak') {
if ($row['type'] == 'pagebreak') {
$counter++;
$counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else {
} else {
// ids from question of the current survey
// ids from question of the current survey
$paged_questions[$counter][] = $row['question_id'];
$paged_questions[$counter][] = $row['question_id'];
@ -1288,6 +1292,18 @@ if (isset($questions) && is_array($questions)) {
$form->addHtml('< div class = "start-survey" > ');
$form->addHtml('< div class = "start-survey" > ');
$js = '';
$js = '';
if (isset($pageBreakText[$originalShow]) & & !empty(strip_tags($pageBreakText[$originalShow]))) {
// Only show page-break texts if there is something there, apart from
// HTML tags
$form->addHtml(
'< div > '.
Security::remove_XSS($pageBreakText[$originalShow]).
'< / div > '
);
$form->addHtml('< br / > ');
}
foreach ($questions as $key => & $question) {
foreach ($questions as $key => & $question) {
$ch_type = 'ch_'.$question['type'];
$ch_type = 'ch_'.$question['type'];
$questionNumber = $questionCounter;
$questionNumber = $questionCounter;