Task skips straight to last rep of loop

ok, we have another level of interestingness here. Your task works perfectly for me, the full way through, with no errors when I run it from your project page. This suggests it could be a browser rather than a project issue. Please could you try a few things for me, first please can you try clearing your browser cache?

Thanks,
Becca

(Don’t worry about this seeming complicated, it is important for us to be aware of these errors, let’s try get it sorted)

Cache cleared, error still there.

OK please can you switch me to maintainer access so that I can try something (this will give me write access).

Thanks for your patience here

No worries at all.

OK, because the issue seemed to be coming from your core library, I tried instead calling a custom psychoJS library (custom-lib). Please can you try and run this and feed back if you still encounter this error?

Thanks,
Becca

Hi Becca,

I tried running again, with the same error I’m afraid, with the same line being flagged up in the console view.

Anthony

Hi Anthony,

OK that’s tricky, so that I can get more information whilst I consult the team - please could you also let us know what browser you are using? (I am using chrome)

Thanks,
Becca

I’m also using chrome.

Just to let you know, I’m playing around with the original project at the same time, and having switched it back to ‘latest’ the task runs but with the original error. So this ‘unspecified error’ does definitely seem to be linked to the version type selection.

Hi Becca,

Believe it or not I’ve solved the problem. I remembered that version I was using prior to the update was 2020.2.4. I set the version number to that in the experimental settings, and now it runs through the loops like it is supposed to. I haven’t extensively tested it but it does seem to be doing what it is supposed to now.

This probably doesn’t answer all the questions of why things were running on your machine but not on mine, so I will leave you with maintainer access for version 1.1. Feel free to play around with it if want to try and understand what was going on. Also, feel free to ask me to test things on my machine if it helps diagnose any problems.

I’m going to switch the original project back to private while I finish with development. If you need access for any reason, do let me know.

Thanks again for all the time you’ve put into this.
Anthony

Hi Anthony,

I am pleased you have found a solution! thanks for leaving your task for archive I will fork that to the support team so that you don’t have to keep it in your dashboard :slight_smile:

All the best,
Becca

EDIT: sorry ignore this. I needed to clear my cache as the html hadn’t updated on sync

Hi Becca,

Final question for now… I’m trying to debug the task by adding console.log() statements (my ‘timeout’ and ‘new_environment’ routines are not appearing as they should). However, I can’t see them turning up in the console anywhere in Dev Tools while the task is running. Am I missing something obvious here?

Thanks,
Anthony

Also having the original problem described above: “task skips straight to last rep of loop”. Using version 2021.1.3 and 2021.1.4. But …

I’ve written everything firstly in Python via Builder, with the bulk auto-translated for PsychoJs. The problem—i.e., skipping all trials, going straight to the last one—does NOT occur when running this in PsychoPy; it only occurs in PsychoJS.

It seems this problem is related to linebreaks in the conditions file. The trials here–actually, just introductory instructional text–are set by/read in from a conditions file with 3 rows and 1 column–in csv format. One thing tried to solve it was to save the file instead as .xlsx. This gets rid of the “task skips straight to last rep of loop” problem, but the text is now presented with “double spacing” of lines. That was in 2021.1.3. Re-saving in csv format sees the return of the “skipping” problem. As using Windows, I tried replacing all “\r\n” with “\n” linebreaks (in Notepad++) but this had no effect; i.e., still “skipping”; and when opening/saving this file as xlsx, changing loop to read in this xlsx file, refreshing etc., now also the skipping behaviour appears–i.e., not only with the csv conditions file, also now with the xlsx conditions file. checked the source–yes, certainly, it is reading in the xlsx file now, and it is skipping all trials; i.e, it is only showing the final instruction, from the last row of the file, not showing the first two at all–so skipping, just like what was happing with the .csv file. But I am now using 2021.1.4, so perhaps the spread (generalisation) of the problem across formats is not to do with this edit of the linebreaks but something changed between versions. In any case, something is bung with reading in the files.

Other thing–also have another loop that reads in conditions–just digits–that are used to set actual trial events, later in experiment. This doesn’t have the “skips straight to last rep of loop” problem. Only substantive difference between files is that the text for the instruction “conditions” is quoted (between quotation marks) to handle commas in the text, so like “Hello, you”, whereas there are no quotation marks, naturally enough, about the digits. It is only the conditions file with the quotation marks that gets all of its rows skipped, and so only the last “condition” (instruction text) is presented.

All this is applying same procedures as used without problem in earlier versions; as the above discussion also seems to indicate.

Perhaps not identified any novel likely source of this “skipping straight to last rep of loop” but perhaps this provokes further ideas that I can try so might finally get this new experiment going on pav.

Curious incompatibility between PsychoPy and PsychoJS in reading from conditions file that explains the skipping to last rep problem (in my case):

I had used equal signs to create an underline/overline of text in all but the last row of the conditions file for displaying instructions in a loop (i.e., text to display in text widget). All rows (“pages” of text) were displayed, one after the other, in PsychoPy, but PsychoJS was skipping straight to the last row; now displaying the text from rows that included these “lines”. Removing these “lines” was all that was needed to now get all rows being read in PsychoJS; whereas they were permitted in PsychoPy–all rows were read, and the “line” showed appropriately–in PsychoPy, but not PsychoJS.

The following is a reduced example, implemented in this dummy experiment: Pavlovia.
For the conditions file, to read in instructions, as shown below, the middle row is skipped by PsychoJS; but it is shown by PsychoPy. The only difference is that the middle row includes equal signs to create a line. So PsychoJS for some reason doesn’t read in/skips this row, and only shows the first and last row.

image

What happens if you put the text in quotes?

All text per row is/always has been between quotes; this is described in my reply before last. The rows span multiple lines–but they always start and end with a quote.