Fix dynamic mastery first-attempt upsert
This commit is contained in:
@@ -79,8 +79,6 @@ public sealed class DynamicQuestionStore
|
|||||||
var update = Builders<DynamicObjectiveMastery>.Update
|
var update = Builders<DynamicObjectiveMastery>.Update
|
||||||
.SetOnInsert(value => value.UserId, claims.UserId)
|
.SetOnInsert(value => value.UserId, claims.UserId)
|
||||||
.SetOnInsert(value => value.ObjectiveId, claims.ObjectiveId)
|
.SetOnInsert(value => value.ObjectiveId, claims.ObjectiveId)
|
||||||
.SetOnInsert(value => value.Attempts, 0)
|
|
||||||
.SetOnInsert(value => value.Correct, 0)
|
|
||||||
.Set(value => value.Elo, oldElo + delta)
|
.Set(value => value.Elo, oldElo + delta)
|
||||||
.Inc(value => value.Attempts, 1)
|
.Inc(value => value.Attempts, 1)
|
||||||
.Inc(value => value.Correct, isCorrect ? 1 : 0)
|
.Inc(value => value.Correct, isCorrect ? 1 : 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user