Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Duration Parameter Not working with Custom Item

  1. #1

    Duration Parameter Not working with Custom Item

    I have a custom item that I would like participants to stay on for a minimum of 25 secs. As such, I would like the "continue" button not to show up unitl after 25 secs have elapsed. To this end, I put (d-25) in the parameters box of the item. But it's not working. What's going on? Any thoughts?
    Thanks!

  2. #2
    jarvis24 Blair Jarvis, Administrator
    Rather than timing the custom item via MediaLab, try adding this javascript to your custom item so that the continue/submit button will be disabled for whatever amount of time you like. In this sample script the button in the HTML form will be disabled for the first 10 seconds.
    <script language="javaScript">
    <!--
    continue_at = "10000";
    function continue_timer() { self.setTimeout("continue_enable();",continue_at); }
    function continue_enable()
    {
    var submitObj = document.getElementById('continue_button');
    submitObj.disabled = false;
    }
    //-->
    </script>
    <body onLoad="continue_timer();">
    <form method="post">
    <p>Your Answer: <input type="text" name="var" size="20"></p>
    <p><input name="continue_button" type="submit" value="Continue" disabled></p>
    </form>
    </body>

  3. #3
    Thanks! Where should this go in the html? At the beginning? At the end? DOes it matter?

  4. #4
    jarvis24 Blair Jarvis, Administrator
    I've attached a revised version of your custom item with the script added in. Let me know if it works ok!

    Yes - I ended up figuring out how to write it myself, but I plugged yours in and it worked, too. Thanks again!