--- loncom/interface/statistics/lonsurveyreports.pm 2008/09/14 15:16:30 1.16 +++ loncom/interface/statistics/lonsurveyreports.pm 2008/10/14 14:10:49 1.17 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonsurveyreports.pm,v 1.16 2008/09/14 15:16:30 raeburn Exp $ +# $Id: lonsurveyreports.pm,v 1.17 2008/10/14 14:10:49 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,7 +73,7 @@ sub BuildSurveyReportsPage { my @Students = @Apache::lonstatistics::Students; # if (@Students < 1) { - $r->print('
'.&mt('There are no students in the sections selected.').'
'); } # my @CacheButtonHTML = @@ -182,9 +182,9 @@ sub SurveyProblemSelector { } } if (! scalar(@SurveyProblems)) { - $Str = ''. + &mt('There are no survey problems in this course.'). + '
'.$/; return $Str; } $Str .= ''.
- &mt('Your text file.').
+ $r->print(''."\n");
$r->print('');
} else {
- $r->print(' '
+ .&mt('There is no essay or string response data to output for this survey.')
+ .'');
}
$r->rflush();
return;
@@ -386,8 +387,8 @@ sub make_Excel_report {
my $warned_about_size = 0;
foreach my $data (@{$data->{'responses'}}) {
if (length($data) > 255 && ! $warned_about_size) {
- $r->print(' '.
- &mt('[_1]:[_2] responses to [_3] may be too long to fit Excel spreadsheet.',
+ $r->print(' '.
+ &mt('[_1]:[_2] responses to [_3] may be too long to fit Excel spreadsheet.',
$resource->compTitle,
$resource->part_display($partid),
$respid).
@@ -447,12 +448,12 @@ sub make_Excel_report {
} #response ids
} # partids
$workbook->close();
- $r->print(' '.
+ $r->print(' '.
&mt('Your Excel spreadsheet.').
''.
- &mt("There is no essay or string response data to output for this survey.").'
');
+ $r->print(' ';
+ $Str.=$tmp.&Apache::loncommon::end_data_table()
+ .'';
} elsif (exists($data->{'_count'}) &&
exists($data->{'foil_values'}) &&
exists($data->{'map'})) {
@@ -553,23 +558,23 @@ sub make_HTML_report {
my $count = $data->{'foil_values'}->{$value};
my $foiltext = $ProblemData->{$partid.'.'.$respid}->{'_Foils'}->{$foilid}->{'text'};
my $foilname = $ProblemData->{$partid.'.'.$respid}->{'_Foils'}->{$foilid}->{'name'};
- $tmp .= ''.
- ' ';
+ $Str.=' '
+ .' ';
+ &mt('Percent'))).''
+ .&Apache::loncommon::end_data_table_header_row();
my @foils = sort(keys(%{$ProblemData->{$partid.'.'.$respid}->{'_Foils'}}));
foreach my $foilid (@foils) {
my $prob_data = $ProblemData->{$partid.'.'.$respid};
@@ -521,7 +525,7 @@ sub make_HTML_report {
my $foiltext = $prob_data->{'_Foils'}->{$foilid}->{'text'};
my $foilname = $prob_data->{'_Foils'}->{$foilid}->{'name'};
my $rowspan = scalar(@{$prob_data->{'_Options'}});
- my $preamble = ''
+ .&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row();
my $tmp = ' '.join(' ',
(&mt('Foil Name'),
&mt('Foil Text'),
&mt('Option'),
&mt('Frequency'),
- &mt('Percent'))).' '.
+ my $preamble = &Apache::loncommon::start_data_table_row().
' '.$/;
- $preamble = ''.
$foilname.' '.
''.
@@ -534,11 +538,12 @@ sub make_HTML_report {
' '.$count.' '.
''.
sprintf('%.2f',100*$count/$foil_count).'%'.
- ' ';
+ ''.&Apache::loncommon::end_data_table_row().$/;
+ $preamble = &Apache::loncommon::continue_data_table_row(); #&Apache::loncommon::start_data_table_row();
}
}
- $Str.=$tmp.' '.
+ $tmp .= &Apache::loncommon::start_data_table_row().
' '.$/;
+ &Apache::loncommon::end_data_table_row().$/;
}
- $Str .= ''.$foilname.' '.
''.$foiltext.' '.
''.$count.' '.
''.
sprintf("%.2f",$count/$total*100).'% '.
- ''.
+ $Str .= &Apache::loncommon::start_data_table_row().
' '.$/.
+ &Apache::loncommon::end_data_table_row().$/.
$tmp;
}
- $Str.= ''.&mt('Foil Name').' '.
''.&mt('Text').' '.
''.&mt('Freq').' '.
''.&mt('Percent').' '.
- '
';
+ $Str.= &Apache::loncommon::end_data_table().'
';
$r->print($Str);
$r->rflush();
}
@@ -655,7 +660,7 @@ sub CreateInterface {
#
$Str .= '