Solved
Psychomotor Vigilance testing using Javascript
Hi all,
Newbie here trying to get things into perspective. I'm looking to incorporate a reaction test within the platform using javascript and measure the reaction time of the individual taking the test. I was looking at using something like this: https://codepen.io/cliff538/pen/Eslxr
Ideally what I would want is to take 8 samples from the individual and create reaction time timestamps, then create an average reaction time for the day. This would likely be put into an embedded field and reported on. We would track this daily.
What would be the smartest way to do this?
Thanks!
Best answer by bstrahin
Assuming you can put each of the 8 samples on it's own page, you shouldn't have to use javascript as Qualtrics has a built in timing question. See the documentation page here: https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/advanced/timing/
You can then use embedded data, piping, and math functions to calculate the respondent's average reaction time for the day.
* Piping: https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/piped-text-overview/
Example:
!
* Embedded Data: https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/embedded-data/
* Math Operations: https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/math-operations/
I have trouble with the math operations always working when I put in parentheses so the screen shot of the survey flow is a broken out into steps for your calculation
Your Survey Flow will look like:
!
And the survey itself will look like:
!
I did this for 2 conditions but you can easily expand it to the 8 you want in your experiment.
Hints: when calculating sum you can pipe in the value from the timing question
1. Make sure you are selecting the value (so the variable without " - Description" after it)
2. Add spaces between variable names and +
3. the whole thing should be wrapped inside of $e{ }
You can use the same exact syntax for the Average variable.
If you want to do calculations on Sum and Average across respondents e.g. the Average of the average, then you need to go into Options in the green Embedded Data box and change Variable type from Text to Number Set.
View original


Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.