function ab_tests_test($test) { global $ab_participant_id; global $redis_connected; $forced_alternative = null; if ($redis_connected) { $forced_alternative = ab_tests_get_forced_alternative($test); } if ($forced_alternative == null) { $alt = ab_tests_alternative_for($ab_participant_id, $test); } else { $alt = $forced_alternative; } return $alt; }
<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]--> <script language="javascript" type="text/javascript" src="js/flot/jquery.js"></script> <script language="javascript" type="text/javascript" src="js/flot/jquery.flot.js"></script> <link href="css/report.css" media="all" rel="stylesheet" type="text/css" /> <link href="css/buttons.css" media="all" rel="stylesheet" type="text/css" /> <body> <h1>a/b testing report</h1> <hr/> <?php $i = 0; foreach ($ab_tests as $test) { $name = $test['name']; $alternatives = $test['alternatives']; $forced_alternative = ab_tests_get_forced_alternative($name); $num_alternatives = count($alternatives); echo "<a name=\"{$name}\"><h2>" . $name . "</h2></a>"; //echo "<P class=\"indent\" style='color: #556; font-size: 12px'>There are " . $num_alternatives . " alternatives for this test"; echo "<P class=\"indent\" style='color: #556; font-size: 12px'>" . $test['description']; if ($forced_alternative != null) { //echo "<P class=\"indent\" style='color: #999; font-size: 15px; margin-top: 12px'>" . "Currently forced to show option <u style='color: #666'>$forced_alternative</u> for all participants"; /*echo ' <a href="?force=true&test=' . $test['name'] . '&alt=' . "!!null!!" . '" class="red-button pcb"> <span style="color: black;">Clear</span> </a>'; */ } $j = 0; $a = array(); $total_converted = 0; $total_conversions = 0; $total_particants = 0;