removing last page from being stored
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-07-01 09:33:44 +02:00
parent bbf10fe866
commit 70dca17451
5 changed files with 29 additions and 0 deletions

View File

@ -1069,6 +1069,14 @@ function qdb_glass_symptom_answer_value(?string $json, string $symptomKey): stri
return trim((string)($decoded[$symptomKey] ?? ''));
}
/**
* Question types that exist only for app/editor flow (no answer payload to persist).
*/
function qdb_is_non_stored_answer_question_type(string $type): bool
{
return $type === 'last_page';
}
/**
* Flat columns for results / CSV: one column per glass-scale symptom.
*
@ -1080,6 +1088,9 @@ function qdb_results_export_columns(array $questions, string $qnID): array
foreach ($questions as $q) {
$cfg = json_decode($q['configJson'] ?? '{}', true) ?: [];
$type = $q['type'] ?? '';
if (qdb_is_non_stored_answer_question_type($type)) {
continue;
}
if ($type === 'glass_scale_question') {
$symptoms = $cfg['symptoms'] ?? [];
if (is_array($symptoms) && $symptoms !== []) {
@ -1368,6 +1379,9 @@ function qdb_display_questionnaire_context(PDO $pdo, string $questionnaireID): a
foreach ($questions as $q) {
$cfg = json_decode($q['configJson'] ?? '{}', true) ?: [];
$type = $q['type'] ?? '';
if (qdb_is_non_stored_answer_question_type($type)) {
continue;
}
if ($type === 'glass_scale_question') {
$symptoms = $cfg['symptoms'] ?? [];
if (is_array($symptoms) && $symptoms !== []) {