version 1.73, 2004/02/20 16:38:49
|
version 1.75, 2004/03/11 19:34:10
|
Line 99 sub BuildProblemAnalysisPage {
|
Line 99 sub BuildProblemAnalysisPage {
|
} |
} |
$r->rflush(); |
$r->rflush(); |
# |
# |
my $problem_types = '(option|radiobutton|numerical)'; |
my $problem_types = '(option|radiobutton)'; |
if (exists($ENV{'form.problemchoice'}) && |
if (exists($ENV{'form.problemchoice'}) && |
! exists($ENV{'form.SelectAnother'})) { |
! exists($ENV{'form.SelectAnother'})) { |
foreach my $button (@SubmitButtons) { |
foreach my $button (@SubmitButtons) { |
Line 552 sub OR_tries_analysis {
|
Line 552 sub OR_tries_analysis {
|
$mintries,$maxtries); |
$mintries,$maxtries); |
my $analysis = ''; |
my $analysis = ''; |
if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
$analysis = &OR_Tries_Foil_Analysis($mintries,$maxtries,$Foils, |
$analysis = &OR_Tries_Foil_Analysis($mintries,$maxtries,$Concepts, |
\%ResponseData,$ORdata); |
\%ResponseData,$ORdata); |
} else { |
} else { |
$analysis = &OR_Tries_Concept_Analysis($mintries,$maxtries, |
$analysis = &OR_Tries_Concept_Analysis($mintries,$maxtries, |
Line 563 sub OR_tries_analysis {
|
Line 563 sub OR_tries_analysis {
|
} |
} |
|
|
sub OR_Tries_Foil_Analysis { |
sub OR_Tries_Foil_Analysis { |
my ($mintries,$maxtries,$Foils,$respdat,$ORdata) = @_; |
my ($mintries,$maxtries,$Concepts,$respdat,$ORdata) = @_; |
my %ResponseData = %$respdat; |
my %ResponseData = %$respdat; |
# |
# |
# Compute the data neccessary to make the plots |
# Compute the data neccessary to make the plots |
my @PlotData; |
my @PlotData; |
foreach my $foilid (@$Foils) { |
foreach my $concept (@$Concepts) { |
for (my $i=$mintries;$i<=$maxtries;$i++) { |
foreach my $foilid (@{$concept->{'foils'}}) { |
if ($ResponseData{$foilid}->[$i]->{'_total'} == 0) { |
for (my $i=$mintries;$i<=$maxtries;$i++) { |
push(@{$PlotData[$i]->{'_correct'}},0); |
|
} else { |
|
push(@{$PlotData[$i]->{'_correct'}}, |
|
100*$ResponseData{$foilid}->[$i]->{'_correct'}/ |
|
$ResponseData{$foilid}->[$i]->{'_total'}); |
|
} |
|
foreach my $option (@{$ORdata->{'_Options'}}) { |
|
push(@{$PlotData[$i]->{'_total'}}, |
|
$ResponseData{$foilid}->[$i]->{'_total'}); |
|
if ($ResponseData{$foilid}->[$i]->{'_total'} == 0) { |
if ($ResponseData{$foilid}->[$i]->{'_total'} == 0) { |
push (@{$PlotData[$i]->{$option}},0); |
push(@{$PlotData[$i]->{'_correct'}},0); |
} else { |
} else { |
if ($ResponseData{$foilid}->[$i]->{'_total'} == |
push(@{$PlotData[$i]->{'_correct'}}, |
$ResponseData{$foilid}->[$i]->{'_correct'}) { |
100*$ResponseData{$foilid}->[$i]->{'_correct'}/ |
push(@{$PlotData[$i]->{$option}},0); |
$ResponseData{$foilid}->[$i]->{'_total'}); |
|
} |
|
foreach my $option (@{$ORdata->{'_Options'}}) { |
|
push(@{$PlotData[$i]->{'_total'}}, |
|
$ResponseData{$foilid}->[$i]->{'_total'}); |
|
if ($ResponseData{$foilid}->[$i]->{'_total'} == 0) { |
|
push (@{$PlotData[$i]->{$option}},0); |
} else { |
} else { |
push (@{$PlotData[$i]->{$option}}, |
if ($ResponseData{$foilid}->[$i]->{'_total'} == |
|
$ResponseData{$foilid}->[$i]->{'_correct'}) { |
|
push(@{$PlotData[$i]->{$option}},0); |
|
} else { |
|
push (@{$PlotData[$i]->{$option}}, |
100 * $ResponseData{$foilid}->[$i]->{$option} / |
100 * $ResponseData{$foilid}->[$i]->{$option} / |
($ResponseData{$foilid}->[$i]->{'_total'} - |
($ResponseData{$foilid}->[$i]->{'_total'} - |
$ResponseData{$foilid}->[$i]->{'_correct'})); |
$ResponseData{$foilid}->[$i]->{'_correct'})); |
|
} |
} |
} |
} |
} |
} |
} |
Line 599 sub OR_Tries_Foil_Analysis {
|
Line 601 sub OR_Tries_Foil_Analysis {
|
# |
# |
# Build a table for the plots |
# Build a table for the plots |
my $analysis_html = "<table>\n"; |
my $analysis_html = "<table>\n"; |
my $foilkey = &build_option_index($ORdata); |
my $optionkey = &build_option_index($ORdata); |
for (my $i=$mintries;$i<=$maxtries;$i++) { |
for (my $try=$mintries;$try<=$maxtries;$try++) { |
my $count = $ResponseData{'_total'}->[$i]; |
my $count = $ResponseData{'_total'}->[$try]; |
if ($count == 0) { |
if ($count == 0) { |
$count = 'no submissions'; |
$count = 'no submissions'; |
} elsif ($count == 1) { |
} elsif ($count == 1) { |
Line 609 sub OR_Tries_Foil_Analysis {
|
Line 611 sub OR_Tries_Foil_Analysis {
|
} else { |
} else { |
$count = $count.' submissions'; |
$count = $count.' submissions'; |
} |
} |
my $title = 'Attempt '.$i.', '.$count; |
my $title = 'Attempt '.$try.', '.$count; |
my @Datasets; |
my @Datasets; |
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) { |
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) { |
next if (! exists($PlotData[$i]->{$option})); |
next if (! exists($PlotData[$try]->{$option})); |
push(@Datasets,$PlotData[$i]->{$option}); |
push(@Datasets,$PlotData[$try]->{$option}); |
} |
} |
my $correctgraph = &Apache::loncommon::DrawBarGraph |
my $correctgraph = &Apache::loncommon::DrawBarGraph |
($title,'Foil Number','Percent Correct', |
($title,'Foil Number','Percent Correct', |
100,$plotcolors,undef,$Datasets[0]); |
100,$plotcolors,undef,$Datasets[0]); |
$analysis_html.= '<tr><td>'.$correctgraph.'</td>'; |
$analysis_html.= '<tr><td>'.$correctgraph.'</td>'; |
## |
|
## |
# |
|
# |
next if (! defined($Datasets[0])); |
next if (! defined($Datasets[0])); |
for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { |
for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { |
$Datasets[0]->[$i]=0; |
$Datasets[0]->[$i]=0; |
} |
} |
$count = $ResponseData{'_total'}->[$i]-$ResponseData{'_correct'}->[$i]; |
$count = $ResponseData{'_total'}->[$try] - |
|
$ResponseData{'_correct'}->[$try]; |
if ($count == 0) { |
if ($count == 0) { |
$count = 'no submissions'; |
$count = 'no submissions'; |
} elsif ($count == 1) { |
} elsif ($count == 1) { |
Line 633 sub OR_Tries_Foil_Analysis {
|
Line 637 sub OR_Tries_Foil_Analysis {
|
} else { |
} else { |
$count = $count.' submissions'; |
$count = $count.' submissions'; |
} |
} |
$title = 'Attempt '.$i.', '.$count; |
$title = 'Attempt '.$try.', '.$count; |
my $incorrectgraph = &Apache::loncommon::DrawBarGraph |
my $incorrectgraph = &Apache::loncommon::DrawBarGraph |
($title,'Foil Number','% Option Chosen Incorrectly', |
($title,'Foil Number','% Option Chosen Incorrectly', |
100,$plotcolors,undef,@Datasets); |
100,$plotcolors,undef,@Datasets); |
$analysis_html.= '<td>'.$incorrectgraph.'</td>'; |
$analysis_html.= '<td>'.$incorrectgraph.'</td>'; |
$analysis_html.= '<td>'.$foilkey."<td></tr>\n"; |
$analysis_html.= '<td>'.$optionkey."<td></tr>\n"; |
} |
} |
$analysis_html .= "</table>\n"; |
$analysis_html .= "</table>\n"; |
return $analysis_html; |
return $analysis_html; |
Line 1299 sub CreateInterface {
|
Line 1303 sub CreateInterface {
|
## Build the menu |
## Build the menu |
my $Str = ''; |
my $Str = ''; |
$Str .= &Apache::lonhtmlcommon::breadcrumbs |
$Str .= &Apache::lonhtmlcommon::breadcrumbs |
(undef,&mt('Detailed Problem Analysis')); |
(undef,'Detailed Problem Analysis'); |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<tr>'; |
$Str .= '<tr>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |