From 44b0ccfdd1c79b013c72d1a6f71e3bc421f14186 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 30 May 2012 21:32:34 +0200 Subject: [PATCH] Make rating.pl use the common function for fetching aux parms. --- www/rating.pl | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/www/rating.pl b/www/rating.pl index 40e9165..f69b19a 100755 --- a/www/rating.pl +++ b/www/rating.pl @@ -20,19 +20,13 @@ $dbh->{RaiseError} = 1; binmode STDOUT, ':utf8'; -# Find auxillary parameters. -my %params = (); -my $q = $dbh->prepare('SELECT * FROM ratings WHERE id < 0'); -$q->execute; -while (my $ref = $q->fetchrow_hashref) { - $params{$ref->{'id'}} = $ref->{'rating'}; -} -my $match_stddev = $params{-2} * sqrt(2.0); +my $aux_parms = wloh_common::get_auxillary_parameters($dbh); +my $match_stddev = $aux_parms->{'score_stddev'} * sqrt(2.0); print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m'); POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8'); -printf <<"EOF", $params{-3}, $match_stddev; +printf <<"EOF", $aux_parms->{'rating_prior_stddev'}, $match_stddev; forklaring beregnet på ikke-matematikere.