Browse files

Documentation fixes

  • Loading branch information...
1 parent 5494246 commit a221777f8dcb4d4ec78356b2b8fa5016cb202b5d @theospears theospears committed Jan 7, 2013
Showing with 13 additions and 2 deletions.
  1. +12 −1 README.rst
  2. +1 −1 experiments/
13 README.rst
@@ -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.
@@ -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
2 experiments/
@@ -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)

0 comments on commit a221777

Please sign in to comment.