Reply To: How to add page breaks in between randomized items?

PennController for IBEX Forums Support How to add page breaks in between randomized items? Reply To: How to add page breaks in between randomized items?

#8517
Jeremy
Keymaster

Hi Lily,

it also gives me a break after my final item, which is the 10th audio file in my current situation.

You can change the definition of sepWithN to handle that situation. Add , dropLast to the functions’ arguments, and prefix newArray.push(sep[j]); with a conditional on whether there remain any items in main. Concretely, replace the respective lines with:

function SepWithN(sep, main, n, dropLast) {
// ...
                    if (main.length>0||dropLast==undefined) newArray.push(sep[j]);
// ...
function sepWithN(sep, main, n, dropLast) { return new SepWithN(sep, main, n, dropLast); }

Then you can sepWithN to not add the last break like this: sepWithN( "break", randomize("experiment"), 5, "dropLast")

However, with my script below, I have something that kind of looks like reaction time in my results. The reaction time-like thingy appears in the column of my rating results, that is the “value” column. Do you know what may have happened here?

Scale elements will log which button was selected, and when it was selected. You should see a value from 1 to 7 in one column (the selected button) and a 13-digit number in another (the timestamp). You’ll also have a timestamp for when the audio stopped playing in an earlier line: subtract the end-of-playback timestamp from the scale-choice timestamp and you’ll get your response time

I was trying to add space in between by using the code: newCanvas(“empty canvas”, 1, 40).print(), but it only works between elements (texts, buttons), not the page bottom

It does work at the bottom of the page, but if you’re printing the Canvas element after the “Agree” button was clicked (ie. after its wait command) then you’ll just never see it. But this would work:

newButton("Agree").print()
,
newCanvas("empty canvas", 1, 40).print()
,
getButton("Agree").wait()

I saw that you suggested in another post to upload a zip file to avoid this problem. But what I don’t understand is where I could host the zip file. I know that cloud services like Dropbox and Google Drive don’t work, what about GitHub? Or any suggestion on this issue?

GitHub does not provide that service: in order for the experiment to run, it needs to download the zip file in the background, but by default background downloads from other domains (ie. from outside the farm) are blocked by browsers, unless the distant server explicitly gives permission for the operation, which you can do with some services, but not with GitHub

One such service you could look into is Amazon S3, which is included in the 12-month AWS Free Tier offer. See this post for more information

Jeremy