Is it possible to add timing to display logic?

SclavijoSclavijo FL, USCommunity Member Qubie ✭
edited September 25 in Custom Code

Is it possible to add timing to display logic?

In a survey project that I am doing, I have a multiple choice question that brings up text questions using in page display logic. Clicking on different choices on the multiple choice question brings up a different text question within the same page. I need to know how long each text question is displayed.

I thought I could do this using a timing question, but the data recorded doesn't record how long each question was displayed, but rather the first and last clicks and when the user moved to the next page. I already tried using page breaks, but then it takes away the functionality of being able to access another one of the text questions through the multiple choice question, and it is important that user is able to select between the other options. And since there is no way to loop using survey flow, this was the solution I came up with.

So I am wondering if I am able to use Javascript (I don't have Javascript experience) or something that allows the survey to record how long each text question is displayed. Or at the very least allow me to figure it out, like perhaps recording the amount of time in between each selection or click.

Best Answer

  • npetrov937npetrov937 London, UKCommunity Member - Trial User Guru ✭✭
    Accepted Answer


    This is indeed possible and there are many ways to approach this.

    Given the relatively few constraints you have suggested above, I attach a quick .qsf I put together for you. The key JS is in the MCQ question.

    This will give you the total time (in seconds) each option was presented (recorded as embedded variables). Note that if a person switches between, say, option 1-option 2-option 1, this solution will add all times option 1 (ditto for any option) was on the screen to the total display time.

    Note as well that this code is far from optimal but given your inexprience with javascript, it could be easy for you to get into it fairly quickly if you have at least a bit of coding experience in general. If you have more options, you will just need to copy-paste some of the blocks of code and swap numbers.

    Hope this helps.


  • SclavijoSclavijo FL, USCommunity Member Qubie ✭

    Thank you so much!! I will immediately get to adding this to my survey.

Sign In to Comment