Enabling Stanford and hint visibility experiments

- Specified levels on which experiments should take place.
- Switched to using ip addresses, rather than user ids, to determine experiment options.
- Added ip address hash to ActivityHint.
- Added and improved tests.
Right now, I'm putting them into the 0 bucket, which gives nice boring
results (for the hint source experiment, uses only crowdsourced hints, and
for the "show hint" experiment, shows the hint look normal).  This will
result in more tests of bucket 0.  If we think there's no qualitative
difference between users whose ip address doesn't show up and users who do,
this is fine.

Continuing to think aloud, it might be better to allow us to differentiate
the no-IP (or malformed IP) cases, so I'll make a little change to how
those are handled...


On Mon, Jul 28, 2014 at 11:34 AM, Laurel <notifications@github.com> wrote:

> In app/models/experiment_activity.rb:
>
> > @@ -82,12 +106,25 @@ def self.feedback_experiment_param(url)
> >
> >    VISIBILITY_EXPERIMENT_PARAMETER = 'hint_visibility_experiment'
> >
> > +  public # for testing
> > +  # Return the penultimate section of an ip address, as an int, to use as a hash value.
> > +  # This returns 0 if the parameter is not in the form 'n.n.n.n', where each n
> > +  # is a possibly distinct integer.  We don't use the last section, since we
> > +  # want everyone in the same classroom to have the same hash value.
> > +  def self.ip_to_hash_value(ip)
> > +    return 0 unless ip
>
> I think you can just decide whether it's better for your experiment data
> to just 'ignore' them by putting them in one bucket or 'ignore' them by
> excluding them from the experiment...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/code-dot-org/dashboard/pull/1092/files#r15481087>.
>