Refactoring and additions related to hint experiments

This goes along with "https://github.com/code-dot-org/blockly/pull/767".
Good point.  Done (but not yet tested, committed, and pushed).


On Thu, Jul 24, 2014 at 10:05 AM, Laurel <notifications@github.com> wrote:

> In app/controllers/application_controller.rb:
>
> > -        end
> > -        response[:hint] = response[:hint].hint
> > -      end
> > -    end
> > -
> > -    # Optionally, perform experiment where user must choose to see hint.
> > -    if hint_visibility_experiment_user_id ||
> > -        (ExperimentActivity::is_experimenting_hint_visibility? && current_user)
> > -      user_id = hint_visibility_experiment_user_id || current_user.id
> > -      response[:hint_request_placement] =
> > -          ExperimentActivity::pick_mod_length(ExperimentActivity::HINT_VISIBILITY_VALUES, user_id)
> > -    end
> > +    # Call method to generate hint and related attributes, copying results into response.
> > +    options[:uri] = request.referer
> > +    options[:current_user] = current_user
> > +    hint_details = ExperimentActivity::determine_hint(options)
>
> probably better to just call determine_hint with a new hash rather than
> modifying the options passed in to this method
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/code-dot-org/dashboard/pull/1065/files#r15358835>.
>