From 925127cf209c6264ef783adb780954a45e72a464 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Tue, 2 Feb 2021 19:34:40 +0000 Subject: [PATCH] #180 [census] export - clearer output --- server/routes/census.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/census.js b/server/routes/census.js index d1f6738fd..9ffae70bc 100644 --- a/server/routes/census.js +++ b/server/routes/census.js @@ -95,13 +95,13 @@ router.get('/census/export', async (req, res) => { for (let question of config.census.questions) { if (question.type === 'checkbox') { for (let [option, comment] of question.options) { - answer[`${i}_${option}`] = (answers[i.toString()] || []).includes(option); + answer[`${i}_${option}`] = (answers[i.toString()] || []).includes(option) ? 1 : ''; } } else { answer[`${i}_`] = answers[i.toString()] || ''; } if (question.writein) { - answer[`${i}__writein`] = writins[i.toString()] || '';; + answer[`${i}__writein`] = writins[i.toString()] || ''; } i++; }