Credits not being used, and data not saving, for "Running" mode in jsPsych?

URL of experiment: Plan rating task

Description of the problem:
Hi, thanks for making Pavlovia so awesome! We’re having issues with data being saved of our study. We have had two participants complete the study through Prolific. However, data does not seem to be saved to the GitLab “data/” folder as usual. Oddly, credits are also not being decremented. Yet, participants are still able to use the link. Do you have any tips or insights on why this is happening? Thanks!

How are you ending your experiment? How does your final routine end? I know that some people ask their participants to press escape on the final routine, which will stop the experiment ending and data being saved.

Thanks for the response @wakecarter!

We end with the following code snippet – where [CODE] is the 8-token code from Prolific (not pasting here to avoid accidental submissions from others)

We’ve used something similar in the past for experiments and not had issues with token collection.

/* finish connection with pavlovia.org */
	var pavlovia_finish = {
		type: "pavlovia",
		command: "finish",
	};
	timeline.push(pavlovia_finish);

	jsPsych.init({
	    timeline: timeline,
	    on_finish: function () {
	        // send back to main prolific link
	        window.location = "https://app.prolific.co/submissions/complete?cc=[CODE]"
	    },
	    show_progress_bar: true,
	    auto_update_progress_bar: false
	});

Usually we see that tokens have been consumed after any time the link is opened. The link’s been opened at least twice by Prolific users, and more by me.

I’m a bit confused about this code. However, I think that’s because you are using JSPsych rather than PsychoJS. I’ve added the relevant tag to your question.

Does these help?

Thanks! Unfortunately the code doesn’t seem to be the impact factor, I think. I’ve used the same code for other projects where I’ve had no issues with data saving. Even if I just click on the link, no credit usage is triggered (in contrast to other projects, where credits are used - and data saved - any time I click on the link). Reading some other forum posts over the past day seems to suggest this problem is somewhat general at the moment? Thanks for any other tips!

@wakecarter the issue has persisted and no data is being saved, nor are credits being used even when I just click on the link (not through Prolific).

Do you know if this is a Pavlovia error? Or something on my side? Thanks!

Hi There! Could you possibly make your repository public? so that we can access the html and js files?

Thanks!
Becca

Thank you @Becca ! I have tried changing the visibilty but can’t seem to switch it to public? I’ve disabled many of the access restrictions so hopefully that may help. I’ve also added you directly to the GitLab for the project. Thanks for any tips!

Hi Katie,

I think you might have added me as a Guest rather than a “developer” please may you add me as a “developer” so that I can see the files.

Thanks!
Becca

Sorry just updated! Thanks!

Hi Katie,

OK, this looks like the problem is that var timeline = [] is defined twice, and the second time is after the initialisation of pavlovia_init, which means that pavlovia_init is cleared from your timeline before the task.

To fix the problem I removed the second initialisation of var timeline = [] on line 36 of your code.

Hope this helps,
Becca

2 Likes

Apologies! I just realized I didn’t respond to this earlier. Thanks for your message – your solution worked!!