Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Typo changes and the like.

  • Loading branch information...
commit 9b7ae350d54699c14e458e18f6e94ab44477f7dc 1 parent adbeb00
@patio11 patio11 authored
Showing with 11 additions and 3 deletions.
  1. +4 −0 lib/abingo/alternative.rb
  2. +7 −3 lib/abingo/statistics.rb
View
4 lib/abingo/alternative.rb
@@ -3,6 +3,10 @@ class Abingo::Alternative < ActiveRecord::Base
belongs_to :experiment
+ def pretty_content
+ YAML::load content
+ end
+
def self.calculate_lookup(test_name, alternative_name)
Digest::MD5.hexdigest(Abingo.salt + test_name + alternative_name.to_s)
end
View
10 lib/abingo/statistics.rb
@@ -54,7 +54,11 @@ def pretty_conversion_rate
end
def describe_result_in_words
- z = zscore
+ begin
+ z = zscore
+ rescue
+ return "Could not execute the significance test because one or more of the alternatives has not been seen yet."
+ end
p = p_value
words = ""
@@ -65,9 +69,9 @@ def describe_result_in_words
alts = alternatives - [best_alternative]
worst_alternative = alts.first
- words += "The best alternative you have is: [#{best_alternative.content}], which had "
+ words += "The best alternative you have is: [#{best_alternative.pretty_content}], which had "
words += "#{best_alternative.conversions} conversions from #{best_alternative.participants} participants "
- words += "(#{best_alternative.pretty_conversion_rate}). The other alternative was [#{worst_alternative.content}],"
+ words += "(#{best_alternative.pretty_conversion_rate}). The other alternative was [#{worst_alternative.pretty_content}], "
words += "which had #{worst_alternative.conversions} conversions from #{worst_alternative.participants} participants "
words += "(#{worst_alternative.pretty_conversion_rate}). "
Please sign in to comment.
Something went wrong with that request. Please try again.