This commit is contained in:
14
common.php
14
common.php
@ -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 !== []) {
|
||||
|
||||
Reference in New Issue
Block a user