/[suikacvs]/perl/kanzan/kanzan.cgi
Suika

Diff of /perl/kanzan/kanzan.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Wed Sep 4 08:57:28 2002 UTC revision 1.4 by wakaba, Wed Sep 4 09:02:38 2002 UTC
# Line 68  sub kanzan (%%%%) { Line 68  sub kanzan (%%%%) {
68      $kanzaned1{_ALL} += $kanzaned1{$subject};      $kanzaned1{_ALL} += $kanzaned1{$subject};
69      $$full1{_ALL} += $$full1{$subject};      $$full1{_ALL} += $$full1{$subject};
70    }    }
71    $kanzaned1{_PERCENT} = 100*$kanzaned1{_ALL}/$$full1{_ALL};    $kanzaned1{_PERCENT} = $$full1{_ALL}==0?0:100*$kanzaned1{_ALL}/$$full1{_ALL};
72    $$full2{_ALL} = 0;    $$full2{_ALL} = 0;
73    for my $subject (keys %$full2) {    for my $subject (keys %$full2) {
74      next if $subject =~ /^_/;      next if $subject =~ /^_/;
# Line 76  sub kanzan (%%%%) { Line 76  sub kanzan (%%%%) {
76      $kanzaned2{_ALL} += $kanzaned2{$subject};      $kanzaned2{_ALL} += $kanzaned2{$subject};
77      $$full2{_ALL} += $$full2{$subject};      $$full2{_ALL} += $$full2{$subject};
78    }    }
79    $kanzaned2{_PERCENT} = 100*$kanzaned2{_ALL}/$$full2{_ALL};    $kanzaned2{_PERCENT} = $$full2{_ALL}==0?0:100*$kanzaned2{_ALL}/$$full2{_ALL};
80        
81    my ($percent, $object_percent);    my ($percent, $object_percent);
82    $percent = 100*($kanzaned1{_ALL}+$kanzaned2{_ALL})    $percent = ($$full1{_ALL}+$$full2{_ALL})==0?0:
83                 100*($kanzaned1{_ALL}+$kanzaned2{_ALL})
84                  /($$full1{_ALL}+$$full2{_ALL});                  /($$full1{_ALL}+$$full2{_ALL});
85    $object_percent = ($$point1{_OBJECT}*$$full1{_ALL}    $object_percent = ($$full1{_ALL}+$$full2{_ALL})==0?0:
86                        ($$point1{_OBJECT}*$$full1{_ALL}
87                      +$$point2{_OBJECT}*$$full2{_ALL})                      +$$point2{_OBJECT}*$$full2{_ALL})
88                  /($$full1{_ALL}+$$full2{_ALL});                  /($$full1{_ALL}+$$full2{_ALL});
89    ($percent, $object_percent, \%kanzaned1, \%kanzaned2);    ($percent, $object_percent, \%kanzaned1, \%kanzaned2);
# Line 139  sub output_html (%%%%%) { Line 141  sub output_html (%%%%%) {
141  <html lang="ja">  <html lang="ja">
142  <head>  <head>
143  <title>配点換算</title>  <title>配点換算</title>
144  <link rev="made" href="mailto:w@suika.fam.cx">  <link rev="made" href="mailto:w\@suika.fam.cx">
145  <link rel="contents" href="http://tomikou.net/">  <link rel="contents" href="http://tomikou.net/">
146  <link rel="contents" href="/chuubu/">  <link rel="contents" href="/chuubu/">
147  <style type="text/css">  <style type="text/css">

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24