This commit is contained in:
@ -1,4 +1,13 @@
|
||||
const STABLE_KEY_RE = /^[a-zA-Z][a-zA-Z0-9_]*$/;
|
||||
const RESULTS_EXCLUDED_KEYS = new Set(['data_final_warning']);
|
||||
const RESULTS_EXCLUDED_TYPES = new Set(['last_page']);
|
||||
|
||||
/** Questions hidden from results tables and CSV exports (e.g. last-page warnings). */
|
||||
export function isResultsExcludedQuestion(q) {
|
||||
if (!q) return false;
|
||||
if (RESULTS_EXCLUDED_TYPES.has(q.type)) return true;
|
||||
return RESULTS_EXCLUDED_KEYS.has(questionDisplayKey(q));
|
||||
}
|
||||
|
||||
/** Local question id from full questionID (hash__q5 → q5). */
|
||||
export function questionLocalKey(questionID, fallback = '') {
|
||||
@ -62,6 +71,7 @@ export function glassSymptomAnswerValue(raw, symptomKey) {
|
||||
export function buildResultColumns(questions) {
|
||||
const cols = [];
|
||||
for (const q of questions || []) {
|
||||
if (isResultsExcludedQuestion(q)) continue;
|
||||
const cfg = parseQuestionConfig(q);
|
||||
const symptoms = cfg.symptoms;
|
||||
if (q.type === 'glass_scale_question' && Array.isArray(symptoms) && symptoms.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user