Add controller name and update version in tutorial user stats

This commit is contained in:
Ryan Huffman 2016-12-12 10:49:47 -08:00
parent a1fea65aa5
commit f3f6317c91
3 changed files with 11 additions and 5 deletions

View file

@ -25,14 +25,15 @@ void UserActivityLoggerScriptingInterface::toggledAway(bool isAway) {
}
void UserActivityLoggerScriptingInterface::tutorialProgress( QString stepName, int stepNumber, float secondsToComplete,
float tutorialElapsedTime, QString tutorialRunID, int tutorialVersion) {
float tutorialElapsedTime, QString tutorialRunID, int tutorialVersion, QString controllerType = "") {
logAction("tutorial_progress", {
{ "tutorial_run_id", tutorialRunID },
{ "tutorial_version", tutorialVersion },
{ "step", stepName },
{ "step_number", stepNumber },
{ "seconds_to_complete", secondsToComplete },
{ "tutorial_elapsed_seconds", tutorialElapsedTime }
{ "tutorial_elapsed_seconds", tutorialElapsedTime },
{ "controller_type", controllerType }
});
}

View file

@ -24,7 +24,7 @@ public:
Q_INVOKABLE void openedMarketplace();
Q_INVOKABLE void toggledAway(bool isAway);
Q_INVOKABLE void tutorialProgress(QString stepName, int stepNumber, float secondsToComplete,
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0);
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0, QString controllerType = "");
private:
void logAction(QString action, QJsonObject details = {});

View file

@ -1020,18 +1020,23 @@ TutorialManager = function() {
var didFinishTutorial = false;
var wentToEntryStepNum;
var VERSION = 1;
var VERSION = 2;
var tutorialID;
var self = this;
// The real controller name is the actual detected controller name, or 'unknown'
// if one is not found.
if (HMD.isSubdeviceContainingNameAvailable("OculusTouch")) {
this.controllerName = "touch";
this.realControllerName = "touch";
} else if (HMD.isHandControllerAvailable("OpenVR")) {
this.controllerName = "vive";
this.realControllerName = "vive";
} else {
info("ERROR, no known hand controller found, defaulting to Vive");
this.controllerName = "vive";
this.realControllerName = "unknown";
}
this.startTutorial = function() {
@ -1120,7 +1125,7 @@ TutorialManager = function() {
var tutorialTimeElapsed = (Date.now() - startedTutorialAt) / 1000;
UserActivityLogger.tutorialProgress(
name, stepNum, timeToFinishStep, tutorialTimeElapsed,
tutorialID, VERSION);
tutorialID, VERSION, this.realControllerName);
}
// This is a message sent from the "entry" portal in the courtyard,