# $Id: amtda2.pl,v 1.2 2005/04/12 19:50:26 ddoughty Exp $ # # Source File: amtda.pl # custom reports for amtda.org # use FileHandle; use Time::Local; use Data::Dumper; require 'sitecfg.pl'; require 'testlib.pl'; require "maillib.pl"; use strict; use vars qw(%FORM %SESSION %CLIENT %TEST_SESSION %SUBTEST_QUESTIONS %TEST %SUBTEST_SUMMARY %CANDIDATE %SUBTEST_ANSWERS %SYSTEM %REPORT %SUBTEST_RESPONSES); use vars qw($testcomplete $cgiroot $pathsep $dataroot ); &app_initialize; &LanguageSupportInit(); &get_client_profile($SESSION{'clid'}); &get_test_profile($CLIENT{'clid'}, $FORM{'tstid'}); $FORM{'tstid'} = ($CLIENT{'clid'} eq 'sandbox'? 'tutor': 'CMTSE2'); if (&get_session($FORM{'tid'})) { if (not $FORM{'reportname'}) { &ReportChooser($CLIENT{'clid'},$FORM{'tstid'}); } else { if ($FORM{'mofm'} < 10) { $FORM{'mofm'}="0$FORM{'mofm'}";} if ($FORM{'moto'} < 10) { $FORM{'moto'}="0$FORM{'moto'}";} if ($FORM{'dyfm'} < 10) { $FORM{'dyfm'}="0$FORM{'dyfm'}";} if ($FORM{'dyto'} < 10) { $FORM{'dyto'}="0$FORM{'dyto'}";} my $datefm="$FORM{'yrfm'}\-$FORM{'mofm'}\-$FORM{'dyfm'}"; my $dateto="$FORM{'yrto'}\-$FORM{'moto'}\-$FORM{'dyto'}"; my $questions = &get_test_questions($CLIENT{'clid'},$FORM{'tstid'}); my $results = &get_all_test_results($CLIENT{'clid'},$FORM{'tstid'}, $datefm, $dateto); my ($subjects, $categories) = &add_results_by_cnd($questions,$results); #print "
".Dumper($results)."\n"; if (toGMSeconds($datefm." 00:00:00") > toGMSeconds($dateto." 00:00:00")) { print "
\n"; return $html; } sub HTMLTable { my ($data,$caption,%options) = @_; my %options = ('aligndef' => 'center', 'alignrow' => [], 'bold' => {0 => 1}, @_); my $html = "
$_ | ",@{$data->[0]}))."
---|