From b501e1367a0218f34b0dc75dfbf57dac7bc41afb Mon Sep 17 00:00:00 2001 From: Alina086 Date: Fri, 27 Jun 2025 14:03:09 -0400 Subject: [PATCH] saving Qualtrics survey responses with participant ID (username) --- frontend/src/editor/index.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/src/editor/index.tsx b/frontend/src/editor/index.tsx index da9e92d8..2adeeb38 100644 --- a/frontend/src/editor/index.tsx +++ b/frontend/src/editor/index.tsx @@ -160,7 +160,7 @@ const SURVEY_URLS = { const taskConfigs = { '1': { condition: 'Completion', - taskPrompt: 'Task 1: Should companies adopt a four-day work week (working Monday through Thursday) instead of the traditional five-day schedule? Consider impacts on productivity, employee well-being, and business operations.', + taskPrompt: 'Task 1: Should companies adopt a four-day work week (working Monday through Thursday) instead of the traditional five-day schedule? Consider impacts on productivity, employee well-being, and business operations.', }, '2': { condition: 'Question', @@ -189,7 +189,7 @@ const taskConfigs = { '3': { condition: 'RMove', taskPrompt: `Task 3: After reading these paragraphs, write a summary that explains CRISPR gene editing to your 11th grade biology classmates. Your goal is to help them understand what CRISPR is, how it works, and why it matters, using language and examples they would find clear and engaging. - + CRISPR-Cas9 is a revolutionary gene-editing technology that allows scientists to make precise changes to DNA. Originally discovered as part of bacteria's immune system, CRISPR works like molecular scissors that can cut DNA at specific locations and either remove, add, or replace genetic material. The CRISPR system consists of two main components: a guide RNA that identifies the target DNA sequence, and the Cas9 protein that acts as the cutting tool. When these components are introduced into a cell, they seek out the matching DNA sequence and make a precise cut. The cell's natural repair mechanisms then fix the break, allowing scientists to insert new genetic material or correct defective genes. @@ -198,8 +198,8 @@ const taskConfigs = { However, CRISPR also raises important ethical questions, particularly regarding its use in human embryos, which could create permanent changes that would be passed down to future generations. The scientific community continues to debate the appropriate boundaries for this powerful technology while working to ensure its safe and beneficial application.` } - } - + } + const letterToCondition = { e: 'Completion', q: 'Question', @@ -213,7 +213,7 @@ const taskConfigs = { result[(idx + 1).toString()] = { condition: letterToCondition[letter as keyof typeof letterToCondition] }; }); return result; - } + } function Router({ page @@ -281,7 +281,7 @@ function Router({ interaction: 'User clicked Consent Form button' }); ; }} - href={`${consentFormURL}?redirect_url=${redirectURL}`} + href={`${consentFormURL}?redirect_url=${redirectURL}&username=${username}`} className={classes.startButton} > Sign Consent Form @@ -306,7 +306,7 @@ function Router({ interaction: 'User clicked Start Study button' }); urlParams.set('page', nextPage) - window.location.search = urlParams.toString(); + window.location.search = urlParams.toString(); }} className={classes.startButton} > @@ -331,7 +331,7 @@ function Router({ interaction: 'User clicked Intro Survey button' }); ; }} - href={`${introSurveyURL}?redirect_url=${redirectURL}`} + href={`${introSurveyURL}?redirect_url=${redirectURL}&username=${username}`} className={classes.startButton} > Take the Intro Survey @@ -387,8 +387,8 @@ function Router({ return (
- @@ -429,7 +429,7 @@ function Router({ interaction: `User started post task ${postTaskNumber} survey` }); }} - href={`${postTaskSurveyURL}?redirect_url=${redirectURL}`} + href={`${postTaskSurveyURL}?redirect_url=${redirectURL}&username=${username}`} className={classes.startButton} > Take Survey @@ -453,7 +453,7 @@ function Router({ interaction: 'User clicked final Post Study Survey button' }); ; }} - href={`${postStudySurveyURL}?redirect_url=${redirectURL}`} + href={`${postStudySurveyURL}?redirect_url=${redirectURL}&username=${username}`} className={classes.startButton} > Take the Post Study Survey @@ -474,7 +474,7 @@ function Router({ interaction: 'User finished the study' }); urlParams.set('page', 'study-intro') - window.location.search = urlParams.toString(); + window.location.search = urlParams.toString(); }} className={classes.startButton} >