Skip to content

Commit f8a4c85

Browse files
committed
deployed second version of live help mode survey
1 parent 2624f9c commit f8a4c85

16 files changed

Lines changed: 529 additions & 152 deletions

v5-unity/build/composingprograms.bundle.js

Lines changed: 102 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22391,6 +22391,82 @@ var pytutor_1 = __webpack_require__(5);
2239122391
});
2239222392
};
2239322393
}(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+
}
2239422470
var OptFrontendSharedSessions = (function (_super) {
2239522471
__extends(OptFrontendSharedSessions, _super);
2239622472
function OptFrontendSharedSessions(params) {
@@ -22637,20 +22713,19 @@ var OptFrontendSharedSessions = (function (_super) {
2263722713
});
2263822714
// add these handlers AFTER the respective DOM nodes have been added above:
2263922715
$(".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";
22646-
$.ajax({
22647-
url: surveyUrl,
22648-
dataType: "json",
22649-
data: { id: idToJoin, user_uuid: me.userUUID, kind: 'volunteerHelp', v: version, response: miniSurveyResponse },
22650-
success: function () { },
22651-
error: function () { },
22652-
});
22653-
}
22716+
var surveyItem = randomlyPickSurveyItem('volunteerHelp');
22717+
var miniSurveyResponse = prompt(surveyItem.prompt);
22718+
// always log every impression, even if miniSurveyResponse is blank,
22719+
// since we can know how many times that survey question was ever seen:
22720+
var idToJoin = $(this).attr('data-id');
22721+
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
22722+
$.ajax({
22723+
url: surveyUrl,
22724+
dataType: "json",
22725+
data: { id: idToJoin, user_uuid: me.userUUID, kind: 'volunteerHelp', v: surveyItem.v, response: miniSurveyResponse },
22726+
success: function () { },
22727+
error: function () { },
22728+
});
2265422729
return true; // ALWAYS cause the link to be clicked
2265522730
});
2265622731
}
@@ -23239,20 +23314,19 @@ var OptFrontendSharedSessions = (function (_super) {
2323923314
exports.TogetherJS(); // shut down TogetherJS
2324023315
}
2324123316
}
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";
23248-
$.ajax({
23249-
url: surveyUrl,
23250-
dataType: "json",
23251-
data: { id: shareId, user_uuid: this.userUUID, kind: 'requestHelp', v: version, response: miniSurveyResponse },
23252-
success: function () { },
23253-
error: function () { },
23254-
});
23255-
}
23317+
var surveyItem = randomlyPickSurveyItem('requestHelp');
23318+
var miniSurveyResponse = prompt(surveyItem.prompt);
23319+
// always log every impression, even if miniSurveyResponse is blank,
23320+
// since we can know how many times that survey question was ever seen:
23321+
var shareId = exports.TogetherJS.shareId();
23322+
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
23323+
$.ajax({
23324+
url: surveyUrl,
23325+
dataType: "json",
23326+
data: { id: shareId, user_uuid: this.userUUID, kind: 'requestHelp', v: surveyItem.v, response: miniSurveyResponse },
23327+
success: function () { },
23328+
error: function () { },
23329+
});
2325623330
this.redrawConnectors(); // update all arrows at the end
2325723331
};
2325823332
OptFrontendSharedSessions.prototype.initStopRequestingPublicHelp = function () {

v5-unity/build/csc108h.bundle.js

Lines changed: 102 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22391,6 +22391,82 @@ var pytutor_1 = __webpack_require__(5);
2239122391
});
2239222392
};
2239322393
}(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+
}
2239422470
var OptFrontendSharedSessions = (function (_super) {
2239522471
__extends(OptFrontendSharedSessions, _super);
2239622472
function OptFrontendSharedSessions(params) {
@@ -22637,20 +22713,19 @@ var OptFrontendSharedSessions = (function (_super) {
2263722713
});
2263822714
// add these handlers AFTER the respective DOM nodes have been added above:
2263922715
$(".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";
22646-
$.ajax({
22647-
url: surveyUrl,
22648-
dataType: "json",
22649-
data: { id: idToJoin, user_uuid: me.userUUID, kind: 'volunteerHelp', v: version, response: miniSurveyResponse },
22650-
success: function () { },
22651-
error: function () { },
22652-
});
22653-
}
22716+
var surveyItem = randomlyPickSurveyItem('volunteerHelp');
22717+
var miniSurveyResponse = prompt(surveyItem.prompt);
22718+
// always log every impression, even if miniSurveyResponse is blank,
22719+
// since we can know how many times that survey question was ever seen:
22720+
var idToJoin = $(this).attr('data-id');
22721+
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
22722+
$.ajax({
22723+
url: surveyUrl,
22724+
dataType: "json",
22725+
data: { id: idToJoin, user_uuid: me.userUUID, kind: 'volunteerHelp', v: surveyItem.v, response: miniSurveyResponse },
22726+
success: function () { },
22727+
error: function () { },
22728+
});
2265422729
return true; // ALWAYS cause the link to be clicked
2265522730
});
2265622731
}
@@ -23239,20 +23314,19 @@ var OptFrontendSharedSessions = (function (_super) {
2323923314
exports.TogetherJS(); // shut down TogetherJS
2324023315
}
2324123316
}
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";
23248-
$.ajax({
23249-
url: surveyUrl,
23250-
dataType: "json",
23251-
data: { id: shareId, user_uuid: this.userUUID, kind: 'requestHelp', v: version, response: miniSurveyResponse },
23252-
success: function () { },
23253-
error: function () { },
23254-
});
23255-
}
23317+
var surveyItem = randomlyPickSurveyItem('requestHelp');
23318+
var miniSurveyResponse = prompt(surveyItem.prompt);
23319+
// always log every impression, even if miniSurveyResponse is blank,
23320+
// since we can know how many times that survey question was ever seen:
23321+
var shareId = exports.TogetherJS.shareId();
23322+
var surveyUrl = exports.TogetherJS.config.get("hubBase").replace(/\/*$/, "") + "/survey";
23323+
$.ajax({
23324+
url: surveyUrl,
23325+
dataType: "json",
23326+
data: { id: shareId, user_uuid: this.userUUID, kind: 'requestHelp', v: surveyItem.v, response: miniSurveyResponse },
23327+
success: function () { },
23328+
error: function () { },
23329+
});
2325623330
this.redrawConnectors(); // update all arrows at the end
2325723331
};
2325823332
OptFrontendSharedSessions.prototype.initStopRequestingPublicHelp = function () {

0 commit comments

Comments
 (0)