Reply To: Force DownloadRecordingButton

PennController for IBEX Forums Support Force DownloadRecordingButton Reply To: Force DownloadRecordingButton

#9813
Jeremy
Keymaster

Hi Emiel,

If you want to prevent the experiment from sending the results when the recordings fail to upload (even though the two things are separate, and as you found out results can still be saved even though recordings aren’t uploaded) then you can do something like this:

Sequence(
    "init",
    sepWith("async", rshuffle("letter","picture")),
    "sync",
    "last"
)

UploadRecordings("sync")

newTrial("last",
    newFunction("check upload", ()=>PennController.UploadRecordingsError)
        .test.is(undefined)
        .failure(
            newText("error", "There was a problem sending the recordings to the server. ")
                .color("red")
                .print()
            ,
            newButton().wait()
        )
)

The idea is you manually insert a synchronous UploadRecordings in your Sequence and check in the next trial whether PennController.UploadRecordingsError reports an error: if so, then you use newButton().wait() to prevent the trial from completing and proceeding to the end of the experiment (=sending the results)

Jeremy