﻿<?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 5  » Per Problem Time Limit for ToL Task</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 23 Sep 2026 02:00:07 GMT</lastBuildDate><ttl>20</ttl><item><title>Per Problem Time Limit for ToL Task</title><link>https://forums.millisecond.com/Topic24842.aspx</link><description>Hi All,&lt;br/&gt;I'm back! After some discussion we decided we still need a time limit set for each problem. I'm trying to implement a problem time limit on the Tower of London task from Inquisitlab. I want the script to move on to the next problem once a set time limit that is same for all problems is up ( for example, 60 seconds, then it automatically moves to the next problem).&lt;br/&gt;&lt;br/&gt;The part of the script I was thinking of adding to the choice trial is:&lt;br/&gt;&lt;br/&gt;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock&lt;br/&gt;&lt;br/&gt;But it doesn't seem to work the way I want it to, and nothing seems to happen. Am I misunderstanding how I should implement the code, or is my approach completely wrong?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 07 May 2018 20:10:09 GMT</pubDate><dc:creator>chunhoilauhk</dc:creator></item><item><title>RE: Per Problem Time Limit for ToL Task</title><link>https://forums.millisecond.com/Topic24849.aspx</link><description>&lt;div data-id="24848" class="if-quote-wrapper" unselectable="on" data-guid="1525747993099"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24848" 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="24848" 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="24848" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, May 7, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24848"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24847" class="if-quote-wrapper" unselectable="on" data-guid="1525747993099"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24847" 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="24847" 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="24847" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, May 7, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24847"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24843" class="if-quote-wrapper" unselectable="on" data-guid="1525747993099"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24843" 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="24843" 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="24843" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24843"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24842" class="if-quote-wrapper" unselectable="on" data-guid="1525747993099"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24842" 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="24842" 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="24842" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24842"&gt;&lt;div class="if-quote-message-margin"&gt;Hi All,&lt;br/&gt;I'm back! After some discussion we decided we still need a time limit set for each problem. I'm trying to implement a problem time limit on the Tower of London task from Inquisitlab. I want the script to move on to the next problem once a set time limit that is same for all problems is up ( for example, 60 seconds, then it automatically moves to the next problem).&lt;br/&gt;&lt;br/&gt;The part of the script I was thinking of adding to the choice trial is:&lt;br/&gt;&lt;br/&gt;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock&lt;br/&gt;&lt;br/&gt;But it doesn't seem to work the way I want it to, and nothing seems to happen. Am I misunderstanding how I should implement the code, or is my approach completely wrong?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24842"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, I forgot the parentheses,&amp;nbsp;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock]&lt;a class="if-quote-goto quote-link" href="#" data-id="24843"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;script.currenttime returns the current time in HH:MM:SS format, it's a string, you cannot do math with it, and subtracting milliseconds from it does not make sense.&lt;br/&gt;&lt;br/&gt;You'll need to work with script.elapsedtime instead, see how the solution time is calculated throughout the script, i.e. look at &lt;br/&gt;&lt;br/&gt;values.t_roundstart, which records the point in time a given round was started in milliseconds elapsed since the start of the script&lt;br/&gt;and &lt;br/&gt;values.t_solution, which records the point in time a given problem was solved in milliseconds elapsed since the start of the script&lt;br/&gt;&lt;br/&gt;You'll need to do something similar to implement your per-problem timeout. Note that t_roundstart is _reset_ when a given problem is re-started.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24847"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Okay, here (attached) is something to give you a start. The general idea is to have a new parameter setting the time allowed per problem (here: set to 60000 ms, i.e. one minute):&lt;br/&gt;&lt;br/&gt;&amp;lt;parameters&amp;gt;&lt;br/&gt;/ maxattempts = 3&lt;br/&gt;/ npracticeproblems = 1&lt;br/&gt;&lt;strong&gt;/ time_per_problem = 60000&lt;/strong&gt;&lt;br/&gt;...&lt;br/&gt;&amp;lt;/parameter&amp;gt;&lt;br/&gt;&lt;br/&gt;Then set a value to that parameter at the start of each round (&amp;lt;trial newround&amp;gt;):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial newround&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&lt;strong&gt;values.timeleft = parameters.time_per_problem;&lt;/strong&gt;&lt;br/&gt;values.t_roundstart=0; &lt;br/&gt;values.t_firstmove=0; &lt;br/&gt;values.t_solution=0;&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;and use the value as a /timeout in the choice trial (&amp;lt;trial choice&amp;gt;) while subtracting the time taken by each choice on a trial-by-trial basis:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial choice&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ ontrialend = [&lt;br/&gt;values.t_choiceend=script.elapsedtime;&lt;br/&gt;&lt;strong&gt;values.timeleft -= (values.t_choiceend - values.t_choicestart);&lt;/strong&gt;&lt;br/&gt;...&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.choice.response=="resetround")&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.subjectattempts &amp;lt; parameters.maxattempts) &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; trial.resetround;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; trial.stopblock;&lt;br/&gt;}&lt;br/&gt;else if (trial.choice.response == "nextround"&lt;strong&gt; || trial.choice.response == 0&lt;/strong&gt;) &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.stopblock;&lt;br/&gt;else if (expressions.targetachieved)&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.feedback;&lt;br/&gt;else&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.choice;&lt;br/&gt;]&lt;strong&gt;&lt;br/&gt;/ timeout = values.timeleft&lt;/strong&gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Among the decisions you have to make:&lt;br/&gt;- Do you want to interrupt the subject in the middle of a move if time has run out (this is what the above code will do) or do you want them to be able to complete the move even if time has run out?&lt;br/&gt;- Do you want to allow 1 minute _per problem_ or per _attempt_ at a given problem? Suppose a participant solves the problem in the 1st attempt but not in the minimum amount of moves. Further suppose that 1st attempt took 40 seconds. Is the participant supposed to only have 20 seconds left for their 2nd attempt or are they supposed to get another full minute? The code attached does the former, if you want the latter you would need to set values.timeleft back to 60000ms in &amp;lt;trial resetround&amp;gt;&lt;br/&gt;&lt;br/&gt;There probably are a number of other, similar complications that I haven't thought of, so I'd recommend you clarify for yourself how exactly you want things to work before making major modifications to the code.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24848"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Thank you so much for your help again! I think so far what you have is definitely what we would need, I'll try my best to modify the code by myself before consulting the forums again.</description><pubDate>Mon, 07 May 2018 20:10:09 GMT</pubDate><dc:creator>chunhoilauhk</dc:creator></item><item><title>RE: Per Problem Time Limit for ToL Task</title><link>https://forums.millisecond.com/Topic24848.aspx</link><description>&lt;div data-id="24847" class="if-quote-wrapper" unselectable="on" data-guid="1525733605020"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24847" 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="24847" 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="24847" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, May 7, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24847"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24843" class="if-quote-wrapper" unselectable="on" data-guid="1525733605020"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24843" 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="24843" 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="24843" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24843"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24842" class="if-quote-wrapper" unselectable="on" data-guid="1525733605020"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24842" 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="24842" 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="24842" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24842"&gt;&lt;div class="if-quote-message-margin"&gt;Hi All,&lt;br/&gt;I'm back! After some discussion we decided we still need a time limit set for each problem. I'm trying to implement a problem time limit on the Tower of London task from Inquisitlab. I want the script to move on to the next problem once a set time limit that is same for all problems is up ( for example, 60 seconds, then it automatically moves to the next problem).&lt;br/&gt;&lt;br/&gt;The part of the script I was thinking of adding to the choice trial is:&lt;br/&gt;&lt;br/&gt;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock&lt;br/&gt;&lt;br/&gt;But it doesn't seem to work the way I want it to, and nothing seems to happen. Am I misunderstanding how I should implement the code, or is my approach completely wrong?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24842"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, I forgot the parentheses,&amp;nbsp;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock]&lt;a class="if-quote-goto quote-link" href="#" data-id="24843"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;script.currenttime returns the current time in HH:MM:SS format, it's a string, you cannot do math with it, and subtracting milliseconds from it does not make sense.&lt;br/&gt;&lt;br/&gt;You'll need to work with script.elapsedtime instead, see how the solution time is calculated throughout the script, i.e. look at &lt;br/&gt;&lt;br/&gt;values.t_roundstart, which records the point in time a given round was started in milliseconds elapsed since the start of the script&lt;br/&gt;and &lt;br/&gt;values.t_solution, which records the point in time a given problem was solved in milliseconds elapsed since the start of the script&lt;br/&gt;&lt;br/&gt;You'll need to do something similar to implement your per-problem timeout. Note that t_roundstart is _reset_ when a given problem is re-started.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24847"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Okay, here (attached) is something to give you a start. The general idea is to have a new parameter setting the time allowed per problem (here: set to 60000 ms, i.e. one minute):&lt;br/&gt;&lt;br/&gt;&amp;lt;parameters&amp;gt;&lt;br/&gt;/ maxattempts = 3&lt;br/&gt;/ npracticeproblems = 1&lt;br/&gt;&lt;strong&gt;/ time_per_problem = 60000&lt;/strong&gt;&lt;br/&gt;...&lt;br/&gt;&amp;lt;/parameter&amp;gt;&lt;br/&gt;&lt;br/&gt;Then set a value to that parameter at the start of each round (&amp;lt;trial newround&amp;gt;):&lt;br/&gt;&lt;br/&gt;&amp;lt;trial newround&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&lt;strong&gt;values.timeleft = parameters.time_per_problem;&lt;/strong&gt;&lt;br/&gt;values.t_roundstart=0; &lt;br/&gt;values.t_firstmove=0; &lt;br/&gt;values.t_solution=0;&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;and use the value as a /timeout in the choice trial (&amp;lt;trial choice&amp;gt;) while subtracting the time taken by each choice on a trial-by-trial basis:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial choice&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ ontrialend = [&lt;br/&gt;values.t_choiceend=script.elapsedtime;&lt;br/&gt;&lt;strong&gt;values.timeleft -= (values.t_choiceend - values.t_choicestart);&lt;/strong&gt;&lt;br/&gt;...&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.choice.response=="resetround")&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.subjectattempts &amp;lt; parameters.maxattempts) &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; trial.resetround;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; trial.stopblock;&lt;br/&gt;}&lt;br/&gt;else if (trial.choice.response == "nextround"&lt;strong&gt; || trial.choice.response == 0&lt;/strong&gt;) &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.stopblock;&lt;br/&gt;else if (expressions.targetachieved)&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.feedback;&lt;br/&gt;else&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.choice;&lt;br/&gt;]&lt;strong&gt;&lt;br/&gt;/ timeout = values.timeleft&lt;/strong&gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Among the decisions you have to make:&lt;br/&gt;- Do you want to interrupt the subject in the middle of a move if time has run out (this is what the above code will do) or do you want them to be able to complete the move even if time has run out?&lt;br/&gt;- Do you want to allow 1 minute _per problem_ or per _attempt_ at a given problem? Suppose a participant solves the problem in the 1st attempt but not in the minimum amount of moves. Further suppose that 1st attempt took 40 seconds. Is the participant supposed to only have 20 seconds left for their 2nd attempt or are they supposed to get another full minute? The code attached does the former, if you want the latter you would need to set values.timeleft back to 60000ms in &amp;lt;trial resetround&amp;gt;&lt;br/&gt;&lt;br/&gt;There probably are a number of other, similar complications that I haven't thought of, so I'd recommend you clarify for yourself how exactly you want things to work before making major modifications to the code.&lt;br/&gt;</description><pubDate>Mon, 07 May 2018 16:22:21 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Per Problem Time Limit for ToL Task</title><link>https://forums.millisecond.com/Topic24847.aspx</link><description>&lt;div data-id="24843" class="if-quote-wrapper" unselectable="on" data-guid="1525708982840"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24843" 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="24843" 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="24843" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24843"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="24842" class="if-quote-wrapper" unselectable="on" data-guid="1525708982840"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24842" 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="24842" 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="24842" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24842"&gt;&lt;div class="if-quote-message-margin"&gt;Hi All,&lt;br/&gt;I'm back! After some discussion we decided we still need a time limit set for each problem. I'm trying to implement a problem time limit on the Tower of London task from Inquisitlab. I want the script to move on to the next problem once a set time limit that is same for all problems is up ( for example, 60 seconds, then it automatically moves to the next problem).&lt;br/&gt;&lt;br/&gt;The part of the script I was thinking of adding to the choice trial is:&lt;br/&gt;&lt;br/&gt;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock&lt;br/&gt;&lt;br/&gt;But it doesn't seem to work the way I want it to, and nothing seems to happen. Am I misunderstanding how I should implement the code, or is my approach completely wrong?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24842"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, I forgot the parentheses,&amp;nbsp;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock]&lt;a class="if-quote-goto quote-link" href="#" data-id="24843"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;script.currenttime returns the current time in HH:MM:SS format, it's a string, you cannot do math with it, and subtracting milliseconds from it does not make sense.&lt;br/&gt;&lt;br/&gt;You'll need to work with script.elapsedtime instead, see how the solution time is calculated throughout the script, i.e. look at &lt;br/&gt;&lt;br/&gt;values.t_roundstart, which records the point in time a given round was started in milliseconds elapsed since the start of the script&lt;br/&gt;and &lt;br/&gt;values.t_solution, which records the point in time a given problem was solved in milliseconds elapsed since the start of the script&lt;br/&gt;&lt;br/&gt;You'll need to do something similar to implement your per-problem timeout. Note that t_roundstart is _reset_ when a given problem is re-started.&lt;br/&gt;</description><pubDate>Mon, 07 May 2018 09:11:24 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Per Problem Time Limit for ToL Task</title><link>https://forums.millisecond.com/Topic24843.aspx</link><description>&lt;div data-id="24842" class="if-quote-wrapper" unselectable="on" data-guid="1525668099872"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="24842" 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="24842" 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="24842" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;chunhoilauhk - Sunday, May 6, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-24842"&gt;&lt;div class="if-quote-message-margin"&gt;Hi All,&lt;br/&gt;I'm back! After some discussion we decided we still need a time limit set for each problem. I'm trying to implement a problem time limit on the Tower of London task from Inquisitlab. I want the script to move on to the next problem once a set time limit that is same for all problems is up ( for example, 60 seconds, then it automatically moves to the next problem).&lt;br/&gt;&lt;br/&gt;The part of the script I was thinking of adding to the choice trial is:&lt;br/&gt;&lt;br/&gt;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock&lt;br/&gt;&lt;br/&gt;But it doesn't seem to work the way I want it to, and nothing seems to happen. Am I misunderstanding how I should implement the code, or is my approach completely wrong?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="24842"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, I forgot the parentheses,&amp;nbsp;/branch [if (script.currenttime - values.t_roundstart &amp;gt;&amp;nbsp;60000) trial.stopblock]</description><pubDate>Sun, 06 May 2018 21:45:38 GMT</pubDate><dc:creator>chunhoilauhk</dc:creator></item></channel></rss>