version 1.11, 2004/06/04 21:42:18
|
version 1.13, 2004/08/31 15:22:51
|
Line 157 sub prepare_excel_output {
|
Line 157 sub prepare_excel_output {
|
$problem->{'part'}); |
$problem->{'part'}); |
$r->print('<h2>'. |
$r->print('<h2>'. |
&mt('Preparing Excel spreadsheet of student responses'). |
&mt('Preparing Excel spreadsheet of student responses'). |
'</h2>'); |
'</h2>'. |
# |
'<p>'. |
&Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students, |
&mt('See the status bar above for student answer computation progress'). |
'Statistics','stats_status'); |
'</p>'); |
|
# |
|
if ($ENV{'form.correctans'} eq 'true') { |
|
&Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students, |
|
'Statistics', |
|
'stats_status'); |
|
} |
# |
# |
$r->print('<script>'. |
$r->print('<script>'. |
'window.document.Statistics.stats_status.value="'. |
'window.document.Statistics.stats_status.value="'. |
'Done computing student answers. Compiling spreadsheet.'. |
'Done computing student answers. Compiling spreadsheet.'. |
'";</script>'); |
'";</script>'); |
$r->rflush(); |
$r->rflush(); |
my @Columns = ( 'username','domain','attempt','time', |
my @Columns; |
'submission','correct', 'grading','awarded','weight', |
push(@Columns,'username'); |
'score'); |
push(@Columns,'domain'); |
my $awarded_col = 7; |
push(@Columns,'attempt'); |
my $weight_col = 8; |
push(@Columns,'time'); |
|
push(@Columns,'submission'); |
|
if ($ENV{'form.correctans'} eq 'true') { push(@Columns,'correct'); } |
|
push(@Columns,'grading'); |
|
push(@Columns,'awarded'); |
|
push(@Columns,'weight'); |
|
push(@Columns,'score'); |
|
my ($awarded_col,$weight_col); |
|
if ($ENV{'form.correctans'} eq 'true') { |
|
$awarded_col = 7; |
|
$weight_col = 8; |
|
} else { |
|
$awarded_col = 6; |
|
$weight_col = 7; |
|
} |
# |
# |
# Create excel worksheet |
# Create excel worksheet |
my $filename = '/prtspool/'. |
my $filename = '/prtspool/'. |
Line 210 sub prepare_excel_output {
|
Line 230 sub prepare_excel_output {
|
my %row; |
my %row; |
$row{'username'} = $student->{'username'}; |
$row{'username'} = $student->{'username'}; |
$row{'domain'} = $student->{'domain'}; |
$row{'domain'} = $student->{'domain'}; |
$row{'correct'} = $student->{'answer'}; |
$row{'correct'} = $student->{'answer'}; |
$row{'weight'} = &Apache::lonnet::EXT |
$row{'weight'} = &Apache::lonnet::EXT |
('resource.'.$partid.'.weight',$resource->{'symb'}, |
('resource.'.$partid.'.weight',$resource->{'symb'}, |
undef,undef,undef); |
undef,undef,undef); |
Line 306 sub CreateInterface {
|
Line 326 sub CreateInterface {
|
$Str .= '<tr>'; |
$Str .= '<tr>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>'; |
|
$Str .= '<td> </td>'; |
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
# |
# |
$Str .= '<tr><td align="center">'."\n"; |
$Str .= '<tr><td align="center">'."\n"; |
Line 316 sub CreateInterface {
|
Line 337 sub CreateInterface {
|
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); |
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); |
$Str .= '</td>'; |
$Str .= '</td>'; |
# |
# |
|
my $checkbox = '<input type="checkbox" name="correctans" '; |
|
if (exists($ENV{'form.correctans'}) && $ENV{'form.correctans'} eq 'true') { |
|
$checkbox .= ' checked '; |
|
} |
|
$checkbox .= 'value="true" />'; |
|
$Str .= '<td align="center">'.'<label><b>'. |
|
&mt('compute correct answers [_1]',$checkbox).'</b></label>'.'</td>'; |
|
# |
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
$Str .= '</table>'."\n"; |
$Str .= '</table>'."\n"; |
# |
# |