OSWeb Data Logging
Hi,
I have an OS experiment with a JavaScript backend, and I have many variables that are defined and used in JavaScript inlines (numbers and strings). They all work well and are printed correctly during debugging, but I'm having some issues with data logging. Specifically, after running the experiment, the JSON files seem to be missing variables that I defined in inlines. This only happens with variables defined as 'let', while constant variables are recorded correctly in the JSON files. I tried manually entering the missing variables into the logger, but then I get a column for each variable that says 'false'.
Any advice would be appreciated!
Best,
Elinor
Comments
Hi Elinor,
No javascript expert here, but why don't you then save all variables as
varinstead oflet? Seems like only global variables are logged.This is explained here as well, by the way: https://osdoc.cogsci.nl/4.0/manual/javascript/about/#declaring-variables-let-and-var
Eduard
Hi @eduard ,
That solved it, thanks! I think I tried
var.[variable_name]before and that didn't work, but seems like I didn't tryvarinstead oflet.Thanks again!
Best,
Elinor