version 1.33, 2003/10/13 19:17:42
|
version 1.35, 2003/10/14 14:23:14
|
Line 218 sub tries_analysis {
|
Line 218 sub tries_analysis {
|
} |
} |
$maxstu = 0 if (! $maxstu); |
$maxstu = 0 if (! $maxstu); |
$minstu = 0 if (! $minstu); |
$minstu = 0 if (! $minstu); |
my $graphlink; |
my $title; |
if ($maxstu == $minstu) { |
if ($maxstu == $minstu) { |
$graphlink = &Apache::loncommon::DrawGraph |
$title = 'Attempt '.$i.', '.$maxstu.' students'; |
('Attempt '.$i.', '.$maxstu.' students', |
|
'Foil Number', |
|
'Percent Correct', |
|
100, |
|
$PlotData[$i]->{'good'}, |
|
$PlotData[$i]->{'bad'}); |
|
} else { |
} else { |
$graphlink = &Apache::loncommon::DrawGraph |
$title = 'Attempt '.$i.', '.$minstu.'-'.$maxstu.' students'; |
('Attempt '.$i.', '.$minstu.'-'.$maxstu. |
|
' students', |
|
'Foil Number', |
|
'Percent Correct', |
|
100, |
|
$PlotData[$i]->{'good'}, |
|
$PlotData[$i]->{'bad'}); |
|
} |
} |
|
my $graphlink = &Apache::loncommon::DrawGraph($title, |
|
'Foil Number', |
|
'Percent Correct', |
|
100, |
|
$PlotData[$i]->{'good'}, |
|
$PlotData[$i]->{'bad'}); |
push(@Plots,$graphlink); |
push(@Plots,$graphlink); |
} |
} |
# |
# |
Line 308 sub time_analysis {
|
Line 301 sub time_analysis {
|
my ($PerformanceData,$ORdata) = @_; |
my ($PerformanceData,$ORdata) = @_; |
my $num_plots = $ENV{'form.NumPlots'}; |
my $num_plots = $ENV{'form.NumPlots'}; |
my ($table,@Foils) = &build_foil_index($ORdata); |
my ($table,@Foils) = &build_foil_index($ORdata); |
my ($begin_index,$end_index); |
|
my $num_data = scalar(@$PerformanceData)-1; |
my $num_data = scalar(@$PerformanceData)-1; |
my $percent = sprintf('%2f',100/$num_plots); |
my $percent = sprintf('%2f',100/$num_plots); |
for (my $i=0;$i<$num_plots;$i++) { |
for (my $i=0;$i<$num_plots;$i++) { |
$begin_index = $i*int($num_data/$num_plots); |
my $starttime = &Apache::lonhtmlcommon::get_date_from_form |
$end_index = ($i+1)*int($num_data/$num_plots); |
('startdate_'.$i); |
my $lownum = sprintf('%2.1f',$i*$percent); |
my $endtime = &Apache::lonhtmlcommon::get_date_from_form |
$lownum =~ s/(\.0)$//; |
('enddate_'.$i); |
my $highnum = sprintf('%2.1f',($i+1)*$percent); |
my ($begin_index,$end_index,$plottitle,$plothtml,$data); |
$highnum =~ s/(\.0)$//; |
if (! defined($starttime) || ! defined($endtime)) { |
my ($plothtml,$starttime,$endtime,$data) = |
$begin_index = $i*int($num_data/$num_plots); |
|
$end_index = ($i+1)*int($num_data/$num_plots); |
|
my $lownum = sprintf('%2.1f',$i*$percent); |
|
$lownum =~ s/(\.0)$//; |
|
my $highnum = sprintf('%2.1f',($i+1)*$percent); |
|
$highnum =~ s/(\.0)$//; |
|
$plottitle = $lownum.'% to '.$highnum.'% of submissions'; |
|
} else { |
|
my $j; |
|
while (++$j < scalar(@$PerformanceData)) { |
|
last if ($PerformanceData->[$j]->[2] > $starttime); |
|
} |
|
$begin_index = $j; |
|
while (++$j < scalar(@$PerformanceData)) { |
|
last if ($PerformanceData->[$j]->[2] > $endtime); |
|
} |
|
$end_index = $j; |
|
$plottitle = 'Tries plot '.($i+1); |
|
} |
|
|
|
($plothtml,$starttime,$endtime,$data) = |
&analyze_option_data_by_time($PerformanceData, |
&analyze_option_data_by_time($PerformanceData, |
$begin_index,$end_index, |
$begin_index,$end_index, |
$lownum.'% to '.$highnum.'% of submissions', |
$plottitle, |
@Foils); |
@Foils); |
|
my $startdateform = &Apache::lonhtmlcommon::date_setter |
|
('Statistics','startdate_'.$i,$starttime); |
|
my $enddateform = &Apache::lonhtmlcommon::date_setter |
|
('Statistics','enddate_'.$i,$endtime); |
|
$plothtml.= "<br />\n". |
|
"<b>Start Time</b>: "." ".$startdateform."<br />\n". |
|
"<b>End Time</b> : "." ".$enddateform."<br />\n"; |
$table.=$plothtml; |
$table.=$plothtml; |
} |
} |
return $table; |
return $table; |
Line 379 sub analyze_option_data_by_time {
|
Line 398 sub analyze_option_data_by_time {
|
'Percent Correct / Incorrect', |
'Percent Correct / Incorrect', |
100, |
100, |
\@Plotdata1,\@Plotdata2); |
\@Plotdata1,\@Plotdata2); |
$graphlink .= "<br />\n". |
|
"<b>Start Time</b>: ".localtime($starttime)."<br />\n". |
|
"<b>End Time</b>: ".localtime($endtime)."<br />\n"; |
|
# |
# |
return ($graphlink,$starttime,$endtime,\%TimeData); |
return ($graphlink,$starttime,$endtime,\%TimeData); |
} |
} |