Skip to content

Commit

Permalink
record mode and full useragent string
Browse files Browse the repository at this point in the history
this stashes the mode in the db (live, sandbox, debug). this can be
helpful when doing analyses later down the line in case one needs to
distinguish between live and sandbox assignments in the db. the mode is
stored as part of the taskdata datastring

also, this fixes a neighboring bug where the full useragent string
wasn't actually being saved to the taskdata datastring by backbone
  • Loading branch information
deargle committed Jun 30, 2016
1 parent e9c907f commit 61c36af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions psiturk/psiturk_js/psiturk.js
Expand Up @@ -43,11 +43,13 @@ var PsiTurk = function(uniqueId, adServerLoc, mode) {
data: [],
questiondata: {},
eventdata: [],
useragent: ""
useragent: "",
mode: ""
},

initialize: function() {
this.useragent = navigator.userAgent;
this.set({ useragent: navigator.userAgent });
this.set({ mode: this.mode });
this.addEvent('initialized', null);
this.addEvent('window_resize', [window.innerWidth, window.innerHeight]);

Expand Down

0 comments on commit 61c36af

Please sign in to comment.