var email = session.get("email_address")
// Look up the email from a remote service/db
var account = accountService.lookup(email);
// UNREGISTERED, FREE, BASIC, PREMIUM
var level = account ? account.level() : Level.UNREGISTERED;
var identifiers = {
"email": email,
"accountId": accountId
}
// Add the lookup result to the proctor context
var proctorContext = ProctorContext.builder()
.withAccountLevel(level)
.build();
// Get the final assignment in all test groups, relying on each test's rules
// to determine whether the identified user is placed in any group for that test.
var proctorResult = proctorContext.getProctorResult(request, response, identifiers);