Error when trying to save data to excel

URL of experiment: Dino / ddd · GitLab

Description of the problem:

The experiment is mainly matrix patterns with dots that are shown to the participants, and they click the square it was in–which turns it black. I want to save the black squares at the end of the routine to the csv, but have started with just saving the clicked items. However, when ending the guessing routine, I get the following error:

  • TypeError: Converting circular structure to JSON → starting at object with constructor ‘PsychoJS’ | property ‘_logger’ → object with constructor ‘Logger’ — property ‘_psychoJS’ closes the circle

Can anyone provide some insight? Thanks!

Are you referring to these lines?

if ((trials_3.thisN === 0)) {
    psychoJS.experiment.addData("Response1", responses);
}

If the experiment runs fine in Python (offline) I suspect that there is something wrong with the js translation of your for loop that precedes this statement. You could try manually writing the loop in js.

Without being able to run the experiment it’s difficult to be sure but I note:

In code3_1 Begin Routine you have if trials_3.thisN == 1: in the Python but if ((trials_3.thisN === 10)) in the JS.

You have clicked_things = in Begin Routine and responses = in End Routine and yet you have

for x in clicked_things:
    if x not in responses:
        responses.append(x)

and no code that seems to change either clicked_things or responses.

You also have a large number of very similar loops, which makes editing and debugging more difficult, but I don’t think that’s the issue here.