Hi all,
I am just updating this thread as, after some help from Chris, I have reached a solution - so I thought I should share it in case anyone finds themselves in a similar situation.
The main take away I have is that, if possible, use a live page! Unfortunately I did not know about these when I started building the programme and because I had already run several sessions with my programme before the problem popped up, I was unable to switch to live pages (no changes could be made that would be visible to the subjects).
Given this, I found a work around with my current programme. The issue was being caused by a bottleneck - once the timer for the real effort task hit 0, the programme had to iterate through up to 420 pages (70 rounds with 6 pages each) for 9 subjects simultaneously, and then calculate their results. Even with relatively high resources I would get H12 errors at this stage and lose data, as if the page errored the data recorded there was not submitted. I was unable to reduce the amount of rounds as we needed to ensure that there were enough tasks that no subject would run out, and even after reducing the pages in each round was still timeout errors (albeit fewer).
My work around was to identify the subject that had completed the most rounds e.g. 20 out of 70 potential tasks, and calculate everyone's results in that round + 1. To do this, I created dummy variables for having played in a given round, and then once the timer hit 0, the programme located the first round in which no subject had played, and then set this as a condition to display the pre-results wait page and result page. In the result page a second dummy variable was set to 1 and carried forward for the remainder of the 70 tasks, so that the next page to display was at the beginning of the next app (you could also use the app_after_this_page function). While this may mean iterating through many empty pages after the results page, even if there is a H12 error then refreshing the page will allow subjects to continue without any data loss. Having said that, in testing this new programme, I have not yet had a H12 error, even using the free testing resources.
Thank you again Chris for all of your help with this.
Best wishes,
Katy