psychopy.org | Reference | Downloads | Github

Stuck on Initialising Experiment

Dear all,

I have read through a lot of “stuck on initialising experiment” threads, but I still cannot seem to fix why I am stuck on this page. The experiment works perfectly without running online. I have looked through the crib-sheet for mistakes.

There are no longer any imports and I do not see any indication of what the problem could be.

I am very much hoping that somebody could shed insight into this as I am completely stuck. If any other information is needed, please let me know.

Best regards,

Snoek

1 Like

Thank you for your reply.

The file does exist, though the .py version is not in my html folder. I can drag it to my html folder.

Only the two js versions need to be there. I’m not sure of the issue but I was wondering if it was due to file renaming.

I have made a new experiment to see if it has something to do with this, but the same problem occurs.

What code components do you have in Begin Experiment blocks? I find it easier to read Python code with notes for any manual translations.

Its possibly due to the use of the percentage symbol in your file name.

1 Like

I seem to have gotten it to work now. It is, however, now stuck on the first screen. I am supposed to be able to go through the instructions with my arrow keys but I cannot move past the first screen.

As it seems related I found this earlier post: https://github.com/psychopy/psychojs/pull/7

It recommends that JS type keys should be added: ‘right’, ‘left’, ‘ArrowLeft’, ‘ArrowRight’

I just saw that Internet Explorer may not work well in an earlier post, so I opened the experiment in Chrome and I am getting this error:
Unspecified JavaScript error

win.setColor([.2,.2,.2])

#total number of items
num_items = 29

#counters to hold the next stimulus reference
cur_image_n = 0
cur_image_1 = 0
cur_image_2 = 0
cur_instruction_1 = 0
cur_instruction_2 = 0

#############


#load in graph instructions
graph_image = ["Stimuli/graph.jpg", "Stimuli/graphb.jpg", "Stimuli/graphc.jpg", "Stimuli/graphd.jpg", "Stimuli/graphe.jpg", "Stimuli/graphf.jpg", "Stimuli/graphf.jpg", "Stimuli/graphg.jpg", "Stimuli/graphh.jpg"]
graph_instr = ["text"]


cur_graph = 0

################

#practice trial

practice_jars = ["Jars3/Jar_750.jpg", "Jars3/Jar_250.jpg", "Jars3/Jar_400.jpg"]
num_practice = 0

practice_jars2 = ["Jars3/Jar_175.jpg", "Jars3/Jar_800.jpg", "Jars3/Jar_725.jpg"]
num_practice2 = 0

practice_jars3 = ["Jars3/Jar_300.jpg", "Jars3/Jar_650.jpg", "Jars3/Jar_200.jpg"]
num_practice3 = 0


##############################################################


#loop the instruction trials

loopRepeats = [1,0,0,0,0,0,0,0,0,0,0,0,0,0]
lastResponse = None


#######################################

#amount of times invalid message

invalidcounter = 0
if invalidcounter > 2:
    core.quit()
    
    
##########
#pictures

print("all pictures")
picture = ["Jars3/Jar_150.jpg", "Jars3/Jar_175.jpg", "Jars3/Jar_200.jpg", "Jars3/Jar_225.jpg", "Jars3/Jar_250.jpg", "Jars3/Jar_275.jpg", "Jars3/Jar_300.jpg", "Jars3/Jar_325.jpg", "Jars3/Jar_350.jpg", "Jars3/Jar_375.jpg", "Jars3/Jar_400.jpg", "Jars3/Jar_425.jpg", "Jars3/Jar_450.jpg", "Jars3/Jar_475.jpg", "Jars3/Jar_500.jpg", "Jars3/Jar_525.jpg", "Jars3/Jar_550.jpg", "Jars3/Jar_575.jpg", "Jars3/Jar_600.jpg", "Jars3/Jar_650.jpg", "Jars3/Jar_675.jpg", "Jars3/Jar_700.jpg", "Jars3/Jar_725.jpg", "Jars3/Jar_750.jpg", "Jars3/Jar_775.jpg", "Jars3/Jar_800.jpg", "Jars3/Jar_825.jpg", "Jars3/Jar_850.jpg"]
print(picture)

picture1 = picture[:]
picture2 = picture[:]
picture3 = picture[:]

shuffle(picture1)
shuffle(picture2)
shuffle(picture3)

#print("picture1")
#print(picture1)
#print("picture2")
#print(picture2)
#print("picture3")
#print(picture3)

###############################

white=[1,1,1]
grey=[.2,.2,.2]
yellow=[1,1,0]
green=[-1,0,-1]
black=[-1,-1,-1]
red=[1,0,0]

I edited my code somewhat if that helps, and the JS part is not in this part of my code. I did add the shuffle, the win and thisExp codes to JS.