version 1.23, 2003/10/14 18:36:54
|
version 1.27, 2004/12/08 00:56:00
|
Line 111 sub get_title {
|
Line 111 sub get_title {
|
my @title = (); |
my @title = (); |
# |
# |
# Determine the students name |
# Determine the students name |
my %userenv = &Apache::loncoursedata::GetUserName($self->{'name'}, |
my $name = &Apache::loncommon::plainname($self->{'name'}, |
$self->{'domain'}); |
$self->{'domain'}); |
my $name = join(' ', |
|
@userenv{'firstname','middlename','lastname','generation'}); |
|
$name =~ s/\s+$//; |
|
|
|
push (@title,$name); |
push (@title,$name); |
push (@title,$self->{'coursedesc'}); |
push (@title,$self->{'coursedesc'}); |
push (@title,&Apache::lonlocal::locallocaltime(time)); |
push (@title,&Apache::lonlocal::locallocaltime(time)); |
Line 147 sub parent_link {
|
Line 143 sub parent_link {
|
sub convenience_links { |
sub convenience_links { |
my $self = shift; |
my $self = shift; |
my ($resource) = @_; |
my ($resource) = @_; |
my $symb = &Apache::lonnet::escape($resource->{'symb'}); |
my $result=&Apache::loncommon::submlink('<img src="/adm/lonMisc/subm_button.gif" border="0" />',$self->{'name'},$self->{'domain'},$resource->{'symb'},'LONcatInfo'); |
my $result = <<"END"; |
$result .= &Apache::loncommon::pgrdlink('<img src="/adm/lonMisc/pgrd_button.gif" border="0" />',$self->{'name'},$self->{'domain'},$resource->{'symb'},'LONcatInfo'); |
<a href="/adm/grades?symb=$symb&command=submission" target="LONcatInfo"> |
$result .= &Apache::loncommon::pprmlink('<img src="/adm/lonMisc/pprm_button.gif" border="0" />',$self->{'name'},$self->{'domain'},$resource->{'symb'},'LONcatInfo'); |
<img src="/adm/lonMisc/subm_button.gif" border=0 /> |
|
</a> |
|
<a href="/adm/grades?symb=$symb&command=gradingmenu" target="LONcatInfo"> |
|
<img src="/adm/lonMisc/pgrd_button.gif" border=0 /> |
|
</a> |
|
<a href="/adm/parmset?symb=$symb" target="LONcatInfo"> |
|
<img src="/adm/lonMisc/pprm_button.gif" border=0 /> |
|
</a> |
|
END |
|
return $result; |
return $result; |
} |
} |
|
|
Line 174 sub outsheet_html {
|
Line 161 sub outsheet_html {
|
my $editing_is_allowed = &Apache::lonnet::allowed('mgr', |
my $editing_is_allowed = &Apache::lonnet::allowed('mgr', |
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
#################################### |
#################################### |
|
# Report any calculation errors # |
|
#################################### |
|
$r->print($self->html_report_error()); |
|
#################################### |
# Determine table structure # |
# Determine table structure # |
#################################### |
#################################### |
my $num_uneditable = 26; |
my $num_uneditable = 26; |
Line 359 sub csv_rows {
|
Line 350 sub csv_rows {
|
# writes the meat of the spreadsheet to an excel worksheet. Called |
# writes the meat of the spreadsheet to an excel worksheet. Called |
# by Spreadsheet::outsheet_excel; |
# by Spreadsheet::outsheet_excel; |
my $self = shift; |
my $self = shift; |
my ($filehandle) = @_; |
my ($connection,$filehandle) = @_; |
# |
# |
# Write a header row |
# Write a header row |
$self->csv_output_row($filehandle,undef, |
$self->csv_output_row($filehandle,undef, |
Line 385 sub excel_rows {
|
Line 376 sub excel_rows {
|
# writes the meat of the spreadsheet to an excel worksheet. Called |
# writes the meat of the spreadsheet to an excel worksheet. Called |
# by Spreadsheet::outsheet_excel; |
# by Spreadsheet::outsheet_excel; |
my $self = shift; |
my $self = shift; |
my ($worksheet,$cols_output,$rows_output) = @_; |
my ($connection,$worksheet,$cols_output,$rows_output) = @_; |
# |
# |
# Write a header row |
# Write a header row |
$cols_output = 0; |
$cols_output = 0; |
Line 527 sub compute {
|
Line 518 sub compute {
|
} |
} |
$f{$cell} = $resource->{'symb'}.'__&&&__'.$assess_filename; |
$f{$cell} = $resource->{'symb'}.'__&&&__'.$assess_filename; |
if ($connection->aborted()) { $self->cleanup(); return; } |
if ($connection->aborted()) { $self->cleanup(); return; } |
my $assessSheet = Apache::assesscalc->new($self->{'name'}, |
my $assessSheet; |
$self->{'domain'}, |
$assessSheet = Apache::assesscalc->new($self->{'name'}, |
$assess_filename, |
$self->{'domain'}, |
$resource->{'symb'}); |
$assess_filename, |
|
$resource->{'symb'}); |
my @exportdata = $assessSheet->export_data($r); |
my @exportdata = $assessSheet->export_data($r); |
|
# |
|
if ($assessSheet->badcalc()) { |
|
$self->set_calcerror( |
|
&mt('Error computing row for assessment "[_1]" (row [_2]):[_3]', |
|
$assessSheet->get_title(),$rownum,$assessSheet->calcerror())); |
|
} |
|
# |
if ($connection->aborted()) { $self->cleanup(); return; } |
if ($connection->aborted()) { $self->cleanup(); return; } |
if ($assessSheet->blackout()) { |
if ($assessSheet->blackout()) { |
$self->blackout(1); |
$self->blackout(1); |
Line 662 Writes the export data for this student
|
Line 661 Writes the export data for this student
|
############################################# |
############################################# |
sub save_export_data { |
sub save_export_data { |
my $self = shift; |
my $self = shift; |
&Apache::assesscalc::save_cached_export_rows($self->{'name'}, |
|
$self->{'domain'}); |
|
return if ($self->temporary()); |
|
my $student = $self->{'name'}.':'.$self->{'domain'}; |
my $student = $self->{'name'}.':'.$self->{'domain'}; |
|
return if ($self->temporary()); |
|
if ($self->badcalc()){ |
|
# do not save data away when calculations have not been done properly. |
|
delete($Exportrows{$student}); |
|
return; |
|
} |
return if (! exists($Exportrows{$student})); |
return if (! exists($Exportrows{$student})); |
|
&Apache::assesscalc::save_cached_export_rows($self->{'name'}, |
|
$self->{'domain'}); |
return if (! $self->is_default()); |
return if (! $self->is_default()); |
my $key = join(':',($self->{'name'},$self->{'domain'},'studentcalc')).':'; |
my $key = join(':',($self->{'name'},$self->{'domain'},'studentcalc')).':'; |
my $timekey = $key.'.time'; |
my $timekey = $key.'.time'; |
Line 710 sub export_data {
|
Line 714 sub export_data {
|
$self->compute($r); |
$self->compute($r); |
} |
} |
if ($connection->aborted()) { $self->cleanup(); return; } |
if ($connection->aborted()) { $self->cleanup(); return; } |
my @Data = @{$Exportrows{$student}->{'data'}}; |
my @Data; |
for (my $i=0; $i<=$#Data;$i++) { |
if ($self->badcalc()) { |
$Data[$i]="'".$Data[$i]."'" if ($Data[$i]=~/\D/ && defined($Data[$i])); |
@Data = (); |
|
} else { |
|
@Data = @{$Exportrows{$student}->{'data'}}; |
|
for (my $i=0; $i<=$#Data;$i++) { |
|
if ($Data[$i]=~/\D/ && defined($Data[$i])) { |
|
$Data[$i]="'".$Data[$i]."'"; |
|
} |
|
} |
} |
} |
return @Data; |
return @Data; |
} |
} |