version 1.138, 2007/06/06 17:30:40
|
version 1.143, 2008/11/10 13:20:14
|
Line 38 lonstatistics
|
Line 38 lonstatistics
|
|
|
Main handler for statistics and chart. |
Main handler for statistics and chart. |
|
|
|
This is part of the LearningOnline Network with CAPA project |
|
described at http://www.lon-capa.org. |
|
|
=over 4 |
=over 4 |
|
|
=cut |
=cut |
Line 462 sub section_and_enrollment_description {
|
Line 465 sub section_and_enrollment_description {
|
$description = §ion_or_group_text($mode,'section',@sections). |
$description = §ion_or_group_text($mode,'section',@sections). |
' '.§ion_or_group_text($mode,'group',@groups); |
' '.§ion_or_group_text($mode,'group',@groups); |
if ($mode eq 'localized') { |
if ($mode eq 'localized') { |
$description .= &mt(' [_1] access status.',$env{'form.Status'}); |
$description .= ' '.&mt($env{'form.Status'}.' access status.'); |
} elsif ($mode eq 'plaintext') { |
} elsif ($mode eq 'plaintext') { |
$description .= ' '.$env{'form.Status'}.' access status.'; |
$description .= ' '.$env{'form.Status'}.' access status.'; |
} |
} |
Line 488 sub section_or_group_text {
|
Line 491 sub section_or_group_text {
|
); |
); |
if (scalar(@items) == 1 && $items[0] ne 'all') { |
if (scalar(@items) == 1 && $items[0] ne 'all') { |
if ($mode eq 'localized') { |
if ($mode eq 'localized') { |
$text = &mt('[_1] [_2].',$phrases{$type}{single},$items[0]); |
$text = &mt($phrases{$type}{single}.' [_1].',$items[0]); |
} elsif ($mode eq 'plaintext') { |
} elsif ($mode eq 'plaintext') { |
$text = $phrases{$type}{single}.' '.$items[0].'.'; |
$text = $phrases{$type}{single}.' '.$items[0].'.'; |
|
|
} |
} |
} elsif (scalar(@items) && $items[0] eq 'all') { |
} elsif (scalar(@items) && $items[0] eq 'all') { |
if ($mode eq 'localized') { |
if ($mode eq 'localized') { |
$text = &mt('[_1].',$phrases{$type}{all}); |
$text = &mt($phrases{$type}{all}.'.'); |
} elsif ($mode eq 'plaintext') { |
} elsif ($mode eq 'plaintext') { |
$text = $phrases{$type}{all}.'.'; |
$text = $phrases{$type}{all}.'.'; |
} |
} |
} elsif (scalar(@items)) { |
} elsif (scalar(@items)) { |
my $lastitem = pop(@items); |
my $lastitem = pop(@items); |
if ($mode eq 'localized') { |
if ($mode eq 'localized') { |
$text = &mt('[_1] [_2] and [_3].',$phrases{$type}{plural}, |
$text = &mt($phrases{$type}{plural}.' [_1] and [_2].', |
join(', ',@items),$lastitem); |
join(', ',@items),$lastitem); |
} elsif ($mode eq 'plaintext') { |
} elsif ($mode eq 'plaintext') { |
$text = $phrases{$type}{plural}.' '.join(', ',@items).' and '. |
$text = $phrases{$type}{plural}.' '.join(', ',@items).' and '. |
Line 707 sub selected_sequences_with_assessments
|
Line 710 sub selected_sequences_with_assessments
|
# |
# |
my @sequences = $navmap->retrieveResources(undef, |
my @sequences = $navmap->retrieveResources(undef, |
sub { shift->is_map(); },1,0,1); |
sub { shift->is_map(); },1,0,1); |
|
my $toplevelseq = $navmap->getById('0.0'); |
|
if (!grep(/^\Q$toplevelseq\E$/,@sequences)) { |
|
unshift(@sequences,$toplevelseq); |
|
} |
|
|
my @sequences_with_assessments; |
my @sequences_with_assessments; |
for my $sequence ($navmap->getById('0.0'), @sequences) { |
foreach my $sequence (@sequences) { |
if ($navmap->hasResource($sequence,sub { shift->is_problem(); },0,1)){ |
if ($navmap->hasResource($sequence,sub { shift->is_problem(); },0,1)){ |
push(@sequences_with_assessments,$sequence); |
push(@sequences_with_assessments,$sequence); |
} |
} |
Line 960 sub DisplayClasslist {
|
Line 968 sub DisplayClasslist {
|
my @selected_sections = &get_selected_sections(); |
my @selected_sections = &get_selected_sections(); |
if (! @Students) { |
if (! @Students) { |
if ($selected_sections[0] eq 'all') { |
if ($selected_sections[0] eq 'all') { |
if (lc($env{'form.Status'}) eq 'any') { |
if (lc($env{'form.Status'}) eq 'active') { |
$Str .= '<h2>'. |
$Str .= '<p class="LC_info">'. |
&mt('There are no students in the course.'). |
|
'</h2>'; |
|
} elsif (lc($env{'form.Status'}) eq 'active') { |
|
$Str .= '<h2>'. |
|
&mt('There are no currently enrolled students in the course.'). |
&mt('There are no currently enrolled students in the course.'). |
'</h2>'; |
'</p>'; |
} elsif (lc($env{'form.Status'}) eq 'expired') { |
} elsif (lc($env{'form.Status'}) eq 'expired') { |
$Str .= '<h2>'. |
$Str .= '<p class="LC_info">'. |
&mt('There are no previously enrolled students in the course.'). |
&mt('There are no previously enrolled students in the course.'). |
'</h2>'; |
'</p>'; |
|
} elsif (lc($env{'form.Status'}) eq 'future') { |
|
$Str .= '<p class="LC_info">'. |
|
&mt('There are no students with future access in the course.'). |
|
'</p>'; |
|
} else { # 'any' and any others |
|
$Str .= '<p class="LC_info">'. |
|
&mt('There are no students in the course.'). |
|
'</p>'; |
} |
} |
} else { |
} else { |
my $sections; |
if (lc($env{'form.Status'}) eq 'active') { |
if (lc($env{'form.Status'}) eq 'any') { |
$Str .= '<p class="LC_info">'. |
$Str .= '<h2>'. |
|
&mt('There are no students in the selected sections.'). |
|
'</h2>'; |
|
} elsif (lc($env{'form.Status'}) eq 'active') { |
|
$Str .= '<h2>'. |
|
&mt('There are no currently enrolled students in the selected sections.'). |
&mt('There are no currently enrolled students in the selected sections.'). |
'</h2>'; |
'</p>'; |
} elsif (lc($env{'form.Status'}) eq 'expired') { |
} elsif (lc($env{'form.Status'}) eq 'expired') { |
$Str .= '<h2>'. |
$Str .= '<p class="LC_info">'. |
&mt('There are no previously enrolled students in the selected sections.'). |
&mt('There are no previously enrolled students in the selected sections.'). |
'</h2>'; |
'</p>'; |
|
} elsif (lc($env{'form.Status'}) eq 'future') { |
|
$Str .= '<p class="LC_info">'. |
|
&mt('There are no students with future access in the selected sections.'). |
|
'</p>'; |
|
} else { # 'any' and any others |
|
$Str .= '<p class="LC_info">'. |
|
&mt('There are no students in the selected sections.'). |
|
'</p>'; |
} |
} |
} |
} |
$Str.= '<a href="/adm/statistics?reportSelected=student_assessment">'. |
$Str.= '<p>' |
&mt('Click here to return to the chart').'</a>'; |
.'<a href="/adm/statistics?reportSelected=student_assessment">' |
|
.&mt('Return to the chart').'</a>' |
|
.'</p>'; |
$r->print($Str); |
$r->print($Str); |
$r->rflush(); |
$r->rflush(); |
return; |
return; |
} |
} |
|
|
# "Click" is asinine but it is probably not my place to change the world. |
$Str .= '<h2>'.&mt('Select One Student').'</h2>' |
$Str .= '<h2>Click on a students name or username to view their chart</h2>'; |
.'<p>'.&mt("Click on a student's name or username to view their chart").'</p>' |
$Str .= '<table border="0"><tr><td bgcolor="#777777">'."\n"; |
.&Apache::loncommon::start_data_table() |
$Str .= '<table border="0" cellpadding="3"><tr bgcolor="#e6ffff">'."\n"; |
.&Apache::loncommon::start_data_table_header_row(); |
foreach my $field (@Fields) { |
foreach my $field (@Fields) { |
$Str .= '<th><a href="/adm/statistics?'. |
$Str .= '<th><a href="/adm/statistics?'. |
'reportSelected=student_assessment&'. |
'reportSelected=student_assessment&'. |
Line 1007 sub DisplayClasslist {
|
Line 1024 sub DisplayClasslist {
|
'sort='.$field.'">'.&mt($field). |
'sort='.$field.'">'.&mt($field). |
'</a></th>'; |
'</a></th>'; |
} |
} |
$Str .= '</tr>'."\n"; |
$Str .= &Apache::loncommon::end_data_table_header_row(); |
# |
# |
my $alternate = 0; |
|
foreach my $student (@Students) { # @Students is a package variable |
foreach my $student (@Students) { # @Students is a package variable |
my $sname = $student->{'username'}.':'.$student->{'domain'}; |
my $sname = $student->{'username'}.':'.$student->{'domain'}; |
if($alternate) { |
$Str .= &Apache::loncommon::start_data_table_row(); |
$Str .= '<tr bgcolor="#ffffe6">'; |
|
} else { |
|
$Str .= '<tr bgcolor="#ffffc6">'; |
|
} |
|
$alternate = ($alternate + 1) % 2; |
|
# |
# |
foreach my $field (@Fields) { |
foreach my $field (@Fields) { |
$Str .= '<td>'; |
$Str .= '<td>'; |
Line 1036 sub DisplayClasslist {
|
Line 1047 sub DisplayClasslist {
|
} |
} |
$Str .= '</td>'; |
$Str .= '</td>'; |
} |
} |
$Str .= "</tr>\n"; |
$Str .= &Apache::loncommon::end_data_table_row(); |
} |
} |
$Str .= '</table></td></tr></table>'."\n"; |
$Str .= &Apache::loncommon::end_data_table(); |
# |
# |
$r->print($Str); |
$r->print($Str); |
$r->rflush(); |
$r->rflush(); |
Line 1176 ENDSTYLE
|
Line 1187 ENDSTYLE
|
# |
# |
if (! &Apache::lonmysql::verify_sql_connection()) { |
if (! &Apache::lonmysql::verify_sql_connection()) { |
my $serveradmin = $r->dir_config('lonAdmEMail'); |
my $serveradmin = $r->dir_config('lonAdmEMail'); |
$r->print('<h2><font color="Red">'. |
$r->print('<h2 class="LC_error">'. |
&mt('Unable to connect to database!'). |
&mt('Unable to connect to database!'). |
'</font></h2>'); |
'</h2>'); |
$r->print('<p>'. |
$r->print('<p>' |
&mt('Please notify the server administrator '). |
.&mt('Please notify the server administrator [_1]', |
'<b>'.$serveradmin.'</b></p>'); |
,'<b>'.$serveradmin.'</b>') |
|
.'</p>'); |
$r->print('<p>'. |
$r->print('<p>'. |
&mt('Course Statistics and Charts cannot be '. |
&mt('Course Statistics and Charts cannot be '. |
'retrieved until the database is restarted. '. |
'retrieved until the database is restarted. '. |