--- loncom/interface/statistics/lonstudentassessment.pm 2006/07/03 03:54:32 1.142
+++ loncom/interface/statistics/lonstudentassessment.pm 2009/08/14 12:37:44 1.150.2.3
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.142 2006/07/03 03:54:32 albertel Exp $
+# $Id: lonstudentassessment.pm,v 1.150.2.3 2009/08/14 12:37:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -248,14 +248,14 @@ sub next_and_previous_buttons {
if (defined($previous)) {
my $sname = $previous->{'username'}.':'.$previous->{'domain'};
$previousbutton .= ' ';
} else {
$previousbutton .= ' ';
+ &mt('Previous student').'" disabled="disabled" />';
}
#
# Build the next student link
@@ -264,19 +264,19 @@ sub next_and_previous_buttons {
if (defined($next)) {
my $sname = $next->{'username'}.':'.$next->{'domain'};
$nextbutton .= ' ';
} else {
$nextbutton .= ' ';
+ &mt('Next student').'" disabled="disabled" />';
}
#
# Build the 'all students' button
my $all = '';
- $all .= ' ';
$Str .= $previousbutton.(' 'x5).$all.(' 'x5).$nextbutton;
@@ -330,7 +330,7 @@ sub CreateInterface {
$Str .= '
'.&mt('Student Data ').
&Apache::loncommon::help_open_topic("Chart_Student_Data").
' ';
- $Str .= ''.&mt('Enrollment Status').' '.
+ $Str .= ''.&mt('Access Status').' '.
&Apache::loncommon::help_open_topic("Chart_Enrollment_Status").
' ';
$Str .= ''.&mt('Sequences and Folders').' '.
@@ -361,19 +361,20 @@ sub CreateInterface {
$Str .= &CreateAndParseOutputDataSelector();
$Str .= ' '."\n";
$Str .= ''."\n";
- $Str .= ' ';
- $Str .= ' 'x5;
+ $Str .= ''.
+ &mt('Status:').' '.
+ ' '.
+ '
';
$Str .= ' ';
$Str .= ' 'x5;
$Str .= ' ';
- $Str .= ' 'x5;
- $Str .=
- &mt('Status [_1]',
- ' ');
- $Str .= ' ';
+ $Str .= ''.
+ ' '.
+ '
';
+
return $Str;
}
@@ -663,28 +664,29 @@ sub html_initialize {
&Apache::lonstatistics::selected_sequences_with_assessments();
if (! ref($navmap)) {
# Unable to get data, so bail out
- $r->print("".
+ $r->print(' '.
&mt('Unable to retrieve course information.').
- '');
+ '
');
}
# If we're showing links, show a checkbox to open in new
# windows.
if ($show_links ne 'no') {
+ my $labeltext = &mt('Show links in new window:');
$r->print(<new_window = true;
-Show links in new window:
-
+$labeltext
+
NEW_WINDOW_CHECKBOX
}
#
$r->print("".$env{'course.'.$env{'request.course.id'}.'.description'}.
- " ".localtime(time)." ");
+ " ".&Apache::lonlocal::locallocaltime(time)."");
#
if ($chosen_output->{'base'} !~ /^final table/) {
- $r->print("".$chosen_output->{'shortdesc'}." ");
+ $r->print("".&mt($chosen_output->{'shortdesc'})." ");
}
my $Str = "\n";
# First, the @StudentData fields need to be listed
@@ -843,12 +845,20 @@ sub html_outputstudent {
my @tmp = &Apache::loncoursedata::get_current_state
($student->{'username'},$student->{'domain'},undef,
$env{'request.course.id'});
- if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
+ if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:(.*)/)) {
%StudentsData = @tmp;
- }
- if (scalar(@tmp) < 1) {
+ } else {
+ my $error = $1;
+ if (scalar(@tmp) < 1) {
+ $Str .= ''
+ .&mt('No Course Data')
+ .' '."\n";
+ } else {
+ $Str .= ''
+ .&mt('Error getting student data ([_1])',$error)
+ .' '."\n";
+ }
$nodata_count++;
- $Str .= 'No Course Data '."\n";
$r->print($Str);
$r->rflush();
return;
@@ -953,12 +963,12 @@ sub html_finish {
sub StudentAverageTotal {
my $Str = ''.&mt('Summary Tables').' '.$/;
- $Str .= ' '."\n";
- $Str .= ''.
+ $Str .= &Apache::loncommon::start_data_table();
+ $Str .= &Apache::loncommon::start_data_table_header_row().
''.&mt('Title').' '.
''.&mt('Average').' '.
''.&mt('Maximum').' '.
- ' '.$/;
+ &Apache::loncommon::end_data_table_header_row().$/;
foreach my $seq (@sequences) {
my $symb = $seq->symb;
my $ave;
@@ -972,11 +982,13 @@ sub StudentAverageTotal {
}
my $max = $Statistics->{$symb}->{'max'};
$ave = sprintf("%.2f",$ave);
- $Str .= ''.$seq->compTitle.' '.
+ $Str .= &Apache::loncommon::start_data_table_row().
+ ''.$seq->compTitle.' '.
''.$ave.' '.
- ''.$max.' '.' '."\n";
+ ''.$max.' '.' '.
+ &Apache::loncommon::end_data_table_row()."\n";
}
- $Str .= "
\n";
+ $Str .= &Apache::loncommon::end_data_table()."\n";
return $Str;
}
@@ -987,31 +999,36 @@ sub SingleStudentTotal {
$student->{'fullname'},
$student->{'username'},$student->{'domain'}).'';
$Str .= $/;
- $Str .= ''."\n";
+ $Str .= &Apache::loncommon::start_data_table()."\n";
$Str .=
- ''.
+ &Apache::loncommon::start_data_table_header_row().
''.&mt('Sequence or Folder').' ';
if ($chosen_output->{'base'} eq 'tries') {
$Str .= ''.&mt('Parts Correct').' ';
} else {
$Str .= ''.&mt('Score').' ';
}
- $Str .= ''.&mt('Maximum').' '." \n";
+ $Str .= ''.&mt('Maximum').' '.
+ &Apache::loncommon::end_data_table_header_row()."\n";
my $total = 0;
my $total_max = 0;
foreach my $seq (@sequences) {
my $value = $Statistics->{$seq->symb}->{'score'};
my $max = $Statistics->{$seq->symb}->{'max'};
- $Str .= ''.&HTML::Entities::encode($seq->compTitle).' '.
+ $Str .= &Apache::loncommon::start_data_table_row().
+ ''.&HTML::Entities::encode($seq->compTitle).' '.
''.$value.' '.
- ''.$max.' '."\n";
+ ''.$max.' '.
+ &Apache::loncommon::end_data_table_row()."\n";
$total += $value;
$total_max +=$max;
}
- $Str .= ''.&mt('Total').' '.
+ $Str .= &Apache::loncommon::start_data_table_row().
+ ''.&mt('Total').' '.
''.$total.' '.
- ''.$total_max." \n";
- $Str .= "
\n";
+ ''.$total_max.' '.
+ &Apache::loncommon::end_data_table_row()."\n";
+ $Str .= &Apache::loncommon::end_data_table()."\n";
return $Str;
}
@@ -1422,14 +1439,10 @@ sub excel_initialize {
if ($env{'form.SelectedStudent'}) {
$studentcount = '1';
}
- if ($studentcount > 1) {
- $r->print(''.&mt('Compiling Excel spreadsheet for [_1] students',
- $studentcount)." \n");
- } else {
- $r->print(''.
- &mt('Compiling Excel spreadsheet for 1 student').
- " \n");
- }
+ $r->print(''
+ .&mt('Compiling Excel spreadsheet for [quant,_1,student]...',$studentcount)
+ ."
\n"
+ );
$r->rflush();
#
# Initialize progress window
@@ -1577,7 +1590,7 @@ sub excel_finish {
#
# Tell the user where to get their excel file
$r->print(' '.
- 'Your Excel spreadsheet. '."\n");
+ ''.&mt('Your Excel spreadsheet').' '."\n");
$r->rflush();
&excel_cleanup();
return;
@@ -1820,7 +1833,7 @@ sub csv_finish {
#
# Tell the user where to get their csv file
$r->print(' '.
- ''.&mt('Your csv file.').' '."\n");
+ ''.&mt('Your CSV file.').' '."\n");
$r->rflush();
&csv_cleanup();
return;
@@ -1951,11 +1964,8 @@ sub student_tries_on_sequence {
#
if ( ($links eq 'yes' && $symbol ne ' ') ||
($links eq 'all')) {
- if (length($symbol) > 1) {
- &Apache::lonnet::logthis('length of symbol "'.$symbol.'" > 1');
- }
my $link = '/adm/grades'.
- '?symb='.&escape($resource->symb).
+ '?symb='.&escape($resource->shown_symb).
'&student='.$student->{'username'}.
'&userdom='.$student->{'domain'}.
'&command=submission';
@@ -2110,7 +2120,7 @@ sub student_performance_on_sequence {
#
if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) {
my $link = '/adm/grades' .
- '?symb='.&escape($symb).
+ '?symb='.&escape($resource->shown_symb).
'&student='.$student->{'username'}.
'&userdom='.$student->{'domain'}.
'&command=submission';