Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 4 of 4

Thread: Time Limit on a Custom Item Using HTML

  1. #1
    Join Date
    Feb 2008
    Posts
    16

    Time Limit on a Custom Item Using HTML

    I've created a Custom item in HTML. It includes 20 anagrams with separate textboxes. It works great - response go straight to SPSS. However, I only want my participants to have 10 minutes to complete it, and have the option to submit before 10 minutes are up. I've tried several combinations with durations in the questionnaire itself, or attached to the experiment file (keeping one item in the questionnaire file - that being the custom item). Problem is, the repsonses are only getting to SPSS if one clicks the submit button at the bottom of the HTML form I made before the 10 minutes have elapsed. If the task is interupted because 10 minutes have elapsed, the user either gets a noitice that time is up and to click OK or hit Enter (when the duration is int he experiemnt file), or the user is automaitcally forwarded to whatever is next in the experiment. In either case, the responses are not written to SPSS. I don't want to force my participants to hit the Submit button before the 10 minutes are up - would seem to add extra stress to the task. I'd actually only like them to use the submit button if they finish before the 10 minutes or wish not to continue with the task. However, if they reach the 10 minutes, I still want their data. I'm using version 2006. Any help would be greatly appreciated.
    Attached Files Attached Files
    Last edited by petrocjv; 07-29-2010 at 06:22 PM.

  2. #2
    Join Date
    Nov 2005
    Posts
    3,328
    John, I pulled and modified this from a google search on "html submit timed". It automatically submits the form after 5 seconds if the user does not click the submit button. Will this help? Of course, you could change the 5000ms value to 30000 for a 30 second delay.
    <html>
    <body onload="setTimeout ('document.forms[0].submit()', 5000)">
    <form method="post">
    <button type="submit">Submit</button>
    </form>
    </body>
    </html>

  3. #3
    Join Date
    Feb 2008
    Posts
    16

    This Does Work

    The commands work!

    In the HTML form (attached), find the following line to adjust time limit. This line sets it at 540 seconds.

    <body onload="setTimeout ('document.forms[0].submit()', 540000)"> <form method="post">

    Also, the "anagram task_TEMP .htm" file that is automatically created after the experiment is run the first time appears to make the timing smoother - that is, without this file there may be a delay (blank screen) that occurs by clicking the submit button before the time limit is reached (a delay which appears to be the remainder of the available time left on the html form).

    Important commands:
    <html>
    <body onload="setTimeout ('document.forms[0].submit()', 5000)">
    <form method="post">
    <button type="submit">Submit</button>
    </form>
    </body>
    </html>

    In my html form I placed my survey between the <form method="post"> and <button type="submit">Submit</button> commands.
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2005
    Posts
    3,328
    Thanks for the update John--and for the revised attachment! -Blair

Similar Threads

  1. recording data from custom html item
    By ljubica in forum MediaLab Older Versions: Troubleshooting
    Replies: 1
    Last Post: 03-23-2010, 09:39 AM
  2. Custom item with various html form elements
    By huiyun in forum MediaLab Older Versions: Troubleshooting
    Replies: 1
    Last Post: 11-05-2009, 10:59 PM
  3. Custom HTML item doesn't display in v2004
    By jzadra in forum MediaLab Older Versions: General Questions
    Replies: 2
    Last Post: 03-24-2009, 02:54 PM
  4. Problem with having only 1 variable in Custom Item HTML
    By xaros in forum MediaLab Older Versions: Troubleshooting
    Replies: 3
    Last Post: 11-25-2008, 12:55 PM
  5. Reaction time data for custom HTML item
    By lekyung in forum MediaLab Older Versions: General Questions
    Replies: 2
    Last Post: 10-31-2007, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •