Thread Wer hilft mir folgendes Script zu optimieren ??: Anfrage Hilfe (29 answers)
Opened by Gast at 2006-05-18 17:06

renee
 2006-05-19 10:45
#7688 #7688
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Vielleicht meinst Du:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/local/bin/perl

use strict;
use CGI;
use HTML::Template::Compiled;

my $cgi = CGI->new();
my %uservars = $cgi->Vars();

my @anwort = qw(0 B D B A C D D B B D B C A D C C A C);
my $richtig;

for (1..$#anwort) { $richtig++ if $uservars{"IQ$_"} eq $antwort[$_] }

if($richtig >= 18){
print $cgi->redirect("richtig.html");
}
else{
my $template = HTML::Template::Compiled->new(filename => 'auswertung.tmpl');
$template->param(AUSWERTUNG => $richtig);
$template->param(ANZAHL => scalar(@antwort));
print $cgi->header(),$template->output();
}


auswertung.tmpl
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<style type="text/css"><!--
body {font-size:18px; }
--></style>
</head>
<BODY background="../back.jpg" text="#000000" bgcolor="#FFFFCC" link="#FF0000" vlink="#FF0000" alink="#FF0000">

<center><b><font size=+4>Testauswertung</font><br>

<br>Ergebnis:<br>
<font color="#FF0000"><TMPL_VAR NAME=AUSWERTUNG ></font> Antwort(en) von <TMPL_VAR NAME=ANZAHL > Aufgaben sind richtig .......
</center>
</body>
</html>
\n\n

<!--EDIT|renee|1148038763-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Wer hilft mir folgendes Script zu optimieren ??: Anfrage Hilfe