Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The result will be: your grade is %, you answered n question correct. (until now I don't need to display which questions were correct)my %test = ( question1 => 'a', question2 => 'b', question3 => 'a', ); #my hash of arrays with multiple answers my %answers = ( question1 => [ 'a' ], question2 => [ 'b', 'd' ], question3 => [ 'b' ], );
So far, not results. Thanksfor my $q1 (keys %test) { for my $a1 (0..$#$answers{$q1}){ if ($test{$q1} eq $answers{$q1}[$a1]{ $grade++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calculate grades
by DamnDirtyApe (Curate) on Apr 02, 2004 at 01:15 UTC | |
by Anonymous Monk on Apr 02, 2004 at 01:36 UTC | |
by DamnDirtyApe (Curate) on Apr 02, 2004 at 01:48 UTC | |
by Anonymous Monk on Apr 02, 2004 at 01:59 UTC | |
|
Re: Calculate grades
by Anonymous Monk on Apr 02, 2004 at 08:59 UTC |