Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theospears committed Jan 7, 2013
1 parent 5494246 commit a221777
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ different result based on the alternative:

If you wish to find out what experiment alternative a user is part of, but not
enroll them if they are not yet a member, you can use get_alternative. This
will return 'control' if the user is not enrolled.
will return 'control' if the user is not enrolled. 'control' is also returned
for users who are enrolled in the experiment but have been assigned to the
control group - there is no way to differentiate between these cases.

::

Expand All @@ -207,6 +209,15 @@ will return 'control' if the user is not enrolled.
elif alternative == 'control':
header_text = get_normal_text_summary()

By default the participant function expects a HttpRequest object, but you can
alternatively pass a user or session as a keyword argument

::

participant(user=current_user).get_alternative('register_text')
participant(session=session).get_alternative('register_text')


\*\ *Experiments will be dynamically created by default if they are
defined in a template but not in the admin. This can be overridden in
settings.*
Expand Down
2 changes: 1 addition & 1 deletion experiments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def enroll(self, experiment_name, alternatives):
return chosen_alternative

def get_alternative(self, experiment_name):
"""Get the alternative this use is enrolled in. If not enrolled in the experiment returns 'control'"""
"""Get the alternative this user is enrolled in. If not enrolled in the experiment returns 'control'"""
experiment = experiment_manager.get(experiment_name, None)
if experiment and experiment.is_displaying_alternatives():
alternative = self._get_enrollment(experiment)
Expand Down

0 comments on commit a221777

Please sign in to comment.