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

How do I have custom item record responses when time elapses? (case 5079)

  1. #1

    How do I have custom item record responses when time elapses? (case 5079)

    Hi,

    For a project I am working on I would like to give participants a set time period (5 minutes) to enter responses to 10 fill in the blank items that are presented on the same screen. It is my understanding that this requires a custom item.

    I manipulated a file that Blair had posted on the Empirisoft support forum and it seems to work with one issue. As of now, it is only recording data once the "Continue" button is pressed. I would like to have data recorded when the time duration runs out instead (in the questionnaire file, I have set a countdown clock for 5 minutes).

    As of now, when the time elapses, participants are told to press Enter to continue, but what they entered in the boxes is not being saved. I can see the line in the html that probably needs to change, but I am unsure of how to change it properly.

    I have attached the html in case any one can help me.

    Thanks!

  2. #2
    HTML can only record data that has been submitted. Setting the custom item to display for five minutes means after five minutes, the program will move on, and any data that has not been submitted will be lost.

    Are you familiar with javascript? Because with javascript, which can be included in HTML custom items, you can command that after a set period of time (e.g., 5 min), the form is submitted.

    This can be accomplished with the javascript command [settimeout()].

    If you're not familiar with javascript, here are some resources.

    http://www.w3schools.com/js/js_intro.asp
    http://www.w3schools.com/js/js_timing.asp

    Hope this helps.

  3. #3
    Hi gnik68. I've attached a slightly updated version of your html. I've added one line of code at the top, <body onload="setTimeout ('document.forms[0].submit()', 600000)">. This will set your custom item to automatically post the entered data after X time has elapsed. In this case it would submit after 10 minutes have elapsed, regardless of whether the continue button is pressed. You can change the 600000 to any number you'd like (I'd suggest setting it to a smaller value to test the code and ensure that the data are recording properly). I hope that helps!

  4. #4
    Hi wcrescioni,

    Thank you so much for the help! That worked perfectly. Again, thanks for taking the time to help me out.