#!/usr/bin/perl ## from a exercise-id --> ## shows the questions from ../MEX/mex.db ## accepts an answer ## validates the answers it according to ../MEX/mex.db --> perguntas e rexpostas ## saves the user inf ../MEX/user.db --> histório de cada user use strict; use utf8::all; use CGI q(:all); use Fcntl ; use Data::Dumper; $Data::Dumper::Terse=2; $Data::Dumper::Indent=2; BEGIN{ my $passarola_path = "#PASS_PATH"; # protect system by only allowing select bins to be executed #$ENV{PATH} = "$passarola_path/bin"; $Exercise::Gen::Verify::passarola_dir="$passarola_path/.passarola/db"; } use Exercise::Gen::Verify; print header(-charset=>'utf-8'); print start_html(-title => 'MEX', # -style => { -src => 'styles2.css', # -type => 'text/css' # } ); print_hidescript(); my $topid = get_topid(); my ($users_ref, $questions_ref) = get_stats(); my %users = %$users_ref; my %questions = %$questions_ref; print "
\n"; for(1..$topid-1){ print ""; } print "\n\n"; for(keys %users){ print ""; for my $id(1..$topid-1){ print ""; } printf ("\n", $users{$_}{avg}); } print ""; for(1..$topid-1){ printf("", $questions{$_}); } print "\n
Aluno\\Exercicio$_Média Alunos
$_"; printf ("%.2f", $users{$_}{$id}) if defined $users{$_}{$id}; print "%.2f
Média Exercícios%.2f
"; print end_form, end_html; sub print_hidescript{ my $q = q{ }; print $q; }