EducationalTestingService / Confero

Eye-tracking, Screen and Event Capturing System for Windows. A web application running on a separate PC allows for real time monitoring of the users actions.
GNU General Public License v3.0
9 stars 1 forks source link

how to send a message from a browser to the ioHub? #94

Open garyfeng opened 10 years ago

garyfeng commented 10 years ago

Thinking about how to pass events (e.g., URL change) from the assessment webpage to the ioHub. In this case we assume the subject is interacting with a browser window, in which we have a custom javascript function that gets the timing of certain events (e.g., changing from one item to the next), and we want to pass that event as a time stamped message to ioHub.

What's the best way to do this? This is not part of this deliverable but I'd like to hear your thoughts.

isolver commented 10 years ago

This could be added as a function to the confero javascript API already started. It would send a json msg using the browser to confero server websocket, which then would pass it to the track computer to save in the hdf5 file.

So same process as what is done when a log msg is sent from the webapp textline, but in this case it would be generated by javascript, not a user action.

garyfeng commented 10 years ago

this sounds great.

garyfeng commented 10 years ago

Quick question: are we still subjected to the 127 char limit in the message sent?

isolver commented 10 years ago

Yes. The limit comes from an experiment message txt field having a length of 128 char in the hdh5 file (strings in hdf5 must be specified with a max length, which is == how much memory the field takes up regardless of the actual character count.

For javascript submitting, there is always the option of accepting any length string and breaking it up into 128 char chunks , saving multiple msg's as needed, each with the same time stamp.

When reading back msg data, there would somehow need to be re-merged without mistakenly merging msg's that did were actually separate.

Let me know.

garyfeng commented 10 years ago

Ok, this is not in the scope of this work. But here's what's been cooking in my brain.

I want to inject a javascript into a webpage (an ETS assessment, which often goes out of the way to obscure how it works), monitors DOM changes for certain key elements, and when changes happen, send Confero messages about mostly where each element I care about is at this point. The time accuracy is in a few video frames, i.e., 100-200ms would be ok in this case.

The plan is:

There are three (almost fatal) flaws with MutantSummary/mutantObserver : 1). It's asynchronous, meaning that the mutant callbacks are called with a delay, when the browser is free. I don't know what the delay is ... but I hope it's <200ms. 2). MutantObserver does not have timestamps of the change events, period. That's a key shortcoming compared to the older DOM3 mutant event method. But again, I am hoping that the timing is not too far off. 3). It doesn't actually track text values in textArea and input elements. For those you need to use onKeyup or similar old-fashioned events. But we have keystroke logging already so I can live with that.

Now wrt bookmarklet vs extensions:

Some old tests ETS produced require IE, which is why I am thinking about bookmarklets. New ones are HTML5-based, which means they should run on Chrome/FF. Extensions would be much better. For one, I hope we would be able to track pop-up windows that you can't run bookmarklets.

Love to hear your thoughts.