version 1.26, 2003/01/09 16:37:48
|
version 1.27, 2003/01/13 01:34:11
|
Line 31
|
Line 31
|
# YEAR=2002 |
# YEAR=2002 |
# 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei |
# 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei |
# 5/12,5/14,5/15,5/19,5/26,7/16,12/24 Behrouz Minaei |
# 5/12,5/14,5/15,5/19,5/26,7/16,12/24 Behrouz Minaei |
# |
# YEAR=2003 |
|
# 1/11 Behrouz Minaei |
### |
### |
|
|
package Apache::lonstudentassessment; |
package Apache::lonstudentassessment; |
Line 41 use Apache::lonhtmlcommon;
|
Line 42 use Apache::lonhtmlcommon;
|
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use GDBM_File; |
use GDBM_File; |
|
|
#my $jr; |
|
|
|
sub BuildStudentAssessmentPage { |
sub BuildStudentAssessmentPage { |
my ($cacheDB,$students,$courseID,$formName,$headings,$spacing, |
my ($cacheDB,$students,$courseID,$formName,$headings,$spacing, |
$studentInformation,$r,$c)=@_; |
$studentInformation,$r,$c)=@_; |
# $jr = $r; |
|
my %cache; |
my %cache; |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
$r->print('<html><body>Unable to tie database.</body></html>'); |
$r->print('<html><body>Unable to tie database.</body></html>'); |
Line 135 sub BuildStudentAssessmentPage {
|
Line 134 sub BuildStudentAssessmentPage {
|
} |
} |
$Count++; |
$Count++; |
my $out = ''; |
my $out = ''; |
# $out .= sprintf("%3d", $Count); |
$out .= sprintf("%3d) ", $Count); |
if($Count % 2) { |
if($Count % 2) { |
$out .= '<bgcolor="#FFFFFF">'; |
$out .= '<bgcolor="#FFFFFF">'; |
} else { |
} else { |
$out .= '<bgcolor="#F0F0F0">'; |
$out .= '<bgcolor="#505050">'; |
} |
} |
my $displayString = $out.'DISPLAYDATA'.$spacing; |
my $displayString = $out.'DISPLAYDATA'.$spacing; |
$r->print(&Apache::lonhtmlcommon::FormatStudentInformation( |
$r->print(&Apache::lonhtmlcommon::FormatStudentInformation( |
Line 188 sub BuildStudentAssessmentPage {
|
Line 187 sub BuildStudentAssessmentPage {
|
} |
} |
|
|
|
|
|
|
|
|
#---- Student Assessment Web Page -------------------------------------------- |
#---- Student Assessment Web Page -------------------------------------------- |
|
|
sub CreateInterface { |
sub CreateInterface { |
Line 249 sub CreateTableHeadings {
|
Line 246 sub CreateTableHeadings {
|
# my $Str = '     '; |
# my $Str = '     '; |
my $Str = ''; |
my $Str = ''; |
$Str .= '<table border="0" cellpadding="0" cellspacing="0">'."\n"; |
$Str .= '<table border="0" cellpadding="0" cellspacing="0">'."\n"; |
|
|
$Str .= '<tr>'."\n"; |
$Str .= '<tr>'."\n"; |
|
$Str .= '<td><pre> </pre></td>'."\n"; |
$Str .= &CreateColumnSelectors($infoHeadings, $sequenceHeadings, |
$Str .= &CreateColumnSelectors($infoHeadings, $sequenceHeadings, |
$sequenceKeys); |
$sequenceKeys); |
$Str .= '<td></td></tr>'."\n"; |
$Str .= '<td></td></tr>'."\n"; |
|
|
$Str .= '<tr>'."\n"; |
$Str .= '<tr>'."\n"; |
my $displayString = '<td align="left"><pre><a href="/adm/statistics?'; |
my $displayString = ''; |
|
$displayString .= '<td><pre> </pre></td>'."\n"; |
|
$displayString .= '<td align="left"><pre><a href="/adm/statistics?'; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA</a>FORMATTING'; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA</a>FORMATTING'; |
$displayString .= $spacing.'</pre></td>'."\n"; |
$displayString .= $spacing.'</pre></td>'."\n"; |
$Str .= &Apache::lonhtmlcommon::CreateHeadings($cache, |
$Str .= &Apache::lonhtmlcommon::CreateHeadings($cache, |
Line 425 sub StudentAverageTotal {
|
Line 424 sub StudentAverageTotal {
|
$TotalProblems += $cache->{$name.':totalProblems'}; |
$TotalProblems += $cache->{$name.':totalProblems'}; |
} |
} |
if ($StudentCount) { |
if ($StudentCount) { |
$ProblemsSolved /= $StudentCount; |
$ProblemsSolved = sprintf( "%.2f", |
|
$ProblemsSolved/$StudentCount); |
$TotalProblems /= $StudentCount; |
$TotalProblems /= $StudentCount; |
} else { |
} else { |
$ProblemsSolved = 0; |
$ProblemsSolved = 0; |
$TotalProblems = 0; |
$TotalProblems = 0; |
} |
} |
|
|
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= '<table border=2 cellspacing="1">'."\n"; |
$Str .= '<tr><td><b>Students Count</b></td><td><b>'. |
$Str .= '<tr><td><b>Students Count</b></td><td><b>'. |
$StudentCount.'</b></td></tr>'."\n"; |
$StudentCount.'</b></td></tr>'."\n"; |