You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22391,6 +22391,82 @@ var pytutor_1 = __webpack_require__(5);
22391
22391
});
22392
22392
};
22393
22393
}(jQuery));
22394
+
// "Get live help!" survey versions
22395
+
// initial pilot version: deployed on 2017-11-10, taken down on 2017-11-13
22396
+
// deployed a single version of the survey to EVERYONE who requested or
22397
+
// volunteered to help in the server logs under the /survey endpoint, i recorded
22398
+
// *ONLY* those people who made a non-null response (for the most part) ...
22399
+
// which is unlike subsequent versions, which record ALL impressions, even null
22400
+
// responses, so that we can know approximately how many times each survey
22401
+
// question got deployed and can thus get a rough response rate
22402
+
/*
22403
+
var liveHelpSurvey = {
22404
+
requestHelp: [{prompt: 'You are now on the help queue. Please support our research by answering below: Why did you decide to ask for help at this time? What motivated you to click the "Get live help" button?',
22405
+
v: 'r1'}],
22406
+
volunteerHelp: [{prompt: "Thanks for volunteering! You're about to join a live chat session. Please support our research by answering below: Why did you decide to volunteer at this time? What motivated you to click on this help link?",
22407
+
v: 'h1'}],
22408
+
};
22409
+
*/
22410
+
// second version, deployed on 2017-11-13. randomly select one of these
22411
+
// questions to ask whenever a user triggers the survey, but save their
22412
+
// responses in localStorage so that when they return, it will ask them
22413
+
// a different question. starting from this version, th server logs
22414
+
// under the /survey endpoint will record *all* responses to the survey,
22415
+
// even null responses, since we can use that data to calculate survey
22416
+
// response rates.
22417
+
var liveHelpSurvey = {
22418
+
requestHelp: [{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nWhy did you decide to ask for help at this time? What motivated you to click the "Get live help" button?',
22419
+
v: 'r2a' },
22420
+
{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nWhy are you asking for help anonymously on this website? Are there people you know around you who can help as well?',
22421
+
v: 'r2b' },
22422
+
{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nHow did you first find this website? What are you currently using this website for?',
22423
+
v: 'r2c' },
22424
+
],
22425
+
volunteerHelp: [{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhy did you decide to volunteer at this time? What motivated you to click on this help link?",
22426
+
v: 'h2a' },
22427
+
{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhat is your current profession (e.g., student, teaching assistant, instructor)? Why are you using this website?",
22428
+
v: 'h2b' },
22429
+
{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhat kind of code are you working on right now? What made you decide to stop coding and volunteer at this time?",
22430
+
v: 'h2c' },
22431
+
]
22432
+
};
22433
+
// randomly picks a survey item from liveHelpSurvey and mutates
22434
+
// localStorage to record that this has been randomly picked, so it won't
22435
+
// be picked again during the next call
22436
+
function randomlyPickSurveyItem(key) {
22437
+
var lst = liveHelpSurvey[key];
22438
+
var filteredLst = [];
22439
+
// filter lst down to filteredLst to find all elements whose version
22440
+
// numbers 'v' does NOT already exist in localStorage
22441
+
if (opt_frontend_common_1.supports_html5_storage()) {
22442
+
lst.forEach(function (e) {
22443
+
if (!localStorage.getItem(e.v)) {
22444
+
filteredLst.push(e);
22445
+
}
22446
+
});
22447
+
}
22448
+
else {
22449
+
filteredLst = lst;
22450
+
}
22451
+
// if ALL entries have been filtered out, then reset everything and
22452
+
// start from scratch:
22453
+
if (filteredLst.length == 0) {
22454
+
if (opt_frontend_common_1.supports_html5_storage()) {
22455
+
lst.forEach(function (e) {
22456
+
localStorage.removeItem(e.v);
22457
+
});
22458
+
}
22459
+
filteredLst = lst;
22460
+
}
22461
+
// now randomly pick an entry and show it:
22462
+
// random number in [0, filteredLst.length)
22463
+
var randInt = Math.floor(Math.random() * filteredLst.length);
22464
+
var randomEntry = filteredLst[randInt];
22465
+
if (opt_frontend_common_1.supports_html5_storage()) {
22466
+
localStorage.setItem(randomEntry.v, '1');
22467
+
}
22468
+
return randomEntry;
22469
+
}
22394
22470
var OptFrontendSharedSessions = (function (_super) {
22395
22471
__extends(OptFrontendSharedSessions, _super);
22396
22472
function OptFrontendSharedSessions(params) {
@@ -22637,20 +22713,19 @@ var OptFrontendSharedSessions = (function (_super) {
22637
22713
});
22638
22714
// add these handlers AFTER the respective DOM nodes have been added above:
22639
22715
$(".gotoHelpLink").click(function () {
22640
-
// deployed on 2017-11-10
22641
-
var miniSurveyResponse = prompt("Thanks for volunteering! You're about to join a live chat session. Please support our research by answering below: Why did you decide to volunteer at this time? What motivated you to click on this help link?");
22642
-
var version = 'h1'; // survey version
22643
-
if (miniSurveyResponse) {
22644
-
var idToJoin = $(this).attr('data-id');
22645
-
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
return true; // ALWAYS cause the link to be clicked
22655
22730
});
22656
22731
}
@@ -23239,20 +23314,19 @@ var OptFrontendSharedSessions = (function (_super) {
23239
23314
exports.TogetherJS(); // shut down TogetherJS
23240
23315
}
23241
23316
}
23242
-
// deployed on 2017-11-10
23243
-
var miniSurveyResponse = prompt('You are now on the help queue. Please support our research by answering below: Why did you decide to ask for help at this time? What motivated you to click the "Get live help" button?');
23244
-
var version = 'r1'; // survey version
23245
-
if (miniSurveyResponse) {
23246
-
var shareId = exports.TogetherJS.shareId();
23247
-
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
@@ -22391,6 +22391,82 @@ var pytutor_1 = __webpack_require__(5);
22391
22391
});
22392
22392
};
22393
22393
}(jQuery));
22394
+
// "Get live help!" survey versions
22395
+
// initial pilot version: deployed on 2017-11-10, taken down on 2017-11-13
22396
+
// deployed a single version of the survey to EVERYONE who requested or
22397
+
// volunteered to help in the server logs under the /survey endpoint, i recorded
22398
+
// *ONLY* those people who made a non-null response (for the most part) ...
22399
+
// which is unlike subsequent versions, which record ALL impressions, even null
22400
+
// responses, so that we can know approximately how many times each survey
22401
+
// question got deployed and can thus get a rough response rate
22402
+
/*
22403
+
var liveHelpSurvey = {
22404
+
requestHelp: [{prompt: 'You are now on the help queue. Please support our research by answering below: Why did you decide to ask for help at this time? What motivated you to click the "Get live help" button?',
22405
+
v: 'r1'}],
22406
+
volunteerHelp: [{prompt: "Thanks for volunteering! You're about to join a live chat session. Please support our research by answering below: Why did you decide to volunteer at this time? What motivated you to click on this help link?",
22407
+
v: 'h1'}],
22408
+
};
22409
+
*/
22410
+
// second version, deployed on 2017-11-13. randomly select one of these
22411
+
// questions to ask whenever a user triggers the survey, but save their
22412
+
// responses in localStorage so that when they return, it will ask them
22413
+
// a different question. starting from this version, th server logs
22414
+
// under the /survey endpoint will record *all* responses to the survey,
22415
+
// even null responses, since we can use that data to calculate survey
22416
+
// response rates.
22417
+
var liveHelpSurvey = {
22418
+
requestHelp: [{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nWhy did you decide to ask for help at this time? What motivated you to click the "Get live help" button?',
22419
+
v: 'r2a' },
22420
+
{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nWhy are you asking for help anonymously on this website? Are there people you know around you who can help as well?',
22421
+
v: 'r2b' },
22422
+
{ prompt: 'You\'re on the help queue. Support our research by answering below:\n\nHow did you first find this website? What are you currently using this website for?',
22423
+
v: 'r2c' },
22424
+
],
22425
+
volunteerHelp: [{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhy did you decide to volunteer at this time? What motivated you to click on this help link?",
22426
+
v: 'h2a' },
22427
+
{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhat is your current profession (e.g., student, teaching assistant, instructor)? Why are you using this website?",
22428
+
v: 'h2b' },
22429
+
{ prompt: "Thanks for volunteering! Support our research by answering below:\n\nWhat kind of code are you working on right now? What made you decide to stop coding and volunteer at this time?",
22430
+
v: 'h2c' },
22431
+
]
22432
+
};
22433
+
// randomly picks a survey item from liveHelpSurvey and mutates
22434
+
// localStorage to record that this has been randomly picked, so it won't
22435
+
// be picked again during the next call
22436
+
function randomlyPickSurveyItem(key) {
22437
+
var lst = liveHelpSurvey[key];
22438
+
var filteredLst = [];
22439
+
// filter lst down to filteredLst to find all elements whose version
22440
+
// numbers 'v' does NOT already exist in localStorage
22441
+
if (opt_frontend_common_1.supports_html5_storage()) {
22442
+
lst.forEach(function (e) {
22443
+
if (!localStorage.getItem(e.v)) {
22444
+
filteredLst.push(e);
22445
+
}
22446
+
});
22447
+
}
22448
+
else {
22449
+
filteredLst = lst;
22450
+
}
22451
+
// if ALL entries have been filtered out, then reset everything and
22452
+
// start from scratch:
22453
+
if (filteredLst.length == 0) {
22454
+
if (opt_frontend_common_1.supports_html5_storage()) {
22455
+
lst.forEach(function (e) {
22456
+
localStorage.removeItem(e.v);
22457
+
});
22458
+
}
22459
+
filteredLst = lst;
22460
+
}
22461
+
// now randomly pick an entry and show it:
22462
+
// random number in [0, filteredLst.length)
22463
+
var randInt = Math.floor(Math.random() * filteredLst.length);
22464
+
var randomEntry = filteredLst[randInt];
22465
+
if (opt_frontend_common_1.supports_html5_storage()) {
22466
+
localStorage.setItem(randomEntry.v, '1');
22467
+
}
22468
+
return randomEntry;
22469
+
}
22394
22470
var OptFrontendSharedSessions = (function (_super) {
22395
22471
__extends(OptFrontendSharedSessions, _super);
22396
22472
function OptFrontendSharedSessions(params) {
@@ -22637,20 +22713,19 @@ var OptFrontendSharedSessions = (function (_super) {
22637
22713
});
22638
22714
// add these handlers AFTER the respective DOM nodes have been added above:
22639
22715
$(".gotoHelpLink").click(function () {
22640
-
// deployed on 2017-11-10
22641
-
var miniSurveyResponse = prompt("Thanks for volunteering! You're about to join a live chat session. Please support our research by answering below: Why did you decide to volunteer at this time? What motivated you to click on this help link?");
22642
-
var version = 'h1'; // survey version
22643
-
if (miniSurveyResponse) {
22644
-
var idToJoin = $(this).attr('data-id');
22645
-
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
return true; // ALWAYS cause the link to be clicked
22655
22730
});
22656
22731
}
@@ -23239,20 +23314,19 @@ var OptFrontendSharedSessions = (function (_super) {
23239
23314
exports.TogetherJS(); // shut down TogetherJS
23240
23315
}
23241
23316
}
23242
-
// deployed on 2017-11-10
23243
-
var miniSurveyResponse = prompt('You are now on the help queue. Please support our research by answering below: Why did you decide to ask for help at this time? What motivated you to click the "Get live help" button?');
23244
-
var version = 'r1'; // survey version
23245
-
if (miniSurveyResponse) {
23246
-
var shareId = exports.TogetherJS.shareId();
23247
-
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
0 commit comments