Dynamically controlling finishpage in batch files


Author
Message
AKrishna
AKrishna
Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)Distinguished Member (3.3K reputation)
Group: Forum Members
Posts: 113, Visits: 386
Dear all,

I've run up against a problem I can't diagnose in my current study (aatsrbr3) and would appreciate any help. In this experiment, I'm dynamically assigning finish pages based on the experiment's completion status. I checked the forums and tried to implement code that does this at the batch level, but I think I have a more fundamental problem: when I start the experiment from the launcher, sometimes after the script ends, no page opens at all in my browser. This happens even when I run the main experiment directly rather than the batch file.

The relevant code is as follows:
<expressions>
...
/ EndPage = if (values.ScreenedOut) {
    "https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm"
} else if (expressions.AcceptSubmission == "NO") {
    "https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm"
} else if (values.CorrectTrialCounter <= values.CriterionForExtraReward*values.TotalTrialCounter) {
    "https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm"
} else {
    "https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm"
}
</expressions>

<expt>
...
/ onblockend = [
    values.EndPage = expressions.EndPage; defaults.finishpage = expressions.EndPage
]
</expt>


So I would expect the respective pages to be shown regardless of whether I run the experiment directly or via the batch (which includes code that sets defaults.finishpage to values.EndPage onscriptend).

However, this only seems to work if I quit the experiment early  via Ctrl+Q (which satisfies the constraint for expressions.AcceptSubmission == "NO") - that shows me the expected finish page. If I proceed to the screening part (a simple color discrimination test starting in trial 2) and fail it (satisfying values.ScreenedOut), the experiment ends as expected (the following trial branches into script.abort(true)), but no finish page is opened.

It may have something to do with the call to script.abort, but that's just a guess. Unfortunately, I spent most of today trying to diagnose this error and didn't get a chance to test whether the other finish pages (for completionbonus.htm and completionnobonus.htm) work or not. If anyone has any ideas, I'd be grateful!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search