Has the functionality of writing a code component and it being automatically converted to java script when exporting html been added?
Any info on this would be awesome. If it hasn’t, is my only option to edit the java script? Right now, the code component is in python, should I convert it to JS and export to html again.
My code component:
import random
random.seed(block.thisTrialN)
x = random.randint(1,100)
numt = float(total)
image_num = block.thisIndex
if key_resp_stimulus.corr:
if (image_num==0 or image_num==1 or image_num==4 or image_num==5):
add = 0.05
elif (x<71) and (image_num==2 or image_num==6 or image_num==3 or image_num==7):
add = 0.05
else:
add = 0.00
else:
if (image_num==0 or image_num==1 or image_num==4 or image_num==5):
add = 0.00
elif (x>70) and (image_num==2 or image_num==6 or image_num==3 or image_num==7):
add = 0.05
else:
add = 0.00
totnum = numt + add
total = str(totnum)
overtotal=total
Best,