MCPcopy Create free account
hub / github.com/codecombat/codecombat / setRole

Method setRole

app/models/User.js:376–383  ·  view source on GitHub ↗
(role, force = false)

Source from the content-addressed store, hash-verified

374 }
375
376 setRole (role, force = false) {
377 const oldRole = this.get('role')
378 if ((oldRole === role) || (oldRole && !force)) { return }
379 this.set('role', role)
380 this.patch()
381 application.tracker.identify()
382 return this.get('role')
383 }
384
385 // y = a * ln(1/b * (x + c)) + 1
386 static levelFromExp (xp) {

Callers 2

onTrialRequestSubmitMethod · 0.80
onTrialRequestSubmitMethod · 0.80

Calls 4

getMethod · 0.95
patchMethod · 0.80
setMethod · 0.45
identifyMethod · 0.45

Tested by

no test coverage detected