'."\n";
$Str .= ''."\n";
foreach my $field (@Fields) {
- $Str .= ''.$field.
+ $Str .= ' | '.$field.
' | ';
}
$Str .= ' '."\n";
#
my $alternate = 0;
- foreach my $student (@Students) {
+ foreach my $student (@Students) { # @Students is a package variable
my $sname = $student->{'username'}.':'.$student->{'domain'};
if($alternate) {
$Str .= '';
@@ -891,11 +1010,12 @@ sub DisplayClasslist {
#
foreach my $field (@Fields) {
$Str .= '';
- if ($field eq 'fullname') {
+ if ($field eq 'fullname' || $field eq 'username') {
$Str .= '';
+ $Str .= &Apache::lonnet::escape('student_assessment');
+ $Str .= '&sort='.&Apache::lonnet::escape($ENV{'form.sort'});
+ $Str .= '&SelectedStudent=';
+ $Str .= &Apache::lonnet::escape($sname).'">';
$Str .= $student->{$field}.' ';
$Str .= '';
} else {
@@ -913,249 +1033,71 @@ sub DisplayClasslist {
return;
}
-sub BuildClasslist {
- my ($cacheDB,$students,$studentInformation,$headings,$r)=@_;
-
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
- return 'Unable to tie database.';
- }
-
-# my $Ptr = '';
-# $Ptr .= '';
-# $Ptr .= 'Select Sections';
-# $Ptr .= ' | '."\n";
-# $Ptr .= ''."\n";
-# my @sectionsSelected = split(':',$cache{'sectionsSelected'});
-# my @sections = split(':',$cache{'sectionList'});
-# $Ptr .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections,
-# \@sectionsSelected,
-# 'Statistics');
-# $Ptr .= ' | ';
-# $r->print($Ptr);
-# $r->rflush();
-# my %mySections = ();
-# foreach (@sections) { $mySections{$_} = 'True'; }
-# $r->print(" $cache{'sectionsSelected'} ");
-
- my $Str='';
- $Str .= ''."\n";
- $Str .= ''."\n";
-
- my $displayString = 'DISPLAYDATA  | '."\n";
- $Str .= &Apache::lonhtmlcommon::CreateHeadings(\%cache,
- $studentInformation,
- $headings, $displayString);
- $Str .= ' '."\n";
-
- my $alternate=0;
- foreach (@$students) {
-# if ($mySections{$cache{$_.':'.'section'}} ne 'True') {next;}
- my ($username, $domain) = split(':', $_);
- if($alternate) {
- $Str .= '';
- } else {
- $Str .= ' ';
- }
- $alternate = ($alternate + 1) % 2;
- foreach my $data (@$studentInformation) {
- $Str .= '';
- if($data eq 'fullname') {
- $Str .= '';
- $Str .= $cache{$_.':'.$data}.' ';
- $Str .= '';
- } elsif($data eq 'updateTime') {
- $Str .= '';
- $Str .= $cache{$_.':'.$data}.' ';
- $Str .= ' ';
- } else {
- $Str .= $cache{$_.':'.$data}.' ';
- }
-
- $Str .= ' | '."\n";
- }
- }
-
- $Str .= ' '."\n";
- $Str .= '
| '."\n";
- $r->print($Str);
- $r->rflush();
-
- untie(%cache);
-
- return;
-}
-
+##############################################
+##############################################
sub CreateMainMenu {
- my ($status, $reports)=@_;
-
- my $Str = '';
-
- $Str .= ''."\n";
- $Str .= ' '."\n";
-
- return $Str;
-}
-
-sub BuildStatistics {
- my ($r)=@_;
-
- my $c = $r->connection;
- my @studentInformation=('fullname','section','id','domain','username',
- 'updateTime');
- my @headings=('Full Name', 'Section', 'PID', 'Domain', 'User Name',
- 'Last Updated');
- my $spacing = ' ';
-
- my %reports = ('classlist' => 'Class list',
- 'problem_statistics' => 'Problem Statistics',
- 'student_assessment' => 'Student Assessment',
- 'percentage' => 'Correct-problems Plot',
-# 'activitylog' => 'Activity Log',
- 'reportSelected' => 'Class list');
-
- my %cache;
- my $courseID=$ENV{'request.course.id'};
- my $cacheDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$courseID\_statistics.db";
-
- $r->print(&Apache::lonhtmlcommon::Title('Course Statistics and Charts'));
-
- my ($returnValue, $students) = &PrepareData($c, $cacheDB,
- \@studentInformation,
- \@headings,$r);
- if($returnValue ne 'OK') {
- $r->print($returnValue."\n".' |
|