Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Response time - delaying the onset of recording

  • sheffieldthesismaps
  • sheffieldthesismaps's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 weeks ago - 7 years 2 weeks ago #149561 by sheffieldthesismaps
Response time - delaying the onset of recording was created by sheffieldthesismaps
Hello!

I'm using LimeSurvey to conduct a user study, part of which involves the use of some interactive web applications, for displaying 3D maps. These are embedded into limesurvey using an iframe. An example can be seen here: arcg.is/2mLRS5X

Participants must then answer some questions about the 3D map. I'm interested in response time, which LimeSurvey usefully records. However, the web application itself takes time to load and initiate - generally 30-40 seconds. As such, the response time recorded by lime survey is always in the region of 30-40 seconds out of step.
  • Is there a way to delay the onset of the the response time measurement, until after the web application has fully loaded?
  • Alternatively... the application records and displays the loading time, in the format "Data loaded in XX settings", when 'Details' is clicked on the loading screen. Might there be a way to extract the number of seconds here, and automatically subtract it from the response time for the question?

Any ideas? I guess this might be possible with javascript somehow, but I'm totally stuck!

Thanks! :)
Last edit: 7 years 2 weeks ago by sheffieldthesismaps. Reason: Spelling
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149571 by tpartner
If you have access to JavaScript in the iframe source, you can send a message from there to the parent frame to fire a function that loads a hidden question with a timestamp (or any other data).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149579 by holch
"Your hardware does not seem to support WebGL."

I hope you are aware that not everyone might be able to access this application. Like me?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149580 by tpartner
Windows XP with IE5 :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149581 by holch
Nope, at least not here: Windows 10, Latest Chrome Version 56.0.2924.87 (64-bit)

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
7 years 2 weeks ago #149582 by jelo

holch wrote: I hope you are aware that not everyone might be able to access this application. Like me?

At least you didn't had to wait 54 sec ;-)

77ms: CE Web Viewer version: 5.1 [ 5.1.0.201702230534 | html:5.1.0.201702230534_ ]
88ms: GL detect: WebGL 1.0 More
4041ms: Loading webscene id : 6eaa9c2dfcab4bb0bb5276692e2f8f03
4054ms: Fallback to custom unzip on arraybuffer and custom streamParser
41597ms: Downloading: 100% (9.14 of 9.14 MB)
41598ms: Requested gzipped data, got gzipped data
41600ms: Using custom unzip and streamparser on arraybuffer
54015ms: Reading: 98% (9 of 9.14 MB)
54260ms: Data loaded in 51 seconds
54378ms: Initializing...
54384ms: Objects: 7, Materials: 7, Textures: 2, Geometries: 7, Layers: 6
54385ms: Web Scene version: 2.0 (Esri ArcScene (Build 4959))


Grabbing Date loaded in.. is differing from the real loading time.
I don't see any way to add custom Javascript into the ArcGIS-Viewer.

Since security is getting tighter in browser is there a way to have a listener, which scraps the frame for content? Is that possible with moderns browsers and tight security settings around iframe.

There are some hardware requirements for the graphic card and driver as well.
doc.arcgis.com/en/arcgis-online/referenc...427EA5D97A14BE32737A

So that might explain why Win10 and Chrome were not enough.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago - 7 years 2 weeks ago #149584 by tpartner

Since security is getting tighter in browser is there a way to have a listener, which scraps the frame for content? Is that possible with moderns browsers and tight security settings around iframe.

Not exactly but, as I mentioned, you can send a message from the iframe to the parent frame, even across different domains.

My approach would be:

- load input-1 of a multiple-text question with a timestamp when the survey page loads
- have the iframe send a message when the application is completely loaded
- upon receipt of the message, input-2 of the multiple-text question is loaded with a new timestamp

Of course, the code to send the message would depend on the application in the iframe but the receiving code in the survey could look something like this:

Code:
<script type="text/javascript" charset="utf-8">  
 
    // Record a timestamp when page loads
    $(document).ready(function(){
      $('#question{QID} input[type="text"]:eq(0)').val(new Date);
 
    });  
 
    // Function to run when message received
    function receiveMessage(event) {
      // Quit if message not from expected origin
      if (event.origin !== 'http://theIframeDomain.com') { 
        return;
      }
      // It's a valid origin...
      else {
        // Verify the content of the received message
        if(event.data.indexOf('Some identifying string in data') < 0) {
          return;
        }
        else {
          // Record a second timestamp
          $(document).ready(function(){
            var messageDate = event.data.replace(/Loaded time:/, '');
            $('#question{QID} input[type="text"]:eq(1)').val(new Date);      
          });
        }
      }
    }
    // Message listener
    window.addEventListener("message", receiveMessage, false);
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 2 weeks ago by tpartner.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149585 by holch

jelo wrote:

holch wrote: I hope you are aware that not everyone might be able to access this application. Like me?

At least you didn't had to wait 54 sec ;-)

Yes, you are right. Loading time was quite quick. ;-)

There are some hardware requirements for the graphic card and driver as well.
doc.arcgis.com/en/arcgis-online/referenc...427EA5D97A14BE32737A

So that might explain why Win10 and Chrome were not enough.


Yeah, my notebook obviously doesn't have the required graphic card. But given that most people out there use notebooks and therefore mostly will depend on the shared Intel graphic card options, may will not be able to access this content.

This might be totally OK, because sheffieldthesismaps's target group might have the required hardware, but I thought I'd mention it, before he is running into the problem later. Not really LImesurvey related, though. ;-)

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: sheffieldthesismaps
The topic has been locked.
  • sheffieldthesismaps
  • sheffieldthesismaps's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 weeks ago #149624 by sheffieldthesismaps
Replied by sheffieldthesismaps on topic Response time - delaying the onset of recording
Thankyou! The issues r.e. graphics cards and hardware shouldn't be a problem – the survey isn't being sent out to multiple users, rather multiple participants will take part on a single computer, so other environmental factors can be controlled.

I'm going to play around with the Javascript today – thanks tpartner for the beginnings – and see if I can get something working. :)
The topic has been locked.
More
7 years 2 weeks ago #149625 by jelo

tpartner wrote: - have the iframe send a message when the application is completely loaded

Thanks for showing your approach. To me it looks like the step with the iframe is not allowed by arcgis viewer (Can be wrong). So my question was, if you are technically allowed to keep looking via JS for changing content in that iframe from outside.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • sheffieldthesismaps
  • sheffieldthesismaps's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 weeks ago - 7 years 2 weeks ago #149626 by sheffieldthesismaps
Replied by sheffieldthesismaps on topic Response time - delaying the onset of recording

tpartner wrote: My approach would be:

- load input-1 of a multiple-text question with a timestamp when the survey page loads
- have the iframe send a message when the application is completely loaded
- upon receipt of the message, input-2 of the multiple-text question is loaded with a new timestamp


I'm also a bit confused by what you're referring to with 'multiple-text' question. Do you mean a multiple short-text question? Ideally I need to use a List (radio) type question in this scenario. Would that theoretically still work with this solution, provided the arcgis issues mentioned by jelo could be overcome?

Another potential solution I thought of, is to hide all content for 60 seconds with a secondary 'loading screen'', and then just subtract 60 seconds from the recorded response time. Perhaps an easier/more workable solution?

So, I can delay the loading of the content for 60 seconds using this:


<style type="text/css">.arcapp { display:none;}
</style>
<div class="arcapp">
<h2>3D App goes here</h2>
</div>
<script type = "text/javascript">
$(document).ready(function() {
$(".arcapp").delay(60000).fadeIn(500);
});
</script>


Is there an simple way to delay timing for 60 seconds, or to subtract 60 seconds within lime survey, instead of doing it later/manually in excel/spss, when I analyse the data?
Last edit: 7 years 2 weeks ago by sheffieldthesismaps. Reason: added javascript code
The topic has been locked.
More
7 years 2 weeks ago #149630 by jelo

sheffieldthesismaps wrote: Do you mean a multiple short-text question?

Tpartner is not talking about your question you want to ask. The javascropt has to save the timestamp somewhere (textfield).

sheffieldthesismaps wrote: Another potential solution I thought of, is to hide all content for 60 seconds with a secondary 'loading screen'', and then just subtract 60 seconds from the recorded response time. Perhaps an easier/more workable solution?

What about users which are not seeing the ArcGIS viewer after 60 seconds? Cause the loading took longer? Environment of every respondent can differ too much to interpret duration in a coherent way.

sheffieldthesismaps wrote: Is there an simple way to delay timing for 60 seconds, or to subtract 60 seconds within lime survey, instead of doing it later/manually in excel/spss, when I analyse the data?

It's ain't getting simpler then doing a SPSS subtraction.


The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose