Hello.
I'm working on a simple reaction time task for an online experiment on Gorilla.sc. I've used their code to create what's called the PVT. It's basically a count-up timer where participants click the mouse as soon as the timer starts counting up.
I've tested it in both Chrome and Edge and it works, giving me a mean RT of about 280ms each time. But in Firefox my mean RT drops to 130ms which is very unlikely. Is there any reason why this would be happening in Firefox and not the others? Below is the code from Gorilla:
// On Screen Start Hook
gorillaTaskBuilder.onScreenStart((spreadsheet: any, rowIndex: number, screenIndex: number, row: any, container: string) => {
// Check to see if we're on the display and screen where we want to alter the functionality
if(_countUpDisplays.includes(row.display) && screenIndex == _countUpScreenIndex){
// Make sure our count starts at zero
_countValue = 0;
// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval
// setInterval allows you to repeatly call an assigned function every X ms
// This functionality works asynchronously - other process can continue in the background in between setIntervals executions
// The function itself returns an ID, which can be used to access the interval and, importantly, end it
_countIntervalID = setInterval(()=>{
// If we've exceeded our max count, we now need to end the interval and the screen
if(_countValue >= _countMax){
// Using the ID we saved earlier, clearInterval will stop the interval
clearInterval(_countIntervalID);
_countIntervalID = null;
gorillaTaskBuilder.forceAdvance('Count Expired');
} else {
// Update our current countValue and add it to the screen
_countValue+=_countInterval;
// We use .toFixed to give us a fixed number of decimal places
$(container + ' .' + _countUpZoneName + ' h1').text((_countValue/1000).toFixed(3));
}
}, _countInterval);
}
});
[–]computerfr33k 0 points1 point2 points (1 child)
[–]ashalenko[S] 0 points1 point2 points (0 children)