mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Drop Cap A/B Tests: v2 (#12759)
* drop cap ab test: enroll all web users, 50/50 * update tests * fix lint
This commit is contained in:
@@ -534,13 +534,11 @@ schema.methods.enrollInDropCapABTest = function enrollInDropCapABTest (xClientHe
|
||||
|
||||
if (isWeb && !this._ABtests.dropCapNotif && !this.isSubscribed()) {
|
||||
const testGroup = Math.random();
|
||||
// Enroll 20% of users, splitting them 50/50
|
||||
if (testGroup <= 0.25) {
|
||||
// Enroll 100% of users, splitting them 50/50
|
||||
if (testGroup <= 0.50) {
|
||||
this._ABtests.dropCapNotif = 'drop-cap-notif-enabled';
|
||||
} else if (testGroup <= 0.5) {
|
||||
this._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
|
||||
} else {
|
||||
this._ABtests.dropCapNotif = 'drop-cap-notif-not-enrolled';
|
||||
this._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
|
||||
}
|
||||
this.markModified('_ABtests');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user