﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Dynamically controlling finishpage in batch files</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 09 Sep 2026 20:06:55 GMT</lastBuildDate><ttl>20</ttl><item><title>Dynamically controlling finishpage in batch files</title><link>https://forums.millisecond.com/Topic36510.aspx</link><description>Dear all,&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;The relevant code is as follows:&lt;br/&gt;[code]&amp;lt;expressions&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ EndPage = if (values.ScreenedOut) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm"&lt;/a&gt;&lt;br/&gt;} else if (expressions.AcceptSubmission == "NO") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm"&lt;/a&gt;&lt;br/&gt;} else if (values.CorrectTrialCounter &amp;lt;= values.CriterionForExtraReward*values.TotalTrialCounter) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm"&lt;/a&gt;&lt;br/&gt;} else {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm"&lt;/a&gt;&lt;br/&gt;}&lt;br/&gt;&amp;lt;/expressions&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.EndPage = expressions.EndPage; defaults.finishpage = expressions.EndPage&lt;br/&gt;]&lt;br/&gt;&amp;lt;/expt&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;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). &lt;br/&gt;&lt;br/&gt;However, this only seems to work if I quit the experiment early&amp;nbsp; 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.&lt;br/&gt;&lt;br/&gt;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!&lt;br/&gt;</description><pubDate>Fri, 13 Sep 2024 11:02:39 GMT</pubDate><dc:creator>AKrishna</dc:creator></item><item><title>RE: Dynamically controlling finishpage in batch files</title><link>https://forums.millisecond.com/Topic36538.aspx</link><description>&lt;blockquote data-id="36536" class="if-quote-wrapper" unselectable="on" data-guid="1726225348854" contenteditable="false" id="if_insertedNode_1726225347489"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36536" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36536" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36536" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;AKrishna - 9/13/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36536"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;A quick followup:&lt;br/&gt;&lt;br/&gt;So I understand from what you've written that using script.abort(true) is not compatible with setting a finishpage dynamically, presumably because the script aborts without calling the property and passing it to the browser. So far so good, the response to that is to use /stop attributes instead of script.abort(true). In a batch file, this is a little more annoying, as it requires passing the stop condition to each subsequent script via values and parameters, but that's certainly possible. However, a side-effect of this solution is that participants in a Web experiment have each subsequent script start invisibly in the background and then terminate, which means that Inquisit will download all the files required for each subsequent script even if a participant quit beforehand. For smaller experiments, this is fine, but some of my work requires downloads of large video files, which can lead to significant waiting times and bandwidth use even after a participant quits.&lt;br/&gt;&lt;br/&gt;So the question is: is there any way to combine dynamic finishpage use with dynamically stopping a batch completely?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="36536"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;I don't believe there currently is.</description><pubDate>Fri, 13 Sep 2024 11:02:39 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Dynamically controlling finishpage in batch files</title><link>https://forums.millisecond.com/Topic36536.aspx</link><description>A quick followup:&lt;br/&gt;&lt;br/&gt;So I understand from what you've written that using script.abort(true) is not compatible with setting a finishpage dynamically, presumably because the script aborts without calling the property and passing it to the browser. So far so good, the response to that is to use /stop attributes instead of script.abort(true). In a batch file, this is a little more annoying, as it requires passing the stop condition to each subsequent script via values and parameters, but that's certainly possible. However, a side-effect of this solution is that participants in a Web experiment have each subsequent script start invisibly in the background and then terminate, which means that Inquisit will download all the files required for each subsequent script even if a participant quit beforehand. For smaller experiments, this is fine, but some of my work requires downloads of large video files, which can lead to significant waiting times and bandwidth use even after a participant quits.&lt;br/&gt;&lt;br/&gt;So the question is: is there any way to combine dynamic finishpage use with dynamically stopping a batch completely?&lt;br/&gt;</description><pubDate>Fri, 13 Sep 2024 08:26:22 GMT</pubDate><dc:creator>AKrishna</dc:creator></item><item><title>RE: Dynamically controlling finishpage in batch files</title><link>https://forums.millisecond.com/Topic36528.aspx</link><description>Cheers, this was correct. Thanks again!&lt;br/&gt;</description><pubDate>Mon, 09 Sep 2024 13:49:44 GMT</pubDate><dc:creator>AKrishna</dc:creator></item><item><title>RE: Dynamically controlling finishpage in batch files</title><link>https://forums.millisecond.com/Topic36511.aspx</link><description>&lt;blockquote data-id="36510" class="if-quote-wrapper" unselectable="on" data-guid="1724861849714" contenteditable="false" id="if_insertedNode_1724861849425"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="36510" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="36510" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="36510" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;AKrishna - 8/28/2024&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-36510"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Dear all,&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;The relevant code is as follows:&lt;br/&gt;[code]&amp;lt;expressions&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ EndPage = if (values.ScreenedOut) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm" "=""&gt;&lt;/a&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm" "=""&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/screenedout.htm"&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;} else if (expressions.AcceptSubmission == "NO") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm" "=""&gt;&lt;/a&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm" "=""&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/nocompletion.htm"&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;} else if (values.CorrectTrialCounter &amp;lt;= values.CriterionForExtraReward*values.TotalTrialCounter) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm" "=""&gt;&lt;/a&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm" "=""&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionbonus.htm"&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;} else {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm" "=""&gt;&lt;/a&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm" "=""&gt;&lt;a href="https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm""&gt;https://scripts.millisecond.eu/andreaseder/aatsrbr3/completionnobonus.htm"&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;}&lt;br/&gt;&amp;lt;/expressions&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ onblockend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.EndPage = expressions.EndPage; defaults.finishpage = expressions.EndPage&lt;br/&gt;]&lt;br/&gt;&amp;lt;/expt&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;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). &lt;br/&gt;&lt;br/&gt;However, this only seems to work if I quit the experiment early&amp;nbsp; 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.&lt;br/&gt;&lt;br/&gt;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!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="36510"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The best tip I can give you is to make a small demo script that does nothing but set the finish page according to the same logic in the main script. Then test just that component and work out any issues.&lt;br/&gt;&lt;br/&gt;I'll take a look at your experiment as-is, but given that it's thousands lines of code that don't make it easy to hit the various conditions, that is going to take much longer than doing the above.&lt;br/&gt;&lt;br/&gt;EDIT: Ah, just saw you mentioned using script.abort() in the script. That will prevent redirection to any finish page. Looking at your batch and script, you should be able to just use a /stop attribute at the &amp;lt;expt&amp;gt; level, i.e.&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;expt AATSRBinding&amp;gt;&lt;br/&gt;/ stop = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.ScreenedOut;&lt;br/&gt;]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/expt&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;instead of&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;trial ScreenedOut&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;script.abort(true)&lt;br/&gt;]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;Otherwise the finish page setting logic should work as expected.&lt;br/&gt;</description><pubDate>Wed, 28 Aug 2024 17:00:35 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>