From fac8f2c912a42b57f1e47ef0fe0694b89464d79a Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 5 Nov 2026 13:43:21 +0530 Subject: [PATCH] UNDP form: new question set, consent first; one-off Sheet column migration --- scripts/cohort-apps-script/Code.gs | 79 +++++++++++++++++++ src/components/cohort/questions.js | 121 +++++++++++++++++++++++------ src/pages/cohorts/cdl_undp.js | 2 +- 3 files changed, 177 insertions(+), 25 deletions(-) diff --git a/scripts/cohort-apps-script/Code.gs b/scripts/cohort-apps-script/Code.gs index 38b127c09..b35e7be7a 100644 --- a/scripts/cohort-apps-script/Code.gs +++ b/scripts/cohort-apps-script/Code.gs @@ -112,3 +112,82 @@ function sortColumns(tabName) { } function sortLongColumns() { sortColumns(TABS.long); } function sortShortColumns() { sortColumns(TABS.short); } + +// One-off, UNDP Sheet only (Nov 2026 question update): run migrateUndpColumns from the editor once, +// after the new script version is deployed. It copies the Long tab to a backup tab first, then +// renames and reorders columns to the new numbering. Columns are matched by question text, not +// number, so every answer moves with its question; two columns with the same question (old and +// new numbering) are merged, keeping the non-empty value. Columns for questions no longer asked +// are kept at the far right as "Retired: ...". Safe to run again. +var UNDP_LABELS = [ + "Do you consent to the use of your responses for this assessment?", + "Would your organisation consider sharing a use case, blog or learning story from the programme?", + "Your full name", + "Your role in the organisation", + "Email address", + "Phone number with country code", + "Organisation name", + "Registration type", + "Which states or districts does your organisation work in?", + "What are your organisation’s main areas of work?", + "Please share a link to your organisation’s website or other digital materials, if available.", + "In one sentence, what is your organisation’s mission, and which communities does it aim to serve?", + "Is your organisation led by members of the communities it primarily serves?", + "What does your organisation use AI tools for?", + "Which AI tools or platforms does your organisation currently use?", + "How frequently does your organisation use AI tools?", + "What are the main barriers to using AI effectively?", + "How would you describe the quality of AI-assisted content or outputs produced by your organisation’s staff?", + "What are your organisation’s primary concerns about the quality and use of AI-assisted outputs?", + "Which skills would be most useful to your organisation?", + "Which learning methods would help you most?", + "What device and internet access will the nominated learner have?", + "Which language would be most comfortable for learning?", + "What support would help the learner participate?", + "Can the same person attend throughout the programme and practise between sessions?", + "If invited to the two-day Delhi/NCR workshop, could the learner attend with travel paid by their organisation or themselves?", + "Finally, is there anything else we should know about your learning or participation needs?" + ]; +var UNDP_RENAMED = { + 'Is there anything else we should know about your learning or participation needs?': + 'Finally, is there anything else we should know about your learning or participation needs?' +}; + +function migrateUndpColumns() { + var ss = SHEET_ID ? SpreadsheetApp.openById(SHEET_ID) : SpreadsheetApp.getActiveSpreadsheet(); + var sheet = ss.getSheetByName(TABS.long); + if (!sheet || sheet.getLastRow() < 1) throw new Error('No "' + TABS.long + '" tab with data.'); + sheet.copyTo(ss).setName(TABS.long + ' backup ' + Utilities.formatDate(new Date(), 'Asia/Kolkata', 'yyyy-MM-dd HH:mm')); + + var values = sheet.getDataRange().getValues(); + var headers = values[0].map(String); + function label(h) { + var l = h.replace(/^Q\d+\.\s*/, ''); + return UNDP_RENAMED[l] || l; + } + var used = {}; + var cols = [{ header: 'Timestamp', from: [headers.indexOf('Timestamp')] }]; + UNDP_LABELS.forEach(function (l, i) { + var from = []; + headers.forEach(function (h, j) { if (h !== 'Timestamp' && label(h) === l) from.push(j); }); + from.forEach(function (j) { used[j] = true; }); + cols.push({ header: 'Q' + (i + 1) + '. ' + l, from: from }); + }); + headers.forEach(function (h, j) { + if (h === 'Timestamp' || used[j] || h === '') return; + cols.push({ header: /^Retired: /.test(h) ? h : 'Retired: ' + h, from: [j] }); + }); + + var out = values.map(function (row, r) { + return cols.map(function (c) { + if (r === 0) return c.header; + for (var k = 0; k < c.from.length; k++) { + var v = c.from[k] < 0 ? '' : row[c.from[k]]; + if (v !== '' && v != null) return v; + } + return ''; + }); + }); + sheet.clearContents(); + sheet.getRange(1, 1, out.length, cols.length).setValues(out); +} diff --git a/src/components/cohort/questions.js b/src/components/cohort/questions.js index 533322406..b4cd01e5f 100644 --- a/src/components/cohort/questions.js +++ b/src/components/cohort/questions.js @@ -169,6 +169,26 @@ export const TECH4DEV_SECTIONS = [ // options must be chosen on their own), `optional`, and `mustAgree` = the error // shown unless the first option is chosen. export const UNDP_SECTIONS = [ + { + title: 'Consent', + fields: [ + { + name: 'consent', + label: 'Do you consent to the use of your responses for this assessment?', + mustAgree: 'We can only use your responses with your consent. Please choose “Yes” to submit.', + options: [ + 'Yes, I consent to CivicDataLab and UNDP India accessing, reviewing and using the information submitted in this form to assess training needs, plan the programme and contact us about participation.', + 'No, I do not consent.' + ] + }, + { + name: 'case_study', + label: 'Would your organisation consider sharing a use case, blog or learning story from the programme?', + hint: 'Case studies may appear in programme reports, websites and communication materials. Consent is voluntary and does not affect selection. Personal details, photographs and confidential information are not covered by this consent.', + options: ['Yes, we would be interested', 'Maybe, after discussing the details', 'No, we would prefer not to'] + } + ] + }, { title: 'About your organisation', fields: [ @@ -201,6 +221,17 @@ export const UNDP_SECTIONS = [ OTHER ] }, + { + name: 'website_link', + label: 'Please share a link to your organisation’s website or other digital materials, if available.', + type: 'url', + optional: true + }, + { + name: 'mission', + label: 'In one sentence, what is your organisation’s mission, and which communities does it aim to serve?', + paragraph: true + }, { name: 'community_led', label: 'Is your organisation led by members of the communities it primarily serves?', @@ -231,6 +262,40 @@ export const UNDP_SECTIONS = [ 'Not sure whether the tools we use include AI' ] }, + { + name: 'ai_tools', + label: 'Which AI tools or platforms does your organisation currently use?', + multi: true, + hint: 'Select either of the last two options on its own.', + exclusive: ['We do not currently use AI tools', 'Not sure'], + options: [ + 'ChatGPT', + 'Google Gemini', + 'Microsoft Copilot', + 'Claude', + 'Perplexity', + 'Canva AI / Magic Studio', + 'Grammarly', + 'AI-powered translation tools', + 'AI features within other software or platforms', + OTHER, + 'We do not currently use AI tools', + 'Not sure' + ] + }, + { + name: 'ai_frequency', + label: 'How frequently does your organisation use AI tools?', + options: [ + 'Daily', + 'A few times a week', + 'A few times a month', + 'Rarely', + 'We have experimented with AI tools but do not use them regularly', + 'We do not currently use AI tools', + 'Not sure' + ] + }, { name: 'barriers', label: 'What are the main barriers to using AI effectively?', @@ -254,9 +319,37 @@ export const UNDP_SECTIONS = [ ] }, { - name: 'checking_confidence', - label: 'How confident are staff in checking AI output before using it?', - options: ['Not at all', 'Slightly', 'Moderately', 'Very', 'Have not tried'] + name: 'output_quality', + label: 'How would you describe the quality of AI-assisted content or outputs produced by your organisation’s staff?', + options: [ + 'Very good – generally requires minimal changes before use', + 'Good – usually useful, with some review and editing', + 'Mixed – quality varies depending on the task or tool', + 'Poor – often requires substantial corrections', + 'We have not used AI-generated or AI-assisted outputs enough to assess their quality', + 'Not sure' + ] + }, + { + name: 'quality_concerns', + label: 'What are your organisation’s primary concerns about the quality and use of AI-assisted outputs?', + multi: true, + max: 3, + hint: 'Select “No major concerns” or “Unsure” on its own.', + exclusive: ['No major concerns', 'Unsure'], + options: [ + 'Inaccurate or misleading information', + 'Bias or lack of representation of local contexts and communities', + 'Poor quality or unnatural language, including local-language content', + 'Outputs that lack relevant context or understanding of the issue', + 'Difficulty verifying information or sources', + 'Privacy, confidentiality or data protection risks', + 'Inappropriate or harmful outputs', + 'Lack of staff capacity to review and improve outputs', + 'No major concerns', + OTHER, + 'Unsure' + ] }, { name: 'useful_skills', @@ -339,30 +432,10 @@ export const UNDP_SECTIONS = [ 'Not yet confirmed', 'We would prefer virtual participation' ] - } - ] - }, - { - title: 'Consent', - fields: [ - { - name: 'consent', - label: 'Do you consent to the use of your responses for this assessment?', - mustAgree: 'We can only use your responses with your consent. Please choose “Yes” to submit.', - options: [ - 'Yes, I consent to CivicDataLab and UNDP India accessing, reviewing and using the information submitted in this form to assess training needs, plan the programme and contact us about participation.', - 'No, I do not consent.' - ] - }, - { - name: 'case_study', - label: 'Would your organisation consider sharing a use case, blog or learning story from the programme?', - hint: 'Case studies may appear in programme reports, websites and communication materials. Consent is voluntary and does not affect selection. Personal details, photographs and confidential information are not covered by this consent.', - options: ['Yes, we would be interested', 'Maybe, after discussing the details', 'No, we would prefer not to'] }, { name: 'anything_else', - label: 'Is there anything else we should know about your learning or participation needs?', + label: 'Finally, is there anything else we should know about your learning or participation needs?', optional: true, hint: 'Mention any need or barrier not covered above. Please do not include confidential information or personal details of beneficiaries.', paragraph: true diff --git a/src/pages/cohorts/cdl_undp.js b/src/pages/cohorts/cdl_undp.js index 76843ec21..a87de8b64 100644 --- a/src/pages/cohorts/cdl_undp.js +++ b/src/pages/cohorts/cdl_undp.js @@ -371,7 +371,7 @@ const UndpCohortPage = () => { {UNDP_SECTIONS.map((s, i) => (
- Section {i + 1}: {s.title} + {s.title === 'Consent' ? s.title : `Section ${i}: ${s.title}`}
    {s.fields.map((f) => (