Open source project to tackle the problem of long development cycles required to produce software to conduct multi-participant and real-time human experiments online.
This is my stages for a round:
round.addStage({name: "fixation", duration:1}); round.addStage({name: "maintenance", duration:10}); round.addStage({name: "retention", duration:1}); round.addStage({name: "recall", duration:10000}); //limit of few hours to respond (basically unlimited time) round.addStage({name: "feedback", duration:1});
and I want to manually record the duration of each stage using these lines of code in each stage file:
So here I console.log the start and end time of the feedback stage (which is the last stage in the round) and they all look normal: the end time is roughly 1 second later than the start time as specified in my callback.js file. However, if I want to log the same quantity in the callback.js file at the end of the round:
Empirica.onRoundEnded(({ round }) => {
const players = round.currentGame.players;
for (const player of players) {
console.log(
player.get("startTimeFeedback"), player.get("endTimeFeedback"));
}
});
endTimeFeedback now becomes equal to startTimeFeedback even though they are supposed to be 1 second apart. This bug occurs because Feedback is the last stage in the round. If I manually add another stage after it the bug goes away.
Steps To Reproduce
Just try to record the start time and end time of a stage and log it in the endround function in the callback.js file.
Empirica Version
v 1.11.4
What OS are you seeing the problem on?
macOS
What browser are you seeing the problem on?
Chrome
Relevant log output
No response
Anything else?
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
What happened?
This is my stages for a round:
round.addStage({name: "fixation", duration:1}); round.addStage({name: "maintenance", duration:10}); round.addStage({name: "retention", duration:1}); round.addStage({name: "recall", duration:10000}); //limit of few hours to respond (basically unlimited time) round.addStage({name: "feedback", duration:1});
So here I console.log the start and end time of the feedback stage (which is the last stage in the round) and they all look normal: the end time is roughly 1 second later than the start time as specified in my callback.js file. However, if I want to log the same quantity in the callback.js file at the end of the round:
endTimeFeedback now becomes equal to startTimeFeedback even though they are supposed to be 1 second apart. This bug occurs because
Feedback
is the last stage in the round. If I manually add another stage after it the bug goes away.Steps To Reproduce
Just try to record the start time and end time of a stage and log it in the endround function in the callback.js file.
Empirica Version
What OS are you seeing the problem on?
macOS
What browser are you seeing the problem on?
Chrome
Relevant log output
No response
Anything else?
No response
Code of Conduct