As an experiment designer, I want to understand how long it takes on average for a participant to answer a survey, so that I can decide whether I want to adjust its length. This information should be measured for each participant for each survey, and saved with the survey record.
As an experiment designer, I want to understand how long it takes on average for a participant to answer a survey, so that I can decide whether I want to adjust its length. This information should be measured for each participant for each survey, and saved with the survey record.
New code should live in the SurveyFactory: https://github.com/Watts-Lab/surveys/blob/main/src/surveyFactory.jsx
Add a useEffect to start a timer:
See https://github.com/Watts-Lab/deliberation-empirica/blob/main/client/src/pages/Discussion.jsx#L34-L36 for examples
Set a timer
Save a
completionTime
in therecord
object in seconds.Use the
exampleSurvey.cy.jsx
cypress test to check that the time is computed properly, see examples here:you'll need to put in a
cy.wait(5000)
or similar to build in some elapsed time that you measure and compare against.