{'_Options'}});$i++) {
+ push(@{$plotdata[$i+1]},0);
}
}
#
# Create the plot
my $count = $end_index-$begin_index;
+ return ('No data','') if ($count <= 0);
my $title;
if ($count == 0) {
$title = 'no submissions';
} elsif ($count == 1) {
$title = 'one submission';
- } else {
+ } elsif ($count > 1) {
$title = $count.' submissions';
}
- my $correctplot = &Apache::loncommon::DrawBarGraph($title,
+ my $correct_plot = &Apache::loncommon::DrawBarGraph($title,
'Foil Number',
'Percent Correct',
100,
$plotcolors,
undef,
- $Plotdata[0]);
- for (my $j=0; $j< scalar(@{$Plotdata[0]});$j++) {
- $Plotdata[0]->[$j]=0;
+ $plotdata[0]);
+ for (my $j=0; $j< scalar(@{$plotdata[0]});$j++) {
+ $plotdata[0]->[$j]=0;
}
$count = $end_index-$begin_index-$TimeData{'_correct'};
if ($count == 0) {
$title = 'no submissions';
+ } elsif ($count < 0) {
+ return ($correct_plot,'');
} elsif ($count == 1) {
$title = 'one submission';
} else {
$title = $count.' submissions';
}
- my $incorrectplot = &Apache::loncommon::DrawBarGraph($title,
+ my $incorrect_plot = &Apache::loncommon::DrawBarGraph($title,
'Foil Number',
'Incorrect Option Choice',
100,
$plotcolors,
undef,
- @Plotdata);
- $analysis_html.=''.
- ''.$correctplot.' | '.
- ''.$incorrectplot.' | '.
- ''.$foilkey.' | '."
\n";
- $analysis_html.= ''.''.
- 'Start Time:'.
- ' '.$interval->{'startdateform'}.' '.
- 'End Time : '.
- ' '.$interval->{'enddateform'}.' '.
-# 'Plot Title :'.
-# (" "x3).$interval->{'titleform'}.
- ' | '.
- "
\n";
- return $analysis_html;
+ @plotdata);
+ return ($correct_plot,$incorrect_plot);
}
sub OR_Concept_Time_Analysis {
- my ($PerformanceData,$ORdata,$Concepts,$interval) = @_;
- my $analysis_html;
+ my ($performance_data,$ORdata,$Concepts,$interval) = @_;
##
## Determine starttime, endtime, startindex, endindex
my ($begin_index,$end_index) = ($interval->{'begin_index'},
@@ -1009,7 +978,7 @@ sub OR_Concept_Time_Analysis {
#
# Compute the number getting the foils correct or incorrects
for (my $j=$begin_index;$j<=$end_index;$j++) {
- my $row = $PerformanceData->[$j];
+ my $row = $performance_data->[$j];
next if (! defined($row));
my %Row = &Process_OR_Row($row);
while (my ($foilid,$href) = each(%Row)) {
@@ -1024,7 +993,7 @@ sub OR_Concept_Time_Analysis {
}
#
# Put the data in plottable form
- my @Plotdata;
+ my @plotdata;
foreach my $concept (@$Concepts) {
my ($total,$correct);
foreach my $foil (@{$concept->{'foils'}}) {
@@ -1032,32 +1001,21 @@ sub OR_Concept_Time_Analysis {
$correct += $TimeData{$foil}->{'_correct'};
}
if ($total == 0) {
- push(@Plotdata,0);
+ push(@plotdata,0);
} else {
- push(@Plotdata,100 * $correct / $total);
+ push(@plotdata,100 * $correct / $total);
}
}
#
# Create the plot
my $title = ($end_index - $begin_index).' submissions';
- my $correctplot = &Apache::loncommon::DrawBarGraph($title,
- 'Concept Number',
- 'Percent Correct',
- 100,
- $plotcolors,
- undef,
- \@Plotdata);
- $analysis_html.=''.
- ''.$correctplot.' | '.
- ''.
- 'Start Time: '.$interval->{'startdateform'}.' '.
- 'End Time : '.
- ' '.$interval->{'enddateform'}.' '.
-# 'Plot Title :'.(" "x3).
-# $interval->{'titleform'}.
- ' | '.
- "
\n";
- return $analysis_html;
+ return &Apache::loncommon::DrawBarGraph($title,
+ 'Concept Number',
+ 'Percent Correct',
+ 100,
+ $plotcolors,
+ undef,
+ \@plotdata);
}
#########################################################
@@ -1068,7 +1026,7 @@ sub OR_Concept_Time_Analysis {
#########################################################
#########################################################
sub OR_excel_sheet {
- my ($r,$resource,$PerformanceData,$ORdata) = @_;
+ my ($r,$resource,$performance_data,$ORdata) = @_;
my $response = '';
my (undef,$Foils,$Concepts) = &build_foil_index($ORdata);
#
@@ -1106,7 +1064,7 @@ sub OR_excel_sheet {
# Do something useful
}
$result = &OR_build_response_data_worksheet($response_data_sheet,$format,
- $PerformanceData,$Foils,
+ $performance_data,$Foils,
$ORdata);
if ($result ne 'okay') {
# Do something useful
@@ -1194,7 +1152,7 @@ sub OR_build_problem_data_worksheet {
}
sub OR_build_response_data_worksheet {
- my ($worksheet,$format,$PerformanceData,$Foils,$ORdata)=@_;
+ my ($worksheet,$format,$performance_data,$Foils,$ORdata)=@_;
my $rows_output = 3;
my $cols_output = 0;
$worksheet->write($rows_output++,0,'Response Data',$format->{'h3'});
@@ -1207,18 +1165,18 @@ sub OR_build_response_data_worksheet {
}
$worksheet->write_row($rows_output++,0,\@Headers,$format->{'header'});
#
- foreach my $row (@$PerformanceData) {
+ foreach my $row (@$performance_data) {
next if (! defined($row));
my ($student,$award,$grading,$submission,$time,$tries) = @$row;
my @Foilgrades = split('&',$grading);
my @Foilsubs = split('&',$submission);
- my %ResponseData;
+ my %response_data;
for (my $j=0;$j<=$#Foilgrades;$j++) {
my ($foilid,$correct) = split('=',$Foilgrades[$j]);
my (undef,$submission) = split('=',$Foilsubs[$j]);
$submission = &Apache::lonnet::unescape($submission);
- $ResponseData{$foilid.' submission'}=$submission;
- $ResponseData{$foilid.' award'}=$correct;
+ $response_data{$foilid.' submission'}=$submission;
+ $response_data{$foilid.' award'}=$correct;
}
$worksheet->write($rows_output,$cols_output++,$student);
$worksheet->write($rows_output,$cols_output++,
@@ -1227,9 +1185,9 @@ sub OR_build_response_data_worksheet {
$worksheet->write($rows_output,$cols_output++,$tries);
foreach my $foilid (@$Foils) {
$worksheet->write($rows_output,$cols_output++,
- $ResponseData{$foilid.' submission'});
+ $response_data{$foilid.' submission'});
$worksheet->write($rows_output,$cols_output++,
- $ResponseData{$foilid.' award'});
+ $response_data{$foilid.' award'});
}
$rows_output++;
$cols_output = 0;
@@ -1425,67 +1383,55 @@ sub CreateInterface {
##
##
$Str .= '';
- { # These braces are here to organize the code, not scope it.
- {
- $Str .= ''.&mt('Analyze Over ');
- $Str .= &Apache::loncommon::help_open_topic
- ('Analysis_Analyze_Over');
- $Str .='';
- $Str .= ' ';
- }
- {
- $Str .= ''.&mt('Analyze as ');
- $Str .= &Apache::loncommon::help_open_topic
- ('Analysis_Analyze_as');
- $Str .=' ';
- }
- {
- $Str .= ''.&mt('Number of Plots:');
- $Str .= &Apache::loncommon::help_open_topic
- ('Analysis_num_plots');
- $Str .= ' ';
- }
- {
- $Str .= ''.&mt('Status: [_1]',
+ ##
+ my $showprob_checkbox =
+ '';
+ $Str.= ' ';
+ ##
+ my $analyze_selector = '';
+ $Str .= ' '.$/;
+ ##
+ my $numplots_selector = ' ';
+ $Str .= '';
+ ##
+ $Str .= ' ';
- }
- }
+ '';
$Str .= ' | ';
##
##