version 1.1, 2004/02/02 21:45:12
|
version 1.6, 2004/02/20 16:24:20
|
Line 35 use Apache::loncoursedata();
|
Line 35 use Apache::loncoursedata();
|
use Apache::lonstatistics; |
use Apache::lonstatistics; |
use Apache::lonstathelpers; |
use Apache::lonstathelpers; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use HTML::Entities(); |
|
use Time::Local(); |
|
use Spreadsheet::WriteExcel(); |
|
|
|
my $plotcolors = ['#33ff00', |
|
'#ff33cc', '#990000', '#aaaa66', '#663399', '#ff9933', |
|
'#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66', |
|
]; |
|
|
|
my @SubmitButtons = ( |
my @SubmitButtons = ( |
{ name => 'CreatePlot', |
{ name => 'CreatePlot', |
Line 53 my @SubmitButtons = (
|
Line 45 my @SubmitButtons = (
|
text => 'Update Student Data' }, |
text => 'Update Student Data' }, |
); |
); |
|
|
|
######################################################### |
|
######################################################### |
|
|
|
=pod |
|
|
|
=item &BuildCorrectProblemsPage |
|
|
|
Entry point from lonstatistics to the correct problems plot page. |
|
|
|
=cut |
|
|
|
######################################################### |
|
######################################################### |
|
|
sub BuildCorrectProblemsPage { |
sub BuildCorrectProblemsPage { |
my ($r,$c)=@_; |
my ($r,$c)=@_; |
# |
# |
Line 65 sub BuildCorrectProblemsPage {
|
Line 71 sub BuildCorrectProblemsPage {
|
# |
# |
&Apache::lonstatistics::PrepareClasslist(); |
&Apache::lonstatistics::PrepareClasslist(); |
# |
# |
$r->print('<h2>'.&mt('Number of Correct Problems Plot').'</h2>'); |
|
$r->print(&CreateInterface()); |
$r->print(&CreateInterface()); |
# |
# |
my @Students = @Apache::lonstatistics::Students; |
my @Students = @Apache::lonstatistics::Students; |
Line 123 sub BuildCorrectProblemsPage {
|
Line 128 sub BuildCorrectProblemsPage {
|
|
|
=pod |
=pod |
|
|
=item |
=item & AnalyzeScoreData($score_data) |
|
|
|
Analyze the result of &Apache::loncoursedata::get_student_scores() and |
|
return html with a plot of the data and a table of the values and bins. |
|
|
=cut |
=cut |
|
|
Line 162 sub AnalyzeScoreData {
|
Line 170 sub AnalyzeScoreData {
|
$Str.= '<tr><td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'. |
$Str.= '<tr><td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'. |
'<td>'.$bin->{'count'}.'</td></tr>'."\n"; |
'<td>'.$bin->{'count'}.'</td></tr>'."\n"; |
} |
} |
my $title = ''; |
# scale max to an integer. |
|
$max = 5*(int($max/5)+1); |
|
my $title = 'Correct Problems Plot'; |
$Str .= "</table><br />\n"; |
$Str .= "</table><br />\n"; |
$Str = "<br />\n".&Apache::loncommon::DrawBarGraph($title, |
$Str = "<br />\n".&Apache::loncommon::DrawBarGraph($title, |
'Num Correct Problems', |
'Num Correct Problems', |
Line 231 sub bin_data {
|
Line 241 sub bin_data {
|
|
|
=pod |
=pod |
|
|
=item |
=item &CreateInterface |
|
|
|
Inputs: none. |
|
|
|
Returns: HTML for the correct problems plot interface. |
|
|
=cut |
=cut |
|
|
Line 241 sub CreateInterface {
|
Line 255 sub CreateInterface {
|
## |
## |
## Environment variable initialization |
## Environment variable initialization |
my $Str; |
my $Str; |
|
$Str .= &Apache::lonhtmlcommon::breadcrumbs(undef,'Correct Problems Plot'); |
$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>'; |