[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentsubmissions.pm

onken onken@source.lon-capa.org
Fri, 26 Mar 2010 13:25:17 -0000


onken		Fri Mar 26 13:25:17 2010 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentsubmissions.pm 
  Log:
  Add the "Student Data" selection field to 'Student Submission Report'-Interface
  
  
  
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.56 loncom/interface/statistics/lonstudentsubmissions.pm:1.57
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.56	Thu Jan 14 17:20:51 2010
+++ loncom/interface/statistics/lonstudentsubmissions.pm	Fri Mar 26 13:25:17 2010
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentsubmissions.pm,v 1.56 2010/01/14 17:20:51 bisitz Exp $
+# $Id: lonstudentsubmissions.pm,v 1.57 2010/03/26 13:25:17 onken Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -225,7 +225,12 @@
     my @extra_resp_headers = &get_extra_response_headers();
     #
     # Create the table header
-    my @student_columns = ('username','domain','id','section');
+    my @student_columns = @Apache::lonstatistics::SelectedStudentData;
+    foreach (@student_columns) {
+        if($_ eq 'all') {
+            @student_columns = ('fullname','username','domain','id','section','status','groups','comments');
+        }
+    }
     #
     my %headers;
     my $student_column_count = scalar(@student_columns);
@@ -326,8 +331,16 @@
         }
         last if ($c->aborted());
         foreach my $field (@student_columns) {
-            $student_row_data .= 
-                '<td valign="top">'.$student->{$field}.'</td>';
+            $student_row_data .= '<td valign="center">';
+            # handle comments like in lonstudentassessment.pm
+            if($field eq 'comments') {
+                $student_row_data .= 
+                        '<a href="/adm/'.$student->{'domain'}.'/'.
+                        $student->{'username'}.'/'.'aboutme#coursecomment">'.&mt('Comments').'</a>';
+            } else {
+                $student_row_data .= $student->{$field};
+            }
+            $student_row_data .= '</td>';
         }
         #
         # Figure out what it is we need to output for this student
@@ -1097,6 +1110,7 @@
     $Str .= &Apache::loncommon::start_data_table_header_row();
     $Str .= '<th>'.&mt('Sections').'</th>';
     $Str .= '<th>'.&mt('Groups').'</th>';
+    $Str .= '<th>'.&mt('Student Data').&Apache::loncommon::help_open_topic("Chart_Student_Data").'</th>';
     $Str .= '<th>'.&mt('Access Status').'</th>';
     $Str .= '<th>'.&mt('Options').'</th>';
     $Str .= '<th>'.&mt('Output Format').'</th>';
@@ -1111,6 +1125,10 @@
     $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5);
     $Str .= '</td>';
     #
+    $Str .= '<td align="center">'."\n";
+    $Str .= &Apache::lonstatistics::StudentDataSelect('StudentData','multiple', 5,undef);
+    $Str .= '</td>';
+    #
     $Str .= '<td align="center">';
     $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
     $Str .= '</td>';