#!/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 "
| Aluno\\Exercicio | "; for(1..$topid-1){ print "$_ | "; } print "\nMédia Alunos |
| $_ | "; for my $id(1..$topid-1){ print ""; printf ("%.2f", $users{$_}{$id}) if defined $users{$_}{$id}; print " | "; } printf ("%.2f |
| Média Exercícios | "; for(1..$topid-1){ printf("%.2f | ", $questions{$_}); } print "