Tip: You can do this in modern surveys and the script is now available! For more information, see How do I time how long it takes a participant to complete a question? (Modern Surveys).
You can use this script to store the length of time a participant takes to complete a question (in seconds). The time is counted from when the question page loads to when the participant clicks next and moves to the next step in the survey.
Detailed Steps
Adding and setting up the questions
- Click on the Questionnaire tab of your survey.
- Create the question of you want to time.
- Create a Numeric Open End Question for use as your timer. Initially, for testing purposes, you may want to add this as a visible question immediately following the timed question. When you are launching the survey, the hidden property of the timer Numeric question should be checked so it is not visible to members but is available in your survey data.
Prepare the scripts
- Open Notepad or a similar text editing tool.
- Copy Script 1 below into Notepad.
- Replace TIMER with the name of the Numeric Open End you created for use as your timer.
- Save the completed script in Notepad.
- Create a new file with Notepad.
- Copy Script 2 below into Notepad.
- Replace TIMER with the name of the Numeric Open End you created for use as your timer.
- Save the completed script in Notepad.
Insert the completed script into the Scripting section your question
- Copy the completed Script 1 from Notepad.
- Select the question you wish to time in the Questionnaire Tree.
- In the Scripting section of your question, click Edit Scripts.
- Paste Script 1 into the On Load tab.
- Click Save.
- Paste Script 2 into the On Exit tab.
- Click Save and close the script editor.
- Click Save on the question page.
- Click Validate.
Scripts
Script 1
/*
Script Name: How do I time how long a respondent takes to complete a question ?
To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results.
*/
VerbatimQuestion vq = TIMER;
if (vq.NumberValue < 1) Set(vq, System.DateTime.Now.Ticks / 10000000);
Script 2
/*
Script Name: How do I time how long a respondent takes to complete a question ?
To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results.
*/
VerbatimQuestion vq = TIMER;
Set(vq, System.DateTime.Now.Ticks/10000000 - vq.NumberValue);
Notes:
- If this is to be repeated on multiple questions, you will need to create multiple Numeric questions to be used as the timer, and edit the script appropriately for each timed question.
Another scenario may be that you would like to time how long it takes to complete a group of question. In this case the procedure is much the same except Script 1 will go on the OnLoad of the first question in the group and Script 2 will go on the OnExit of the last question in the group. - The timer value will only be accurate if the participant completes the question that is being timed. Also, this script does not accommodate scenarios where the participant restarted the survey, or clicked the previous button and redid the question.
Comments
0 comments
Article is closed for comments.