JavaScript quiz engine