Enabled testing of Stanford experiment.

Yes it is.  Good catch.


On Thu, Jul 17, 2014 at 1:43 PM, Laurel <notifications@github.com> wrote:

> In app/controllers/application_controller.rb:
>
> > @@ -105,8 +105,15 @@ def milestone_response(options)
> >
> >      # Check if the current level_source has program specific hint, use it if use is set.
> >      if options[:level_source]
> > -      if current_user && ExperimentActivity.is_experimenting_feedback?
> > -        index = current_user.id % ExperimentActivity::FEEDBACK_
> EXPERIMENT_SOURCES.length
> > +      # For testing purposes, we are running the Stanford experiment when a URL
> > +      # parameter stanford_experiment is provided.  It should contain an
> > +      # integer, which is interpreted as a user id.
> > +      referer = @_env['HTTP_REFERER']
> > +      parms = referer && CGI.parse(URI.parse(referer).query)
> > +      stanford_experiment_user_id = parms && parms['stanford_experiment'] && parms['stanford_experiment'][0]
> > +      if stanford_experiment_user_id || ExperimentActivity.is_experimenting_feedback?
> > +        id = (stanford_experiment_user_id && stanford_experiment_user_id.to_i) || current_user.id
>
> is it possible for current_user to be nil here?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/code-dot-org/dashboard/pull/1031/files#r15082712>.
>